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

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

//返り値：各種情報 ret : OK=true, NG=false
function unrock($dbutil, $data) {
  global $stringUtil;
  $logger = new logger(basename(__FILE__));
  $logger->info("ai201x_unrock",$data);
  $ret_array = array(
    "ret" => true,
    "msg" => ""
  );
  //戻り値初期値
  $ret = true;
  $msg = "";

  try {
    $whereParams = array();
    $whereParams["chgcd"] = $data["chgcd"];
    $sql = file_get_contents("./sql/unrock.sql");
  
    $result = $dbutil->update($sql, $whereParams);
    $logger->info("result",$result);
    $dbutil->commit();

  } catch(userException $ue) {
    $msg  = $ue->getErrorMessage();
    $ret = false;
    //$dbutil->rollback();

  } catch(Exception $e) {
    $msg  = $e->getMessage();
    $ret = false;
    //$dbutil->rollback();
  }

endFunction:
	$ret_array["msg"] = $msg;
  $ret_array["ret"] = $ret;
	return $ret_array;
}

?>
