「[EC-CUBE]お問い合わせメールを管理画面で確認できるようにする」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
[EC-CUBE]お問い合わせメールを管理画面で確認できるようにする
1.テーブルを追加
お問い合わせを保存するテーブルを追加する。
テーブル名:dtb_inquiry
以下のSQLを発行し、テーブルをCREATEする。
#highlight(linenumber){{
create table dtb_contact (
contact_id serial NOT NULL,
name text,
name_f text,
zip01 text,
zip02 text,
pref integer,
addr01 text,
tel01 text,
tel02 text,
tel03 text,
email text,
message text,
create_date timestamp,
del_flg integer DEFAULT 0,
customer_id integer,
status integer DEFAULT 0
);
}}
作成したテーブルに対して一意性制約を加える。
alter table dtb_contact add constraint dtb_contact_contact_id_key unique (contact_id);
2.INSERT文の作成。
お問い合わせのページのクラスを編集してINSERTのための処理を追記する。
/data/class/pages/contact/LC_Page_Contact.php
以下のメソッドを追加。
#highlight(linenumber,php){{
// データベースへお問い合わせ内容を追加する
function IfRegistContactData(){
$sqlval = array();
$objQuery = new SC_Query();
$sqlval['name'] = $this->arrForm['name01'];
$sqlval['name_f'] = $this->arrForm['name02'];
$sqlval['email'] = $this->arrForm['email'];
$sqlval['zip01'] = $this->arrForm['zip01'];
$sqlval['zip02'] = $this->arrForm['zip02'];
$sqlval['pref'] = $this->arrForm['pref'];
$sqlval['addr01'] = $this->arrForm['addr01'];
$sqlval['tel01'] = $this->arrForm['tel01'];
$sqlval['tel02'] = $this->arrForm['tel02'];
$sqlval['tel03'] = $this->arrForm['tel03'];
$sqlval['message'] = $this->arrForm['contents'];
$sqlval['create_date'] = 'Now()';
if(!empty($this->arrData['customer_id'])){
$sqlval['customer_id'] = $this->arrForm['customer_id'];
}
$objQuery->insert("dtb_contact", $sqlval);
}
}}
complete時に上記メソッドを呼び出す。(122行目あたり)
#highlight(linenumber,php){{
case 'complete':
$this->arrForm = $_POST;
$this->arrForm['email'] = strtolower($_POST['email']);
$this->arrForm = $this->lfConvertParam($this->arrForm,$arrConvertColumn);
$this->arrErr = $this->lfErrorCheck($this->arrForm);
$this->lfRegistContactData(); //追加
if(!$this->arrErr) {
$this->lfSendMail($CONF, $this);
// 完了ページへ移動する
$this->sendRedirect($this->getLocation("./complete.php", array(), true));
exit;
} else {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
break;
}}
ここまででDBへの登録が可能になる。
3.お問い合わせ内容の表示
以下の4ファイルを新規作成する。
※ただし、4ファイルとも同じディレクトリにあるedit.php(.tpl)をコピーして作成すること。
/html/admin/customer/contact.php
/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Ex.php
/data/class/pages/admin/customer/LC_Page_Admin_Customer_Contact.php
/data/Smarty/templates/default/admin/customer/contact.tpl
contact.php
LC_Page_Admin_Customer_Edit_Ex となっている箇所を LC_Page_Admin_Customer_Contact_Ex に変更
#highlight(linenumber,php){{
<?php
// {{{ requires
require_once("../../require.php");
require_once(CLASS_EX_PATH . "page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Ex.php");
// }}}
// {{{ generate page
$objPage = new LC_Page_Admin_Customer_Contact_Ex();
register_shutdown_function(array($objPage, "destroy"));
$objPage->init();
$objPage->process();
?>
}}
LC_Page_Admin_Customer_Contact_Ex.php
このファイルも、Customer_Edit となっているところを Customer_Contact に変更
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH . "pages/admin/customer/LC_Page_Admin_Customer_Contact.php");
/**
* お問い合わせ のページクラス(拡張).
*
* LC_Page_Admin_Customer_Contact をカスタマイズする場合はこのクラスを編集する.
* @version $Id$
*/
class LC_Page_Admin_Customer_Contact_Ex extends LC_Page_Admin_Customer_Contact {
/**
* Page を初期化する.
*
* @return void
*/
function init() {
parent::init();
}
/**
* Page のプロセス.
*
* @return void
*/
function process() {
parent::process();
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
}
?>
}}
LC_Page_Admin_Customer_Contact.php
このファイルはすべて書き直し。
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH. "pages/LC_Page.php");
class LC_Page_Admin_Customer_Contact extends LC_Page{
function init(){
parent::init();
$this->tpl_mainpage = 'customer/contact.tpl';
$this->tpl_subnavi = 'customer/subnavi.tpl';
$this->tpl_mainno = 'customer';
$this->tpl_subno = 'contact';
$this->tpl_pager = TEMPLATE_DIR. 'admin/pager.tpl';
$this->tpl_subtitle = 'お問い合わせ管理';
$masterData = new SC_DB_MasterData_Ex();
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->arrPageMax = $masterData->getMasterData("mtb_page_max");
}
/**
* Page のプロセス.
*
*@return void
*/
function process(){
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objDb = new SC_Helper_DB_Ex();
$objSess = new SC_Session();
//ページ送り用
$this->arrHidden['search_pageno'] =
isset($_POST['search_pageno'])? $_POST['search_pageno']: "";
//認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if(!isset($_POST['mode']))$_POST['mode']= "";
if($_POST['mode'] == 'delete'){
if(SC_Utils_Ex::sfIsInt($_POST['contact_id'])){
$objQuery = new SC_Query();
$where = "contact_id = ?";
$sqlval['del_flg'] = '1';
$objQuery->update("dtb_contact", $sqlval, $where, array($_POST['contact_id']));
}
}
$order = "create_date DESC";
//読み込む列とテーブルの指定
$col = "*";
$from = "dtb_contact";
$where = "del_flg = 0";
$objQuery = new SC_Query();
//行数の取得
$linemax = $objQuery->count($from, $where);
$this->tpl_linemax = $linemax; //何件が該当しました。表示用
//ページ送りの処理
if(is_numeric($_POST['search_page_max'])){
$page_max = $_POST['search_page_max'];
}else{
$page_max = SEARCH_PMAX;
}
//ページ送りの取得
$objNavi= new SC_PageNavi($this->arrHidden['search_pageno'],
$linemax, $page_max,
"fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
//取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
//表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrResults = $objQuery->select($col, $from, $where);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
}
?>
}}
contact.tpl
表示用テンプレ。これも丸ごと書き換える。
#highlight(linenumber,html){{
<!--★★メインコンテンツ★★-->
<table width="878" border="0" cellspacing="0" cellpadding="0" summary="">
<tr valign="top">
<td background="<!--{$TPL_DIR}-->img/contents/navi_bg.gif" height="443">
<!--サブナビ -->
<!--{include file=$tpl_subnavi}-->
</td>
<td class="mainbg">
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<!--メインエリア-->
<tr>
<td align="center">
<!--★★メインコンテンツ★★-->
<!--{if count($arrErr) == 0 }-->
<!--★★検索結果一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="contact_id" value="">
<!--{foreach key=key item=item from=$arrHidden}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->">
<!--{/foreach}-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td colspan="2"><img src="<!--{$TPL_DIR}-->img/contents/search_line.jpg" width="737" height="12" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td>
<!--検索結果-->
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_top.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_top_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_top.gif" width="22" height="5" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_middle.gif" width="22" height="12" alt=""></td>
<td bgcolor="#393a48" class="white10">検索結果一覧 <span class="reselt"><!--検索結果数--><!--{$tpl_linemax}-->件</span> が該当しました。</td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="22" height="8" alt=""></td>
</tr>
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_bottom.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_bottom_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_bottom.gif" width="22" height="5" alt=""></td>
</tr>
</table>
<!--検索結果-->
</td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td bgcolor="#f0f0f0" align="center">
<!--{if count($arrResults) > 0}-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td height="12"></td></tr>
<tr>
<td bgcolor="#cccccc">
<!--検索結果表示テーブル-->
<table class="fs12" width="100%" border="0" cellspacing="1" cellpadding="3" summary="" bgcolor="#cccccc">
<tr align="center" bgcolor="#636469" STYLE="color:#ffffff;">
<td rowspan="2">状況</td>
<td>名前</td>
<td rowspan="2">内容</td>
<td>メールアドレス</td>
<td rowspan="2">受信日時</td>
<td rowspan="2">住所</td>
<td rowspan="2">操作</td>
</tr>
<tr align="center" bgcolor="#636469" STYLE="color:#ffffff;">
<td>会員ID</td>
<td>TEL</td>
</tr>
<!--{foreach from=$arrResults key=k item=v}-->
<tr bgcolor="#ffffff">
<td align="center" rowspan="2"
<a href = "./contact_detail.php?id=<!--{ $v.contact_id }-->">
<!--{ if $v.status == 0 }-->
<span STYLE="color:red; font-weight:bold;">未読</span>
<!--{ elseif $v.status == 1 }-->
既読
<!--{ elseif $v.status == 2 }-->
対応中
<!--{ elseif $v.status == 3 }-->
対応済
<!--{ /if }-->
</a>
</td>
<td><!--{ $v.name }--><!--{ $v.name_f }-->様</td>
<td rowspan="2">
<a href = "./contact_detail.php?contact_id=<!--{ $v.contact_id }-->">
<!--{ $v.message|truncate:30}-->
</a>
</td>
<td><!--{mailto address=$v.email encode="javascript"}--></td>
<td rowspan="2"><!--{ $v.create_date|sfDispDBDate}--></td>
<td rowspan="2">〒<!--{ $v.zip01 }-->-<!--{ $v.zip02 }--><br><!--{$arrPref[$v.pref]}--><!--{ $v.addr01 }--></td>
<td align="center">
<span class="icon_mail">
<a href= "./mail.php?contact_id=<!--{ $v.contact_id }-->">
返信
</a>
</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right"><!--{ if $v.customer_id }--><!--{ $v.customer_id }--><!--{ else }-->非会員<!--{ /if }--></td>
<td><!--{ $v.tel01 }-->-<!--{ $v.tel02 }-->-<!--{ $v.tel03 }--></td>
<td align="center">
<!--{ if $v.del_flg == 0 }-->
<span class="icon_delete">
<a href = "<!--{$smarty.server.PHP_SELF|escape}-->"
onclick= "fnModeSubmit('delete', 'contact_id', <!--{ $v.contact_id }-->);
return false;">
削除
</a>
</span>
<!--{ elseif $v.del_flg == 1 }-->
保護
<!--{ /if }-->
</td>
</tr>
<!--{ /foreach }-->
</table>
<!--検索結果表示テーブル-->
</td>
</tr>
</table>
<!--{/if}-->
</td>
</tr>
</table>
<!--★★検索結果一覧★★-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
</form>
<!--{/if}-->
</td>
</tr>
<!--メインエリア-->
</table>
</td>
</tr>
</table>
subnavi.tpl
contact.tplと同じディレクトリにあるsubnavi.tplの
左ナビに「お問合わせ管理」を追加。
<table width="141" border="0" cellspacing="0" cellpadding="0" summary=" " id="menu_navi">
<!--ナビ-->
<tr><td class=<!--{if $tpl_subno != 'index'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./index.php" onMouseOver="naviStyleChange('index', '#a5a5a5')" <!--{if $tpl_subno != 'index'}-->onMouseOut="naviStyleChange('index', '#636469')"<!--{/if}--> id="index"><img src="<!--{$TPL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">顧客マスタ</span></a></td></tr>
<tr><td><img src="<!--{$TPL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr>
<!--以下を追加-->
<tr><td class=<!--{if $tpl_subno != 'contact'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./contact.php" onMouseOver="naviStyleChange('contact', '#a5a5a5')" <!--{if $tpl_subno != 'contact'}-->onMouseOut="naviStyleChange('contact', '#636469')"<!--{/if}--> id="contact"><img src="<!--{$TPL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">お問い合わせ管理</span></a></td></tr>
<tr><td><img src="<!--{$TPL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr>
<!--ここまで-->
<!--ナビ-->
</table>
}}
詳細表示できるようにさらに実装する。
お問合わせ詳細表示
以下のファイルを新規作成する。
/html/admin/customer/contact_detail.php
/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Detail_Ex.php
/data/class/pages/admin/customer/LC_Page_Admin_Customer_Contact_Detail.php
/data/Smarty/templates/default/admin/customer/contact_detail.tpl
contact_detail.php
#highlight(linenumber,php){{
<?php
require_once("../../require.php");
require_once(CLASS_EX_PATH . "page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Detail_Ex.php");
$objPage = new LC_Page_Admin_Customer_Contact_Detail_Ex();
register_shutdown_function(array($objPage, "destroy"));
$objPage->init();
$objPage->process();
?>
}}
LC_Page_Admin_Customer_Contact_Detail_Ex.php
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH . "pages/admin/customer/LC_Page_Admin_Customer_Contact_Detail.php");
/**
* お問い合わせ詳細確認 のページクラス(拡張).
*
* LC_Page_Admin_Customer_Contact_Detail をカスタマイズする場合はこのクラスを編集する.
*
* @package Page
* @version $Id$
*/
class LC_Page_Admin_Customer_Contact_Detail_Ex extends LC_Page_Admin_Customer_Contact_Detail {
/**
* Page を初期化する.
*
* @return void
*/
function init() {
parent::init();
}
/**
* Page のプロセス.
*
* @return void
*/
function process() {
parent::process();
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
}
?>
}}
//
<script type="text/javascript">
<!--
function fnReturn() {
document.form_search.action = './contact.php';
document.form_search.submit();
return false;
}
function fnContactidSubmit(toiawase_id, toiawase_id_value) {
if(toiawase_id != "" && toiawase_id_value != "") {
document.form2[toiawase_id].value = toiawase_id_value;
}
document.form2.action = '../contact/contact_edit.php';
document.form2.submit();
}
//-->
</script>
<!--★★メインコンテンツ★★-->
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<form name="form2" id="form2" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="confirm">
<input type="hidden" name="edit_contact" value="<!--{$tpl_edit_contact}-->">
<input type="hidden" name="toiawase_id" value="<!--{$list_data.contact_id|escape}-->">
<tr valign="top">
<td background="<!--{$TPL_DIR}-->img/contents/navi_bg.gif" height="402">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</td>
<td class="mainbg">
<!--▼登録テーブルここから-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary=" ">
<!--メインエリア-->
<tr>
<td align="center">
<table width="706" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td height="14"></td></tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_top.jpg" width="706" height="14" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/main_left.jpg"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td>
<td bgcolor="#cccccc">
<table width="678" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_top.gif" width="678" height="7" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td>
<td bgcolor="#636469" width="638" class="fs14n"><span class="white"><!--コンテンツタイトル-->問合せ詳細</span></td>
<td background="<!--{$TPL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_bottom.gif" width="678" height="7" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_bar.jpg" width="678" height="10" alt=""></td>
</tr>
</table>
<table width="678" border="0" cellspacing="1" cellpadding="8" summary=" ">
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">顧客ID</td>
<td bgcolor="#ffffff" width="" align="center">
<!--{if $list_data.customer_id}-->
<!--{$list_data.customer_id|escape}-->
<!--{else}-->
非会員
<!--{/if}-->
</td>
<td bgcolor="#f2f1ec" width="100">状態</td>
<td bgcolor="#ffffff" width="" align="center">
<!--{if $list_data.del_flg == 0}-->
<input type="checkbox" name="del_flg" value=1 id="del_flg" /><label for="del_flg">保護</label>
<!--{else}-->
保護
<!--{/if}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">お名前</td>
<td bgcolor="#ffffff" width="">
<!--{$list_data.name|escape}--> <!--{$list_data.name_f|escape}--> 様
</td>
<td bgcolor="#f2f1ec" width="100">対応状況</td>
<td bgcolor="#ffffff" width="" align="center">
<select name="status" id="status">
<option value="1" <!--{if $list_data.status eq 1}-->selected="selected"<!--{/if}--> >既読</option>
<option value="2" <!--{if $list_data.status eq 2}-->selected="selected"<!--{/if}--> >対応中</option>
<option value="3" <!--{if $list_data.status eq 3}-->selected="selected"<!--{/if}--> >対応済</option>
</select>
</td>
</tr>
<tr class="fs12">
<td bgcolor="#f2f1ec" width="100">ご住所</td>
<td bgcolor="#ffffff" colspan="3">
〒 <!--{$list_data.zip01|escape}--> - <!--{$list_data.zip02|escape}-->
<!--{$arrPref[$list_data.pref]}--><!--{$list_data.addr01|escape}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">メールアドレス</td>
<td bgcolor="#ffffff" width=""><!--{$list_data.email|escape}--></td>
<td bgcolor="#f2f1ec" width="100">電話番号</td>
<td bgcolor="#ffffff" width=""><!--{$list_data.tel01|escape}-->-<!--{$list_data.tel02|escape}-->-<!--{$list_data.tel03|escape}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="" align="center" colspan="4">問い合わせ内容</td>
</tr>
<tr>
<td bgcolor="#ffffff" width="" class="fs10n" colspan="4"><span class="red12"><!--{$arrErr.note}--></span>
<!--{$list_data.message|escape|nl2br}-->
</td>
</tr>
<tr class="fs12n">
</tr>
</table>
<table width="678" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/tbl_top.gif" width="676" height="7" alt=""></td>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
</tr>
<tr>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td>
<td bgcolor="#e9e7de" align="center">
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td>
<!--▼検索結果へ戻る-->
<a href="./contact.php" onmouseover="chgImg('<!--{$TPL_DIR}-->img/contents/btn_search_back_on.jpg','back');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/contents/btn_search_back.jpg','back');" onclick="return fnReturn();"><img src="<!--{$TPL_DIR}-->img/contents/btn_search_back.jpg" width="123" height="24" alt="検索画面に戻る" border="0" name="back"></a>
<!--▲検索結果へ戻る-->
<a href="./contact.php" onMouseover="chgImgImageSubmit('<!--{$TPL_DIR}-->img/contents/btn_confirm_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$TPL_DIR}-->img/contents/btn_confirm.jpg',this)"><img src="<!--{$TPL_DIR}-->img/contents/btn_confirm.jpg" width="123" height="24" alt="確認ページへ" border="0" name="subm" >
</td>
</tr>
</table>
</td>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/tbl_bottom.gif" width="678" height="8" alt=""></td>
</tr>
</table>
</td>
<td background="<!--{$TPL_DIR}-->img/contents/main_right.jpg"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_bottom.jpg" width="706" height="14" alt=""></td>
</tr>
<tr><td height="30"></td></tr>
</table>
</td>
</tr>
<!--メインエリア-->
</table>
<!--▲登録テーブルここまで-->
</td>
</tr>
</form>
</table>
<!--★★メインコンテンツ★★-->
<!--★★問い合わせ履歴一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->?toiawase_id=<!--{$list_data.toiawase_id}-->">
<input type="hidden" name="mode" value="">
<input type="hidden" name="toiawase_id" value="<!--{$list_data.toiawase_id}-->">
<input type="hidden" name="search_pageno" value="<!--{$tpl_pageno}-->">
<input type="hidden" name="edit_customer_id" value="<!--{$list_data.customer_id}-->" >
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td colspan="2"><img src="<!--{$TPL_DIR}-->img/contents/search_line.jpg" width="878" height="12" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td>
<!--問い合わせ履歴一覧-->
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_top.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_top_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_top.gif" width="22" height="5" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_middle.gif" width="22" height="12" alt=""></td>
<td bgcolor="#393a48" class="white10">問合せ履歴一覧 <span class="reselt"><!--問合せ履歴一覧--><!--{$tpl_linemax}-->件</span> が該当しました。</td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="22" height="8" alt=""></td>
</tr>
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_bottom.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_bottom_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_bottom.gif" width="22" height="5" alt=""></td>
</tr>
</table>
<!--問い合わせ履歴一覧-->
</td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
</form>
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td bgcolor="#f0f0f0" align="center">
<table width="840" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td height="12"></td></tr>
<tr>
<!--{if $tpl_linemax > 0}-->
<td bgcolor="#cccccc">
<!--問い合わせ履歴一覧テーブル-->
<table width="840" border="0" cellspacing="1" cellpadding="5" summary=" ">
<tr bgcolor="#636469" align="center" class="fs10n">
<td width="160"><span class="white">日付</span></td>
<td width="140"><span class="white">問合せ番号</span></td>
<td width="140"><span class="white">内容</span></td>
<td width="160"><span class="white">状態</span></td>
<td width="140"><span class="white">対応状況</span></td>
</tr>
<!--{section name=cnt loop=$arrPurchaseHistory}-->
<tr bgcolor="#ffffff" align="center" class="fs12">
<td width=""><!--{$arrPurchaseHistory[cnt].create_date|sfDispDBDate}--></td>
<td width=""><a href="contact_detail.php?contact_id=<!--{$arrPurchaseHistory[cnt].contact_id}-->"><!--{$arrPurchaseHistory[cnt].contact_id}--></a></td>
<td width=""><!--{$arrPurchaseHistory[cnt].message|truncate:40}--></td>
<td width="">
<!--{if $arrPurchaseHistory[cnt].del_flg eq 1}-->
保護
<!--{else}-->
削除可
<!--{ /if }-->
</td>
<td width="">
<!--{if $arrPurchaseHistory[cnt].status eq 1}-->
既読
<!--{elseif $arrPurchaseHistory[cnt].status eq 2}-->
対応中
<!--{elseif $arrPurchaseHistory[cnt].status eq 3}-->
対応済
<!--{else}-->
未読
<!--{ /if }-->
</td>
</tr>
<!--{/section}-->
</table>
<!--問い合わせ履歴一覧テーブル-->
</td>
<!--{else}-->
<td align="center" class="fs12">問い合わせ履歴はありません。</td>
<!--{/if}-->
</tr>
</table>
</td>
</tr>
</table>
<!--★★検索結果一覧★★-->
/
配信されるメールのテンプレート場所
[DocumentRoot]/html/eccube/data/Smarty/templates/default/mail_templates
[EC-CUBE]お問い合わせメールを管理画面で確認できるようにする
1.テーブルを追加
お問い合わせを保存するテーブルを追加する。
テーブル名:dtb_inquiry
以下のSQLを発行し、テーブルをCREATEする。
#highlight(linenumber){{
create table dtb_contact (
contact_id serial NOT NULL,
name text,
name_f text,
zip01 text,
zip02 text,
pref integer,
addr01 text,
tel01 text,
tel02 text,
tel03 text,
email text,
message text,
create_date timestamp,
del_flg integer DEFAULT 0,
customer_id integer,
status integer DEFAULT 0
);
}}
作成したテーブルに対して一意性制約を加える。
alter table dtb_contact add constraint dtb_contact_contact_id_key unique (contact_id);
2.INSERT文の作成。
お問い合わせのページのクラスを編集してINSERTのための処理を追記する。
/data/class/pages/contact/LC_Page_Contact.php
以下のメソッドを追加。
#highlight(linenumber,php){{
// データベースへお問い合わせ内容を追加する
function IfRegistContactData(){
$sqlval = array();
$objQuery = new SC_Query();
$sqlval['name'] = $this->arrForm['name01'];
$sqlval['name_f'] = $this->arrForm['name02'];
$sqlval['email'] = $this->arrForm['email'];
$sqlval['zip01'] = $this->arrForm['zip01'];
$sqlval['zip02'] = $this->arrForm['zip02'];
$sqlval['pref'] = $this->arrForm['pref'];
$sqlval['addr01'] = $this->arrForm['addr01'];
$sqlval['tel01'] = $this->arrForm['tel01'];
$sqlval['tel02'] = $this->arrForm['tel02'];
$sqlval['tel03'] = $this->arrForm['tel03'];
$sqlval['message'] = $this->arrForm['contents'];
$sqlval['create_date'] = 'Now()';
if(!empty($this->arrData['customer_id'])){
$sqlval['customer_id'] = $this->arrForm['customer_id'];
}
$objQuery->insert("dtb_contact", $sqlval);
}
}}
complete時に上記メソッドを呼び出す。(122行目あたり)
#highlight(linenumber,php){{
case 'complete':
$this->arrForm = $_POST;
$this->arrForm['email'] = strtolower($_POST['email']);
$this->arrForm = $this->lfConvertParam($this->arrForm,$arrConvertColumn);
$this->arrErr = $this->lfErrorCheck($this->arrForm);
$this->lfRegistContactData(); //追加
if(!$this->arrErr) {
$this->lfSendMail($CONF, $this);
// 完了ページへ移動する
$this->sendRedirect($this->getLocation("./complete.php", array(), true));
exit;
} else {
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
break;
}}
ここまででDBへの登録が可能になる。
3.お問い合わせ内容の表示
以下の4ファイルを新規作成する。
※ただし、4ファイルとも同じディレクトリにあるedit.php(.tpl)をコピーして作成すること。
/html/admin/customer/contact.php
/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Ex.php
/data/class/pages/admin/customer/LC_Page_Admin_Customer_Contact.php
/data/Smarty/templates/default/admin/customer/contact.tpl
contact.php
LC_Page_Admin_Customer_Edit_Ex となっている箇所を LC_Page_Admin_Customer_Contact_Ex に変更
#highlight(linenumber,php){{
<?php
// {{{ requires
require_once("../../require.php");
require_once(CLASS_EX_PATH . "page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Ex.php");
// }}}
// {{{ generate page
$objPage = new LC_Page_Admin_Customer_Contact_Ex();
register_shutdown_function(array($objPage, "destroy"));
$objPage->init();
$objPage->process();
?>
}}
LC_Page_Admin_Customer_Contact_Ex.php
このファイルも、Customer_Edit となっているところを Customer_Contact に変更
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH . "pages/admin/customer/LC_Page_Admin_Customer_Contact.php");
/**
* お問い合わせ のページクラス(拡張).
*
* LC_Page_Admin_Customer_Contact をカスタマイズする場合はこのクラスを編集する.
* @version $Id$
*/
class LC_Page_Admin_Customer_Contact_Ex extends LC_Page_Admin_Customer_Contact {
/**
* Page を初期化する.
*
* @return void
*/
function init() {
parent::init();
}
/**
* Page のプロセス.
*
* @return void
*/
function process() {
parent::process();
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
}
?>
}}
LC_Page_Admin_Customer_Contact.php
このファイルはすべて書き直し。
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH. "pages/LC_Page.php");
class LC_Page_Admin_Customer_Contact extends LC_Page{
function init(){
parent::init();
$this->tpl_mainpage = 'customer/contact.tpl';
$this->tpl_subnavi = 'customer/subnavi.tpl';
$this->tpl_mainno = 'customer';
$this->tpl_subno = 'contact';
$this->tpl_pager = TEMPLATE_DIR. 'admin/pager.tpl';
$this->tpl_subtitle = 'お問い合わせ管理';
$masterData = new SC_DB_MasterData_Ex();
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->arrPageMax = $masterData->getMasterData("mtb_page_max");
}
/**
* Page のプロセス.
*
*@return void
*/
function process(){
$conn = new SC_DBConn();
$objView = new SC_AdminView();
$objDb = new SC_Helper_DB_Ex();
$objSess = new SC_Session();
//ページ送り用
$this->arrHidden['search_pageno'] =
isset($_POST['search_pageno'])? $_POST['search_pageno']: "";
//認証可否の判定
SC_Utils_Ex::sfIsSuccess($objSess);
if(!isset($_POST['mode']))$_POST['mode']= "";
if($_POST['mode'] == 'delete'){
if(SC_Utils_Ex::sfIsInt($_POST['contact_id'])){
$objQuery = new SC_Query();
$where = "contact_id = ?";
$sqlval['del_flg'] = '1';
$objQuery->update("dtb_contact", $sqlval, $where, array($_POST['contact_id']));
}
}
$order = "create_date DESC";
//読み込む列とテーブルの指定
$col = "*";
$from = "dtb_contact";
$where = "del_flg = 0";
$objQuery = new SC_Query();
//行数の取得
$linemax = $objQuery->count($from, $where);
$this->tpl_linemax = $linemax; //何件が該当しました。表示用
//ページ送りの処理
if(is_numeric($_POST['search_page_max'])){
$page_max = $_POST['search_page_max'];
}else{
$page_max = SEARCH_PMAX;
}
//ページ送りの取得
$objNavi= new SC_PageNavi($this->arrHidden['search_pageno'],
$linemax, $page_max,
"fnNaviSearchPage", NAVI_PMAX);
$startno = $objNavi->start_row;
$this->arrPagenavi = $objNavi->arrPagenavi;
//取得範囲の指定(開始行番号、行数のセット)
$objQuery->setlimitoffset($page_max, $startno);
//表示順序
$objQuery->setorder($order);
//検索結果の取得
$this->arrResults = $objQuery->select($col, $from, $where);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
}
}
?>
}}
contact.tpl
表示用テンプレ。これも丸ごと書き換える。
#highlight(linenumber,html){{
<!--★★メインコンテンツ★★-->
<table width="878" border="0" cellspacing="0" cellpadding="0" summary="">
<tr valign="top">
<td background="<!--{$TPL_DIR}-->img/contents/navi_bg.gif" height="443">
<!--サブナビ -->
<!--{include file=$tpl_subnavi}-->
</td>
<td class="mainbg">
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<!--メインエリア-->
<tr>
<td align="center">
<!--★★メインコンテンツ★★-->
<!--{if count($arrErr) == 0 }-->
<!--★★検索結果一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="contact_id" value="">
<!--{foreach key=key item=item from=$arrHidden}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->">
<!--{/foreach}-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td colspan="2"><img src="<!--{$TPL_DIR}-->img/contents/search_line.jpg" width="737" height="12" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td>
<!--検索結果-->
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_top.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_top_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_top.gif" width="22" height="5" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_middle.gif" width="22" height="12" alt=""></td>
<td bgcolor="#393a48" class="white10">検索結果一覧 <span class="reselt"><!--検索結果数--><!--{$tpl_linemax}-->件</span> が該当しました。</td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="22" height="8" alt=""></td>
</tr>
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_bottom.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_bottom_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_bottom.gif" width="22" height="5" alt=""></td>
</tr>
</table>
<!--検索結果-->
</td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td bgcolor="#f0f0f0" align="center">
<!--{if count($arrResults) > 0}-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td height="12"></td></tr>
<tr>
<td bgcolor="#cccccc">
<!--検索結果表示テーブル-->
<table class="fs12" width="100%" border="0" cellspacing="1" cellpadding="3" summary="" bgcolor="#cccccc">
<tr align="center" bgcolor="#636469" STYLE="color:#ffffff;">
<td rowspan="2">状況</td>
<td>名前</td>
<td rowspan="2">内容</td>
<td>メールアドレス</td>
<td rowspan="2">受信日時</td>
<td rowspan="2">住所</td>
<td rowspan="2">操作</td>
</tr>
<tr align="center" bgcolor="#636469" STYLE="color:#ffffff;">
<td>会員ID</td>
<td>TEL</td>
</tr>
<!--{foreach from=$arrResults key=k item=v}-->
<tr bgcolor="#ffffff">
<td align="center" rowspan="2"
<a href = "./contact_detail.php?id=<!--{ $v.contact_id }-->">
<!--{ if $v.status == 0 }-->
<span STYLE="color:red; font-weight:bold;">未読</span>
<!--{ elseif $v.status == 1 }-->
既読
<!--{ elseif $v.status == 2 }-->
対応中
<!--{ elseif $v.status == 3 }-->
対応済
<!--{ /if }-->
</a>
</td>
<td><!--{ $v.name }--><!--{ $v.name_f }-->様</td>
<td rowspan="2">
<a href = "./contact_detail.php?contact_id=<!--{ $v.contact_id }-->">
<!--{ $v.message|truncate:30}-->
</a>
</td>
<td><!--{mailto address=$v.email encode="javascript"}--></td>
<td rowspan="2"><!--{ $v.create_date|sfDispDBDate}--></td>
<td rowspan="2">〒<!--{ $v.zip01 }-->-<!--{ $v.zip02 }--><br><!--{$arrPref[$v.pref]}--><!--{ $v.addr01 }--></td>
<td align="center">
<span class="icon_mail">
<a href= "./mail.php?contact_id=<!--{ $v.contact_id }-->">
返信
</a>
</span>
</td>
</tr>
<tr bgcolor="#ffffff">
<td align="right"><!--{ if $v.customer_id }--><!--{ $v.customer_id }--><!--{ else }-->非会員<!--{ /if }--></td>
<td><!--{ $v.tel01 }-->-<!--{ $v.tel02 }-->-<!--{ $v.tel03 }--></td>
<td align="center">
<!--{ if $v.del_flg == 0 }-->
<span class="icon_delete">
<a href = "<!--{$smarty.server.PHP_SELF|escape}-->"
onclick= "fnModeSubmit('delete', 'contact_id', <!--{ $v.contact_id }-->);
return false;">
削除
</a>
</span>
<!--{ elseif $v.del_flg == 1 }-->
保護
<!--{ /if }-->
</td>
</tr>
<!--{ /foreach }-->
</table>
<!--検索結果表示テーブル-->
</td>
</tr>
</table>
<!--{/if}-->
</td>
</tr>
</table>
<!--★★検索結果一覧★★-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary="">
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary="">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
</form>
<!--{/if}-->
</td>
</tr>
<!--メインエリア-->
</table>
</td>
</tr>
</table>
subnavi.tpl
contact.tplと同じディレクトリにあるsubnavi.tplの
左ナビに「お問合わせ管理」を追加。
<table width="141" border="0" cellspacing="0" cellpadding="0" summary=" " id="menu_navi">
<!--ナビ-->
<tr><td class=<!--{if $tpl_subno != 'index'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./index.php" onMouseOver="naviStyleChange('index', '#a5a5a5')" <!--{if $tpl_subno != 'index'}-->onMouseOut="naviStyleChange('index', '#636469')"<!--{/if}--> id="index"><img src="<!--{$TPL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">顧客マスタ</span></a></td></tr>
<tr><td><img src="<!--{$TPL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr>
<!--以下を追加-->
<tr><td class=<!--{if $tpl_subno != 'contact'}-->"navi"<!--{else}-->"navi-on"<!--{/if}-->><a href="./contact.php" onMouseOver="naviStyleChange('contact', '#a5a5a5')" <!--{if $tpl_subno != 'contact'}-->onMouseOut="naviStyleChange('contact', '#636469')"<!--{/if}--> id="contact"><img src="<!--{$TPL_DIR}-->img/contents/icon.jpg" width="15" height="9" alt="" border="0"><span class="navi_text">お問い合わせ管理</span></a></td></tr>
<tr><td><img src="<!--{$TPL_DIR}-->img/contents/navi_line.gif" width="140" height="2" alt=""></td></tr>
<!--ここまで-->
<!--ナビ-->
</table>
}}
詳細表示できるようにさらに実装する。
お問合わせ詳細表示
以下のファイルを新規作成する。
/html/admin/customer/contact_detail.php
/data/class_extends/page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Detail_Ex.php
/data/class/pages/admin/customer/LC_Page_Admin_Customer_Contact_Detail.php
/data/Smarty/templates/default/admin/customer/contact_detail.tpl
contact_detail.php
#highlight(linenumber,php){{
<?php
require_once("../../require.php");
require_once(CLASS_EX_PATH . "page_extends/admin/customer/LC_Page_Admin_Customer_Contact_Detail_Ex.php");
$objPage = new LC_Page_Admin_Customer_Contact_Detail_Ex();
register_shutdown_function(array($objPage, "destroy"));
$objPage->init();
$objPage->process();
?>
}}
LC_Page_Admin_Customer_Contact_Detail_Ex.php
#highlight(linenumber,php){{
<?php
require_once(CLASS_PATH . "pages/admin/customer/LC_Page_Admin_Customer_Contact_Detail.php");
/**
* お問い合わせ詳細確認 のページクラス(拡張).
*
* LC_Page_Admin_Customer_Contact_Detail をカスタマイズする場合はこのクラスを編集する.
*
* @package Page
* @version $Id$
*/
class LC_Page_Admin_Customer_Contact_Detail_Ex extends LC_Page_Admin_Customer_Contact_Detail {
/**
* Page を初期化する.
*
* @return void
*/
function init() {
parent::init();
}
/**
* Page のプロセス.
*
* @return void
*/
function process() {
parent::process();
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
}
?>
}}
contact_detail.tpl
//
<script type="text/javascript">
<!--
function fnReturn() {
document.form_search.action = './contact.php';
document.form_search.submit();
return false;
}
function fnContactidSubmit(toiawase_id, toiawase_id_value) {
if(toiawase_id != "" && toiawase_id_value != "") {
document.form2[toiawase_id].value = toiawase_id_value;
}
document.form2.action = '../contact/contact_edit.php';
document.form2.submit();
}
//-->
</script>
<!--★★メインコンテンツ★★-->
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<form name="form2" id="form2" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="confirm">
<input type="hidden" name="edit_contact" value="<!--{$tpl_edit_contact}-->">
<input type="hidden" name="toiawase_id" value="<!--{$list_data.contact_id|escape}-->">
<tr valign="top">
<td background="<!--{$TPL_DIR}-->img/contents/navi_bg.gif" height="402">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</td>
<td class="mainbg">
<!--▼登録テーブルここから-->
<table width="737" border="0" cellspacing="0" cellpadding="0" summary=" ">
<!--メインエリア-->
<tr>
<td align="center">
<table width="706" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td height="14"></td></tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_top.jpg" width="706" height="14" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/main_left.jpg"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td>
<td bgcolor="#cccccc">
<table width="678" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_top.gif" width="678" height="7" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td>
<td bgcolor="#636469" width="638" class="fs14n"><span class="white"><!--コンテンツタイトル-->問合せ詳細</span></td>
<td background="<!--{$TPL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/contents_title_bottom.gif" width="678" height="7" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_bar.jpg" width="678" height="10" alt=""></td>
</tr>
</table>
<table width="678" border="0" cellspacing="1" cellpadding="8" summary=" ">
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">顧客ID</td>
<td bgcolor="#ffffff" width="" align="center">
<!--{if $list_data.customer_id}-->
<!--{$list_data.customer_id|escape}-->
<!--{else}-->
非会員
<!--{/if}-->
</td>
<td bgcolor="#f2f1ec" width="100">状態</td>
<td bgcolor="#ffffff" width="" align="center">
<!--{if $list_data.del_flg == 0}-->
<input type="checkbox" name="del_flg" value=1 id="del_flg" /><label for="del_flg">保護</label>
<!--{else}-->
保護
<!--{/if}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">お名前</td>
<td bgcolor="#ffffff" width="">
<!--{$list_data.name|escape}--> <!--{$list_data.name_f|escape}--> 様
</td>
<td bgcolor="#f2f1ec" width="100">対応状況</td>
<td bgcolor="#ffffff" width="" align="center">
<select name="status" id="status">
<option value="1" <!--{if $list_data.status eq 1}-->selected="selected"<!--{/if}--> >既読</option>
<option value="2" <!--{if $list_data.status eq 2}-->selected="selected"<!--{/if}--> >対応中</option>
<option value="3" <!--{if $list_data.status eq 3}-->selected="selected"<!--{/if}--> >対応済</option>
</select>
</td>
</tr>
<tr class="fs12">
<td bgcolor="#f2f1ec" width="100">ご住所</td>
<td bgcolor="#ffffff" colspan="3">
〒 <!--{$list_data.zip01|escape}--> - <!--{$list_data.zip02|escape}-->
<!--{$arrPref[$list_data.pref]}--><!--{$list_data.addr01|escape}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="100">メールアドレス</td>
<td bgcolor="#ffffff" width=""><!--{$list_data.email|escape}--></td>
<td bgcolor="#f2f1ec" width="100">電話番号</td>
<td bgcolor="#ffffff" width=""><!--{$list_data.tel01|escape}-->-<!--{$list_data.tel02|escape}-->-<!--{$list_data.tel03|escape}-->
</td>
</tr>
<tr class="fs12n">
<td bgcolor="#f2f1ec" width="" align="center" colspan="4">問い合わせ内容</td>
</tr>
<tr>
<td bgcolor="#ffffff" width="" class="fs10n" colspan="4"><span class="red12"><!--{$arrErr.note}--></span>
<!--{$list_data.message|escape|nl2br}-->
</td>
</tr>
<tr class="fs12n">
</tr>
</table>
<table width="678" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/tbl_top.gif" width="676" height="7" alt=""></td>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
</tr>
<tr>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td>
<td bgcolor="#e9e7de" align="center">
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td>
<!--▼検索結果へ戻る-->
<a href="./contact.php" onmouseover="chgImg('<!--{$TPL_DIR}-->img/contents/btn_search_back_on.jpg','back');" onmouseout="chgImg('<!--{$TPL_DIR}-->img/contents/btn_search_back.jpg','back');" onclick="return fnReturn();"><img src="<!--{$TPL_DIR}-->img/contents/btn_search_back.jpg" width="123" height="24" alt="検索画面に戻る" border="0" name="back"></a>
<!--▲検索結果へ戻る-->
<a href="./contact.php" onMouseover="chgImgImageSubmit('<!--{$TPL_DIR}-->img/contents/btn_confirm_on.jpg',this)" onMouseout="chgImgImageSubmit('<!--{$TPL_DIR}-->img/contents/btn_confirm.jpg',this)"><img src="<!--{$TPL_DIR}-->img/contents/btn_confirm.jpg" width="123" height="24" alt="確認ページへ" border="0" name="subm" >
</td>
</tr>
</table>
</td>
<td bgcolor="#cccccc"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="10" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/tbl_bottom.gif" width="678" height="8" alt=""></td>
</tr>
</table>
</td>
<td background="<!--{$TPL_DIR}-->img/contents/main_right.jpg"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="14" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="<!--{$TPL_DIR}-->img/contents/main_bottom.jpg" width="706" height="14" alt=""></td>
</tr>
<tr><td height="30"></td></tr>
</table>
</td>
</tr>
<!--メインエリア-->
</table>
<!--▲登録テーブルここまで-->
</td>
</tr>
</form>
</table>
<!--★★メインコンテンツ★★-->
<!--★★問い合わせ履歴一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->?toiawase_id=<!--{$list_data.toiawase_id}-->">
<input type="hidden" name="mode" value="">
<input type="hidden" name="toiawase_id" value="<!--{$list_data.toiawase_id}-->">
<input type="hidden" name="search_pageno" value="<!--{$tpl_pageno}-->">
<input type="hidden" name="edit_customer_id" value="<!--{$list_data.customer_id}-->" >
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td colspan="2"><img src="<!--{$TPL_DIR}-->img/contents/search_line.jpg" width="878" height="12" alt=""></td></tr>
<tr bgcolor="cbcbcb">
<td>
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/search_left.gif" width="19" height="22" alt=""></td>
<td>
<!--問い合わせ履歴一覧-->
<table border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_top.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_top_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_top.gif" width="22" height="5" alt=""></td>
</tr>
<tr>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_left_bg.gif"><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_middle.gif" width="22" height="12" alt=""></td>
<td bgcolor="#393a48" class="white10">問合せ履歴一覧 <span class="reselt"><!--問合せ履歴一覧--><!--{$tpl_linemax}-->件</span> が該当しました。</td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_right_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="22" height="8" alt=""></td>
</tr>
<tr>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_left_bottom.gif" width="22" height="5" alt=""></td>
<td background="<!--{$TPL_DIR}-->img/contents/reselt_bottom_bg.gif"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td>
<td><img src="<!--{$TPL_DIR}-->img/contents/reselt_right_bottom.gif" width="22" height="5" alt=""></td>
</tr>
</table>
<!--問い合わせ履歴一覧-->
</td>
<td><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="8" height="1" alt=""></td>
</tr>
</table>
</td>
<td align="right">
<!--{include file=$tpl_pager}-->
</td>
</tr>
<tr><td bgcolor="cbcbcb" colspan="2"><img src="<!--{$TPL_DIR}-->img/common/_.gif" width="1" height="5" alt=""></td></tr>
</table>
</form>
<table width="878" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr>
<td bgcolor="#f0f0f0" align="center">
<table width="840" border="0" cellspacing="0" cellpadding="0" summary=" ">
<tr><td height="12"></td></tr>
<tr>
<!--{if $tpl_linemax > 0}-->
<td bgcolor="#cccccc">
<!--問い合わせ履歴一覧テーブル-->
<table width="840" border="0" cellspacing="1" cellpadding="5" summary=" ">
<tr bgcolor="#636469" align="center" class="fs10n">
<td width="160"><span class="white">日付</span></td>
<td width="140"><span class="white">問合せ番号</span></td>
<td width="140"><span class="white">内容</span></td>
<td width="160"><span class="white">状態</span></td>
<td width="140"><span class="white">対応状況</span></td>
</tr>
<!--{section name=cnt loop=$arrPurchaseHistory}-->
<tr bgcolor="#ffffff" align="center" class="fs12">
<td width=""><!--{$arrPurchaseHistory[cnt].create_date|sfDispDBDate}--></td>
<td width=""><a href="contact_detail.php?contact_id=<!--{$arrPurchaseHistory[cnt].contact_id}-->"><!--{$arrPurchaseHistory[cnt].contact_id}--></a></td>
<td width=""><!--{$arrPurchaseHistory[cnt].message|truncate:40}--></td>
<td width="">
<!--{if $arrPurchaseHistory[cnt].del_flg eq 1}-->
保護
<!--{else}-->
削除可
<!--{ /if }-->
</td>
<td width="">
<!--{if $arrPurchaseHistory[cnt].status eq 1}-->
既読
<!--{elseif $arrPurchaseHistory[cnt].status eq 2}-->
対応中
<!--{elseif $arrPurchaseHistory[cnt].status eq 3}-->
対応済
<!--{else}-->
未読
<!--{ /if }-->
</td>
</tr>
<!--{/section}-->
</table>
<!--問い合わせ履歴一覧テーブル-->
</td>
<!--{else}-->
<td align="center" class="fs12">問い合わせ履歴はありません。</td>
<!--{/if}-->
</tr>
</table>
</td>
</tr>
</table>
<!--★★検索結果一覧★★-->
/
配信されるメールのテンプレート場所
[DocumentRoot]/html/eccube/data/Smarty/templates/default/mail_templates