function lfSetStartEndDate(&$objFormParam)
 {
     $arrRet = $objFormParam->getHashArray();
     // 月度集計
     if ($arrRet['search_form'] == 1) {
         list($sdate, $edate) = SC_Utils_Ex::sfTermMonth($arrRet['search_startyear_m'], $arrRet['search_startmonth_m'], CLOSE_DAY);
     } elseif ($arrRet['search_form'] == 2) {
         $sdate = $arrRet['search_startyear'] . '/' . $arrRet['search_startmonth'] . '/' . $arrRet['search_startday'];
         $edate = $arrRet['search_endyear'] . '/' . $arrRet['search_endmonth'] . '/' . $arrRet['search_endday'];
     }
     return array($sdate, $edate);
 }
 function lfSetStartEndDate(&$objFormParam)
 {
     $arrRet = $objFormParam->getHashArray();
     foreach ($arrRet as $key => $val) {
         if ($val == "") {
             continue;
         }
         switch ($key) {
             case 'search_startyear':
                 $sdate = $objFormParam->getValue('search_startyear') . "/" . $objFormParam->getValue('search_startmonth') . "/" . $objFormParam->getValue('search_startday');
                 break;
             case 'search_endyear':
                 $edate = $objFormParam->getValue('search_endyear') . "/" . $objFormParam->getValue('search_endmonth') . "/" . $objFormParam->getValue('search_endday');
                 break;
             case 'search_startyear_m':
                 list($sdate, $edate) = SC_Utils_Ex::sfTermMonth($objFormParam->getValue('search_startyear_m'), $objFormParam->getValue('search_startmonth_m'), CLOSE_DAY);
                 break;
             default:
                 break;
         }
     }
     return array($sdate, $edate);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // 入力期間をセッションに記録する
     $this->lfSaveDateSession();
     if (isset($_GET['draw_image']) && $_GET['draw_image'] != "") {
         define('DRAW_IMAGE', true);
     } else {
         define('DRAW_IMAGE', false);
     }
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     $this->objFormParam->setParam($_POST);
     $this->objFormParam->setParam($_GET);
     // 検索ワードの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrHidden[$key] = $val;
         }
     }
     $mode = $this->objFormParam->getValue('mode');
     switch ($mode) {
         case 'pdf':
         case 'csv':
         case 'search':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError();
             $arrRet = $this->objFormParam->getHashArray();
             // 入力エラーなし
             if (empty($this->arrErr)) {
                 foreach ($arrRet as $key => $val) {
                     if ($val == "") {
                         continue;
                     }
                     switch ($key) {
                         case 'search_startyear':
                             $sdate = $this->objFormParam->getValue('search_startyear') . "/" . $this->objFormParam->getValue('search_startmonth') . "/" . $this->objFormParam->getValue('search_startday');
                             break;
                         case 'search_endyear':
                             $edate = $this->objFormParam->getValue('search_endyear') . "/" . $this->objFormParam->getValue('search_endmonth') . "/" . $this->objFormParam->getValue('search_endday');
                             break;
                         case 'search_startyear_m':
                             list($sdate, $edate) = SC_Utils_Ex::sfTermMonth($this->objFormParam->getValue('search_startyear_m'), $this->objFormParam->getValue('search_startmonth_m'), CLOSE_DAY);
                             break;
                         default:
                             break;
                     }
                 }
                 if ($this->objFormParam->getValue('type') != "") {
                     $type = $this->objFormParam->getValue('type');
                 } else {
                     $type = "";
                 }
                 $page = $this->objFormParam->getValue('page');
                 switch ($page) {
                     // 商品別集計
                     case 'products':
                         if ($type == "") {
                             $type = 'all';
                         }
                         $this->tpl_page_type = "total/page_products.tpl";
                         // 未集計データの集計を行う
                         if (!DAILY_BATCH_MODE) {
                             $this->objBatch->lfRealTimeDailyTotal($sdate, $edate);
                         }
                         // 検索結果の取得
                         $this->lfGetOrderProducts($type, $sdate, $edate, $this, $this->install_GD, $mode);
                         break;
                         // 職業別集計
                     // 職業別集計
                     case 'job':
                         if ($type == "") {
                             $type = 'all';
                         }
                         $this->tpl_page_type = "total/page_job.tpl";
                         // 未集計データの集計を行う
                         if (!DAILY_BATCH_MODE) {
                             $this->objBatch->lfRealTimeDailyTotal($sdate, $edate);
                         }
                         // 検索結果の取得
                         $this->lfGetOrderJob($type, $sdate, $edate, $this, $this->install_GD);
                         break;
                         // 会員別集計
                     // 会員別集計
                     case 'member':
                         if ($type == "") {
                             $type = 'all';
                         }
                         $this->tpl_page_type = "total/page_member.tpl";
                         // 未集計データの集計を行う
                         if (!DAILY_BATCH_MODE) {
                             $this->objBatch->lfRealTimeDailyTotal($sdate, $edate);
                         }
                         // 検索結果の取得
                         $this->lfGetOrderMember($type, $sdate, $edate, $this, $this->install_GD);
                         break;
                         // 年代別集計
                     // 年代別集計
                     case 'age':
                         if ($type == "") {
                             $type = 'all';
                         }
                         $this->tpl_page_type = "total/page_age.tpl";
                         // 未集計データの集計を行う
                         if (!DAILY_BATCH_MODE) {
                             $this->objBatch->lfRealTimeDailyTotal($sdate, $edate);
                         }
                         // 検索結果の取得
                         $this->lfGetOrderAge($type, $sdate, $edate, $this, $this->install_GD);
                         break;
                         // 期間別集計
                     // 期間別集計
                     default:
                         if (!isset($type)) {
                             $type = "";
                         }
                         if ($type == "") {
                             $type = 'day';
                         }
                         $this->tpl_page_type = "total/page_term.tpl";
                         // 未集計データの集計を行う
                         if (!DAILY_BATCH_MODE) {
                             $this->objBatch->lfRealTimeDailyTotal($sdate, $edate);
                         }
                         // 検索結果の取得
                         $this->lfGetOrderTerm($type, $sdate, $edate, $this, $this->install_GD);
                         break;
                 }
                 if ($mode == 'csv') {
                     // CSV出力タイトル行の取得
                     list($arrTitleCol, $arrDataCol) = $this->lfGetCSVColum($page, $this->keyname);
                     $head = SC_Utils_Ex::sfGetCSVList($arrTitleCol);
                     $data = $this->lfGetDataColCSV($this->arrResults, $arrDataCol);
                     // CSVを送信する。
                     SC_Utils_Ex::sfCSVDownload($head . $data, $page . "_" . $type);
                     exit;
                 }
                 if ($mode == 'pdf') {
                     // CSV出力タイトル行の取得
                     list($arrTitleCol, $arrDataCol, $arrColSize, $arrAlign, $title) = $this->lfGetPDFColum($page, $type, $this->keyname);
                     $head = SC_Utils_Ex::sfGetPDFList($arrTitleCol);
                     $data = $this->lfGetDataColPDF($this->arrResults, $arrDataCol, 40);
                     // PDF出力用
                     $graph_name = basename($this->tpl_image);
                     $this->lfPDFDownload($graph_name, $head . $data, $arrColSize, $arrAlign, $sdate, $edate, $title, $page);
                     exit;
                 }
             }
             break;
         default:
             if (count($_GET) == 0) {
                 // バッチモードの場合のみ実行する(当日の集計を行うため)
                 if (DAILY_BATCH_MODE) {
                     // 3日前までの集計
                     $this->objBatch->lfStartDailyTotal(3, 0);
                 }
             }
             break;
     }
     // 登録・更新日検索用
     $objDate = new SC_Date();
     $objDate->setStartYear(RELEASE_YEAR);
     $objDate->setEndYear(DATE("Y"));
     $this->arrYear = $objDate->getYear();
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     // 入力値の取得
     $this->arrForm = $this->objFormParam->getFormParamList();
     $this->tpl_subtitle = $this->arrTitle[$this->objFormParam->getValue('page')];
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 function lfSetStartEndDate(&$objFormParam)
 {
     $arrRet = $objFormParam->getHashArray();
     $out_flg = 0;
     foreach ($arrRet as $key => $val) {
         if ($val == '') {
             continue;
         }
         switch ($key) {
             case 'search_startyear':
                 $sdate = $objFormParam->getValue('search_startyear') . '/' . $objFormParam->getValue('search_startmonth') . '/' . $objFormParam->getValue('search_startday');
                 break;
             case 'search_endyear':
                 $edate = $objFormParam->getValue('search_endyear') . '/' . $objFormParam->getValue('search_endmonth') . '/' . $objFormParam->getValue('search_endday');
                 break;
             case 'search_startyear_m':
                 list($sdate, $edate) = SC_Utils_Ex::sfTermMonth($objFormParam->getValue('search_startyear_m'), $objFormParam->getValue('search_startmonth_m'), CLOSE_DAY);
                 $out_flg = 1;
                 break;
             default:
                 break;
         }
         // 月度集計の場合に、集計期間が本日日付で上書きされてしまうのを回避するため
         if ($objFormParam->getValue('form') == 1 && $out_flg == 1) {
             break;
         }
     }
     return array($sdate, $edate);
 }