/** * Page のアクション. * * @return void */ function action() { $objDb = new SC_Helper_DB_Ex(); $cnt = $objDb->sfGetBasisCount(); if ($cnt > 0) { $this->tpl_mode = 'update'; } else { $this->tpl_mode = 'insert'; } if (!empty($_POST)) { $objFormParam = new SC_FormParam_Ex(); $this->lfInitParam($objFormParam, $_POST); $objFormParam->setParam($_POST); $objFormParam->convParam(); $this->arrErr = $this->lfErrorCheck($objFormParam); $post = $objFormParam->getHashArray(); $this->arrForm = $post; if (count($this->arrErr) == 0) { switch ($this->getMode()) { // 既存編集 case 'update': $this->lfUpdateData($this->arrForm); break; // 新規作成 // 新規作成 case 'insert': $this->lfInsertData($this->arrForm); break; default: break; } $this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "'); window.alert('SHOPマスターの登録が完了しました。');"; } if (empty($this->arrForm['regular_holiday_ids'])) { $this->arrSel = array(); } else { $this->arrSel = $this->arrForm['regular_holiday_ids']; } } else { $arrCol = $this->lfGetCol(); $col = SC_Utils_Ex::sfGetCommaList($arrCol); $arrRet = $objDb->sfGetBasisData(true, $col); $this->arrForm = $arrRet; $regular_holiday_ids = explode('|', $this->arrForm['regular_holiday_ids']); $this->arrForm['regular_holiday_ids'] = $regular_holiday_ids; $this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "');"; } }
/** * Page のアクション. * * @return void */ function action() { $objDb = new SC_Helper_DB_Ex(); // パラメーター管理クラス $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); // POST値の取得 $objFormParam->setParam($_POST); $cnt = $objDb->sfGetBasisCount(); if ($cnt > 0) { $this->tpl_mode = 'update'; } else { $this->tpl_mode = 'insert'; } if (!empty($_POST)) { // 入力値の変換 $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); if (count($this->arrErr) == 0) { switch ($this->getMode()) { case 'update': $this->lfUpdateData($objFormParam->getHashArray()); // 既存編集 break; case 'insert': $this->lfInsertData($objFormParam->getHashArray()); // 新規作成 break; default: break; } // 再表示 $this->tpl_onload = "window.alert('ポイント設定が完了しました。');"; } } else { $arrCol = $objFormParam->getKeyList(); // キー名一覧を取得 $col = SC_Utils_Ex::sfGetCommaList($arrCol); $arrRet = $objDb->sfGetBasisData(true, $col); $objFormParam->setParam($arrRet); } $this->arrForm = $objFormParam->getFormParamList(); }