<?php
//共通
require_once '../../base/common.php';
require_once '../../util/combo.php';

$logger = new logger(basename(__FILE__));
$logger->info("===af251x_index_start===");
//$logger->info('post', $_POST)

$assign_var["noeventClassHeader"] = "";
$assign_var["noeventClassBody"]   = "";


$header = Array(
);
$header['sdday'] = $_SESSION[$GLOBALS['SYSTEM_NAME_EN']]["SDDAY"];
$valutil = new getValueUtil();

$sdday = $_SESSION[$GLOBALS['SYSTEM_NAME_EN']]["SDDAY"];

//コンボボックス作成
$listutil = null;
$listutil = new getListUtil();
$assign_var["listGdcls9"] = $listutil->getListAfm90('6'); //改廃区分


try {
  //編集、出庫有無追加
  $ret994x = $valutil->getAxm994("AF251X");
  if ($ret994x == null) {
    $header["modify_mode"] = "0";
    $header["issue_mode"] = "0";
  } else {
    if ($stringUtil->isEmpty($ret994x["r01"])) { //未指示修正 デフォルトOK
      $header["modify_mode"] = "0";
    } else {
      $header["modify_mode"] = $ret994x["r01"];
    }
    if ($stringUtil->isEmpty($ret994x["r02"])) { //出庫実績作成 デフォルト無
      $header["issue_mode"] = "0";
    } else {
      $header["issue_mode"] = $ret994x["r02"];
    }
  }
} catch(userException $ue) {
  $assign_var["hasError"] = true;
  $assign_var["errorMsg"] = $ue->getMessage();
} catch(Exception $e) {
  $assign_var["hasError"] = true;
  $assign_var["errorMsg"] = $e->getMessage();
}

//POPUP
$assign_var["hasPopJan"] = "1";
$assign_var["hasPopKtktcd"] = "1";

//テスト用にコメントアウト！！ 戻す！！！！！！
if($header["modify_mode"] == '0') {
  $assign_var["hasPopAf251x1"] = "1"; //伝票検索
}


$assign_var["header"] = $header;
$logger->info("header", $header);

// 初期表示
$dataList = Array(
);
array_push($dataList, $obj);

$logger->info("dataList", $dataList);
$assign_var["data"] = $dataList;

//Smartyへアサイン
$logger->info("assign_var",$assign_var);
$smarty->assign($assign_var);
$smarty->display("index");

$logger->info("=== af251x_index_end ===");
?>
