_is_include = false; parent::init(); $this->view->assign('title' , '物件お問い合わせ'); } public function preDispatch() { // TODO 認証ありなしのフラグ } public function updateAction(){ $req = $this->getRequest(); $_r = $req->getParams(); $result = $this->_authIdentity; if(isset($result->{Mjnet_Member::TBL_NAME}->{Mjnet_Member::COL_ID}) && $result->{Mjnet_Member::TBL_NAME}->{Mjnet_Member::COL_ID} != ""){ $Vie_Itp_MjnetMember = new Apis_Vie_Itp_MjnetMember($this->_conn); $p_member = array( Vie_Itp_MjnetMember::COL_MEMBERCD => $result->{Mjnet_Member::TBL_NAME}->{Mjnet_Member::COL_ID}, ); $Vie_Itp_MjnetMemberOne = $Vie_Itp_MjnetMember->findOne($p_member); $this->view->assign('Vie_Itp_MjnetMemberOne', $Vie_Itp_MjnetMemberOne); } $limit=5; $mustsee= false; $is_pager=true; $Vie_MjnetCaDataListSmart = new Apis_Vie_MjnetCarDataListSmart($this->_conn); $param = array( Vie_MjnetCarDataListSmart::COL_ID => $_r[RequestParam::REQ_ID], ); $ord = array( Vie_MjnetCarDataListSmart::COL_ID => Model::SORT_ORDER_DESC, ); $om = $Vie_MjnetCaDataListSmart->select()->setOrIn($param)->setOrder($ord); //ページャ及びリスト取得 $p = new PagerLocal($_r); $p->setLimit($limit); $p->page = $req->page; $p->total_num = $om->getCount(); $all = range(0, $p->total_num); // var_dump($om->setLimit($p->limit, $p->offset)->getSql()); $lists = $om->setLimit($p->limit, $p->offset)->fetchAll(); $p->init($lists); if($is_pager){ ///ページャ $req = $this->getRequest(); $moduleName = $req->getModuleName(); $actionName = $req->getActionName(); $controllerName = $req->getControllerName(); foreach($req->getParams() as $key => $val) { if(is_array($val)){ $urlparam[$key] = array(); foreach($val as $value) $urlparam[$key][] = $value; }else{ if($val == "") { unset($urlparam[$key]); }else{ $urlparam[$key] = $val; } } } unset($urlparam['module']); unset($urlparam['controller']); unset($urlparam['action']); $urlparam_sort = $urlparam; unset($urlparam_sort['module']); unset($urlparam_sort['page']); unset($urlparam_sort['sort']); unset($urlparam_sort['ord']); $orderLink = str_replace('=','/',http_build_query($urlparam_sort,'','/')); $params = array( 'itemData' => $all, 'perPage' => $p->limit, 'append' => true, 'separator' => ' ', 'clearIfVoid' => false, 'urlVar' => 'page', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'path' => '/' . $moduleName . '/'.$controllerName .'/'. $actionName, 'fixFileName' => "", 'fileName' => "", 'currentPage' => $req->page, 'extraVars' => $urlparam, ); $pager = & Pager::factory($params); $links = $pager->getLinks(); $_b = array('?','=','&','a href/','" title/'); $_a = array('','/','/','a href=','/" title=',); $_links = str_replace($_b ,$_a,$links); foreach($_links as $key => $link) { //配列の要素全部回すと重いので・・・とりあえずallしか参照してない。 if($key == 'all') { $links[$key] = ereg_replace("%5B([0-9]{1,2})%5D", "", $link); } } $this->view->assign('pager', $pager); $this->view->assign('links', $links); } $this->view->assign('p', $p); $this->view->assign('ord', $ord); $this->view->assign('sort', $sort); $this->view->assign('orderLink', $orderLink); // データ整形 foreach($lists as $vmcdlswp) { $vmcdlswp = $this->_lfDataFormatForCar($vmcdlswp); $vmcdlswp->SOUKOU_PH1 = str_replace("
", "", $vmcdlswp->SOUKOU_PH1); $vmcdlswp->SYUFUKU_PH1 = str_replace("
", "", $vmcdlswp->SYUFUKU_PH1); } $this->view->assign('Vie_MjnetCarDataListSmartWithPager' , $lists); $InquiryMaster = new Apis_InquiryMaster($this->_conn); $PrefMaster = new Apis_PrefMaster($this->_conn); $ord2 = array( PrefMaster::COL_PREFCODE => Model::SORT_ORDER_ASC ); $inq_ord = array( InquiryMaster::COL_INQUIRYCODE => Model::SORT_ORDER_ASC, ); $pref_list = $PrefMaster->select()->setAnd()->setOrder($ord2)->fetchAll(); $inq_list = $InquiryMaster->select()->setAnd()->setOrder($inq_ord)->fetchAll(); // こちらの物件も一緒にいかがですか? // 検討中に登録している物件の抽出 $tmp = explode("|",$this->getRequest()->getCookie("ucarfavo")); $tmp = array_filter($tmp, "strlen"); foreach($tmp as $one){ $MyList[] = explode('.',$one); } if(isset($MyList) && $MyList != ""){ foreach($MyList as $one){ $IdList[] = $one[0]; } $IdList = array_reverse($IdList); $p_car_in = array( Vie_MjnetCarDataListSmart::COL_ID => $IdList, Vie_MjnetCarDataListSmart::COL_PRIORITY => 1, Vie_MjnetCarDataListSmart::COL_SOLDFLAG => 0, ); $p_price = array( Vie_MjnetCarDataListSmart::COL_OTHERPRICE => 99999, ); $p_not_id = array( Vie_MjnetCarDataListSmart::COL_ID => $_r[RequestParam::REQ_ID], ); $lists = $Vie_MjnetCaDataListSmart->select()->setAndIn($p_car_in)->setAndNotIn($p_not_id)->setAndLessThan($p_price)->setOrder($ord)->fetchAll(); // お気に入り登録時間順 3件まで取得 $i = 0; foreach($IdList as $IdOne){ foreach($lists as $vmcdlswp) { if($IdOne == $vmcdlswp->{Vie_MjnetCarDataListSmart::COL_ID}) { $Vie_MjnetCaDataListSmartList[] = $vmcdlswp; $i++; } } if($i > 2) break; } }else{ // 検討中に登録している物件がない場合は最近見た物件の詳細 if(isset($this->_authIdentity->{Mjnet_Member::TBL_NAME}->{Mjnet_Member::COL_ID})){ $p_member = array( IndividualData::COL_MJNETMEMBERID => $this->_member->{Mjnet_Member::COL_ID} ); $IndividualData = new Apis_IndividualData($this->_conn); $IndividualDataOne = $IndividualData->findOne($p_member); if(isset($IndividualDataOne->{IndividualData::COL_UID})) { $psuid = $IndividualDataOne->{IndividualData::COL_UID}; }else{ $psuid = $_SERVER['REMOTE_ADDR'] . "_" . date('Y') . date('m') . date('d'); } }else{ $psuid = $_SERVER['REMOTE_ADDR'] . "_" . date('Y') . date('m') . date('d'); $p_member = array( IndividualData::COL_UID => $psuid ); $IndividualData = new Apis_IndividualData($this->_conn); $IndividualDataOne = $IndividualData->findOne($p_member); if(isset($IndividualDataOne->{IndividualData::COL_UID})) { $psuid = $IndividualDataOne->{IndividualData::COL_UID}; } } $Vie_RecentlyViewCar = new Apis_Vie_RecentlyViewCar($this->_conn); $p_uid = array( Vie_RecentlyViewCar::COL_UID => $psuid, ); $p_not_id = array( Vie_RecentlyViewCar::COL_ID => $_r[RequestParam::REQ_ID], ); $cdateOrd = array( Vie_RecentlyViewCar::COL_CDATE => Model::SORT_ORDER_DESC, ); $Vie_RecentlyViewCarList = $Vie_RecentlyViewCar->select()->setAndIn($p_uid)->setAndNotIn($p_not_id)->setOrder($cdateOrd)->fetchAll(); $ids = array(); // 被り除去 3件まで取得 $i = 0; foreach($Vie_RecentlyViewCarList as $Vie_RecentlyViewCarOne){ if($ids[$Vie_RecentlyViewCarOne->{Vie_RecentlyViewCar::COL_ID}] != '1'){ $Vie_MjnetCaDataListSmartList[] = $Vie_RecentlyViewCarOne; $i++; if($i > 2) break; } $ids[$Vie_RecentlyViewCarOne->{Vie_RecentlyViewCar::COL_ID}] = '1'; } } $this->view->assign('Vie_MjnetCaDataListSmartList',$Vie_MjnetCaDataListSmartList); if ($_r['is_back'] || $_r['InquiryRequestCDs']) { foreach ($_r as $key => $val) { if (is_array($val)) { foreach ($val as $key2 => $val2) { $obj->{$key}[$key2] = $val2; } } else { $obj->{$key} = $val; } } } $this->view->assign('inq_list',$inq_list); $this->view->assign('pref_list',$pref_list); $this->view->assign('obj',$obj); // 価格コムからの問い合わせ if($_r['g'] == '6'){ $ua = $_SERVER['HTTP_USER_AGENT']; if($this->_pnSystemGlobalCD == 0) { if(strpos($ua, "iPad") !== false){ }else if(strpos($ua, "iPhone") !== false || strpos($ua, "iPod") !== false){ $this->_redirect('https://www2.mjnet.co.jp/ucar/smart/contact.asp?id='.$_r[RequestParam::REQ_ID].'&g=6'); }else if(strpos($ua, "Android") !== false || strpos($ua, "Mobile") !== false){ $this->_redirect('https://www2.mjnet.co.jp/ucar/android/contact.asp?id='.$_r[RequestParam::REQ_ID].'&g=6'); } }else{ if(strpos($ua, "iPad") !== false){ }else if(strpos($ua, "iPhone") !== false || strpos($ua, "iPod") !== false){ $this->_redirect('http://m.kurumaru.com/kurumaru/smart/contact.asp?id='.$_r[RequestParam::REQ_ID].'&g=6'); }else if(strpos($ua, "Android") !== false || strpos($ua, "Mobile") !== false){ $this->_redirect('http://m.kurumaru.com/kurumaru/android/contact.asp?id='.$_r[RequestParam::REQ_ID].'&g=6'); } } if(is_array($_r[RequestParam::REQ_ID])){ $DataId = $_r[RequestParam::REQ_ID][0]; }else{ $DataId = $_r[RequestParam::REQ_ID]; } $Log_Kakakucom = new Log_Kakakucom($this->_conn); $g_data = array( Log_Kakakucom::COL_DATAID => $DataId, Log_Kakakucom::COL_MODE => 0, Log_Kakakucom::COL_REMOTE_ADDR => $_SERVER["REMOTE_ADDR"], Log_Kakakucom::COL_HTTP_USER_AGENT => $_SERVER['HTTP_USER_AGENT'], Log_Kakakucom::COL_DATAREGISTRATIONDATE => $Log_Kakakucom->getDay(), ); if($this->_IsNeedLog()) $Log_Kakakucom->insertFromPostRequest($g_data); } // レコメンドスイートタグ(くるまる) if(is_array($_r[RequestParam::REQ_ID])){ foreach($_r[RequestParam::REQ_ID] as $req_id){ $req_ids .= $req_id . ","; } $req_ids = rtrim($req_ids, ","); }else{ $req_ids = $_r[RequestParam::REQ_ID]; } $this->view->assign('req_ids',$req_ids); } public function updateConfirmAction(){ $req = $this->getRequest(); $_r = $req->getParams(); foreach ($_POST as $key => $val) { if (is_array($val)) { foreach($val as $key2 => $val2) { $obj->{$key}[$key2] = $val2; } } else { $obj->{$key} = $val; } } $this->view->assign('obj',$obj); $InquiryMaster = new Apis_InquiryMaster($this->_conn); $inq_ord = array( InquiryMaster::COL_INQUIRYCODE => Model::SORT_ORDER_ASC, ); $inq_list = $InquiryMaster->select()->setAnd()->setOrder($inq_ord)->fetchAll(); foreach($inq_list as $inq_one){ foreach($_r[Vie_Itp_NdExchangeInquiry::COL_INQUIRYREQUESTCDS] as $one){ if($inq_one->{InquiryMaster::COL_INQUIRYCODE} == $one){ $obj->inq_name[] = $inq_one->{InquiryMaster::COL_INQUIRYNAME}; } } } $limit=5; $mustsee= false; $is_pager=true; $Vie_MjnetCaDataListSmart = new Apis_Vie_MjnetCarDataListSmart($this->_conn); if(isset($_r['IDs']) && $_r['IDs'] != ""){ $car_id = $_r['IDs']; $car_id[] = $_r[RequestParam::REQ_ID][0]; }else{ $car_id = $_r[RequestParam::REQ_ID]; } $param = array( Vie_MjnetCarDataListSmart::COL_ID => $car_id ); $ord = array( Vie_MjnetCarDataListSmart::COL_ID => Model::SORT_ORDER_DESC, ); $om = $Vie_MjnetCaDataListSmart->select()->setOrIn($param)->setOrder($ord); //ページャ及びリスト取得 $p = new PagerLocal($_r); $p->setLimit($limit); $p->page = $req->page; $p->total_num = $om->getCount(); $all = range(0, $p->total_num); // var_dump($om->setLimit($p->limit, $p->offset)->getSql()); $lists = $om->setLimit($p->limit, $p->offset)->fetchAll(); $p->init($lists); if($is_pager){ ///ページャ $req = $this->getRequest(); $moduleName = $req->getModuleName(); $actionName = $req->getActionName(); $controllerName = $req->getControllerName(); foreach($req->getParams() as $key => $val) { if(is_array($val)){ $urlparam[$key] = array(); foreach($val as $value) $urlparam[$key][] = $value; }else{ if($val == "") { unset($urlparam[$key]); }else{ $urlparam[$key] = $val; } } } unset($urlparam['module']); unset($urlparam['controller']); unset($urlparam['action']); $urlparam_sort = $urlparam; unset($urlparam_sort['module']); unset($urlparam_sort['page']); unset($urlparam_sort['sort']); unset($urlparam_sort['ord']); $orderLink = str_replace('=','/',http_build_query($urlparam_sort,'','/')); $params = array( 'itemData' => $all, 'perPage' => $p->limit, 'append' => true, 'separator' => ' ', 'clearIfVoid' => false, 'urlVar' => 'page', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'path' => '/' . $moduleName . '/'.$controllerName .'/'. $actionName, 'fixFileName' => "", 'fileName' => "", 'currentPage' => $req->page, 'extraVars' => $urlparam, ); $pager = & Pager::factory($params); $links = $pager->getLinks(); $_b = array('?','=','&','a href/','" title/'); $_a = array('','/','/','a href=','/" title=',); $_links = str_replace($_b ,$_a,$links); foreach($_links as $key => $link) { //配列の要素全部回すと重いので・・・とりあえずallしか参照してない。 if($key == 'all') { $links[$key] = ereg_replace("%5B([0-9]{1,2})%5D", "", $link); } } $this->view->assign('pager', $pager); $this->view->assign('links', $links); } $this->view->assign('p', $p); $this->view->assign('ord', $ord); $this->view->assign('sort', $sort); $this->view->assign('orderLink', $orderLink); // データ整形 foreach($lists as $vmcdlswp) { $vmcdlswp = $this->_lfDataFormatForCar($vmcdlswp); $vmcdlswp->SOUKOU_PH1 = str_replace("
", "", $vmcdlswp->SOUKOU_PH1); $vmcdlswp->SYUFUKU_PH1 = str_replace("
", "", $vmcdlswp->SYUFUKU_PH1); } $this->view->assign('Vie_MjnetCarDataListSmartWithPager' , $lists); } public function updateDoAction(){ $req = $this->getRequest(); $_r = $req->getParams(); $result = $this->_authIdentity; $Mjnet_Member = new Mjnet_Member($this->_conn); $Vie_MjnetCarDataListSmart = new Vie_MjnetCarDataListSmart($this->_conn); $Vie_Itp_NdExchangeInquiry = new Vie_Itp_NdExchangeInquiry($this->_conn); $Vie_Itp_NdExchangeInquiryLog = new Vie_Itp_NdExchangeInquiryLog($this->_conn); $Vie_Itp_MjnetMember = new Vie_Itp_MjnetMember($this->_conn); // ログインしていない //if($result == ""){ // ユーザー登録者かどうか判断する $p_mail = array( Vie_Itp_MjnetMember::COL_EMAIL => $_r[Vie_Itp_MjnetMember::COL_EMAIL] ); $dateOrd = array( Vie_Itp_MjnetMember::COL_DATAREGISTRATIONDATE => Model::SORT_ORDER_DESC ); $Vie_Itp_MjnetMemberOne = $Vie_Itp_MjnetMember->select()->setAnd($p_mail)->setOrder($dateOrd)->fetch(); if($Vie_Itp_MjnetMemberOne == false){ //同じアドレスで見つからない $member = array( Vie_Itp_MjnetMember::COL_NAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], Vie_Itp_MjnetMember::COL_HANDLENAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], Vie_Itp_MjnetMember::COL_PREFNAME => $_r[Vie_Itp_MjnetMember::COL_PREFNAME], Vie_Itp_MjnetMember::COL_SEX => $_r[Vie_Itp_MjnetMember::COL_SEX], Vie_Itp_MjnetMember::COL_EMAIL => $_r[Vie_Itp_MjnetMember::COL_EMAIL], Vie_Itp_MjnetMember::COL_EMAILSERVICEFLAG => 1, Vie_Itp_MjnetMember::COL_DELETEFLAG => 0, Vie_Itp_MjnetMember::COL_STATE => 1, ); $Vie_Itp_MjnetMember->insertFromPostRequest($member); $Vie_Itp_MjnetMemberOne = $Vie_Itp_MjnetMember->select()->setAnd($p_mail)->setOrder($dateOrd)->fetch(); }else{ //見つかった $member = array( Vie_Itp_MjnetMember::COL_NAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], Vie_Itp_MjnetMember::COL_HANDLENAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], Vie_Itp_MjnetMember::COL_PREFNAME => $_r[Vie_Itp_MjnetMember::COL_PREFNAME], Vie_Itp_MjnetMember::COL_SEX => $_r[Vie_Itp_MjnetMember::COL_SEX], Vie_Itp_MjnetMember::COL_EMAIL => $_r[Vie_Itp_MjnetMember::COL_EMAIL] ); $where_member = array( Vie_Itp_MjnetMember::COL_MEMBERCD => $Vie_Itp_MjnetMemberOne->{Vie_Itp_MjnetMember::COL_MEMBERCD} ); if( $Vie_Itp_MjnetMemberOne->{Vie_Itp_MjnetMember::COL_MEMBERCD} != "") { $Vie_Itp_MjnetMember->updateFromPostRequest($member,$where_member); } } $MemberCD = $Vie_Itp_MjnetMemberOne->{Vie_Itp_MjnetMember::COL_MEMBERCD}; // }else{ // $MemberCD = $this->_member->{Mjnet_Member::COL_ID}; // $member = array( // Vie_Itp_MjnetMember::COL_NAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], // Vie_Itp_MjnetMember::COL_HANDLENAME => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], // Vie_Itp_MjnetMember::COL_PREFNAME => $_r[Vie_Itp_MjnetMember::COL_PREFNAME], // Vie_Itp_MjnetMember::COL_SEX => $_r[Vie_Itp_MjnetMember::COL_SEX], // Vie_Itp_MjnetMember::COL_EMAIL => $_r[Vie_Itp_MjnetMember::COL_EMAIL] // ); // $where_member = array( // Vie_Itp_MjnetMember::COL_MEMBERCD => $this->_member->{Mjnet_Member::COL_ID} // ); // if( $this->_member->{Mjnet_Member::COL_ID} != "") // { // if($this->_member->{Mjnet_Member::COL_ID} == ) // $Vie_Itp_MjnetMember->updateFromPostRequest($member,$where_member); // } // } // 返信方法(電話、メール) if(isset($_r[Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTELNO]) && $_r[Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTELNO] != ""){ $ResMethod = 2; }else{ $ResMethod = 1; } $data = $_r; if(count($data['IDList']) > 1){ $TotalToiawaseCntStr = "複"; }else{ $TotalToiawaseCntStr = "単"; } // 価格コム if(!isset($_r['g']) || $_r['g'] == ""){ $WhereFromSiteCD = 0; }else if($_r['g'] == 1){ $WhereFromSiteCD = 2; }else{ $WhereFromSiteCD = $_r['g']; } foreach($data['IDList'] as $id_one){ $id_param = array( Vie_MjnetCarDataListSmart::COL_ID => $id_one, ); $Vie_MjnetCarDataListSmartOne = $Vie_MjnetCarDataListSmart->findOne($id_param); foreach($_r[Vie_Itp_NdExchangeInquiry::COL_INQUIRYREQUESTCDS] as $one){ $req_cds .= $one . ","; } $req_cds = rtrim($req_cds, ","); if(strpos($req_cds,'10') !== false){ $InquiryRequestNote .= "物件を実際に見たい
"; } if(strpos($req_cds,'11') !== false){ $InquiryRequestNote .= "詳しい見積りが欲しい
"; } if(strpos($req_cds,'12') !== false){ $InquiryRequestNote .= "在庫の有無の確認
"; } if(strpos($req_cds,'13') !== false){ $InquiryRequestNote .= "物件の詳細が知りたい
"; } if(strpos($req_cds,'14') !== false){ $InquiryRequestNote .= "来店予約したい
"; } if(strpos($req_cds,'15') !== false){ $InquiryRequestNote .= "試乗したい
"; } if(strpos($req_cds,'16') !== false){ $InquiryRequestNote .= "整備・保証について知りたい
"; } if(strpos($req_cds,'17') !== false){ $InquiryRequestNote .= "キズ・汚れの有無の確認
"; } if(strpos($req_cds,'18') !== false){ $InquiryRequestNote .= "分割払いについて
"; } if(strpos($req_cds,'19') !== false){ $InquiryRequestNote .= "遠方納車について
"; } if(isset($InquiryRequestNote) && $InquiryRequestNote != ""){ $InquiryRequestNote = rtrim($InquiryRequestNote, "
"); } $data = array( // Vie_Itp_NdExchangeInquiry::COL_INQUIRYHK => "", Vie_Itp_NdExchangeInquiry::COL__DATAID => $id_one, Vie_Itp_NdExchangeInquiry::COL__BUKKENID => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_NO}, Vie_Itp_NdExchangeInquiry::COL_USEDCARCD => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_USEDCARCD}, Vie_Itp_NdExchangeInquiry::COL_MEMBERCD => $MemberCD, Vie_Itp_NdExchangeInquiry::COL_TERMINALCD => 0, Vie_Itp_NdExchangeInquiry::COL_INQUIRYREQUESTCD => 0, Vie_Itp_NdExchangeInquiry::COL_INQUIRYRESPONSECD => 0, Vie_Itp_NdExchangeInquiry::COL_INQUIRYREQUESTCDS => $req_cds, Vie_Itp_NdExchangeInquiry::COL_INQUIRYREQUESTNOTE => $InquiryRequestNote, Vie_Itp_NdExchangeInquiry::COL_WHEREFROMSITECD => 0, Vie_Itp_NdExchangeInquiry::COL_SHITADORICD => $_r[Vie_Itp_NdExchangeInquiry::COL_SHITADORICD], Vie_Itp_NdExchangeInquiry::COL_NOTE => $_r[Vie_Itp_NdExchangeInquiry::COL_NOTE], Vie_Itp_NdExchangeInquiry::COL_RESPONSEFLAG => 0, Vie_Itp_NdExchangeInquiry::COL_RESPONSEMETHOD => $ResMethod, Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTELNO => $_r[Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTELNO], Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTIME => $_r[Vie_Itp_NdExchangeInquiry::COL_RESPONSEKIBOUTIME], Vie_Itp_NdExchangeInquiry::COL_SYAMEICODE => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_CARNAMECODE}, Vie_Itp_NdExchangeInquiry::COL_SYAMEI => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_CARNAME}, Vie_Itp_NdExchangeInquiry::COL_GRADE => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_GRADENAME}, Vie_Itp_NdExchangeInquiry::COL_NENSIKI => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_NENSHIKI}, Vie_Itp_NdExchangeInquiry::COL_PRICE => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_PRICE}, Vie_Itp_NdExchangeInquiry::COL_SHITADORINOTE => $_r[Vie_Itp_NdExchangeInquiry::COL_SHITADORINOTE], Vie_Itp_NdExchangeInquiry::COL_SELLTIMECD => $_r[Vie_Itp_NdExchangeInquiry::COL_SELLTIMECD], Vie_Itp_NdExchangeInquiry::COL_DELETEFLAG => 0, Vie_Itp_NdExchangeInquiry::COL_DATAREGISTRATIONDATE => $Vie_Itp_NdExchangeInquiry->getDay(), Vie_Itp_NdExchangeInquiry::COL_DATAUPDATEDATE => $Vie_Itp_NdExchangeInquiry->getDay(), Vie_Itp_NdExchangeInquiry::COL_WHEREFROMSITECD => $WhereFromSiteCD, ); if($data[Vie_Itp_NdExchangeInquiry::COL_MEMBERCD] == null){ $data[Vie_Itp_NdExchangeInquiry::COL_MEMBERCD] = 0; } if($data[Vie_Itp_NdExchangeInquiry::COL_SHITADORICD] == null){ $data[Vie_Itp_NdExchangeInquiry::COL_SHITADORICD] = 0; } if($data[Vie_Itp_NdExchangeInquiry::COL_SELLTIMECD] == null){ $data[Vie_Itp_NdExchangeInquiry::COL_SELLTIMECD] = 0; } $Vie_Itp_NdExchangeInquiry->insertFromPostRequest($data); $ord = array( Vie_Itp_NdExchangeInquiry::COL_DATAREGISTRATIONDATE => Model::SORT_ORDER_DESC, ); $param = array( // Vie_Itp_NdExchangeInquiry::COL_MEMBERCD => $result->{Mjnet_Member::TBL_NAME}->{Mjnet_Member::COL_ID}, Vie_Itp_NdExchangeInquiry::COL__DATAID => $id_one ); $inq_one = $Vie_Itp_NdExchangeInquiry->select()->setAnd($param)->setOrder($ord)->fetch(); if($this->_pnSystemGlobalCD == 0){ $DealershipCD = $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE}; }else{ $DealershipCD = substr_replace($Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE},'N',0,1); } $data2 = array( // Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYLOGHK => "", Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYCD => $inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}, Vie_Itp_NdExchangeInquiryLog::COL_DEALERSHIPCD => $DealershipCD, Vie_Itp_NdExchangeInquiryLog::COL_GENRE => 0, Vie_Itp_NdExchangeInquiryLog::COL_STOCKFLAG => "", Vie_Itp_NdExchangeInquiryLog::COL_BODY => $_r[Vie_Itp_NdExchangeInquiry::COL_NOTE], Vie_Itp_NdExchangeInquiryLog::COL_CHARGE => $_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE], Vie_Itp_NdExchangeInquiryLog::COL_PARENTLOGID => "", Vie_Itp_NdExchangeInquiryLog::COL_REPLYMETHOD => $ResMethod, Vie_Itp_NdExchangeInquiryLog::COL_STATE => "", Vie_Itp_NdExchangeInquiryLog::COL_FILEID => "", Vie_Itp_NdExchangeInquiryLog::COL_DATAREGISTRATIONDATE => $Vie_Itp_NdExchangeInquiryLog->getDay(), Vie_Itp_NdExchangeInquiryLog::COL_DATAUPDATEDATE => $Vie_Itp_NdExchangeInquiryLog->getDay(), ); $Vie_Itp_NdExchangeInquiryLog->insertFromPostRequest($data2); $p_log = array( Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYCD => $inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}, ); $dateOrd = array( Vie_Itp_NdExchangeInquiryLog::COL_DATAREGISTRATIONDATE => Model::SORT_ORDER_DESC ); $Vie_Itp_NdExchangeInquiryLogOne = $Vie_Itp_NdExchangeInquiryLog->select()->setAnd($p_log)->setOrder($dateOrd)->fetch(); $p_parent = array( Vie_Itp_NdExchangeInquiryLog::COL_PARENTLOGID => $Vie_Itp_NdExchangeInquiryLogOne->{Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYLOGCD} ); $w_log_id = array( Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYLOGCD => $Vie_Itp_NdExchangeInquiryLogOne->{Vie_Itp_NdExchangeInquiryLog::COL_INQUIRYLOGCD}, ); $Vie_Itp_NdExchangeInquiryLog->updateFromPostRequest($p_parent, $w_log_id); // 販売店の情報を抜き出す $Vie_ContactShopData = new Apis_Vie_ContactShopData($this->_conn); $p_shop = array( Vie_ContactShopData::COL_DEALERSHIPNO => $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE}, ); $shopOrd = array( Vie_ContactShopData::COL_DEALERSHIPCD => Model::SORT_ORDER_ASC, ); $Vie_ContactShopDataList = $Vie_ContactShopData->select()->setAnd($p_shop)->setOrder($shopOrd)->fetchAll(); foreach($Vie_ContactShopDataList as $Vie_ContactShopDataOne) { // WEB if($Vie_ContactShopDataOne->{Vie_ContactShopData::COL_TERMINALTYPE} == 0){ // メール送信(店web) $title = "[".$this->_config->cfg->nm->operator_en."]".$_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE]."様からの問い合わせNO(".$TotalToiawaseCntStr.$Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE}."_".$inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}.")[".date("Y-m-d")."]"; $mail = new smartyMail(); $mail->assign('config',$this->_config); $mail->assign('Vie_MjnetCarDataListSmartOne',$Vie_MjnetCarDataListSmartOne); $mail->assign('name',$_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE]); $mail->assign('pref',$_r[Vie_Itp_MjnetMember::COL_PREFNAME]); $mail->template_dir = ROOT_PATH . "src/app/front/mail/"; //テンプレート $mail->compile_dir = ROOT_PATH . "var/cache/templates_c/front/"; //コンパイル $mail->email_from = $this->_config->mail->optionorder->params->from; $mail->email_from_name = $this->_config->mail->optionorder->params->fromname; $mail->email_to = $Vie_ContactShopDataOne->{Vie_ContactShopData::COL_EMAIL}; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc2; // $mail->email_to = "satoshi.souda@pricer.jp"; $mail->email_subject = $title; $mail->Mailer = $this->_config->mail->member->mailer; $mail->Host = $this->_config->mail->member->params->host; $mail->Port = $this->_config->mail->member->params->port; $mail->Username = $this->_config->mail->member->params->username; $mail->Password = $this->_config->mail->member->params->password; $mail->SMTPAuth = $this->_config->mail->member->params->smtpauth == 1 ? true : false; $mail->CharSet = $this->_config->mail->member->params->charset; $mail->Encoding = $this->_config->mail->member->params->encoding; $mail->send('contact_shop_web.tpl'); // 携帯 }else if($Vie_ContactShopDataOne->{Vie_ContactShopData::COL_TERMINALTYPE} == 1){ // チェックを入れた人は夜にメールを送らない if($Vie_ContactShopDataOne->{Vie_ContactShopData::COL_INQUIRYNIGHTNOTSENDFLAG} == 1){ if(date('G') >= 9 && date('G') <= 20){ // メール送信(店携帯) $title = $this->_config->cfg->nm->operator_en."問合NO(".$TotalToiawaseCntStr.$Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE}."_".$inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}.")"; $mail = new smartyMail(); $mail->assign('config',$this->_config); $mail->assign('Vie_MjnetCarDataListSmartOne',$Vie_MjnetCarDataListSmartOne); $mail->assign('name',$_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE]); $mail->assign('pref',$_r[Vie_Itp_MjnetMember::COL_PREFNAME]); $mail->template_dir = ROOT_PATH . "src/app/front/mail/"; //テンプレート $mail->compile_dir = ROOT_PATH . "var/cache/templates_c/front/"; //コンパイル $mail->email_from = $this->_config->mail->optionorder->params->from; $mail->email_from_name = $this->_config->mail->optionorder->params->fromname; $mail->email_to = $Vie_ContactShopDataOne->{Vie_ContactShopData::COL_EMAIL}; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc2; // $mail->email_to = "satoshi.souda@pricer.jp"; $mail->email_subject = $title; $mail->Mailer = $this->_config->mail->member->mailer; $mail->Host = $this->_config->mail->member->params->host; $mail->Port = $this->_config->mail->member->params->port; $mail->Username = $this->_config->mail->member->params->username; $mail->Password = $this->_config->mail->member->params->password; $mail->SMTPAuth = $this->_config->mail->member->params->smtpauth == 1 ? true : false; $mail->CharSet = $this->_config->mail->member->params->charset; $mail->Encoding = $this->_config->mail->member->params->encoding; $mail->send('contact_shop_mobile.tpl'); }else{ // TODO 時間差で送る処理(朝) } }else{ // メール送信(店携帯) $title = $this->_config->cfg->nm->operator_en."問合NO(".$TotalToiawaseCntStr.$Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE}."_".$inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}.")"; $mail = new smartyMail(); $mail->assign('config',$this->_config); $mail->assign('Vie_MjnetCarDataListSmartOne',$Vie_MjnetCarDataListSmartOne); $mail->assign('name',$_r[Vie_Itp_NdExchangeInquiryLog::COL_CHARGE]); $mail->assign('pref',$_r[Vie_Itp_MjnetMember::COL_PREFNAME]); $mail->template_dir = ROOT_PATH . "src/app/front/mail/"; //テンプレート $mail->compile_dir = ROOT_PATH . "var/cache/templates_c/front/"; //コンパイル $mail->email_from = $this->_config->mail->optionorder->params->from; $mail->email_from_name = $this->_config->mail->optionorder->params->fromname; $mail->email_to = $Vie_ContactShopDataOne->{Vie_ContactShopData::COL_EMAIL}; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc; $mail->email_bcc[] = $this->_config->mail->optionorder->params->bcc2; // $mail->email_to = "satoshi.souda@pricer.jp"; $mail->email_subject = $title; $mail->Mailer = $this->_config->mail->member->mailer; $mail->Host = $this->_config->mail->member->params->host; $mail->Port = $this->_config->mail->member->params->port; $mail->Username = $this->_config->mail->member->params->username; $mail->Password = $this->_config->mail->member->params->password; $mail->SMTPAuth = $this->_config->mail->member->params->smtpauth == 1 ? true : false; $mail->CharSet = $this->_config->mail->member->params->charset; $mail->Encoding = $this->_config->mail->member->params->encoding; $mail->send('contact_shop_mobile.tpl'); } } } // メール送信(ユーザー) $title2 = $this->_config->cfg->nm->operator_en."からのお知らせ[".date("Y-m-d")."]"; $mail2 = new smartyMail(); $mail2->assign('config',$this->_config); $mail2->assign('Vie_MjnetCarDataListSmartOne',$Vie_MjnetCarDataListSmartOne); $mail2->template_dir = ROOT_PATH . "src/app/front/mail/"; //テンプレート $mail2->compile_dir = ROOT_PATH . "var/cache/templates_c/front/"; //コンパイル $mail2->email_from = $this->_config->mail->optionorder->params->from; $mail2->email_from_name = $this->_config->mail->optionorder->params->fromname; $mail2->email_to = $_r[Vie_Itp_MjnetMember::COL_EMAIL]; $mail2->email_bcc[] = $this->_config->mail->optionorder->params->bcc; $mail2->email_bcc[] = $this->_config->mail->optionorder->params->bcc2; $mail2->email_subject = $title2; $mail2->Mailer = $this->_config->mail->member->mailer; $mail2->Host = $this->_config->mail->member->params->host; $mail2->Port = $this->_config->mail->member->params->port; $mail2->Username = $this->_config->mail->member->params->username; $mail2->Password = $this->_config->mail->member->params->password; $mail2->SMTPAuth = $this->_config->mail->member->params->smtpauth == 1 ? true : false; $mail2->CharSet = $this->_config->mail->member->params->charset; $mail2->Encoding = $this->_config->mail->member->params->encoding; $mail2->send('contact_user.tpl'); unset($req_cds); unset($InquiryRequestNote); $url_param .= 'ID/'.$id_one.'/'; } if($_r['g'] == '6'){ $this->_redirect('/contact/update-end/'.$url_param.'g/6/'); }else{ $this->_redirect('/contact/update-end/'.$url_param); } } public function updateEndAction(){ $req = $this->getRequest(); $_r = $req->getParams(); $Vie_MjnetCarDataListSmart = new Apis_Vie_MjnetCarDataListSmart($this->_conn); $Vie_DealershipMaster = new Apis_Vie_DealershipMaster($this->_conn); $param = array( Vie_MjnetCarDataListSmart::COL_ID => $_r[RequestParam::REQ_ID], ); $carOrd = array( Vie_MjnetCarDataListSmart::COL_CARNAMECODE => Model::SORT_ORDER_DESC ); $Vie_MjnetCarDataListSmartList = $Vie_MjnetCarDataListSmart->select()->setAndIn($param)->setOrder($carOrd)->fetchAll(); $ord = array( Vie_DealershipMaster::COL_DEALERSHIPCD => Model::SORT_ORDER_ASC ); $Vie_DealershipMasterList = $Vie_DealershipMaster->select()->setAnd()->setOrder($ord)->fetchAll(); foreach($Vie_DealershipMasterList as $Vie_DealershipMasterOne){ foreach($Vie_MjnetCarDataListSmartList as $Vie_MjnetCarDataListSmartOne){ if($Vie_DealershipMasterOne->{RequestParam::REQ_DEALERSHIP_CODE} == $Vie_MjnetCarDataListSmartOne->{Vie_MjnetCarDataListSmart::COL_HANBAITENCODE} && $prev[$Vie_DealershipMasterOne->{Vie_DealershipMaster::COL_DEALERSHIPCD}] != 'flag'){ $DealerList[] = $Vie_DealershipMasterOne; $prev[$Vie_DealershipMasterOne->{Vie_DealershipMaster::COL_DEALERSHIPCD}] = 'flag'; } } } if(count($Vie_MjnetCarDataListSmartList) == 1) $ViewFlag = 1; $this->view->assign('Vie_DealershipMasterList',$DealerList); $this->view->assign('Vie_MjnetCarDataListSmartOne',$Vie_MjnetCarDataListSmartOne); $this->view->assign('ViewFlag',$ViewFlag); // レコメンドスイートタグ(くるまる) if($this->_pnSystemGlobalCD == 1){ $Vie_Itp_NdExchangeInquiry = new Apis_Vie_Itp_NdExchangeInquiry($this->_conn); if(is_array($_r[RequestParam::REQ_ID])){ foreach($_r[RequestParam::REQ_ID] as $id){ $dateOrd = array( Vie_Itp_NdExchangeInquiry::COL_DATAREGISTRATIONDATE => Model::SORT_ORDER_DESC, ); $p_id = array( Vie_Itp_NdExchangeInquiry::COL__DATAID => $id, ); $inq_one = $Vie_Itp_NdExchangeInquiry->select()->setAndIn($p_id)->setOrder($dateOrd)->fetch(); $ids .= $inq_one->{Vie_Itp_NdExchangeInquiry::COL__DATAID} . ","; $prices .= $inq_one->{Vie_Itp_NdExchangeInquiry::COL_PRICE} . ","; $inqs .= $inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD} . ","; } $ids = rtrim($ids, ","); $inqs = rtrim($inqs, ","); }else{ $dateOrd = array( Vie_Itp_NdExchangeInquiry::COL_DATAREGISTRATIONDATE => Model::SORT_ORDER_DESC, ); $p_id = array( Vie_Itp_NdExchangeInquiry::COL__DATAID => $_r[RequestParam::REQ_ID], ); $inq_one = $Vie_Itp_NdExchangeInquiry->select()->setAndIn($p_id)->setOrder($dateOrd)->fetch(); $ids = $_r[RequestParam::REQ_ID]; $prices .= $inq_one->{Vie_Itp_NdExchangeInquiry::COL_PRICE}; $inqs = $inq_one->{Vie_Itp_NdExchangeInquiry::COL_INQUIRYCD}; } $prices = rtrim($prices, ","); $this->view->assign('ids',$ids); $this->view->assign('prices',$prices); $this->view->assign('inqs',$inqs); } } } ?>