db = sp4inq_open(); $template =& loadTemplate( $p ); $type_arr = array( '0' => '質問', '1' => '回答' ); $inq_detail = sp4inq_get_one($this->db,$p['id'],$p['use_inq']); $all_history = sp4inq_history($this->db,$p['id'],$p['use_inq']); $template->setVariable('inq_no',$inq_detail['no']); $template->setVariable('inq_title',$inq_detail['title']); for($i=0;$isetCurrentBlock('__Inq__'); $template->setVariable('inq_date',$all_history[$i]['upd_date']); $template->setVariable('type',$type_arr[$all_history[$i]['type']]); //- 再問合せURL部分を切り落とす $content = $all_history[$i]['content']; $trush_pos = strpos($content,"http://"); if($trush_pos){ $content = substr($content,0,$trush_pos); } $template->setVariable('inq_body',$content); $template->parseCurrentBlock(); } //--- 商品問合せ処理 if(!empty($p['p_no']) && empty($p['mode'])){ $this->db = cs4_open(); //-- ジャンル配列 $gnr_name_arr = array( '12' => array('rice','厳選日本のお米100選'), '11' => array('water','世界の銘水100選'), '13' => array('spice','究極の調味料'), '14' => array('kitchen','キッチングッズ'), '15' => array('oishu','五つ星のお取寄せ'), '16' => array('oishu','五つ星のお取寄せ') ); $item_detail = get_item_detail($this->db,$p['p_no'],1); $pdc_detail = get_producer_detail($this->db,$item_detail['pdc_no']); $dir_name = $gnr_name_arr[substr($item_detail['p_gnr'],0,2)][0]; $back_url = sprintf("/%s/%s_detail.php?p[p_no]=%d",$dir_name,$dir_name,$item_detail['uniq_id']); $back_url_footer = sprintf("/%s/%s_top.php",$dir_name,$dir_name); //- ページタイトル $template->setCurrentBlock('__ItemHeader__'); $template->setVariable('inq_header',sprintf("%s%s",$pdc_detail['pdc_nm'],$item_detail['p_nm'])); $template->parseCurrentBlock(); //- 商品番号 $template->setCurrentBlock('__ItemNo__'); $template->setVariable('p_no',$p['p_no']); $template->parseCurrentBlock(); //- 商品詳細戻り $template->setCurrentBlock('__BacktoItem__'); $template->setVariable('detail_url',$back_url); $template->parseCurrentBlock(); //- 商品トップ戻り $template->setCurrentBlock('__ItemFooter__'); $template->setVariable('return_url',$back_url_footer); $template->setVariable('return_page',$gnr_name_arr[substr($item_detail['p_gnr'],0,2)][1]); $template->parseCurrentBlock(); cs4_close($this->db); }else{ if(!empty($p['p_no']) && !empty($p['mode'])){ $template->setVariable('inq_target','ご購入商品お問合せ'); $template->TouchBlock('__PurchaseHeader__'); $template->setCurrentBlock('__Mode__'); $template->setVariable('mode',$p['mode']); $template->parseCurrentBlock(); //- 商品番号 $template->setCurrentBlock('__ItemNo__'); $template->setVariable('p_no',$p['p_no']); $template->parseCurrentBlock(); }else{ $template->TouchBlock('__SiteHeader__'); $template->setVariable('inq_target','美食総合倶楽部'); } $template->HideBlock('__BacktoItem__'); $template->HideBlock('__ItemFooter__'); $template->TouchBlock('__SupportFooter__'); } $template->setCurrentBlock('__ReInq__'); $template->setVariable('inq_id',$inq_detail['id']); if(!empty($p['body'])){ $template->setVariable('reinq_body',$p['body']); } $template->parseCurrentBlock(); $template->show(); sp4inq_close($this->db); } support_history_list( $p ); ?>