<?php

class dateUtil {
  private $logger;

  function __construct() {
    $this->logger = new logger(basename(__FILE__));
  }

  function __destruct() {
  }

  public function getSdday() {

    $sdday = null;
    try {
      global $serverUtil;

      $file = $serverUtil->getProjectDir() . "/util/sql/getSdday.sql";
      $this->logger->info("FILE", $file);
      global $dbutil;
      // SQL実行
      $sql = file_get_contents($file);
      $whereParams = array();
      $whereParams["ktktcd"] = $_SESSION[$GLOBALS['SYSTEM_NAME_EN']]["LGKTKTCD"];
$this->logger->info('getsdday'.$sql, $whereParams);
      $result = $dbutil->select($sql, $whereParams);

      if( $result != null ) {
        $retData = $result[0];
      } else {
        $retData = Array(
          'sdday_yyyy' => data('y'),
          'sdday_mm' => data('m'),
          'sdday_dd' => data('d'),
          'sdday' => date('y/m/d')
        );
      }

    } catch(userException $ue) {
      $dbutil->rollback();
    } catch(Exception $e) {
      $dbutil->rollback();
    }

    return $retData;

  }

}

?>
