Example #1
0
 private function makeLogFile(&$result)
 {
     $header = "";
     $header .= "案件ID,";
     $header .= "アクション日時,";
     $header .= "アクションID,";
     $header .= "メディアID,";
     $header .= "任意のID,";
     $header .= "売上(単価),";
     $header .= "原価(卸値),";
     $header .= "ステータス,";
     $header .= "締め日,";
     $header .= "備考,";
     //追加パラメーター1
     if (isset($this->_option['option1']['option_name'])) {
         $header .= $this->_option['option1']['option_name'] . ",";
     }
     //追加パラメーター2
     if (isset($this->_option['option2']['option_name'])) {
         $header .= $this->_option['option2']['option_name'] . ",";
     }
     //追加パラメーター3
     if (isset($this->_option['option3']['option_name'])) {
         $header .= $this->_option['option3']['option_name'] . ",";
     }
     //追加パラメーター4
     if (isset($this->_option['option4']['option_name'])) {
         $header .= $this->_option['option4']['option_name'] . ",";
     }
     //追加パラメーター5
     if (isset($this->_option['option5']['option_name'])) {
         $header .= $this->_option['option5']['option_name'] . ",";
     }
     $header .= "結果";
     $header .= "\r\n";
     $str = "";
     foreach ($result as $d) {
         $a = array();
         $a[] = $d['data']['anken_id'];
         //案件ID
         $a[] = $d['data']['action_time'];
         //アクション日時
         $a[] = $d['data']['action_id'];
         //アクションID
         $a[] = $d['data']['media_id'];
         //メディアID
         $a[] = $d['data']['client_user_id'];
         //任意のID
         $a[] = $d['data']['accept_price'];
         //売上
         $a[] = $d['data']['accept_oroshi'];
         //原価
         $a[] = $d['data']['accept_flg'];
         //ステータス
         $a[] = $d['data']['accept_date'];
         //締め日
         $a[] = $d['data']['memo'];
         //備考
         //追加パラメーター1
         if (isset($this->_option['option1']['option_name'])) {
             $a[] = $d['data']['option1'];
         }
         //追加パラメーター2
         if (isset($this->_option['option2']['option_name'])) {
             $a[] = $d['data']['option2'];
         }
         //追加パラメーター3
         if (isset($this->_option['option3']['option_name'])) {
             $a[] = $d['data']['option3'];
         }
         //追加パラメーター4
         if (isset($this->_option['option4']['option_name'])) {
             $a[] = $d['data']['option4'];
         }
         //追加パラメーター5
         if (isset($this->_option['option5']['option_name'])) {
             $a[] = $d['data']['option5'];
         }
         // 結果メッセージ
         $msg = "";
         $err = array();
         if ($d['eListCount'] != 0) {
             foreach ($d['eList'] as $e) {
                 $m = $e->code . ": " . $e->msg;
                 if ($e->getMessage()) {
                     $m .= " : {$e->getMessage()}";
                 }
                 $err[] = $m;
             }
             $m = implode("\r\n", $err);
             $msg = "\"{$m}\"";
         } else {
             $msg = "更新しました。";
         }
         $a[] = $msg;
         $str .= implode(',', $a) . "\r\n";
     }
     $contents = $header . $str;
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $contents = $header . $str;
     $logFile->outputWithOpearationLog($contents);
     return $logFile->getPath();
 }
Example #2
0
 private function makeLogFile(&$contents)
 {
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $logFile->outputWithOpearationLog($contents);
 }
Example #3
0
 private function makeLogFile(&$old, &$new)
 {
     // 変更前データ
     $oldDataList = $old->getArray();
     $oldHeader = "変更前\r\n";
     $oldData = "";
     foreach ($oldDataList as $column => $value) {
         $oldHeader .= $column . ",";
         $oldData .= $value . ",";
     }
     $oldHeader = substr($oldHeader, 0, -1);
     $oldData = substr($oldData, 0, -1);
     $oldHeader .= "\r\n";
     $oldData .= "\r\n";
     // 変更後データ
     $newDataList = $new->getarray();
     $newHeader = "変更後\r\n";
     $newData = "";
     foreach ($newDataList as $column => $value) {
         $newHeader .= $column . ",";
         $newData .= $value . ",";
     }
     $newHeader = substr($newHeader, 0, -1);
     $newData = substr($newData, 0, -1);
     $newHeader .= "\r\n";
     $newData .= "\r\n";
     $contents = $oldHeader . $oldData . $newHeader . $newData;
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $logFile->outputWithOpearationLog($contents);
 }