Пример #1
0
 /**
  * 実行
  */
 protected function perform()
 {
     // 案件ID
     $ankenId = $this->_like['anken_id'];
     // モデル
     $m =& $this->_model;
     if (isset($this->_request['search'])) {
         // 対象となる案件を取得
         $anken =& $m->getAnkenData($ankenId);
         $this->appendDataFrom($anken);
         if ($anken != null) {
             // 案件情報の成果段階の値
             $enum = new AcceptDankaiEnum();
             $accept2Dankai = $enum->getKey('2段階');
             $this->_dataFrom["accept_2dankai"] = $accept2Dankai;
             //---------------------------------------
             // ステータス、締め日UPLOAD用のフォームのカスタム処理
             //---------------------------------------
             $path = $m->Result_SeikaUpdateIndex_getStatusUploadFormTmplPath($ankenId);
             $this->_dataFrom["status_upform_path"] = $path;
             //---------------------------------------
             // メディア、金額UPLOAD用のフォームのカスタム処理
             //---------------------------------------
             $path = $m->Result_SeikaUpdateIndex_getMediaUploadFormTmplPath($ankenId);
             $this->_dataFrom["media_upform_path"] = $path;
             // 追加パラメータの取得
             $option =& $m->Result_SeikaModifyIndex_getOptionParamList($ankenId);
             $this->_dataFrom['option'] =& $option;
             // テンプレート変数追加
             $this->_dataFrom['show'] = true;
         }
     }
 }
Пример #2
0
 /**
  * 画面表示のためのテンプレート初期化
  */
 public function &Anken_Edit_getInitData()
 {
     $data = array();
     // 締め日
     $enum = new ShimeDayEnum();
     $data['shime_day'] = $enum->getArray();
     // 案件カテゴリ
     $enum = new AnkenGategoryEnum();
     $data['category'] = $enum->getArray();
     // 実施タイプ
     $enum = new AnkenTypeEnum();
     $data['type'] = $enum->getArray();
     // 案件種別
     $enum = new AnkenSyubetsuEnum();
     $data['syubetsu'] = $enum->getArray();
     // 案件タイプ
     $enum = new AnkenType2Enum();
     $data['type2'] = $enum->getArray();
     // 成果地点
     $enum = new AnkenSeikaPointEnum();
     $data['seika_point'] = $enum->getArray();
     // デバイス
     $enum = new AnkenDeviceEnum();
     $data['device'] = $enum->getArray();
     //↓↓===========nm00189 2010/03/29 start===================================
     // 成果計測方式追加
     $enum = new AnkenSeikaCountTypeEnum();
     $data['seika_count_type'] = $enum->getArray();
     //↑↑===========nm00189 2010/03/29 end=====================================
     // クライアント
     $list =& $this->Anken_Edit_getClientList();
     $data['client_list'] = $list;
     // 入力モード
     $data['input_type'] = 'input';
     // 成果UL時紐付けID
     $enum = new AcceptUseActionIdEnum();
     $data['accept_use_action_id'] = $enum->getArray();
     // 成果
     $enum = new AcceptDankaiEnum();
     $data['accept_dankai'] = $enum->getArray();
     // 成果承認
     $enum = new AutoAcceptEnum();
     $data['auto_accept'] = $enum->getArray();
     // 単価タイプ
     $enum = new PriceTypeCdEnum();
     $data['price_type'] = $enum->getArray();
     //↓↓===========nm90073 2013/07/24 start===================================
     // 売上端数調整方法追加
     $enum = new RoundingTypeEnum();
     $data['rounding_type'] = $enum->getArray();
     //↑↑===========nm90073 2013/07/24 end=====================================
     // 消費税
     $enum = new ClientAmountIncludeTaxEnum();
     $data['client_amount_include_tax'] = $enum->getArray();
     // 退会率
     $enum = new AnkenTaikaiOptionCdEnum();
     $data['taikai_option_cd'] = $enum->getArray();
     return $data;
 }
Пример #3
0
 /**
  * 実行
  */
 protected function perform()
 {
     // モデル
     $m =& $this->_model;
     // 案件ID
     $ankenId = $this->_request['aid'];
     // 案件情報
     $anken =& $m->getAnkenData($ankenId);
     $this->_anken = $anken;
     // テンプレート変数追加
     $this->_dataFrom['anken'] = $anken;
     // カウンター初期化
     $this->_updateCount['sum'] = 0;
     $this->_updateCount['Y'] = 0;
     $this->_updateCount['E'] = 0;
     //--------------------------
     // リロード防止対策
     //--------------------------
     $hashKey = $this->_request['hash'];
     $execute = $this->_core->getSession("execute{$hashKey}");
     if (is_bool($execute) == false || $execute === true) {
         // エラーメッセージ
         $this->_dataFrom['reload_error'] = true;
         // カウンター値をテンプレートに渡す
         $this->_dataFrom['update_count'] =& $this->_updateCount;
         return;
     }
     $this->_core->setSession("execute{$hashKey}", true);
     // キャンペーンコード
     $code = $anken['campaign_code'];
     // 案件情報の成果段階の値
     $enum = new AcceptDankaiEnum();
     $accept2Dankai = $enum->getKey('2段階');
     $this->_dataFrom["accept_2dankai"] = $accept2Dankai;
     // 案件情報の単価タイプの値
     $enum = new PriceTypeCdEnum();
     $priceTeiritsu = $enum->getKey('定率');
     $this->_dataFrom["price_teiritsu"] = $priceTeiritsu;
     // UL項目
     $keys = $this->_nomalKeys;
     $isAccept2Dankai = false;
     $isPriceTeiritsu = false;
     if ($anken['accept_dankai'] == $accept2Dankai) {
         $keys = $this->_2dankaiKeys;
         $isAccept2Dankai = true;
     } else {
         if ($anken['price_type_cd'] == $priceTeiritsu) {
             $keys = $this->_teiritsuKeys;
             $isPriceTeiritsu = true;
         }
     }
     // オプションパラメータ一覧取得
     $option =& $m->Result_HotenUpload_getOptionParamList($ankenId);
     $this->_option =& $option;
     $this->_dataFrom["option"] =& $option;
     // 任意のIDの後ろに追加
     $cidIndex = array_search('client_user_id', $keys);
     foreach ($option as $k => $v) {
         $cidIndex++;
         array_splice($keys, $cidIndex, 0, $k);
     }
     $result = array();
     // ファイル読込み
     if (is_file($this->_tmpFilePath) == true) {
         $lines = file($this->_tmpFilePath);
         //↓↓===========nm00234 2011/02/11 start=================================
         // 任意のID重複チェックの対象案件判断
         $useSameClientUserIdCheck =& $m->Result_HotenUpload_getUseSameClientUserIdCheckFlg($ankenId);
         //↑↑===========nm00234 2011/02/11 end===================================
         foreach ($lines as $index => $line) {
             // 空白行は無視
             if (strlen(trim($line)) == 0) {
                 continue;
             }
             // 文字コード変換
             $line = mb_convert_encoding($line, 'utf-8', 'cp932');
             // 配列に
             $values = explode(',', $line);
             // 1行を処理
             //↓↓===========nm00234 2011/02/11 start=================================
             //$d =& $this->actionLine($code, $isAccept2Dankai, $isPriceTeiritsu, $keys, $values);
             $d =& $this->actionLine($code, $isAccept2Dankai, $isPriceTeiritsu, $keys, $values, $useSameClientUserIdCheck);
             //↑↑===========nm00234 2011/02/11 end===================================
             // 結果を取得
             if (empty($d['data']) == false) {
                 $result[$index + 1] =& $d;
             }
         }
     }
     // テンプレート変数の設定
     $this->_dataFrom['list'] =& $result;
     // カウンター値をテンプレートに渡す
     $this->_dataFrom['update_count'] =& $this->_updateCount;
     // ファイル削除
     if (is_file($this->_tmpFilePath) == true) {
         @unlink($this->_tmpFilePath);
     }
     //↓↓===========nm00312 2013/07/29 start===================================
     /// ログファイル作成
     $logFilePath = $this->makeLogFile($result);
     // 文書作成
     $addMessage .= "該当:" . $this->_updateCount['sum'] . "件\r\n";
     $addMessage .= "実施:" . $this->_updateCount['Y'] . "件\r\n";
     $addMessage .= "エラー:" . $this->_updateCount['E'] . "件\r\n";
     if ($this->_updateCount['sum'] == '0') {
         $addMessage .= "対象の成果がありません。\r\n";
     }
     // 完了メール送信
     NotifyManager::hotenUpload($this->_core, $anken, $logFilePath, $addMessage);
     //↑↑===========nm00312 2013/07/29 end=====================================
 }
Пример #4
0
 /**
  * 実行
  */
 protected function perform()
 {
     // モデル
     $m =& $this->_model;
     // 案件ID
     $ankenId = $this->_request['aid'];
     // 案件情報
     $anken =& $m->getAnkenData($ankenId);
     $this->_anken = $anken;
     // テンプレート変数追加
     $this->_dataFrom['anken'] = $anken;
     // カウンター初期化
     $this->_updateCount['sum'] = 0;
     $this->_updateCount['Y'] = 0;
     $this->_updateCount['E'] = 0;
     // キャンペーンコード
     $code = $anken['campaign_code'];
     // 案件情報の成果段階の値
     $enum = new AcceptDankaiEnum();
     $accept2Dankai = $enum->getKey('2段階');
     $this->_dataFrom["accept_2dankai"] = $accept2Dankai;
     // 案件情報の単価タイプの値
     $enum = new PriceTypeCdEnum();
     $priceTeiritsu = $enum->getKey('定率');
     $this->_dataFrom["price_teiritsu"] = $priceTeiritsu;
     // UL項目
     $keys = $this->_nomalKeys;
     $isAccept2Dankai = false;
     $isPriceTeiritsu = false;
     if ($anken['accept_dankai'] == $accept2Dankai) {
         $keys = $this->_2dankaiKeys;
         $isAccept2Dankai = true;
     } else {
         if ($anken['price_type_cd'] == $priceTeiritsu) {
             $keys = $this->_teiritsuKeys;
             $isPriceTeiritsu = true;
         }
     }
     // オプションパラメータ一覧取得
     $option =& $m->Result_HotenUpload_getOptionParamList($ankenId);
     $this->_option =& $option;
     $this->_dataFrom["option"] =& $option;
     // 任意のIDの後ろに追加
     $cidIndex = array_search('client_user_id', $keys);
     foreach ($option as $k => $v) {
         $cidIndex++;
         array_splice($keys, $cidIndex, 0, $k);
     }
     $result = array();
     // ファイル読込み
     if (is_file($this->_tmpFilePath) == true) {
         $lines = file($this->_tmpFilePath);
         foreach ($lines as $index => $line) {
             // 空白行は無視
             if (strlen(trim($line)) == 0) {
                 continue;
             }
             // 文字コード変換
             $line = mb_convert_encoding($line, 'utf-8', 'cp932');
             // 配列に
             $values = explode(',', $line);
             // 1行を処理
             $d =& $this->actionLine($code, $isAccept2Dankai, $isPriceTeiritsu, $keys, $values);
             // 結果を取得
             if (empty($d['data']) == false) {
                 $result[$index + 1] =& $d;
             }
         }
     }
     // テンプレート変数の設定
     $this->_dataFrom['list'] =& $result;
     // カウンター値をテンプレートに渡す
     $this->_dataFrom['update_count'] =& $this->_updateCount;
     // ファイル削除
     if (is_file($this->_tmpFilePath) == true) {
         @unlink($this->_tmpFilePath);
     }
 }