/**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     // ログインチェック
     SC_Utils::sfIsSuccess(new SC_Session());
     // トランザクショントークンの取得
     $this->transactionid = $this->getToken();
     switch ($this->getMode()) {
         case 'new':
             $this->execNewMode();
             break;
         case 'edit':
             $this->execEditMode();
             break;
         case 'parent_reload':
             $this->execParentReloadMode();
             // defaultアクションも実行させるためbreakしない
         // defaultアクションも実行させるためbreakしない
         default:
             $this->execDefaultMode();
             break;
     }
     $objView = new SC_AdminView();
     $objView->assignobj($this);
     $objView->display('system/input.tpl');
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_GET['mode'])) {
         $_GET['mode'] = "";
     }
     if (!isset($_GET['id'])) {
         $_GET['id'] = "";
     }
     if ($_GET['mode'] == "delete" && SC_Utils_Ex::sfCheckNumLength($_GET['id']) === true) {
         // メール担当の画像があれば削除しておく
         $sql = "SELECT charge_image FROM dtb_mailmaga_template WHERE template_id = ?";
         $result = $conn->getOne($sql, array($_GET["id"]));
         if (strlen($result) > 0) {
             @unlink(IMAGE_SAVE_DIR . $result);
         }
         // 登録削除
         $sql = "UPDATE dtb_mailmaga_template SET del_flg = 1 WHERE template_id = ?";
         $conn->query($sql, array($_GET['id']));
         $this->reload(null, true);
     }
     $sql = "SELECT *, create_date as disp_date FROM dtb_mailmaga_template WHERE del_flg = 0 ORDER BY create_date DESC";
     $this->list_data = $conn->getAll($sql);
     $this->list_data['disp_date'] = substr($this->list_data['disp_date'], 0, 19);
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     $css_path = USER_PATH . "css/common.css";
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // データ更新処理
     if ($_POST['mode'] == 'confirm') {
         // プレビュー用テンプレートに書き込み
         $fp = fopen($css_path, "w");
         // TODO
         fwrite($fp, $_POST['css']);
         fclose($fp);
         $this->tpl_onload = "alert('登録が完了しました。');";
     }
     // CSSファイルの読み込み
     if (file_exists($css_path)) {
         $css_data = file_get_contents($css_path);
     }
     // テキストエリアに表示
     $this->css_data = $css_data;
     // 画面の表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) {
         $objQuery = new SC_Query();
         $col = "subject, mail_body";
         $where = "send_id = ?";
         $arrRet = $objQuery->select($col, "dtb_mail_history", $where, array($_GET['send_id']));
         $this->tpl_subject = $arrRet[0]['subject'];
         $this->tpl_body = $arrRet[0]['mail_body'];
     }
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     SC_Utils_Ex::sfIsSuccess(new SC_Session());
     $objView = new SC_AdminView();
     $this->initForm();
     switch ($this->objForm->getValue('mode')) {
         // PHP INFOを表示
         case 'info':
             phpinfo();
             exit;
             break;
         default:
             break;
     }
     $this->arrSystemInfo = $this->getSystemInfo();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #6
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ADMIN_ID以外の管理者件数を取得
     $linemax = $this->getMemberCount("del_flg <> 1 AND member_id <> " . ADMIN_ID);
     // ADMIN_ID以外で稼動中の管理者件数を取得
     $this->workmax = $this->getMemberCount("work = 1 AND del_flg <> 1 AND member_id <> " . ADMIN_ID);
     // ページ送りの処理
     $pageno = isset($_GET['pageno']) ? $_GET['pageno'] : 1;
     $objNavi = new SC_PageNavi($pageno, $linemax, MEMBER_PMAX, "fnMemberPage", NAVI_PMAX);
     $this->tpl_strnavi = $objNavi->strnavi;
     $this->tpl_disppage = $objNavi->now_page;
     $this->tpl_pagemax = $objNavi->max_page;
     // 取得範囲を指定(開始行番号、行数のセット)して管理者データを取得
     $this->list_data = $this->getMemberData($objNavi->start_row);
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #7
0
 /**
  * Page のプロセス。
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     switch ($this->type) {
         case LOGIN_ERROR:
             $this->tpl_error = "IDまたはパスワードが正しくありません。<br />もう一度ご確認のうえ、再度入力してください。";
             break;
         case ACCESS_ERROR:
             $this->tpl_error = "ログイン認証の有効期限切れの可能性があります。<br />もう一度ご確認のうえ、再度ログインしてください。";
             break;
         case AUTH_ERROR:
             $this->tpl_error = "このファイルにはアクセス権限がありません。<br />もう一度ご確認のうえ、再度ログインしてください。";
             break;
         case INVALID_MOVE_ERRORR:
             $this->tpl_error = "不正なページ移動です。<br />もう一度ご確認のうえ、再度入力してください。";
             break;
         default:
             $this->tpl_error = "エラーが発生しました。<br />もう一度ご確認のうえ、再度ログインしてください。";
             break;
     }
     $objView->assignobj($this);
     $objView->display(LOGIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objQuery = new SC_Query();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     //検索ワードの引継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrSearchHidden[$key] = $val;
         }
     }
     // 状態の設定
     $masterData = new SC_DB_MasterData_Ex();
     $this->arrTrackBackStatus = $masterData->getMasterData("mtb_track_back_status");
     //取得文字列の変換用カラム
     $arrRegistColumn = array(array("column" => "update_date"), array("column" => "status"), array("column" => "title", "convert" => "KVa"), array("column" => "excerpt", "convert" => "KVa"), array("column" => "blog_name", "convert" => "KVa"), array("column" => "url", "convert" => "KVa"), array("column" => "del_flg", "convert" => "n"));
     // トラックバックIDを渡す
     $this->tpl_trackback_id = $_POST['trackback_id'];
     // トラックバック情報のカラムの取得
     $this->arrTrackback = $this->lfGetTrackbackData($_POST['trackback_id'], $objQuery);
     // 商品ごとのトラックバック表示数取得
     $count = $objQuery->count("dtb_trackback", "del_flg = 0 AND product_id = ?", array($this->arrTrackback['product_id']));
     // 両方選択可能
     $this->tpl_status_change = true;
     switch ($_POST['mode']) {
         // 登録
         case 'complete':
             //フォーム値の変換
             $arrTrackback = $this->lfConvertParam($_POST, $arrRegistColumn);
             $this->arrErr = $this->lfCheckError($arrTrackback);
             //エラー無し
             if (!$this->arrErr) {
                 //レビュー情報の編集登録
                 $this->lfRegistTrackbackData($arrTrackback, $arrRegistColumn, $objQuery);
                 $this->arrTrackback = $arrTrackback;
                 $this->tpl_onload = "confirm('登録が完了しました。');";
             }
             break;
         default:
             break;
     }
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objCSV = new SC_Helper_CSV_Ex();
     $this->arrSubnavi = $objCSV->arrSubnavi;
     $this->tpl_subno_csv = $objCSV->arrSubnavi[1];
     $this->arrSubnaviName = $objCSV->arrSubnaviName;
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     $arrOutput = array();
     $arrChoice = array();
     $get_tpl_subno_csv = isset($_GET['tpl_subno_csv']) ? $_GET['tpl_subno_csv'] : "";
     // GETで値が送られている場合にはその値を元に画面表示を切り替える
     if ($get_tpl_subno_csv != "") {
         // 送られてきた値が配列に登録されていなければTOPを表示
         if (in_array($get_tpl_subno_csv, $this->arrSubnavi)) {
             $subno_csv = $get_tpl_subno_csv;
         } else {
             $subno_csv = $this->arrSubnavi[1];
         }
     } else {
         // GETで値がなければPOSTの値を使用する
         if (isset($_POST['tpl_subno_csv']) && $_POST['tpl_subno_csv'] != "") {
             $subno_csv = $_POST['tpl_subno_csv'];
         } else {
             $subno_csv = $this->arrSubnavi[1];
         }
     }
     // subnoの番号を取得
     $subno_id = array_keys($this->arrSubnavi, $subno_csv);
     $subno_id = $subno_id[0];
     // データの登録
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if ($_POST["mode"] == "confirm") {
         // エラーチェック
         $this->arrErr = $this->lfCheckError($_POST['output_list']);
         if (count($this->arrErr) <= 0) {
             // データの更新
             $this->lfUpdCsvOutput($subno_id, $_POST['output_list']);
             // 画面のリロード
             $this->reload(array("tpl_subno_csv" => $subno_csv));
         }
     }
     // 出力項目の取得
     $arrOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput($subno_csv, "WHERE csv_id = ? AND status = 1", array($subno_id)));
     $arrOutput = SC_Utils_Ex::sfarrCombine($arrOutput['col'], $arrOutput['disp_name']);
     // 非出力項目の取得
     $arrChoice = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput($subno_csv, "WHERE csv_id = ? AND status = 2", array($subno_id)));
     if (!isset($arrChoice['col'])) {
         $arrChoice['col'] = array();
     }
     if (!isset($arrChoice['disp_name'])) {
         $arrChoice['disp_name'] = array();
     }
     $arrChoice = SC_Utils_Ex::sfarrCombine($arrChoice['col'], $arrChoice['disp_name']);
     $this->arrOutput = $arrOutput;
     $this->arrChoice = $arrChoice;
     $this->SubnaviName = $this->arrSubnaviName[$subno_id];
     $this->tpl_subno_csv = $subno_csv;
     // 画面の表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #10
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objDb = new SC_Helper_DB_Ex();
     $objSess = new SC_Session();
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     $this->objFormParam->setParam($_POST);
     $this->objFormParam->splitParamCheckBoxes('search_order_sex');
     $this->objFormParam->splitParamCheckBoxes('search_payment_id');
     // 検索ワードの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             switch ($key) {
                 case 'search_order_sex':
                 case 'search_payment_id':
                     $this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
                     break;
                 default:
                     $this->arrHidden[$key] = $val;
                     break;
             }
         }
     }
     // ページ送り用
     $this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (!isset($arrRet)) {
         $arrRet = array();
     }
     if ($_POST['mode'] == 'delete') {
         if (SC_Utils_Ex::sfIsInt($_POST['order_id'])) {
             $objQuery = new SC_Query();
             $where = "order_id = ?";
             $sqlval['del_flg'] = '1';
             $objQuery->update("dtb_order", $sqlval, $where, array($_POST['order_id']));
         }
     }
     switch ($_POST['mode']) {
         case 'delete':
         case 'csv':
         case 'pdf':
         case 'delete_all':
         case 'search':
             // 入力値の変換
             $this->objFormParam->convParam();
             $this->arrErr = $this->lfCheckError($arrRet);
             $arrRet = $this->objFormParam->getHashArray();
             // 入力なし
             if (count($this->arrErr) == 0) {
                 $where = "del_flg = 0";
                 foreach ($arrRet as $key => $val) {
                     if ($val == "") {
                         continue;
                     }
                     $val = SC_Utils_Ex::sfManualEscape($val);
                     switch ($key) {
                         case 'search_order_name':
                             if (DB_TYPE == "pgsql") {
                                 $where .= " AND order_name01||order_name02 ILIKE ?";
                             } elseif (DB_TYPE == "mysql") {
                                 $where .= " AND concat(order_name01,order_name02) ILIKE ?";
                             }
                             $nonsp_val = mb_ereg_replace("[  ]+", "", $val);
                             $arrval[] = "%{$nonsp_val}%";
                             break;
                         case 'search_order_kana':
                             if (DB_TYPE == "pgsql") {
                                 $where .= " AND order_kana01||order_kana02 ILIKE ?";
                             } elseif (DB_TYPE == "mysql") {
                                 $where .= " AND concat(order_kana01,order_kana02) ILIKE ?";
                             }
                             $nonsp_val = mb_ereg_replace("[  ]+", "", $val);
                             $arrval[] = "%{$nonsp_val}%";
                             break;
                         case 'search_order_id1':
                             $where .= " AND order_id >= ?";
                             $arrval[] = $val;
                             break;
                         case 'search_order_id2':
                             $where .= " AND order_id <= ?";
                             $arrval[] = $val;
                             break;
                         case 'search_order_sex':
                             $tmp_where = "";
                             foreach ($val as $element) {
                                 if ($element != "") {
                                     if ($tmp_where == "") {
                                         $tmp_where .= " AND (order_sex = ?";
                                     } else {
                                         $tmp_where .= " OR order_sex = ?";
                                     }
                                     $arrval[] = $element;
                                 }
                             }
                             if ($tmp_where != "") {
                                 $tmp_where .= ")";
                                 $where .= " {$tmp_where} ";
                             }
                             break;
                         case 'search_order_tel':
                             if (DB_TYPE == "pgsql") {
                                 $where .= " AND (order_tel01 || order_tel02 || order_tel03) LIKE ?";
                             } elseif (DB_TYPE == "mysql") {
                                 $where .= " AND concat(order_tel01,order_tel02,order_tel03) LIKE ?";
                             }
                             $nonmark_val = ereg_replace("[()-]+", "", $val);
                             $arrval[] = "%{$nonmark_val}%";
                             break;
                         case 'search_order_email':
                             $where .= " AND order_email ILIKE ?";
                             $arrval[] = "%{$val}%";
                             break;
                         case 'search_payment_id':
                             $tmp_where = "";
                             foreach ($val as $element) {
                                 if ($element != "") {
                                     if ($tmp_where == "") {
                                         $tmp_where .= " AND (payment_id = ?";
                                     } else {
                                         $tmp_where .= " OR payment_id = ?";
                                     }
                                     $arrval[] = $element;
                                 }
                             }
                             if ($tmp_where != "") {
                                 $tmp_where .= ")";
                                 $where .= " {$tmp_where} ";
                             }
                             break;
                         case 'search_total1':
                             $where .= " AND total >= ?";
                             $arrval[] = $val;
                             break;
                         case 'search_total2':
                             $where .= " AND total <= ?";
                             $arrval[] = $val;
                             break;
                         case 'search_sorderyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_sorderyear'], $_POST['search_sordermonth'], $_POST['search_sorderday']);
                             $where .= " AND create_date >= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_eorderyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_eorderyear'], $_POST['search_eordermonth'], $_POST['search_eorderday'], true);
                             $where .= " AND create_date <= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_supdateyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_supdateyear'], $_POST['search_supdatemonth'], $_POST['search_supdateday']);
                             $where .= " AND update_date >= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_eupdateyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_eupdateyear'], $_POST['search_eupdatemonth'], $_POST['search_eupdateday'], true);
                             $where .= " AND update_date <= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_sbirthyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_sbirthyear'], $_POST['search_sbirthmonth'], $_POST['search_sbirthday']);
                             $where .= " AND order_birth >= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_ebirthyear':
                             $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_ebirthyear'], $_POST['search_ebirthmonth'], $_POST['search_ebirthday'], true);
                             $where .= " AND order_birth <= ?";
                             $arrval[] = $date;
                             break;
                         case 'search_order_status':
                             $where .= " AND status = ?";
                             $arrval[] = $val;
                             break;
                         default:
                             if (!isset($arrval)) {
                                 $arrval = array();
                             }
                             break;
                     }
                 }
                 $order = "update_date DESC";
                 switch ($_POST['mode']) {
                     case 'csv':
                         require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
                         $objCSV = new SC_Helper_CSV_Ex();
                         // オプションの指定
                         $option = "ORDER BY {$order}";
                         // CSV出力タイトル行の作成
                         $arrCsvOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(3, " WHERE csv_id = 3 AND status = 1"));
                         if (count($arrCsvOutput) <= 0) {
                             break;
                         }
                         $arrCsvOutputCols = $arrCsvOutput['col'];
                         $arrCsvOutputTitle = $arrCsvOutput['disp_name'];
                         $head = SC_Utils_Ex::sfGetCSVList($arrCsvOutputTitle);
                         $data = $objCSV->lfGetCSV("dtb_order", $where, $option, $arrval, $arrCsvOutputCols);
                         // CSVを送信する。
                         SC_Utils_Ex::sfCSVDownload($head . $data);
                         exit;
                         break;
                     case 'pdf':
                         $objFpdf = new SC_Fpdf(1, '納品書');
                         $objFpdf->setData($arrRet);
                         $objFpdf->createPdf();
                         break;
                     case 'delete_all':
                         // 検索結果をすべて削除
                         $sqlval['del_flg'] = 1;
                         $objQuery = new SC_Query();
                         $objQuery->update("dtb_order", $sqlval, $where, $arrval);
                         break;
                     default:
                         // 読み込む列とテーブルの指定
                         $col = "*";
                         $from = "dtb_order";
                         $objQuery = new SC_Query();
                         // 行数の取得
                         $linemax = $objQuery->count($from, $where, $arrval);
                         $this->tpl_linemax = $linemax;
                         // 何件が該当しました。表示用
                         // ページ送りの処理
                         if (is_numeric($_POST['search_page_max'])) {
                             $page_max = $_POST['search_page_max'];
                         } else {
                             $page_max = SEARCH_PMAX;
                         }
                         // ページ送りの取得
                         $objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
                         $startno = $objNavi->start_row;
                         $this->arrPagenavi = $objNavi->arrPagenavi;
                         // 取得範囲の指定(開始行番号、行数のセット)
                         $objQuery->setlimitoffset($page_max, $startno);
                         // 表示順序
                         $objQuery->setorder($order);
                         // 検索結果の取得
                         $this->arrResults = $objQuery->select($col, $from, $where, $arrval);
                 }
             }
             break;
         default:
             break;
     }
     $objDate = new SC_Date();
     // 登録・更新日検索用
     $objDate->setStartYear(RELEASE_YEAR);
     $objDate->setEndYear(DATE("Y"));
     $this->arrRegistYear = $objDate->getYear();
     // 生年月日検索用
     $objDate->setStartYear(BIRTH_YEAR);
     $objDate->setEndYear(DATE("Y"));
     $this->arrBirthYear = $objDate->getYear();
     // 月日の設定
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     // 入力値の取得
     $this->arrForm = $this->objFormParam->getFormParamList();
     // 支払い方法の取得
     $arrRet = $objDb->sfGetPayment();
     $this->arrPayment = SC_Utils_Ex::sfArrKeyValue($arrRet, 'payment_id', 'payment_method');
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $masterData = new SC_DB_MasterData_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess(new SC_Session());
     // キーの配列を生成
     $this->arrKeys = $this->getParamKeys($masterData);
     if (isset($_POST["mode"]) && $_POST["mode"] == "update") {
         // データの引き継ぎ
         $this->arrForm = $_POST;
         // エラーチェック
         $this->arrErr = $this->errorCheck();
         // エラーの無い場合は update
         if (empty($this->arrErr)) {
             $this->update();
             $this->tpl_onload = "window.alert('パラメータの設定が完了しました。');";
         } else {
             $this->arrValues = SC_Utils_Ex::getHash2Array($this->arrForm, $this->arrKeys);
             $this->tpl_onload = "window.alert('エラーが発生しました。入力内容をご確認下さい。');";
         }
     }
     if (empty($this->arrErr)) {
         $this->arrValues = SC_Utils_Ex::getHash2Array($masterData->getDBMasterData("mtb_constants"));
     }
     // コメント, 値の配列を生成
     $this->arrComments = SC_Utils_Ex::getHash2Array($masterData->getDBMasterData("mtb_constants", array("id", "remarks", "rank")));
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // 要求判定
     switch ($_POST['mode']) {
         // 編集処理
         case 'edit':
             // POST値の引き継ぎ
             $this->arrForm = $_POST;
             // 入力文字の変換
             $this->arrForm = $this->lfConvertParam($this->arrForm);
             // エラーチェック
             $this->arrErr = $this->lfErrorCheck();
             if (count($this->arrErr) <= 0) {
                 if ($_POST['class_id'] == "") {
                     $this->lfInsertClass($this->arrForm);
                     // 新規作成
                 } else {
                     $this->lfUpdateClass($this->arrForm);
                     // 既存編集
                 }
                 // 再表示
                 $this->reload();
             } else {
                 // POSTデータを引き継ぐ
                 $this->tpl_class_id = $_POST['class_id'];
             }
             break;
             // 削除
         // 削除
         case 'delete':
             $objDb->sfDeleteRankRecord("dtb_class", "class_id", $_POST['class_id'], "", true);
             $objQuery = new SC_Query();
             $objQuery->delete("dtb_classcategory", "class_id = ?", $_POST['class_id']);
             // 再表示
             $this->reload();
             break;
             // 編集前処理
         // 編集前処理
         case 'pre_edit':
             // 編集項目をDBより取得する。
             $where = "class_id = ?";
             $class_name = $objQuery->get("dtb_class", "name", $where, array($_POST['class_id']));
             // 入力項目にカテゴリ名を入力する。
             $this->arrForm['name'] = $class_name;
             // POSTデータを引き継ぐ
             $this->tpl_class_id = $_POST['class_id'];
             break;
         case 'down':
             $objDb->sfRankDown("dtb_class", "class_id", $_POST['class_id']);
             // 再表示
             $this->reload();
             break;
         case 'up':
             $objDb->sfRankUp("dtb_class", "class_id", $_POST['class_id']);
             // 再表示
             $this->reload();
             break;
         default:
             break;
     }
     // 規格の読込
     $where = "del_flg <> 1";
     $objQuery->setorder("rank DESC");
     $this->arrClass = $objQuery->select("name, class_id", "dtb_class", $where);
     $this->arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ファイル管理クラス
     $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
     // ファイル情報の初期化
     $this->lfInitFile();
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     $colmax = $this->objFormParam->getCount();
     $this->objFormParam->setHtmlDispNameArray();
     $this->arrTitle = $this->objFormParam->getHtmlDispNameArray();
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'csv_upload':
             $err = false;
             // エラーチェック
             $arrErr['csv_file'] = $this->objUpFile->makeTempFile('csv_file');
             if ($arrErr['css_file'] == "") {
                 $arrErr = $this->objUpFile->checkEXISTS();
             }
             // 実行時間を制限しない
             set_time_limit(0);
             // 出力をバッファリングしない(==日本語自動変換もしない)
             ob_end_clean();
             // IEのために256バイト空文字出力
             echo str_pad('', 256);
             if (empty($arrErr['csv_file'])) {
                 // 一時ファイル名の取得
                 $filepath = $this->objUpFile->getTempFilePath('csv_file');
                 // エンコード
                 $enc_filepath = SC_Utils_Ex::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_DIR);
                 // レコード数を得る
                 $rec_count = $this->lfCSVRecordCount($enc_filepath);
                 $fp = fopen($enc_filepath, "r");
                 $line = 0;
                 // 行数
                 $regist = 0;
                 // 登録数
                 $objQuery = new SC_Query();
                 $objQuery->begin();
                 echo "■ CSV登録進捗状況 <br/><br/>\n";
                 while (!feof($fp) && !$err) {
                     $arrCSV = fgetcsv($fp, CSV_LINE_MAX);
                     // 行カウント
                     $line++;
                     if ($line <= 1) {
                         continue;
                     }
                     // 項目数カウント
                     $max = count($arrCSV);
                     // 項目数が1以下の場合は無視する
                     if ($max <= 1) {
                         continue;
                     }
                     // 項目数チェック
                     if ($max != $colmax) {
                         echo "※ 項目数が" . $max . "個検出されました。項目数は" . $colmax . "個になります。</br>\n";
                         $err = true;
                     } else {
                         // シーケンス配列を格納する。
                         $this->objFormParam->setParam($arrCSV, true);
                         $arrRet = $this->objFormParam->getHashArray();
                         $this->objFormParam->setParam($arrRet);
                         // 入力値の変換
                         $this->objFormParam->convParam();
                         // <br>なしでエラー取得する。
                         $arrCSVErr = $this->lfCheckError();
                     }
                     // 入力エラーチェック
                     if (count($arrCSVErr) > 0) {
                         echo "<font color=\"red\">■" . $line . "行目でエラーが発生しました。</font></br>\n";
                         foreach ($arrCSVErr as $val) {
                             $this->printError($val);
                         }
                         $err = true;
                     }
                     if (!$err) {
                         $this->lfRegistProduct($objQuery, $line);
                         $regist++;
                     }
                     $arrParam = $this->objFormParam->getHashArray();
                     if (!$err) {
                         echo $line . " / " . $rec_count . "行目 (カテゴリID:" . $arrParam['category_id'] . " / カテゴリ名:" . $arrParam['category_name'] . ")\n<br />";
                     }
                     flush();
                 }
                 fclose($fp);
                 if (!$err) {
                     $objQuery->commit();
                     echo "■" . $regist . "件のレコードを登録しました。";
                     // カテゴリ件数カウント関数の実行
                     $objDb->sfCategory_Count($objQuery);
                 } else {
                     $objQuery->rollback();
                 }
             } else {
                 foreach ($arrErr as $val) {
                     $this->printError($val);
                 }
             }
             echo "<br/><a href=\"javascript:window.close()\">→閉じる</a>";
             flush();
             exit;
             break;
         default:
             break;
     }
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #14
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $masterData = new SC_DB_MasterData_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     $this->arrMailTEMPLATE = $masterData->getMasterData("mtb_mail_template");
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if ($_POST['mode'] == 'id_set') {
         // テンプレートプルダウン変更時
         if (SC_Utils_Ex::sfCheckNumLength($_POST['template_id'])) {
             $sql = "SELECT * FROM dtb_mailtemplate WHERE template_id = ?";
             $result = $conn->getAll($sql, array($_POST['template_id']));
             if ($result) {
                 $this->arrForm = $result[0];
             } else {
                 $this->arrForm['template_id'] = $_POST['template_id'];
             }
         }
     } elseif ($_POST['mode'] == 'regist' && SC_Utils_Ex::sfCheckNumLength($_POST['template_id'])) {
         // POSTデータの引き継ぎ
         $this->arrForm = $this->lfConvertParam($_POST);
         $this->arrErr = $this->fnErrorCheck($this->arrForm);
         if ($this->arrErr) {
             // エラーメッセージ
             $this->tpl_msg = "エラーが発生しました";
         } else {
             // 正常
             $this->lfRegist($conn, $this->arrForm);
             // 完了メッセージ
             $this->tpl_onload = "window.alert('メール設定が完了しました。テンプレートを選択して内容をご確認ください。');";
             unset($this->arrForm);
         }
     }
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #15
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objQuery = new SC_Query();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // データの取得
     $objLayout = new SC_Helper_PageLayout_Ex();
     $this->arrPageData = $objLayout->lfgetPageData(" edit_flg = 2 ");
     if (isset($_POST['page_id'])) {
         $page_id = $_POST['page_id'];
     } else {
         $page_id = "";
     }
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if ($_POST['mode'] == "confirm") {
         // エラーチェック
         $this->arrErr[$page_id] = $this->lfErrorCheck($_POST['meta'][$page_id]);
         // エラーがなければデータを更新
         if (count($this->arrErr[$page_id]) == 0) {
             // 更新データの変換
             $arrMETA = $this->lfConvertParam($_POST['meta'][$page_id]);
             // 更新データ配列生成
             $arrUpdData = array($arrMETA['author'], $arrMETA['description'], $arrMETA['keyword'], $page_id);
             // データ更新
             $this->lfUpdPageData($arrUpdData);
         } else {
             // POSTのデータを再表示
             $arrPageData = $this->lfSetData($arrPageData, $_POST['meta']);
             $this->arrPageData = $arrPageData;
         }
     }
     $arrDisp_flg = array();
     // エラーがなければデータの取得
     if (count($this->arrErr[$page_id]) == 0) {
         // データの取得
         $arrPageData = $objLayout->lfgetPageData(" edit_flg = 2 ");
         $this->arrPageData = $arrPageData;
     }
     // 表示・非表示切り替え
     foreach ($arrPageData as $key => $val) {
         $arrDisp_flg[$val['page_id']] = $_POST['disp_flg' . $val['page_id']];
     }
     $this->disp_flg = $arrDisp_flg;
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $this->objLayout = new SC_Helper_PageLayout_Ex();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ページ一覧を取得
     $this->arrPageList = $this->objLayout->lfgetPageData();
     // ブロックIDを取得
     if (isset($_POST['page_id'])) {
         $page_id = $_POST['page_id'];
     } else {
         if (isset($_GET['page_id'])) {
             $page_id = $_GET['page_id'];
         } else {
             $page_id = '';
         }
     }
     $this->page_id = $page_id;
     // メッセージ表示
     if (isset($_GET['msg']) && $_GET['msg'] == "on") {
         $this->tpl_onload = "alert('登録が完了しました。');";
     }
     // page_id が指定されている場合にはテンプレートデータの取得
     if (is_numeric($page_id) and $page_id != '') {
         $arrPageData = $this->objLayout->lfgetPageData(" page_id = ? ", array($page_id));
         if ($arrPageData[0]['tpl_dir'] === "") {
             $this->arrErr['page_id_err'] = "※ 指定されたページは編集できません。";
             // 画面の表示
             $objView->assignobj($this);
             $objView->display(MAIN_FRAME);
             exit;
         }
         // テンプレートファイルが存在していれば読み込む
         $tpl_file = USER_TEMPLATE_PATH . "/" . TEMPLATE_NAME . "/" . $arrPageData[0]['filename'] . ".tpl";
         if (file_exists($tpl_file)) {
             $arrPageData[0]['tpl_data'] = file_get_contents($tpl_file);
             // 存在してなければ, 指定されたテンプレートのファイルを読み込む
         } else {
             $arrPageData[0]['tpl_data'] = file_get_contents(TEMPLATE_DIR . $arrPageData[0]['filename'] . ".tpl");
         }
         // チェックボックスの値変更
         $arrPageData[0]['header_chk'] = SC_Utils_Ex::sfChangeCheckBox($arrPageData[0]['header_chk'], true);
         $arrPageData[0]['footer_chk'] = SC_Utils_Ex::sfChangeCheckBox($arrPageData[0]['footer_chk'], true);
         // ディレクトリを画面表示用に編集
         $arrPageData[0]['directory'] = str_replace(USER_DIR, '', $arrPageData[0]['php_dir']);
         $this->arrPageData = $arrPageData[0];
     }
     // プレビュー処理
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if ($_POST['mode'] == 'preview') {
         $page_id_old = $page_id;
         // プレビューの場合ページIDを0にセットする。
         $page_id = "0";
         $url = basename($_POST['url']);
         $tmpPost = $_POST;
         $tmpPost['page_id'] = $page_id;
         $tmpPost['url'] = $url;
         $tmpPost['tpl_dir'] = USER_PATH . "templates/preview/";
         $arrPreData = $this->objLayout->lfgetPageData("page_id = ?", array($page_id));
         // tplファイルの削除
         $del_tpl = USER_PATH . "templates/" . $arrPreData[0]['filename'] . '.tpl';
         if (file_exists($del_tpl)) {
             unlink($del_tpl);
         }
         // DBへデータを更新する
         $this->lfEntryPageData($tmpPost);
         // TPLファイル作成
         $preview_tpl = USER_PATH . "templates/preview/" . TEMPLATE_NAME . "/" . $url . '.tpl';
         $this->lfCreateFile($preview_tpl);
         // blocposition を削除
         $objDBConn = new SC_DbConn();
         // DB操作オブジェクト
         $sql = 'delete from dtb_blocposition where page_id = 0';
         $ret = $objDBConn->query($sql);
         if ($page_id_old != "") {
             // 登録データを取得
             $sql = "SELECT 0, target_id, bloc_id, bloc_row FROM dtb_blocposition WHERE page_id = ?";
             $ret = $objDBConn->getAll($sql, array($page_id_old));
             if (count($ret) > 0) {
                 // blocposition を複製
                 $sql = " insert into dtb_blocposition (";
                 $sql .= "     page_id,";
                 $sql .= "     target_id,";
                 $sql .= "     bloc_id,";
                 $sql .= "     bloc_row";
                 $sql .= "     )values(?, ?, ?, ?)";
                 // 取得件数文INSERT実行
                 foreach ($ret as $key => $val) {
                     $ret = $objDBConn->query($sql, $val);
                 }
             }
         }
         $_SESSION['preview'] = "ON";
         $this->sendRedirect($this->getLocation(URL_DIR . "preview/index.php", array("filename" => $arrPageData[0]["filename"])));
         exit;
     }
     // データ登録処理
     if ($_POST['mode'] == 'confirm') {
         // エラーチェック
         $this->arrErr = $this->lfErrorCheck($_POST);
         // エラーがなければ更新処理を行う
         if (count($this->arrErr) == 0) {
             // DBへデータを更新する
             $this->lfEntryPageData($_POST);
             // ベースデータでなければファイルを削除し、PHPファイルを作成する
             if (!$this->objLayout->lfCheckBaseData($page_id)) {
                 // ファイル削除
                 $this->objLayout->lfDelFile($arrPageData[0]);
                 // PHPファイル作成
                 $cre_php = USER_PATH . $_POST['url'] . ".php";
                 $this->lfCreatePHPFile($cre_php);
             }
             // TPLファイル作成
             $cre_tpl = USER_TEMPLATE_PATH . "/" . TEMPLATE_NAME . "/" . basename($_POST['url']) . '.tpl';
             $this->lfCreateFile($cre_tpl);
             // 編集可能ページの場合にのみ処理を行う
             if ($arrPageData[0]['edit_flg'] != 2) {
                 // 新規作成した場合のために改にページIDを取得する
                 $arrPageData = $this->objLayout->lfgetPageData(" url = ? ", array(USER_URL . $_POST['url'] . ".php"));
                 $page_id = $arrPageData[0]['page_id'];
             }
             $this->sendRedirect($this->getLocation("./main_edit.php", array("page_id" => $page_id, "msg" => "on")));
             exit;
         } else {
             // エラーがあれば入力時のデータを表示する
             $this->arrPageData = $_POST;
             $this->arrPageData['header_chk'] = SC_Utils_Ex::sfChangeCheckBox(SC_Utils_Ex::sfChangeCheckBox($_POST['header_chk']), true);
             $this->arrPageData['footer_chk'] = SC_Utils_Ex::sfChangeCheckBox(SC_Utils_Ex::sfChangeCheckBox($_POST['footer_chk']), true);
             $this->arrPageData['directory'] = $_POST['url'];
             $this->arrPageData['filename'] = "";
         }
     }
     // データ削除処理 ベースデータでなければファイルを削除
     if ($_POST['mode'] == 'delete' and !$this->objLayout->lfCheckBaseData($page_id)) {
         $this->objLayout->lfDelPageData($_POST['page_id']);
         $this->sendRedirect($this->getLocation("./main_edit.php"));
         exit;
     }
     // 画面の表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     //---- 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     $objView = new SC_AdminView();
     $objQuery = new SC_Query();
     $objFormParam = new SC_FormParam();
     $objCSV = new SC_Helper_CSV_Ex();
     // パラメータ情報の初期化
     $this->lfInitParam($objFormParam);
     // フォームの値をセット
     $objFormParam->setParam($_POST);
     // 編集処理の場合は状態を保持
     $this->is_update = isset($_POST['is_update']) ? $_POST['is_update'] : "";
     // フォームの値をテンプレートへ渡す
     $this->arrForm = $objFormParam->getHashArray();
     $campaign_id = isset($_POST['campaign_id']) ? $_POST['campaign_id'] : "";
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         // 新規登録/編集登録
         case 'regist':
             // エラーチェック
             $this->arrErr = $this->lfErrorCheck($campaign_id, $objQuery, $objFormParam);
             if (count($this->arrErr) <= 0) {
                 // 登録
                 $this->lfRegistCampaign($campaign_id, $objQuery, $objFormParam);
                 // キャンペーンTOPへリダイレクト
                 $this->sendRedirect($this->getLocation(URL_CAMPAIGN_TOP));
                 exit;
             }
             break;
             // 編集押下時
         // 編集押下時
         case 'update':
             // キャンペーン情報を取得
             $this->arrForm = $this->lfGetCampaign($campaign_id, $objQuery);
             $this->is_update = true;
             break;
             // 削除押下時
         // 削除押下時
         case 'delete':
             // 削除
             $this->lfDeleteCampaign($campaign_id, $objQuery);
             // キャンペーンTOPへリダイレクト
             $this->sendRedirect($this->getLocation(URL_CAMPAIGN_TOP));
             exit;
             break;
             // CSV出力
         // CSV出力
         case 'csv':
             // オプションの指定
             $option = "ORDER BY create_date DESC";
             // CSV出力タイトル行の作成
             $arrCsvOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(4, " WHERE csv_id = 4 AND status = 1"));
             if (count($arrCsvOutput) <= 0) {
                 break;
             }
             $arrCsvOutputCols = $arrCsvOutput['col'];
             $arrCsvOutputTitle = $arrCsvOutput['disp_name'];
             $head = SC_Utils_Ex::sfGetCSVList($arrCsvOutputTitle);
             $data = $objCSV->lfGetCSV("dtb_campaign_order", "campaign_id = ?", $option, array($campaign_id), $arrCsvOutputCols);
             // CSVを送信する。
             SC_Utils_Ex::sfCSVDownload($head . $data);
             exit;
             break;
         default:
             break;
     }
     // キャンペーン一覧取得
     $this->arrCampaign = $this->lfGetCampaignList($objQuery);
     $this->campaign_id = $campaign_id;
     // キャンペーン期間用
     $objDate = new SC_Date();
     $this->arrYear = $objDate->getYear(min(date('Y'), $this->arrForm['start_year']));
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     $this->arrHour = $objDate->getHour();
     $this->arrMinutes = $objDate->getMinutes();
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #18
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objLayout = new SC_Helper_PageLayout_Ex();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ページIDを取得
     if (isset($_GET['page_id'])) {
         $page_id = $_GET['page_id'];
     } else {
         if (isset($_POST['page_id'])) {
             $page_id = $_POST['page_id'];
         } else {
             $page_id = 1;
         }
     }
     // 編集可能ページを取得
     $this->arrEditPage = $objLayout->lfgetPageData();
     // ブロック配置用データを取得
     $sel = ", pos.target_id, pos.bloc_id, pos.bloc_row ";
     $from = ", dtb_blocposition AS pos";
     $where = " where ";
     $where .= " lay.page_id = ? AND ";
     $where .= "lay.page_id = pos.page_id AND exists (select bloc_id from dtb_bloc as blc where pos.bloc_id = blc.bloc_id) ORDER BY lay.page_id,pos.target_id, pos.bloc_row, pos.bloc_id ";
     $arrData = array($page_id);
     $arrBlocPos = $this->lfgetLayoutData($sel, $from, $where, $arrData);
     // データの存在チェックを行う
     $arrPageData = $objLayout->lfgetPageData("page_id = ?", array($page_id));
     if (count($arrPageData) <= 0) {
         $exists_page = 0;
     } else {
         $exists_page = 1;
     }
     $this->exists_page = $exists_page;
     // メッセージ表示
     if (isset($_GET['msg']) && $_GET['msg'] == "on") {
         $this->complate_msg = "alert('登録が完了しました。');";
     }
     // ブロックを取得
     $arrBloc = $this->lfgetBlocData();
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // 新規ブロック作成
     if ($_POST['mode'] == 'new_bloc') {
         $this->sendRedirect($this->getLocation("./bloc.php"));
         exit;
     }
     // 新規ページ作成
     if ($_POST['mode'] == 'new_page') {
         $this->sendRedirect($this->getLocation("./main_edit.php"));
         exit;
     }
     // データ登録処理
     if ($_POST['mode'] == 'confirm' or $_POST['mode'] == 'preview') {
         $page_id = $_POST['page_id'];
         if ($_POST['mode'] == 'preview') {
             $page_id = '0';
         }
         $masterData = new SC_DB_MasterData_Ex();
         $arrTarget = $masterData->getMasterData("mtb_target");
         // 更新用にデータを整える
         $arrUpdBlocData = array();
         $arrTargetFlip = array_flip($arrTarget);
         $upd_cnt = 1;
         $arrUpdData[$upd_cnt]['page_id'] = $page_id;
         // POSTのデータを使いやすいように修正
         for ($upd_cnt = 1; $upd_cnt <= $_POST['bloc_cnt']; $upd_cnt++) {
             if (!isset($_POST['id_' . $upd_cnt])) {
                 break;
             }
             $arrUpdBlocData[$upd_cnt]['name'] = $_POST['name_' . $upd_cnt];
             // ブロック名称
             $arrUpdBlocData[$upd_cnt]['id'] = $_POST['id_' . $upd_cnt];
             // ブロックID
             $arrUpdBlocData[$upd_cnt]['target_id'] = $arrTargetFlip[$_POST['target_id_' . $upd_cnt]];
             // ターゲットID
             $arrUpdBlocData[$upd_cnt]['top'] = $_POST['top_' . $upd_cnt];
             // TOP座標
             $arrUpdBlocData[$upd_cnt]['update_url'] = $_SERVER['HTTP_REFERER'];
             // 更新URL
         }
         // データの更新を行う
         $objDBConn = new SC_DbConn();
         // DB操作オブジェクト
         $arrRet = array();
         // データ取得用
         // delete実行
         $del_sql = "";
         $del_sql .= "DELETE FROM dtb_blocposition WHERE page_id = ? ";
         $arrRet = $objDBConn->query($del_sql, array($page_id));
         // ブロックの順序を取得し、更新を行う
         foreach ($arrUpdBlocData as $key => $val) {
             // ブロックの順序を取得
             $bloc_row = $this->lfGetRowID($arrUpdBlocData, $val);
             $arrUpdBlocData[$key]['bloc_row'] = $bloc_row;
             $arrUpdBlocData[$key]['page_id'] = $page_id;
             // ページID
             /*
             ターゲットID 1:レフトナビ 2:ライトナビ 3:イン画面上部 4:メイン画面下部 5:欄外
             */
             if ($arrUpdBlocData[$key]['target_id'] == 5) {
                 $arrUpdBlocData[$key]['bloc_row'] = "0";
             }
             // insert文生成
             $ins_sql = "";
             $ins_sql .= "INSERT INTO dtb_blocposition ";
             $ins_sql .= " values ( ";
             $ins_sql .= "   ?  ";
             // ページID
             $ins_sql .= "   ,? ";
             // ターゲットID
             $ins_sql .= "   ,? ";
             // ブロックID
             $ins_sql .= "   ,? ";
             // ブロックの並び順序
             $ins_sql .= "   ,(SELECT filename FROM dtb_bloc WHERE bloc_id = ?) ";
             // ファイル名称
             $ins_sql .= "   )  ";
             // insertデータ生成
             $arrInsData = array($page_id, $arrUpdBlocData[$key]['target_id'], $arrUpdBlocData[$key]['id'], $arrUpdBlocData[$key]['bloc_row'], $arrUpdBlocData[$key]['id']);
             // SQL実行
             $arrRet = $objDBConn->query($ins_sql, $arrInsData);
         }
         // プレビュー処理
         if ($_POST['mode'] == 'preview') {
             if ($page_id === "") {
                 $this->sendRedirect($this->getLocation("./index.php"));
                 exit;
             }
             $this->lfSetPreData($arrPageData, $objLayout);
             $_SESSION['preview'] = "ON";
             $this->sendRedirect($this->getLocation(URL_DIR . "preview/index.php", array("filename" => $arrPageData[0]["filename"])));
             exit;
         } else {
             $this->sendRedirect($this->getLocation("./index.php", array("page_id" => $page_id, "msg" => "on")));
             exit;
         }
     }
     // データ削除処理 ベースデータでなければファイルを削除
     if ($_POST['mode'] == 'delete' and !$objLayout->lfCheckBaseData($page_id)) {
         $objLayout->lfDelPageData($page_id);
         $this->sendRedirect($this->getLocation("./index.php"));
         exit;
     }
     // ブロック情報を画面配置用に編集
     $tpl_arrBloc = array();
     $cnt = 0;
     // 使用されているブロックデータを生成
     foreach ($arrBlocPos as $key => $val) {
         if ($val['page_id'] == $page_id) {
             $tpl_arrBloc = $this->lfSetBlocData($arrBloc, $val, $tpl_arrBloc, $cnt);
             $cnt++;
         }
     }
     // 未使用のブロックデータを追加
     foreach ($arrBloc as $key => $val) {
         if (!$this->lfChkBloc($val, $tpl_arrBloc)) {
             $val['target_id'] = 5;
             // 未使用に追加する
             $tpl_arrBloc = $this->lfSetBlocData($arrBloc, $val, $tpl_arrBloc, $cnt);
             $cnt++;
         }
     }
     $this->tpl_arrBloc = $tpl_arrBloc;
     $this->bloc_cnt = count($tpl_arrBloc);
     $this->page_id = $page_id;
     // ページ名称を取得
     $arrPageData = $objLayout->lfgetPageData(' page_id = ?', array($page_id));
     $this->arrPageData = $arrPageData[0];
     global $GLOBAL_ERR;
     $errCnt = 0;
     if ($GLOBAL_ERR != "") {
         $arrGlobalErr = explode("\n", $GLOBAL_ERR);
         $errCnt = count($arrGlobalErr) - 8;
         if ($errCnt < 0) {
             $errCnt = 0;
         }
     }
     $this->errCnt = $errCnt;
     // 画面の表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     $get_check = false;
     // 規格IDのチェック
     if (SC_Utils_Ex::sfIsInt($_GET['class_id'])) {
         // 規格名の取得
         $this->tpl_class_name = $objQuery->get("dtb_class", "name", "class_id = ?", array($_GET['class_id']));
         if ($this->tpl_class_name != "") {
             // 規格IDの引き継ぎ
             $this->arrHidden['class_id'] = $_GET['class_id'];
             $get_check = true;
         }
     }
     if (!$get_check) {
         // 規格登録ページに飛ばす。
         $this->sendRedirect($this->getLocation(URL_CLASS_REGIST));
         exit;
     }
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if (isset($_POST['class_id'])) {
         if (!SC_Utils_Ex::sfIsInt($_POST['class_id'])) {
             SC_Utils_Ex::sfDispError("");
         }
     }
     // 新規作成 or 編集
     switch ($_POST['mode']) {
         // 登録ボタン押下
         case 'edit':
             // POST値の引き継ぎ
             $this->arrForm = $_POST;
             // 入力文字の変換
             $_POST = $this->lfConvertParam($_POST);
             // エラーチェック
             $this->arrErr = $this->lfErrorCheck();
             if (count($this->arrErr) <= 0) {
                 if ($_POST['classcategory_id'] == "") {
                     $this->lfInsertClass();
                     // DBへの書き込み
                 } else {
                     $this->lfUpdateClass();
                     // DBへの書き込み
                 }
                 // 再表示
                 $this->reload($_GET['class_id']);
                 //sfReload("class_id=" . $_GET['class_id']);
             } else {
                 // POSTデータを引き継ぐ
                 $this->tpl_classcategory_id = $_POST['classcategory_id'];
             }
             break;
             // 削除
         // 削除
         case 'delete':
             // ランク付きレコードの削除
             $where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
             $objDb->sfDeleteRankRecord("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where, true);
             break;
             // 編集前処理
         // 編集前処理
         case 'pre_edit':
             // 編集項目をDBより取得する。
             $where = "classcategory_id = ?";
             $name = $objQuery->get("dtb_classcategory", "name", $where, array($_POST['classcategory_id']));
             // 入力項目にカテゴリ名を入力する。
             $this->arrForm['name'] = $name;
             // POSTデータを引き継ぐ
             $this->tpl_classcategory_id = $_POST['classcategory_id'];
             break;
         case 'down':
             $where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
             $objDb->sfRankDown("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
             break;
         case 'up':
             $where = "class_id = " . SC_Utils_Ex::sfQuoteSmart($_POST['class_id']);
             $objDb->sfRankUp("dtb_classcategory", "classcategory_id", $_POST['classcategory_id'], $where);
             break;
         default:
             break;
     }
     // 規格分類の読込
     $where = "del_flg <> 1 AND class_id = ?";
     $objQuery->setorder("rank DESC");
     $this->arrClassCat = $objQuery->select("name, classcategory_id", "dtb_classcategory", $where, array($_GET['class_id']));
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     // 通常時は親カテゴリを0に設定する。
     $this->arrForm['parent_category_id'] = isset($_POST['parent_category_id']) ? $_POST['parent_category_id'] : "";
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         case 'edit':
             $this->objFormParam->convParam();
             $arrRet = $this->objFormParam->getHashArray();
             $this->arrErr = $this->lfCheckError($arrRet);
             if (count($this->arrErr) == 0) {
                 if ($_POST['category_id'] == "") {
                     $objQuery = new SC_Query();
                     $count = $objQuery->count("dtb_category");
                     if ($count < CATEGORY_MAX) {
                         $this->lfInsertCat($_POST['parent_category_id']);
                     } else {
                         print "カテゴリの登録最大数を超えました。";
                     }
                 } else {
                     $this->lfUpdateCat($_POST['category_id']);
                 }
             } else {
                 $this->arrForm = array_merge($this->arrForm, $this->objFormParam->getHashArray());
                 $this->arrForm['category_id'] = $_POST['category_id'];
             }
             break;
         case 'pre_edit':
             // 編集項目のカテゴリ名をDBより取得する。
             $oquery = new SC_Query();
             $where = "category_id = ?";
             $cat_name = $oquery->get("dtb_category", "category_name", $where, array($_POST['category_id']));
             $description = $oquery->get("dtb_category", "description", $where, array($_POST['category_id']));
             // 入力項目にカテゴリ名を入力する。
             $this->arrForm['category_name'] = $cat_name;
             $this->arrForm['description'] = $description;
             // POSTデータを引き継ぐ
             $this->arrForm['category_id'] = $_POST['category_id'];
             break;
         case 'delete':
             $objQuery = new SC_Query();
             // 子カテゴリのチェック
             $where = "parent_category_id = ? AND del_flg = 0";
             $count = $objQuery->count("dtb_category", $where, array($_POST['category_id']));
             if ($count != 0) {
                 $this->arrErr['category_name'] = "※ 子カテゴリが存在するため削除できません。<br>";
             }
             // 登録商品のチェック
             $table = "dtb_product_categories AS T1 LEFT JOIN dtb_products AS T2 ON T1.product_id = T2.product_id";
             $where = "T1.category_id = ? AND T2.del_flg = 0";
             $count = $objQuery->count($table, $where, array($_POST['category_id']));
             if ($count != 0) {
                 $this->arrErr['category_name'] = "※ カテゴリ内に商品が存在するため削除できません。<br>";
             }
             if (!isset($this->arrErr['category_name'])) {
                 // ランク付きレコードの削除(※処理負荷を考慮してレコードごと削除する。)
                 $objDb->sfDeleteRankRecord("dtb_category", "category_id", $_POST['category_id'], "", true);
             }
             break;
         case 'up':
             $objQuery = new SC_Query();
             $objQuery->begin();
             $up_id = $this->lfGetUpRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
             if ($up_id != "") {
                 // 上のグループのrankから減算する数
                 $my_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
                 // 自分のグループのrankに加算する数
                 $up_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id);
                 if ($my_count > 0 && $up_count > 0) {
                     // 自分のグループに加算
                     $this->lfUpRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id'], $up_count);
                     // 上のグループから減算
                     $this->lfDownRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $up_id, $my_count);
                 }
             }
             $objQuery->commit();
             break;
         case 'down':
             $objQuery = new SC_Query();
             $objQuery->begin();
             $down_id = $this->lfGetDownRankID($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
             if ($down_id != "") {
                 // 下のグループのrankに加算する数
                 $my_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id']);
                 // 自分のグループのrankから減算する数
                 $down_count = $this->lfCountChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $down_id);
                 if ($my_count > 0 && $down_count > 0) {
                     // 自分のグループから減算
                     $this->lfUpRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $down_id, $my_count);
                     // 下のグループに加算
                     $this->lfDownRankChilds($objQuery, "dtb_category", "parent_category_id", "category_id", $_POST['category_id'], $down_count);
                 }
             }
             $objQuery->commit();
             break;
         case 'tree':
             break;
         case 'csv':
             require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
             $objCSV = new SC_Helper_CSV_Ex();
             // オプションの指定
             $option = "ORDER BY rank DESC";
             // CSV出力タイトル行の作成
             $arrOutput = SC_Utils_Ex::sfSwapArray($objCSV->sfgetCsvOutput(5, " WHERE csv_id = 5 AND status = 1"));
             if (count($arrOutput) <= 0) {
                 break;
             }
             $arrOutputCols = $arrOutput['col'];
             $arrOutputTitle = $arrOutput['disp_name'];
             $head = SC_Utils_Ex::sfGetCSVList($arrOutputTitle);
             $where = "del_flg = 0";
             $data = $objCSV->lfGetCategoryCSV($where, $option, $arrval, $arrOutputCols);
             // CSVを送信する。
             SC_Utils_Ex::sfCSVDownload($head . $data, 'category');
             exit;
             break;
         default:
             $this->arrForm['parent_category_id'] = 0;
             break;
     }
     $this->arrList = $this->lfGetCat($this->arrForm['parent_category_id']);
     $this->arrTree = $objDb->sfGetCatTree($this->arrForm['parent_category_id']);
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #21
0
 /**
  * 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);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSiteInfo = new SC_SiteInfo();
     $objQuery = new SC_Query();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ファイル管理クラス
     $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
     // ファイル情報の初期化
     $this->lfInitFile();
     // Hiddenからのデータを引き継ぐ
     $this->objUpFile->setHiddenFileList($_POST);
     // 規格の有り無し判定
     $this->tpl_nonclass = $this->lfCheckNonClass($_POST['product_id']);
     // 検索パラメータの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrSearchHidden[$key] = $val;
         }
     }
     // FORMデータの引き継ぎ
     $this->arrForm = $_POST;
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         // 検索画面からの編集
         case 'pre_edit':
         case 'copy':
             // 編集時
             if (SC_Utils_Ex::sfIsInt($_POST['product_id'])) {
                 // DBから商品情報の読込
                 $arrForm = $this->lfGetProduct($_POST['product_id']);
                 // DBデータから画像ファイル名の読込
                 $this->objUpFile->setDBFileList($arrForm);
                 if ($_POST['mode'] == "copy") {
                     $arrForm["copy_product_id"] = $arrForm["product_id"];
                     $arrForm["product_id"] = "";
                     // 画像ファイルのコピー
                     $arrKey = $this->objUpFile->keyname;
                     $arrSaveFile = $this->objUpFile->save_file;
                     foreach ($arrSaveFile as $key => $val) {
                         $this->lfMakeScaleImage($arrKey[$key], $arrKey[$key], true);
                     }
                 }
                 $this->arrForm = $arrForm;
                 // 商品ステータスの変換
                 $arrRet = SC_Utils_Ex::sfSplitCBValue($this->arrForm['product_flag'], "product_flag");
                 $this->arrForm = array_merge($this->arrForm, $arrRet);
                 // DBからおすすめ商品の読み込み
                 $this->arrRecommend = $this->lfPreGetRecommendProducts($_POST['product_id']);
                 $this->lfProductPage();
                 // 商品登録ページ
             }
             break;
             // 商品登録・編集
         // 商品登録・編集
         case 'edit':
             if ($_POST['product_id'] == "" and SC_Utils_Ex::sfIsInt($_POST['copy_product_id'])) {
                 $this->tpl_nonclass = $this->lfCheckNonClass($_POST['copy_product_id']);
             }
             // 入力値の変換
             $this->arrForm = $this->lfConvertParam($this->arrForm);
             // エラーチェック
             $this->arrErr = $this->lfErrorCheck($this->arrForm);
             // ファイル存在チェック
             $this->arrErr = array_merge((array) $this->arrErr, (array) $this->objUpFile->checkEXISTS());
             // エラーなしの場合
             if (count($this->arrErr) == 0) {
                 $this->lfProductConfirmPage();
                 // 確認ページ
             } else {
                 $this->lfProductPage();
                 // 商品登録ページ
             }
             break;
             // 確認ページから完了ページへ
         // 確認ページから完了ページへ
         case 'complete':
             $this->tpl_mainpage = 'products/complete.tpl';
             $this->arrForm['product_id'] = $this->lfRegistProduct($_POST);
             // データ登録
             // 件数カウントバッチ実行
             $objDb->sfCategory_Count($objQuery);
             // 一時ファイルを本番ディレクトリに移動する
             $this->objUpFile->moveTempFile();
             break;
             // 画像のアップロード
         // 画像のアップロード
         case 'upload_image':
             // ファイル存在チェック
             $this->arrErr = array_merge((array) $this->arrErr, (array) $this->objUpFile->checkEXISTS($_POST['image_key']));
             // 画像保存処理
             $this->arrErr[$_POST['image_key']] = $this->objUpFile->makeTempFile($_POST['image_key'], IMAGE_RENAME);
             // 中、小画像生成
             $this->lfSetScaleImage();
             $this->lfProductPage();
             // 商品登録ページ
             break;
             // 画像の削除
         // 画像の削除
         case 'delete_image':
             $this->objUpFile->deleteFile($_POST['image_key']);
             $this->lfProductPage();
             // 商品登録ページ
             break;
             // 確認ページからの戻り
         // 確認ページからの戻り
         case 'confirm_return':
             $this->lfProductPage();
             // 商品登録ページ
             break;
             // おすすめ商品選択
         // おすすめ商品選択
         case 'recommend_select':
             $this->lfProductPage();
             // 商品登録ページ
             break;
         default:
             $this->lfProductPage();
             // 商品登録ページ
             break;
     }
     if ($_POST['mode'] != 'pre_edit') {
         // おすすめ商品の読み込み
         $this->arrRecommend = $this->lfGetRecommendProducts();
     }
     // 基本情報を渡す
     $this->arrInfo = $objSiteInfo->data;
     // サブ情報の入力があるかどうかチェックする
     $sub_find = false;
     for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
         if (isset($this->arrForm['sub_title' . $cnt]) && !empty($this->arrForm['sub_title' . $cnt]) || isset($this->arrForm['sub_comment' . $cnt]) && !empty($this->arrForm['sub_comment' . $cnt]) || isset($this->arrForm['sub_image' . $cnt]) && !empty($this->arrForm['sub_image' . $cnt]) || isset($this->arrForm['sub_large_image' . $cnt]) && !empty($this->arrForm['sub_large_image' . $cnt]) || isset($this->arrForm['sub_image' . $cnt]) && is_array($this->arrFile['sub_image' . $cnt]) || isset($this->arrForm['sub_large_image' . $cnt]) && is_array($this->arrFile['sub_large_image' . $cnt])) {
             $sub_find = true;
             break;
         }
     }
     // サブ情報表示・非表示のチェックに使用する。
     $this->sub_find = $sub_find;
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     //---- ページ初期設定
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objDate = new SC_Date();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_GET['send_id'])) {
         $_GET['send_id'] = "";
     }
     if (!isset($_GET['mode'])) {
         $_GET['mode'] = "";
     }
     if (!isset($_POST['search_pageno'])) {
         $_POST['search_pageno'] = "";
     }
     // 削除時
     if (SC_Utils_Ex::sfCheckNumLength($_GET['send_id']) && $_GET['mode'] == 'delete') {
         $sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?";
         $conn->query($sql, array($_GET['send_id']));
         $_SERVER['QUERY_STRING'] = "";
         $this->reload();
     }
     $col = "*";
     $from = "dtb_send_history";
     $where = " del_flg = ?";
     $arrval[] = "0";
     $objQuery = new SC_Query();
     // 行数の取得
     $linemax = $objQuery->count($from, $where, $arrval);
     $this->tpl_linemax = $linemax;
     // 何件が該当しました。表示用
     // ページ送りの取得
     $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, SEARCH_PMAX, "fnNaviSearchPage", NAVI_PMAX);
     $this->tpl_strnavi = $objNavi->strnavi;
     // 表示文字列
     $startno = $objNavi->start_row;
     // 取得範囲の指定(開始行番号、行数のセット)
     $objQuery->setlimitoffset(SEARCH_PMAX, $startno);
     // 表示順序
     $order = "start_date DESC, send_id DESC";
     $objQuery->setorder($order);
     // 検索結果の取得
     $this->arrDataList = $objQuery->select($col, $from, $where, $arrval);
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // 検索パラメータの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrSearchHidden[$key] = $val;
         }
     }
     $this->tpl_product_id = isset($_POST['product_id']) ? $_POST['product_id'] : "";
     $this->tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : "";
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     switch ($_POST['mode']) {
         // 規格削除要求
         case 'delete':
             $objQuery = new SC_Query();
             $objQuery->setLimitOffset(1);
             $where = "product_id = ? AND NOT (classcategory_id1 = 0 AND classcategory_id2 = 0)";
             $objQuery->setOrder("rank1 DESC, rank2 DESC");
             $arrRet = $objQuery->select("*", "vw_cross_products_class AS crs_prd", $where, array($_POST['product_id']));
             if (count($arrRet) > 0) {
                 $sqlval['product_id'] = $arrRet[0]['product_id'];
                 $sqlval['classcategory_id1'] = '0';
                 $sqlval['classcategory_id2'] = '0';
                 $sqlval['product_code'] = $arrRet[0]['product_code'];
                 $sqlval['stock'] = $arrRet[0]['stock'];
                 $sqlval['price01'] = $arrRet[0]['price01'];
                 $sqlval['price02'] = $arrRet[0]['price02'];
                 $sqlval['creator_id'] = $_SESSION['member_id'];
                 $sqlval['create_date'] = "now()";
                 $sqlval['update_date'] = "now()";
                 $objQuery->begin();
                 $where = "product_id = ?";
                 $objQuery->delete("dtb_products_class", $where, array($_POST['product_id']));
                 $objQuery->insert("dtb_products_class", $sqlval);
                 $objQuery->commit();
             }
             $this->lfProductClassPage();
             // 規格登録ページ
             break;
             // 編集要求
         // 編集要求
         case 'pre_edit':
             $objQuery = new SC_Query();
             $where = "product_id = ? AND NOT(classcategory_id1 = 0 AND classcategory_id2 = 0) ";
             $ret = $objQuery->count("dtb_products_class", $where, array($_POST['product_id']));
             if ($ret > 0) {
                 // 規格組み合わせ一覧の取得(DBの値を優先する。)
                 $this->arrClassCat = $this->lfGetClassCatListEdit($_POST['product_id']);
             }
             $this->lfProductClassPage();
             // 規格登録ページ
             break;
             // 規格組み合わせ表示
         // 規格組み合わせ表示
         case 'disp':
             $this->arrForm['select_class_id1'] = $_POST['select_class_id1'];
             $this->arrForm['select_class_id2'] = $_POST['select_class_id2'];
             $this->arrErr = $this->lfClassError();
             if (count($this->arrErr) == 0) {
                 // 規格組み合わせ一覧の取得
                 $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['select_class_id1'], $_POST['select_class_id2']);
             }
             $this->lfProductClassPage();
             // 規格登録ページ
             break;
             // 規格登録要求
         // 規格登録要求
         case 'edit':
             // 入力値の変換
             $this->arrForm = $this->lfConvertParam($_POST);
             // エラーチェック
             $this->arrErr = $this->lfProductClassError($this->arrForm);
             if (count($this->arrErr) == 0) {
                 // 確認ページ設定
                 $this->tpl_mainpage = 'products/product_class_confirm.tpl';
                 $this->lfProductConfirmPage();
                 // 確認ページ表示
             } else {
                 // 規格組み合わせ一覧の取得
                 $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false);
                 $this->lfProductClassPage();
                 // 規格登録ページ
             }
             break;
             // 確認ページからの戻り
         // 確認ページからの戻り
         case 'confirm_return':
             // フォームパラメータの引き継ぎ
             $this->arrForm = $_POST;
             // 規格の選択情報は引き継がない。
             $this->arrForm['select_class_id1'] = "";
             $this->arrForm['select_class_id2'] = "";
             // 規格組み合わせ一覧の取得(デフォルト値は出力しない)
             $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false);
             $this->lfProductClassPage();
             // 規格登録ページ
             break;
         case 'complete':
             // 完了ページ設定
             $this->tpl_mainpage = 'products/product_class_complete.tpl';
             // 商品規格の登録
             $this->lfInsertProductClass($_POST, $_POST['product_id']);
             break;
         default:
             $this->lfProductClassPage();
             // 規格登録ページ
             break;
     }
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     if ($_POST['mode'] == "search") {
         // POST値の引き継ぎ
         $this->arrForm = $_POST;
         // 入力文字の強制変換
         $this->lfConvertParam();
         $where = "del_flg = 0 AND status = 1";
         /* 入力エラーなし */
         foreach ($this->arrForm as $key => $val) {
             if ($val == "") {
                 continue;
             }
             switch ($key) {
                 case 'search_name':
                     $where .= " AND name ILIKE ?";
                     $arrval[] = "%{$val}%";
                     break;
                 case 'search_category_id':
                     list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val);
                     if ($tmp_where != "") {
                         $where .= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";
                         $arrval = array_merge((array) $arrval, (array) $tmp_arrval);
                     }
                     break;
                 case 'search_product_code':
                     $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)";
                     $arrval[] = "{$val}%";
                     break;
                 default:
                     break;
             }
         }
         $order = "update_date DESC, product_id DESC";
         // 読み込む列とテーブルの指定
         $col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
         $from = "vw_products_nonclass AS noncls ";
         $objQuery = new SC_Query();
         // 行数の取得
         if (empty($arrval)) {
             $arrval = array();
         }
         $linemax = $objQuery->count("dtb_products", $where, $arrval);
         $this->tpl_linemax = $linemax;
         // 何件が該当しました。表示用
         // ページ送りの処理
         if (isset($_POST['search_page_max']) && is_numeric($_POST['search_page_max'])) {
             $page_max = $_POST['search_page_max'];
         } else {
             $page_max = SEARCH_PMAX;
         }
         // ページ送りの取得
         $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
         $this->tpl_strnavi = $objNavi->strnavi;
         // 表示文字列
         $startno = $objNavi->start_row;
         // 取得範囲の指定(開始行番号、行数のセット)
         $objQuery->setlimitoffset($page_max, $startno);
         // 表示順序
         $objQuery->setorder($order);
         // 検索結果の取得
         $this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
     }
     // カテゴリ取得
     $this->arrCatList = $objDb->sfGetCategoryList();
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objQuery = new SC_Query();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     $cnt = $objQuery->count("dtb_baseinfo");
     if ($cnt > 0) {
         $this->tpl_mode = "update";
     } else {
         $this->tpl_mode = "insert";
     }
     if (isset($_POST['mode']) && !empty($_POST['mode'])) {
         // 入力値の変換
         $this->objFormParam->convParam();
         $this->arrErr = $this->lfCheckError();
         if (count($this->arrErr) == 0) {
             switch ($_POST['mode']) {
                 case 'update':
                     $this->lfUpdateData();
                     // 既存編集
                     break;
                 case 'insert':
                     $this->lfInsertData();
                     // 新規作成
                     break;
                 default:
                     break;
             }
             // 再表示
             //sfReload();
             $this->tpl_onload = "window.alert('特定商取引法の登録が完了しました。');";
         }
     } else {
         $arrCol = $this->objFormParam->getKeyList();
         // キー名一覧を取得
         $col = SC_Utils_Ex::sfGetCommaList($arrCol);
         $arrRet = $objQuery->select($col, "dtb_baseinfo");
         // DB値の取得
         $this->objFormParam->setParam($arrRet[0]);
     }
     $this->arrForm = $this->objFormParam->getFormParamList();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     // ログインチェック
     $objSession = new SC_Session();
     SC_Utils::sfIsSuccess($objSession);
     $this->now_template = $this->lfGetNowTemplate();
     // uniqidをテンプレートへ埋め込み
     $this->uniqid = $objSession->getUniqId();
     switch ($this->lfGetMode()) {
         // ダウンロードボタン押下時の処理
         case 'download':
             break;
             // アップロードボタン押下時の処理
         // アップロードボタン押下時の処理
         case 'upload':
             // 画面遷移の正当性チェック
             if (!SC_Utils::sfIsValidTransition($objSession)) {
                 SC_Utils::sfDispError('');
             }
             // フォームパラメータ初期化
             $objForm = $this->lfInitUpload();
             // エラーチェック
             if ($arrErr = $this->lfValidateUpload($objForm)) {
                 $this->arrErr = $arrErr;
                 $this->arrForm = $objForm->getFormParamList();
                 break;
             }
             // アップロードファイル初期化
             $objUpFile = $this->lfInitUploadFile($objForm);
             // 一時ファイルへ保存
             $errMsg = $objUpFile->makeTempFile('template_file', false);
             // 書き込みエラーチェック
             if (isset($errMsg)) {
                 $this->arrErr['template_file'] = $errMsg;
                 $this->arrForm = $objForm->getFormParamList();
                 break;
             }
             $this->lfAddTemplates($objForm, $objUpFile);
             $this->tpl_onload = "alert('テンプレートファイルをアップロードしました。');";
             break;
             // 初回表示
         // 初回表示
         default:
             break;
     }
     // 画面の表示
     $objView = new SC_AdminView();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
Пример #28
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // 検索パラメータの引き継ぎ
     foreach ($_POST as $key => $val) {
         if (ereg("^search_", $key)) {
             $this->arrSearchHidden[$key] = $val;
         }
     }
     $this->tpl_order_id = $_POST['order_id'];
     // パラメータ管理クラス
     $objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam($objFormParam);
     $objMail = new SC_Helper_Mail_Ex();
     switch ($_POST['mode']) {
         case 'pre_edit':
             break;
         case 'return':
             // POST値の取得
             $objFormParam->setParam($_POST);
             break;
         case 'send':
             // POST値の取得
             $objFormParam->setParam($_POST);
             // 入力値の変換
             $objFormParam->convParam();
             $this->arrErr = $objFormParam->checkerror();
             // メールの送信
             if (count($this->arrErr) == 0) {
                 // 注文受付メール
                 $objMail->sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer']);
             }
             $this->sendRedirect($this->getLocation(URL_SEARCH_ORDER));
             exit;
             break;
         case 'confirm':
             // POST値の取得
             $objFormParam->setParam($_POST);
             // 入力値の変換
             $objFormParam->convParam();
             // 入力値の引き継ぎ
             $this->arrHidden = $objFormParam->getHashArray();
             $this->arrErr = $objFormParam->checkerror();
             // メールの送信
             if (count($this->arrErr) == 0) {
                 // 注文受付メール(送信なし)
                 $objSendMail = $objMail->sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer'], false);
                 // 確認ページの表示
                 $this->tpl_subject = $_POST['subject'];
                 $this->tpl_body = mb_convert_encoding($objSendMail->body, CHAR_CODE, "auto");
                 $this->tpl_to = $objSendMail->tpl_to;
                 $this->tpl_mainpage = 'order/mail_confirm.tpl';
                 $objView->assignobj($this);
                 $objView->display(MAIN_FRAME);
                 exit;
             }
             break;
         case 'change':
             // POST値の取得
             $objFormParam->setValue('template_id', $_POST['template_id']);
             if (SC_Utils_Ex::sfIsInt($_POST['template_id'])) {
                 $objQuery = new SC_Query();
                 $where = "template_id = ?";
                 $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($_POST['template_id']));
                 $objFormParam->setParam($arrRet[0]);
             }
             break;
     }
     $objQuery = new SC_Query();
     $col = "send_date, subject, template_id, send_id";
     $where = "order_id = ?";
     $objQuery->setorder("send_date DESC");
     if (SC_Utils_Ex::sfIsInt($_POST['order_id'])) {
         $this->arrMailHistory = $objQuery->select($col, "dtb_mail_history", $where, array($_POST['order_id']));
     }
     $this->arrForm = $objFormParam->getFormParamList();
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     $conn = new SC_DBConn();
     $objView = new SC_AdminView();
     $objSess = new SC_Session();
     $objDb = new SC_Helper_DB_Ex();
     // 認証可否の判定
     SC_Utils_Ex::sfIsSuccess($objSess);
     // ファイル管理クラス
     $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
     // ファイル情報の初期化
     $this->objUpFile = $this->lfInitFile();
     // Hiddenからのデータを引き継ぐ
     $this->objUpFile->setHiddenFileList($_POST);
     // パラメータ管理クラス
     $this->objFormParam = new SC_FormParam();
     // パラメータ情報の初期化
     $this->lfInitParam();
     // POST値の取得
     $this->objFormParam->setParam($_POST);
     switch ($_POST['mode']) {
         case 'edit':
             // 入力値の変換
             $this->objFormParam->convParam();
             // エラーチェック
             $this->arrErr = $this->lfCheckError();
             $this->charge_flg = $_POST["charge_flg"];
             if (count($this->arrErr) == 0) {
                 $this->lfRegistData($_POST['payment_id']);
                 // 一時ファイルを本番ディレクトリに移動する
                 $this->objUpFile->moveTempFile();
                 // 親ウィンドウを更新するようにセットする。
                 $this->tpl_onload = "fnUpdateParent('" . URL_PAYMENT_TOP . "'); window.close();";
             }
             break;
             // 画像のアップロード
         // 画像のアップロード
         case 'upload_image':
             // ファイル存在チェック
             $this->arrErr = $this->objUpFile->checkEXISTS($_POST['image_key']);
             // 画像保存処理
             $this->arrErr[$_POST['image_key']] = $this->objUpFile->makeTempFile($_POST['image_key']);
             break;
             // 画像の削除
         // 画像の削除
         case 'delete_image':
             $this->objUpFile->deleteFile($_POST['image_key']);
             break;
         default:
             break;
     }
     if ($_POST['mode'] == "") {
         switch ($_GET['mode']) {
             case 'pre_edit':
                 if (SC_Utils_Ex::sfIsInt($_GET['payment_id'])) {
                     $arrRet = $this->lfGetData($_GET['payment_id']);
                     $this->objFormParam->setParam($arrRet);
                     $this->charge_flg = $arrRet["charge_flg"];
                     // DBデータから画像ファイル名の読込
                     $this->objUpFile->setDBFileList($arrRet);
                     $this->tpl_payment_id = $_GET['payment_id'];
                 }
                 break;
             default:
                 break;
         }
     } else {
         $this->tpl_payment_id = $_POST['payment_id'];
     }
     $this->arrDelivList = $objDb->sfGetIDValueList("dtb_deliv", "deliv_id", "service_name");
     $this->arrForm = $this->objFormParam->getFormParamList();
     // FORM表示用配列を渡す。
     $this->arrFile = $this->objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL);
     // HIDDEN用に配列を渡す。
     $this->arrHidden = array_merge((array) $this->arrHidden, (array) $this->objUpFile->getHiddenFileList());
     $objView->assignobj($this);
     $objView->display($this->tpl_mainpage);
 }
Пример #30
0
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function process()
 {
     //---- ページ初期設定
     $objQuery = new SC_Query();
     $objView = new SC_AdminView();
     $objDate = new SC_Date(1901);
     $objDb = new SC_Helper_DB_Ex();
     $this->arrYear = $objDate->getYear();
     // 日付プルダウン設定
     $this->arrMonth = $objDate->getMonth();
     $this->arrDay = $objDate->getDay();
     $this->objDate = $objDate;
     // 認証可否の判定
     $objSess = new SC_Session();
     SC_Utils_Ex::sfIsSuccess($objSess);
     // POST値の引き継ぎ
     $this->arrForm = $_POST;
     // ページ送り用
     $this->arrHidden['search_pageno'] = isset($_POST['search_pageno']) ? $_POST['search_pageno'] : "";
     // 検索ワードの引き継ぎ
     foreach ($_POST as $key => $val) {
         switch ($key) {
             case 'sex':
             case 'status':
                 $this->arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val);
                 if (!is_array($val)) {
                     $this->arrForm[$key] = split("-", $val);
                 }
                 break;
             default:
                 $this->arrHidden[$key] = $val;
                 break;
         }
     }
     if (!isset($_POST['mode'])) {
         $_POST['mode'] = "";
     }
     // 顧客削除
     if ($_POST['mode'] == "delete") {
         $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";
         $result_customer = $objQuery->conn->getAll($sql, array($_POST["edit_customer_id"]));
         if ($result_customer[0]["status"] == 2) {
             //本会員削除
             $arrDel = array("del_flg" => 1, "update_date" => "NOW()");
             $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["edit_customer_id"]));
         } elseif ($result_customer[0]["status"] == 1) {
             //仮会員削除
             $sql = "DELETE FROM dtb_customer WHERE customer_id = ?";
             $objQuery->conn->query($sql, array($_POST["edit_customer_id"]));
         }
     }
     //if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all") {
     // 登録メール再送
     if ($_POST['mode'] == "resend_mail") {
         $arrRet = $objQuery->select("name01, name02, secret_key, email", "dtb_customer", "customer_id = ? AND del_flg <> 1 AND status = 1", array($_POST["edit_customer_id"]));
         if (is_array($arrRet) === true && count($arrRet) > 0) {
             $CONF = $objDb->sf_getBasisData();
             $this->CONF = $CONF;
             $objMailText = new SC_SiteView();
             $objMailText->assignobj($this);
             $mailHelper = new SC_Helper_Mail_Ex();
             $this->name01 = $arrRet[0]['name01'];
             $this->name02 = $arrRet[0]['name02'];
             $this->uniqid = $arrRet[0]['secret_key'];
             $subject = $mailHelper->sfMakesubject($objQuery, $objMailText, $this, '会員登録のご確認');
             $toCustomerMail = $objMailText->fetch("mail_templates/customer_mail.tpl");
             $objMail = new SC_SendMail();
             $objMail->setItem('', $subject, $toCustomerMail, $CONF["email03"], $CONF["shop_name"], $CONF["email03"], $CONF["email04"], $CONF["email04"]);
             // 宛先の設定
             $name = $this->name01 . $this->name02 . " 様";
             $objMail->setTo($arrRet[0]["email"], $name);
             $objMail->sendMail();
         }
     }
     if ($_POST['mode'] == "search" || $_POST['mode'] == "csv" || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "resend_mail") {
         // 入力文字の強制変換
         $this->lfConvertParam();
         // エラーチェック
         $this->arrErr = $this->lfCheckError($this->arrForm);
         $where = "del_flg = 0";
         /* 入力エラーなし */
         if (count($this->arrErr) == 0) {
             //-- 検索データ取得
             $objSelect = new SC_CustomerList($this->arrForm, "customer");
             // 表示件数設定
             $page_rows = $this->arrForm['page_rows'];
             if (is_numeric($page_rows)) {
                 $page_max = $page_rows;
             } else {
                 $page_max = SEARCH_PMAX;
             }
             if (!isset($this->arrForm['search_pageno'])) {
                 $this->arrForm['search_pageno'] = "";
             }
             if ($this->arrForm['search_pageno'] == 0) {
                 $this->arrForm['search_pageno'] = 1;
             }
             $offset = $page_max * ($this->arrForm['search_pageno'] - 1);
             $objSelect->setLimitOffset($page_max, $offset);
             if ($_POST["mode"] == 'csv') {
                 $searchSql = $objSelect->getListCSV($this->arrColumnCSV);
             } else {
                 $searchSql = $objSelect->getList();
             }
             $this->search_data = $objQuery->conn->getAll($searchSql, $objSelect->arrVal);
             switch ($_POST['mode']) {
                 case 'csv':
                     require_once CLASS_EX_PATH . "helper_extends/SC_Helper_CSV_Ex.php";
                     $objCSV = new SC_Helper_CSV_Ex();
                     $i = 0;
                     $header = "";
                     // CSVカラム取得
                     $arrCsvOutput = $objCSV->sfgetCsvOutput(2, " WHERE csv_id = 2 AND status = 1");
                     if (count($arrCsvOutput) <= 0) {
                         break;
                     }
                     foreach ($arrCsvOutput as $data) {
                         $arrColumn[] = $data["col"];
                         if ($i != 0) {
                             $header .= ", ";
                         }
                         $header .= $data["disp_name"];
                         $i++;
                     }
                     $header .= "\n";
                     //- 都道府県/職業の変換
                     for ($i = 0; $i < count($this->search_data); $i++) {
                         $this->search_data[$i]["pref"] = $this->arrPref[$this->search_data[$i]["pref"]];
                         $this->search_data[$i]["job"] = $this->arrJob[$this->search_data[$i]["job"]];
                     }
                     //- CSV出力
                     $data = SC_Utils_Ex::getCSVData($this->search_data, $arrColumn);
                     SC_Utils_Ex::sfCSVDownload($header . $data);
                     exit;
                     break;
                 case 'delete_all':
                     // 検索結果をすべて削除
                     $where = "product_id IN (SELECT product_id FROM vw_products_nonclass AS noncls WHERE {$where})";
                     $sqlval['del_flg'] = 1;
                     $objQuery->update("dtb_products", $sqlval, $where, $arrval);
                     $sql = "SELECT status,email FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";
                     $result_customer = $objQuery->conn->getAll($sql, array($_POST["del_customer_id"]));
                     if ($result_customer[0]["status"] == 2) {
                         //本会員削除
                         $arrDel = array("del_flg" => 1, "update_date" => "NOW()");
                         $objQuery->conn->autoExecute("dtb_customer", $arrDel, "customer_id = " . SC_Utils_Ex::sfQuoteSmart($_POST["del_customer_id"]));
                     } elseif ($result_customer[0]["status"] == 1) {
                         //仮会員削除
                         $sql = "DELETE FROM dtb_customer WHERE customer_id = ?";
                         $objQuery->conn->query($sql, array($_POST["del_customer_id"]));
                     }
                     break;
                 default:
                     // 行数の取得
                     $linemax = $objQuery->conn->getOne($objSelect->getListCount(), $objSelect->arrVal);
                     $this->tpl_linemax = $linemax;
                     // 何件が該当しました。表示用
                     // ページ送りの取得
                     $objNavi = new SC_PageNavi($this->arrHidden['search_pageno'], $linemax, $page_max, "fnCustomerPage", NAVI_PMAX);
                     $startno = $objNavi->start_row;
                     $this->arrPagenavi = $objNavi->arrPagenavi;
             }
         }
     }
     $this->arrCatList = $objDb->sfGetCategoryList();
     //---- ページ表示
     $objView->assignobj($this);
     $objView->display(MAIN_FRAME);
 }