/** * Page のプロセス. * * POST パラメーター "mode" が register の場合は登録処理を行う. * 登録処理の後, 自ページをリロードし, GET パラメーター "mode" を付与する. * 登録に成功し, GET パラメーター "mode" の値が success の場合は * 「登録に成功しました」というメッセージをポップアップで表示する. * 登録に失敗し, GET パラメーター "mode" の値が failure の場合は * 「登録に失敗しました」というメッセージをポップアップで表示する. * * TODO Transaction Token を使用する * * @return void */ function process() { // 認証可否の判定 SC_Utils_Ex::sfIsSuccess(new SC_Session()); switch ($_POST["mode"]) { case "register": if ($this->register($_POST['ga_ua'])) { SC_Response_Ex::reload(array("mode" => "success"), true); exit; } else { SC_Response_Ex::reload(array("mode" => "failure"), true); exit; } break; default: } switch ($_GET["mode"]) { case "success": $this->tpl_onload .= "window.alert('登録に成功しました。');"; break; case "failure": $this->tpl_onload .= "window.alert('登録に失敗しました。');"; break; default: } $objView = new SC_AdminView_Ex(); $objView->assignobj($this); $objView->display(MAIN_FRAME); }
/** * Page のアクション. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $class_id = $objFormParam->getValue('class_id'); $classcategory_id = $objFormParam->getValue('classcategory_id'); switch ($this->getMode()) { // 登録ボタン押下 // 新規作成 or 編集 case 'edit': // パラメーター値の取得 $this->arrForm = $objFormParam->getHashArray(); // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { //新規規格追加かどうかを判定する $is_insert = $this->lfCheckInsert($classcategory_id); if ($is_insert) { //新規追加 $this->lfInsertClass($this->arrForm); } else { //更新 $this->lfUpdateClass($this->arrForm); } // 再表示 SC_Response_Ex::reload(); } break; // 削除 // 削除 case 'delete': // ランク付きレコードの削除 $this->lfDeleteClassCat($class_id, $classcategory_id); SC_Response_Ex::reload(); break; // 編集前処理 // 編集前処理 case 'pre_edit': // 規格名を取得する。 $classcategory_name = $this->lfGetClassCatName($classcategory_id); // 入力項目にカテゴリ名を入力する。 $this->arrForm['name'] = $classcategory_name; break; case 'down': //並び順を下げる $this->lfDownRank($class_id, $classcategory_id); SC_Response_Ex::reload(); break; case 'up': //並び順を上げる $this->lfUpRank($class_id, $classcategory_id); SC_Response_Ex::reload(); break; default: break; } //規格分類名の取得 $this->tpl_class_name = $this->lfGetClassName($class_id); //規格分類情報の取得 $this->arrClassCat = $this->lfGetClassCat($class_id); // POSTデータを引き継ぐ $this->tpl_classcategory_id = $classcategory_id; }
/** * Page のアクション. * * @return void */ function action() { $objDb = new SC_Helper_DB_Ex(); $mode = $this->getMode(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($mode, $objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $this->lfCheckError($mode, $objFormParam); $is_error = !SC_Utils_Ex::isBlank($this->arrErr); $this->kiyaku_id = $objFormParam->getValue('kiyaku_id'); if ($is_error) { trigger_error('', E_USER_ERROR); return; } // 要求判定 switch ($mode) { // 編集処理 case 'confirm': // POST値の引き継ぎ $this->arrForm = $_POST; if (!$is_error) { if ($this->kiyaku_id == '') { $result = $this->lfInsertClass($this->arrForm, $_SESSION['member_id']); // 新規作成 } else { $result = $this->lfUpdateClass($this->arrForm, $this->kiyaku_id); // 既存編集 } if ($result !== FALSE) { $arrPram = array('kiyaku_id' => $result, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); SC_Response_Ex::actionExit(); } } break; // 削除 // 削除 case 'delete': $objDb->sfDeleteRankRecord('dtb_kiyaku', 'kiyaku_id', $this->kiyaku_id, '', true); // 再表示 $this->objDisplay->reload(); break; case 'down': $objDb->sfRankDown('dtb_kiyaku', 'kiyaku_id', $this->kiyaku_id); // 再表示 $this->objDisplay->reload(); break; case 'up': $objDb->sfRankUp('dtb_kiyaku', 'kiyaku_id', $this->kiyaku_id); // 再表示 $this->objDisplay->reload(); break; default: if (isset($_GET['msg']) && $_GET['msg'] == 'on') { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; } break; } $this->arrForm = $objFormParam->getFormParamList(); if (!$is_error) { // 規約一覧を取得 $this->arrKiyaku = $this->lfGetKiyakuList(); // kiyaku_id が指定されている場合には規約データの取得 if (!SC_Utils_Ex::isBlank($this->kiyaku_id)) { // 編集項目を取得する。 $arrKiyakuData = $this->lfGetKiyakuDataByKiyakuID($this->kiyaku_id); // 入力項目にカテゴリ名を入力する。 $this->arrForm['kiyaku_title'] = $arrKiyakuData[0]['kiyaku_title']; $this->arrForm['kiyaku_text'] = $arrKiyakuData[0]['kiyaku_text']; // POSTデータを引き継ぐ $this->tpl_kiyaku_id = $this->kiyaku_id; } } else { // 画面にエラー表示しないため, ログ出力 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } }
/** * Page のアクション. * * @return void */ public function action() { $objNews = new SC_Helper_News_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $news_id = $objFormParam->getValue('news_id'); //---- 新規登録/編集登録 switch ($this->getMode()) { case 'edit': $this->arrErr = $this->lfCheckError($objFormParam); if (!SC_Utils_Ex::isBlank($this->arrErr['news_id'])) { trigger_error('', E_USER_ERROR); return; } if (count($this->arrErr) <= 0) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 $res_news_id = $this->doRegist($news_id, $arrParam, $objNews); if ($res_news_id !== FALSE) { // 完了メッセージ $news_id = $res_news_id; $this->tpl_onload = "alert('登録が完了しました。');"; } } // POSTデータを引き継ぐ $this->tpl_news_id = $news_id; break; case 'pre_edit': $news = $objNews->getNews($news_id); list($news['year'], $news['month'], $news['day']) = $this->splitNewsDate($news['cast_news_date']); $objFormParam->setParam($news); // POSTデータを引き継ぐ $this->tpl_news_id = $news_id; break; case 'delete': //---- データ削除 $objNews->deleteNews($news_id); //自分にリダイレクト(再読込による誤動作防止) SC_Response_Ex::reload(); break; //---- 表示順位移動 //---- 表示順位移動 case 'up': $objNews->rankUp($news_id); // リロード SC_Response_Ex::reload(); break; case 'down': $objNews->rankDown($news_id); // リロード SC_Response_Ex::reload(); break; case 'moveRankSet': //---- 指定表示順位移動 $input_pos = $this->getPostRank($news_id); if (SC_Utils_Ex::sfIsInt($input_pos)) { $objNews->moveRank($news_id, $input_pos); } SC_Response_Ex::reload(); break; default: break; } $this->arrNews = $objNews->getList(); $this->line_max = count($this->arrNews); $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のアクション. * * @return void */ function action() { $objDb = new SC_Helper_DB_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $news_id = $objFormParam->getValue('news_id'); //---- 新規登録/編集登録 switch ($this->getMode()) { case 'regist': $arrPost = $objFormParam->getHashArray(); $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { // ニュースIDの値がPOSTされて来た場合は既存データの編集とみなし、 // 更新メソッドを呼び出す。 // ニュースIDが存在しない場合は新規登録を行う。 $arrPost['link_method'] = $this->checkLinkMethod($arrPost['link_method']); $arrPost['news_date'] = $this->getRegistDate($arrPost); $member_id = $_SESSION['member_id']; if (strlen($news_id) > 0 && is_numeric($news_id)) { $this->lfNewsUpdate($arrPost, $member_id); } else { $this->lfNewsInsert($arrPost, $member_id); } $news_id = ''; $this->tpl_onload = "window.alert('編集が完了しました');"; } else { $this->arrForm = $arrPost; } break; case 'search': if (is_numeric($news_id)) { list($this->arrForm) = $this->getNews($news_id); list($this->arrForm['year'], $this->arrForm['month'], $this->arrForm['day']) = $this->splitNewsDate($this->arrForm['cast_news_date']); $this->edit_mode = 'on'; } break; case 'delete': //---- データ削除 if (is_numeric($news_id)) { $pre_rank = $this->getRankByNewsId($news_id); $this->computeRankForDelete($news_id, $pre_rank); SC_Response_Ex::reload(); //自分にリダイレクト(再読込による誤動作防止) } break; case 'move': //---- 表示順位移動 if (strlen($news_id) > 0 && is_numeric($news_id) == true) { $term = $objFormParam->getValue('term'); if ($term == 'up') { $objDb->sfRankUp('dtb_news', 'news_id', $news_id); } else { if ($term == 'down') { $objDb->sfRankDown('dtb_news', 'news_id', $news_id); } } $this->objDisplay->reload(); } break; case 'moveRankSet': //---- 指定表示順位移動 $input_pos = $this->getPostRank($news_id); if (SC_Utils_Ex::sfIsInt($input_pos)) { $objDb->sfMoveRank('dtb_news', 'news_id', $news_id, $input_pos); $this->objDisplay->reload(); } break; default: break; } $this->arrNews = $this->getNews(); $this->tpl_news_id = $news_id; $this->line_max = count($this->arrNews); $this->max_rank = $this->getRankMax(); }
/** * Page のアクション. * * @return void */ function action() { // パラメーター管理クラス $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $mode = $this->getMode(); switch ($mode) { case 'install': case 'uninstall': case 'enable': case 'disable': // エラーチェック $this->arrErr = $objFormParam->checkError(); if (count($this->arrErr) == 0) { $plugin_id = $objFormParam->getValue('plugin_id'); $plugin_code = $objFormParam->getValue('plugin_code'); // プラグインファイルを読み込み、modeで指定されたメソッドを実行 $this->arrErr = $this->lfExecPlugin($plugin_id, $plugin_code, $mode); } break; case 'upload': // プラグイン情報を設定 $plugin_code = $this->lfGetPluginCode($_FILES['plugin_file']['name']); $plugin_dir = $this->lfGetPluginDir($plugin_code); // ファイルアップロード情報を設定 $objUpFile = new SC_UploadFile_Ex(TEMPLATE_TEMP_REALDIR, $plugin_dir); $this->lfInitUploadFile($objUpFile); // エラーチェック $this->arrErr = $this->lfCheckErrorUploadFile($plugin_code, $plugin_dir); if (count($this->arrErr) == 0) { // 一時ディレクトリへアップロード $this->arrErr['plugin_file'] = $objUpFile->makeTempFile('plugin_file', false); if ($this->arrErr['plugin_file'] == "") { // プラグイン保存ディレクトリへ解凍 $this->arrErr = $this->lfUploadPlugin($objUpFile, $plugin_dir, $plugin_code, $_FILES['plugin_file']['name']); // 完了メッセージアラート設定 if (count($this->arrErr) == 0) { $this->tpl_onload = "alert('プラグインをアップロードしました。');"; } } } break; case 'up': $this->arrErr = $objFormParam->checkError(); if (count($this->arrErr) == 0) { $plugin_id = $objFormParam->getValue('plugin_id'); SC_Helper_DB_Ex::sfRankUp("dtb_plugin", "plugin_id", $plugin_id); SC_Response_Ex::reload(); } break; case 'down': $this->arrErr = $objFormParam->checkError(); if (count($this->arrErr) == 0) { $plugin_id = $objFormParam->getValue('plugin_id'); SC_Helper_DB_Ex::sfRankDown("dtb_plugin", "plugin_id", $plugin_id); SC_Response_Ex::reload(); } break; default: break; } // DBからプラグイン情報を取得 $this->plugins = SC_Helper_Plugin_Ex::getAllPlugin(); }
/** * Page のアクション. * * @return void */ public function action() { $objMaker = new SC_Helper_Maker_Ex(); $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); // POST値をセット $objFormParam->setParam($_POST); // POST値の入力文字変換 $objFormParam->convParam(); //maker_idを変数にセット $maker_id = $objFormParam->getValue('maker_id'); // モードによる処理切り替え switch ($this->getMode()) { // 編集処理 case 'edit': // エラーチェック $this->arrErr = $this->lfCheckError($objFormParam, $objMaker); if (!SC_Utils_Ex::isBlank($this->arrErr['maker_id'])) { trigger_error('', E_USER_ERROR); return; } if (count($this->arrErr) <= 0) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 $res_maker_id = $this->doRegist($maker_id, $arrParam, $objMaker); if ($res_maker_id !== FALSE) { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; SC_Response_Ex::reload(); } else { $this->arrErr['maker_id'] = '登録に失敗しました。'; } } break; // 編集前処理 // 編集前処理 case 'pre_edit': $maker = $objMaker->getMaker($maker_id); $objFormParam->setParam($maker); // POSTデータを引き継ぐ $this->tpl_maker_id = $maker_id; break; // メーカー順変更 // メーカー順変更 case 'up': $objMaker->rankUp($maker_id); // リロード SC_Response_Ex::reload(); break; case 'down': $objMaker->rankDown($maker_id); // リロード SC_Response_Ex::reload(); break; // 削除 // 削除 case 'delete': $objMaker->delete($maker_id); // リロード SC_Response_Ex::reload(); break; default: break; } $this->arrForm = $objFormParam->getFormParamList(); // メーカー情報読み込み $this->arrMaker = $objMaker->getList(); }
/** * Page のアクション. * * @return void */ public function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); $is_error = !SC_Utils_Ex::isBlank($this->arrErr); $this->bloc_id = $objFormParam->getValue('bloc_id'); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $objBloc = new SC_Helper_Bloc_Ex($this->device_type_id); switch ($this->getMode()) { // 登録/更新 case 'confirm': if (!$is_error) { $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr, $objBloc); if (SC_Utils_Ex::isBlank($this->arrErr)) { $result = $this->doRegister($objFormParam, $objBloc); if ($result !== false) { $arrPram = array('bloc_id' => $result, 'device_type_id' => $this->device_type_id, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); SC_Response_Ex::actionExit(); } } } break; // 削除 // 削除 case 'delete': if (!$is_error) { if ($this->doDelete($objFormParam, $objBloc)) { $arrPram = array('device_type_id' => $this->device_type_id, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); SC_Response_Ex::actionExit(); } } break; default: if (isset($_GET['msg']) && $_GET['msg'] == 'on') { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; } break; } if (!$is_error) { // ブロック一覧を取得 $this->arrBlocList = $objBloc->getList(); // bloc_id が指定されている場合にはブロックデータの取得 if (!SC_Utils_Ex::isBlank($this->bloc_id)) { $arrBloc = $this->getBlocTemplate($this->bloc_id, $objBloc); $objFormParam->setParam($arrBloc); } } else { // 画面にエラー表示しないため, ログ出力 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のアクション. * * @return void */ function action() { $objLayout = new SC_Helper_PageLayout_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); $is_error = !SC_Utils_Ex::isBlank($this->arrErr); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $this->page_id = $objFormParam->getValue('page_id'); switch ($this->getMode()) { // 削除 case 'delete': if (!$is_error) { if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) { $objLayout->lfDelPageData($this->page_id, $this->device_type_id); SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id, 'msg' => 'on'), true); SC_Response_Ex::actionExit(); } } break; // 登録/編集 // 登録/編集 case 'confirm': if (!$is_error) { $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr); if (SC_Utils_Ex::isBlank($this->arrErr)) { $result = $this->doRegister($objFormParam, $objLayout); if ($result !== false) { SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id, 'page_id' => $result, 'msg' => 'on'), true); SC_Response_Ex::actionExit(); } } } break; default: if (isset($_GET['msg']) && $_GET['msg'] == 'on') { $this->tpl_onload = "alert('" . t('c_Registration is complete._01') . "');"; } break; } if (!$is_error) { $this->arrPageList = $objLayout->getPageProperties($this->device_type_id, null); // page_id が指定されている場合にはテンプレートデータの取得 if (!SC_Utils_Ex::isBlank($this->page_id)) { $arrPageData = $this->getTplMainpage($this->device_type_id, $this->page_id, $objLayout); $objFormParam->setParam($arrPageData); } } else { // 画面にエラー表示しないため, ログ出力 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . ' > ' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); }
protected function getAccountDay() { $accountDay = $_REQUEST["accountDay"]; // 日付形式でない場合は 当月1日 if (!SC_Utils::sfIsInt($accountDay) || strlen($accountDay) != 8) { return date("Ym01"); } $y = substr($accountDay, 0, 4); $m = substr($accountDay, 4, 2); $d = substr($accountDay, 6, 2); if (!checkdate($m, $d, $y)) { SC_Response_Ex::reload(array(), true); } return $accountDay; }
/** * Page のアクション. * * @return void */ public function action() { $objTaxRule = new SC_Helper_TaxRule_Ex(); $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); // POST値をセット $objFormParam->setParam($_POST); // POST値の入力文字変換 $objFormParam->convParam(); //tax_rule_idを変数にセット $tax_rule_id = $objFormParam->getValue('tax_rule_id'); // モードによる処理切り替え switch ($this->getMode()) { // 共通設定登録 case 'param_edit': $arrErr = $this->lfCheckError($objFormParam, $objTaxRule); if (SC_Utils_Ex::isBlank($arrErr['product_tax_flg'])) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 if ($this->doParamRegist($arrParam)) { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; } } else { // エラーが存在する場合、メッセージを表示する為に代入 $this->arrErr['product_tax_flg'] = $arrErr['product_tax_flg']; } break; // 編集処理 // 編集処理 case 'edit': // エラーチェック $this->arrErr = $this->lfCheckError($objFormParam, $objTaxRule); if (count($this->arrErr) <= 0) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 $res_tax_rule_id = $this->doRegist($tax_rule_id, $arrParam, $objTaxRule); if ($res_tax_rule_id !== FALSE) { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; // リロード SC_Response_Ex::reload(); } } else { if (SC_Utils_Ex::isBlank($this->arrErr['tax_rule_id'])) { // 税率ID以外のエラーの場合、ID情報を引き継ぐ $this->tpl_tax_rule_id = $tax_rule_id; } } break; // 編集前処理 // 編集前処理 case 'pre_edit': $TaxRule = $objTaxRule->getTaxRuleData($tax_rule_id); $tmp = explode(" ", $TaxRule['apply_date']); $tmp_ymd = explode("-", $tmp[0]); $TaxRule['apply_date_year'] = $tmp_ymd[0]; $TaxRule['apply_date_month'] = $tmp_ymd[1]; $TaxRule['apply_date_day'] = $tmp_ymd[2]; $tmp_hm = explode(":", $tmp[1]); $TaxRule['apply_date_hour'] = $tmp_hm[0]; $TaxRule['apply_date_minutes'] = $tmp_hm[1]; $objFormParam->setParam($TaxRule); // POSTデータを引き継ぐ $this->tpl_tax_rule_id = $tax_rule_id; break; // 削除 // 削除 case 'delete': $objTaxRule->deleteTaxRuleData($tax_rule_id); // リロード SC_Response_Ex::reload(); break; default: break; } $this->arrForm = $objFormParam->getFormParamList(); // 税規約情報読み込み $this->arrTaxrule = $objTaxRule->getTaxRuleList(); }
/** * Page のアクション. * * @return void */ function action() { // パラメーター管理クラス $objFormParam = new SC_FormParam_Ex(); // パラメーター設定 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->setParam($_GET); $objFormParam->convParam(); $this->arrForm = $objFormParam->getHashArray(); switch ($this->getMode()) { // データの登録 case 'confirm': $this->arrErr = $this->lfCheckConfirmError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { // データの更新 $this->arrForm['sql_id'] = $this->lfUpdData($objFormParam->getValue('sql_id'), $objFormParam->getDbArray()); // 完了メッセージ表示 $this->tpl_onload = "alert('登録が完了しました。');"; } break; // 確認画面 // 確認画面 case 'preview': $this->arrErr = $this->lfCheckPreviewError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->sqlerr = $this->lfCheckSQL($objFormParam->getValue('csv_sql')); } $this->setTemplate('contents/csv_sql_view.tpl'); return; // 新規作成 // 新規作成 case 'new_page': // リロード SC_Response_Ex::reload(); break; // データ削除 // データ削除 case 'delete': $this->arrErr = $this->lfCheckDeleteError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->lfDelData($objFormParam->getValue('sql_id')); SC_Response_Ex::reload(); SC_Response_Ex::actionExit(); } break; // CSV出力 // CSV出力 case 'csv_output': $this->arrErr = $this->lfCheckOutputError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { $this->lfDoCsvOutput($objFormParam->getValue('csv_output_id')); SC_Response_Ex::actionExit(); } break; default: $this->arrErr = $objFormParam->checkError(); if (SC_Utils_Ex::isBlank($this->arrErr)) { // 設定内容を取得する $this->arrForm = $this->lfGetSqlData($objFormParam); // カラム一覧を取得する $this->arrColList = $this->lfGetColList($objFormParam->getValue('select_table')); } break; } // 登録済みSQL一覧取得 $this->arrSqlList = $this->lfGetSqlList(); // テーブル一覧を取得する $this->arrTableList = $this->lfGetTableList(); }
function LC_Page_iOS_Products_List_action_after(LC_Page_Products_List $objPage) { $detect = new Mobile_Detect(); $category_id = self::sfGetCategoryId(); if ($detect->isMobile()) { if ($detect->is("AndroidOS")) { $cur_category_id = 1; } elseif ($detect->is("iOS")) { $cur_category_id = 2; } else { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); } if ($category_id != $cur_category_id) { $category_id = $cur_category_id; SC_Response_Ex::reload(compact("category_id")); } } }
/** * Page のアクション. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); // POST値をセット $objFormParam->setParam($_POST); // POST値の入力文字変換 $objFormParam->convParam(); //maker_idを変数にセット $maker_id = $objFormParam->getValue('maker_id'); // 変換後のPOST値を取得 $this->arrForm = $objFormParam->getHashArray(); // モードによる処理切り替え switch ($this->getMode()) { // 編集処理 case 'edit': // 入力文字の変換 // エラーチェック $this->arrErr = $this->lfErrorCheck($this->arrForm); if (count($this->arrErr) <= 0) { if ($this->arrForm['maker_id'] == "") { // メーカー情報新規登録 $this->lfInsert($this->arrForm); } else { // メーカー情報編集 $this->lfUpdate($this->arrForm); } // 再表示 $this->objDisplay->reload(); } else { // POSTデータを引き継ぐ $this->tpl_maker_id = $this->arrForm['maker_id']; } break; // 編集前処理 // 編集前処理 case 'pre_edit': $this->arrForm = $this->lfPreEdit($this->arrForm, $this->arrForm['maker_id']); $this->tpl_maker_id = $this->arrForm['maker_id']; break; // メーカー順変更 // メーカー順変更 case 'up': case 'down': $this->lfRankChange($this->arrForm['maker_id'], $this->getMode()); // リロード SC_Response_Ex::reload(); break; // 削除 // 削除 case 'delete': $this->lfDelete($this->arrForm['maker_id']); // リロード SC_Response_Ex::reload(); break; default: break; } // メーカー情報読み込み $this->arrMaker = $this->lfDisp(); // POSTデータを引き継ぐ $this->tpl_maker_id = $maker_id; }
/** * Page のアクション. * * @return void */ function action() { $objLayout = new SC_Helper_PageLayout_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam, intval($_REQUEST['bloc_cnt'])); $objFormParam->setParam($_REQUEST); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $this->page_id = $objFormParam->getValue('page_id', 1); switch ($this->getMode()) { // 新規ブロック作成 case 'new_bloc': SC_Response_Ex::sendRedirect('bloc.php', array('device_type_id' => $this->device_type_id)); SC_Response_Ex::actionExit(); break; // 新規ページ作成 // 新規ページ作成 case 'new_page': SC_Response_Ex::sendRedirect('main_edit.php', array('device_type_id' => $this->device_type_id)); SC_Response_Ex::actionExit(); break; // プレビュー // プレビュー case 'preview': $this->placingBlocs($objFormParam, true); $filename = $this->savePreviewData($this->page_id, $objLayout); $_SESSION['preview'] = 'ON'; SC_Response_Ex::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $filename)); SC_Response_Ex::actionExit(); // 編集実行 // 編集実行 case 'confirm': $this->placingBlocs($objFormParam); $arrQueryString = array('device_type_id' => $this->device_type_id, 'page_id' => $this->page_id, 'msg' => 'on'); SC_Response_Ex::reload($arrQueryString, true); SC_Response_Ex::actionExit(); break; // データ削除処理 // データ削除処理 case 'delete': //ベースデータでなければファイルを削除 if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) { $objLayout->lfDelPageData($this->page_id, $this->device_type_id); SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id), true); SC_Response_Ex::actionExit(); } break; default: // 完了メッセージ表示 if (isset($_GET['msg']) && $_GET['msg'] == 'on') { $this->tpl_onload = "alert('登録が完了しました。');"; } break; } $this->arrBlocs = $this->getLayout($this->device_type_id, $this->page_id, $objLayout); $this->bloc_cnt = count($this->arrBlocs); // 編集中のページ $this->arrPageData = $objLayout->getPageProperties($this->device_type_id, $this->page_id); // 編集可能ページ一覧 $this->arrEditPage = $objLayout->getPageProperties($this->device_type_id, null); //サブタイトルを取得 $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; }
/** * Page のアクション. * * @return void */ public function action() { $objLayout = new SC_Helper_PageLayout_Ex(); $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); $is_error = !SC_Utils_Ex::isBlank($this->arrErr); // CSSファイル名を取得 $this->css_name = $objFormParam->getValue('css_name'); $this->old_css_name = $objFormParam->getValue('old_css_name', $this->css_name); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $css_dir = $objLayout->getTemplatePath($this->device_type_id, true) . 'css/'; $css_path = $css_dir . $this->css_name . '.css'; switch ($this->getMode()) { // データ更新処理 case 'confirm': if (!$is_error) { $this->arrErr = array_merge($this->arrErr, $this->lfCheckError($objFormParam, $this->arrErr)); if (SC_Utils_Ex::isBlank($this->arrErr)) { if ($this->doRegister($css_dir, $this->css_name, $this->old_css_name, $css_path, $objFormParam->getValue('css_data'))) { $this->tpl_onload = "alert('登録が完了しました。');"; } } } break; case 'delete': if (!$is_error) { if ($this->doDelete($css_path)) { $arrPram = array('device_type_id' => $this->device_type_id, 'msg' => 'on'); SC_Response_Ex::reload($arrPram, true); } } break; default: if (isset($_GET['msg']) && $_GET['msg'] == 'on') { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; } break; } if (SC_Utils_Ex::isBlank($this->arrErr) && $this->checkPath($this->css_name)) { // CSSファイルの読み込み if (!SC_Utils_Ex::isBlank($this->css_name)) { $objFormParam->setValue('css_data', file_get_contents($css_path)); } } else { // 画面にエラー表示しないため, ログ出力 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } // ファイルリストを取得 $this->arrCSSList = $this->getCSSList($css_dir); $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); }
/** * Page のアクション. * * @return void */ function action() { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $class_id = $objFormParam->getValue('class_id'); // 要求判定 switch ($this->getMode()) { // 編集処理 case 'edit': //パラメーターの取得 $this->arrForm = $objFormParam->getHashArray(); // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); if (SC_Utils_Ex::isBlank($this->arrErr)) { //新規規格追加かどうかを判定する $is_insert = $this->lfCheckInsert($this->arrForm); if ($is_insert) { $this->lfInsertClass($this->arrForm); // 新規作成 } else { $this->lfUpdateClass($this->arrForm); // 既存編集 } // 再表示 SC_Response_Ex::reload(); } break; // 削除 // 削除 case 'delete': //規格データの削除処理 $this->lfDeleteClass($class_id); // 再表示 SC_Response_Ex::reload(); break; // 編集前処理 // 編集前処理 case 'pre_edit': // 規格名を取得する。 $class_name = $this->lfGetClassName($class_id); // 入力項目にカテゴリ名を入力する。 $this->arrForm['name'] = $class_name; break; case 'down': $this->lfDownRank($class_id); // 再表示 SC_Response_Ex::reload(); break; case 'up': $this->lfUpRank($class_id); // 再表示 SC_Response_Ex::reload(); break; default: break; } // 規格の読込 $this->arrClass = $this->lfGetClass(); $this->arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount(); // POSTデータを引き継ぐ $this->tpl_class_id = $class_id; }
/** * Page のアクション. * * @return void */ function action() { $objCartSess = new SC_CartSession_Ex(); $objSiteSess = new SC_SiteSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objFormParam = $this->lfInitParam($_POST); $this->mode = $this->getMode(); // モバイル対応 if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { if (isset($_GET['cart_no'])) { $objFormParam->setValue('cart_no', $_GET['cart_no']); } if (isset($_GET['cartKey'])) { $objFormParam->setValue('cartKey', $_GET['cartKey']); } } $this->cartKeys = $objCartSess->getKeys(); foreach ($this->cartKeys as $key) { // 商品購入中にカート内容が変更された。 if ($objCartSess->getCancelPurchase($key)) { $this->tpl_message .= "商品購入中にカート内容が変更されましたので、お手数ですが購入手続きをやり直して下さい。\n"; } } $cart_no = $objFormParam->getValue('cart_no'); $cartKey = $objFormParam->getValue('cartKey'); // エラーチェック $arrError = $objFormParam->checkError(); if (isset($arrError) && !empty($arrError)) { SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND); SC_Response_Ex::actionExit(); } switch ($this->mode) { case 'confirm': // カート内情報の取得 $cartList = $objCartSess->getCartList($cartKey); // カート商品が1件以上存在する場合 if (count($cartList) > 0) { // カートを購入モードに設定 $this->lfSetCurrentCart($objSiteSess, $objCartSess, $cartKey); // 購入ページへ SC_Response_Ex::sendRedirect(SHOPPING_URL); SC_Response_Ex::actionExit(); } break; case 'up': //1個追加 $objCartSess->upQuantity($cart_no, $cartKey); SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); SC_Response_Ex::actionExit(); break; case 'down': //1個減らす $objCartSess->downQuantity($cart_no, $cartKey); SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); SC_Response_Ex::actionExit(); break; case 'setQuantity': //数量変更 $objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey); SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); SC_Response_Ex::actionExit(); break; case 'delete': //カートから削除 $objCartSess->delProduct($cart_no, $cartKey); SC_Response_Ex::reload(array('category_id' => $objFormParam->getValue('category_id')), true); SC_Response_Ex::actionExit(); break; default: break; } $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); $totalIncTax = 0; foreach ($this->cartKeys as $key) { // カート集計処理 $this->tpl_message .= $objCartSess->checkProducts($key); $this->tpl_total_inctax[$key] = $objCartSess->getAllProductsTotal($key); $totalIncTax += $this->tpl_total_inctax[$key]; $this->tpl_total_tax[$key] = $objCartSess->getAllProductsTax($key); // ポイント合計 $this->tpl_total_point[$key] = $objCartSess->getAllProductsPoint($key); $this->arrData[$key] = $objCartSess->calculate($key, $objCustomer); // 送料無料チェック $this->arrData[$key]['is_deliv_free'] = $objCartSess->isDelivFree($key); // 送料無料までの金額を計算 $this->tpl_deliv_free[$key] = $this->arrInfo['free_rule'] - $this->tpl_total_inctax[$key]; } //商品の合計金額をセット $this->tpl_all_total_inctax = $totalIncTax; $this->tpl_category_id = $objFormParam->getValue('category_id'); // ログイン判定 if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = true; $this->tpl_user_point = $objCustomer->getValue('point'); $this->tpl_name = $objCustomer->getValue('name01'); } // 前頁のURLを取得 // TODO: SC_CartSession::setPrevURL()利用不可。 $this->lfGetCartPrevUrl($_SESSION, $_SERVER['HTTP_REFERER']); $this->tpl_prev_url = isset($_SESSION['cart_prev_url']) ? $_SESSION['cart_prev_url'] : ''; // すべてのカートの内容を取得する $this->cartItems = $objCartSess->getAllCartList(); }
function init() { parent::init(); $objCustomer = new SC_Customer_Ex(); if (isset($_GET["sid"]) && isset($_GET["admin"])) { $sid = $_REQUEST["sid"]; $email = $objCustomer->getValue("email"); $osid = session_id(); if ($osid != $sid) { session_destroy(); session_id($sid); session_start(); } $objCustomer->setLogin($email); $get = $_GET; unset($get["sid"]); SC_Response_Ex::reload($get, true); } $objQuery = SC_Query_Ex::getSingletonInstance(); $objProduct = new SC_Product_Ex(); if (GC_Utils_Ex::isFrontFunction() && $this->skip_load_page_layout == false) { $objCustomer = new SC_Customer_Ex(); // 画面更新毎に情報を更新する if ($objCustomer->isLoginSuccess()) { // 初回アクセス時に更新 $objCustomer->updateSession(); $this->tpl_login = true; $this->tpl_point = $objCustomer->getValue("point"); $this->tpl_customer_id = $objCustomer->getValue("customer_id"); $this->tpl_first_buy_date = $objCustomer->getValue("first_buy_date"); $this->tpl_carrier = $objCustomer->getValue("carrier"); $downloadable_days = $this->arrSiteInfo["downloadable_days"]; $downloadable_days_unlimited = $this->arrSiteInfo["downloadable_days_unlimited"]; $date = null; if ($downloadable_days_unlimited) { $date = SC_Utils_Ex::sfGetTimestamp(RELEASE_YEAR, 1, 1, false); $date2 = SC_Utils_Ex::sfGetTimestamp(9999, 12, 31, false); } else { $xdate = strtotime("-{$downloadable_days} day"); $date = SC_Utils_Ex::sfGetTimestamp(date("Y", $xdate), date("m", $xdate), date("d", $xdate), false); $xdate = strtotime("+{$downloadable_days} day"); $date2 = SC_Utils_Ex::sfGetTimestamp(date("Y", $xdate), date("m", $xdate), date("d", $xdate), false); } $this->downloadable_days = $date; $this->downloadable_days2 = $date2; $objPurchase = new SC_Helper_Purchase_Ex(); $arrOrderId = $objQuery->getCol("order_id", "dtb_order", "payment_date > ? AND customer_id = ?", array($date, $this->tpl_customer_id)); $this->arrRedownloadProduct = array(); foreach ($arrOrderId as $order_id) { $arrOrderDetail = $objPurchase->getOrderDetail($order_id, true); $this->arrRedownloadProduct = array_merge($this->arrRedownloadProduct, $arrOrderDetail); } // 再ダウンロード可能な商品一覧 $this->arrRedownloadProduct = SC_Utils_Ex::makeArrayIDToKey("product_id", $this->arrRedownloadProduct); foreach ($this->arrRedownloadProduct as $product_id => $row) { $row["product"] = $objProduct->getDetail($product_id); $this->arrRedownloadProduct[$product_id] = $row; } } else { $this->tpl_login = false; $this->tpl_point = 0; $this->tpl_customer_id = 0; $this->tpl_first_buy_date = null; $this->tpl_carrier = 9; $this->arrRedownloadProduct = array(); } $objDb = new SC_Helper_DB_Ex(); if ($objDb->sfColumnExists("cp_dtb_customer_transaction", "id")) { $where = " customer_id = ? AND transaction_status = ? AND continue_account_id IS NOT NULL AND del_flg = 0"; $arrWhereVal = array($this->tpl_customer_id, 40); if ($objQuery->exists("cp_dtb_customer_transaction", $where, $arrWhereVal)) { // OK } else { switch (basename(dirname($_SERVER["SCRIPT_NAME"]))) { case "au": break; default: if ($objCustomer->isLoginSuccess()) { $objCustomer->EndSession(); SC_Response_Ex::reload(); } break; } } } $objCategory = new SC_Helper_Category_Ex(); $this->arrCommonCategory = $objCategory->getList(true); $this->arrCommonCategoryTree = $objCategory->getTree(); $detect = new Mobile_Detect(); $script_file = $_SERVER["SCRIPT_NAME"]; $script_file = ltrim($script_file, "/"); $script_file2 = str_replace("ios/", "", $script_file); if ($detect->is("iOS")) { if (file_exists(HTML_REALDIR . "ios/{$script_file}")) { SC_Response_Ex::sendRedirect(HTTP_URL . "ios/{$script_file}", $_GET); } } elseif (strcmp($script_file, $script_file2) !== 0) { SC_Response_Ex::sendRedirect(HTTP_URL . "{$script_file2}", $_GET); } $_SESSION["is_android"] = $detect->is("AndroidOS"); if ($detect->isMobile() == false) { // NG $this->device_support = false; } elseif ($detect->is("iOS")) { if ($detect->match("iPhone")) { // OK $this->device_support = true; } elseif ($detect->match("iPod")) { // NG $this->device_support = false; } elseif ($detect->match("iPad")) { // NG $this->device_support = false; } else { // NG $this->device_support = false; } $version = $detect->version("iOS", $detect::VERSION_TYPE_FLOAT); if ($version < 6) { // NG $this->device_support = false; } } elseif ($detect->match("Android") == false) { // NG $this->device_support = false; } elseif (class_exists("SC_DeviceAndroidSelect_Ex", true)) { $useragent = array(); if (preg_match("|.*; ([^;]+) Build/.*|", $_SERVER["HTTP_USER_AGENT"], $useragent)) { $device = new SC_DeviceAndroidSelect_Ex(array("search_device_user_agent_word" => $useragent[1], "search_status" => 1)); $this->device_support = $device->exists(); $this->tpl_device = $device->getOne(); } } elseif ($detect->match("Android")) { // OK $this->device_support = true; } else { // NG $this->device_support = false; } } if ($this->device_support) { GC_Utils_Ex::gfPrintLog("対応端末:" . $_SERVER['HTTP_USER_AGENT']); return; } else { GC_Utils_Ex::gfPrintLog("非対応端末:" . $_SERVER['HTTP_USER_AGENT']); if (is_a($this, "LC_Page_Index")) { SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php"); } elseif (is_a($this, "LC_Page_Unsupported")) { // 非対応端末表示を行わない return; } elseif (is_a($this, "LC_Page_Entry_Kiyaku")) { // 非対応端末表示を行わない return; } elseif ($this->not_unsupported) { // 非対応端末表示を行わない return; } else { SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php"); } } }