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

/**
 * af481x共通カスタム関数
 */

function callFm_AF462X_Get($dbutil, $header){
  $logger = new logger(basename(__FILE__));
    global $stringUtil;
$logger->info("callFm_AF462X_Get>>",$data);
    $ret_array = array(
      "ret" => "0", 
      "msg" => "",
    );
    $ret = '0';
    $logger->info("abcdefg>>",$header);

    try {
      $cnt = 0;
      $ins_cnt = 0;

      //ヘッダー情報(検索条件)
      $ktktcd = $_SESSION[$GLOBALS['SYSTEM_NAME_EN']]["LGKTKTCD"];

      $sql = file_get_contents("./sql/callFm_AF462X_Get.sql");   
      $wseq = $dbutil->nextVal("innerwseq");
$logger->info("wseq>>",$wseq);
$logger->info("ktktcd>>",$ktktcd);
$logger->info("cudt>>",$header["cudt"]);
$logger->info("dats>>",$header["dats"]);
$logger->info("cls>>",$header["cls"]);
      $whereParams = array();
      $whereParams["wseq"]["in"]   = $wseq;
      $whereParams["ktktcd"]["in"] = $ktktcd;
      $whereParams["cudt"]["in"]   = $header["cudt"];
      $whereParams["dats"]["in"]   = $header["dats"];
      $whereParams["cls"]["in"]   = $header["cls"];
      $whereParams["ret"]["out"]   = "";

      $retPlsql = $dbutil->call($sql, $whereParams);
      $ret = $retPlsql["ret"];


    } catch(userException $ue) {
      $ret = '-999';
      $msg = $ue->getErrorMessage();
    } catch(Exception $e) {
      $ret = '-999';
      $msg = $e->getMessage();
    }

    $ret_array["ret"] = $ret;
    $ret_array["msg"] = $msg;
    $ret_array["wseq"] = $wseq;

    return $ret_array;
  }



?>
