最近在用反饋表單在做旅游預(yù)訂的功能,已基本上實(shí)現(xiàn)。因?yàn)槠渲猩婕案膭?dòng)不少源文件及數(shù)據(jù)庫結(jié)構(gòu),所以大家在使用過程請自行根據(jù)需要選擇。
因?yàn)槲易龅墓δ鼙容^復(fù)雜,不適合大眾的需求,所以我只挑出了一部分比較實(shí)用的功能,中間如果有什么錯(cuò)誤,歡迎在此帖反饋。我也是個(gè)菜鳥,能幫多少幫多少。
第一步 添加字段
phome_enewsfeedback
增加
ddno varchar(30) 訂單號(hào)
retext varchar(120) 客服回復(fù)
如果你不想改動(dòng)數(shù)據(jù)庫結(jié)構(gòu),方便以后升級(jí),建議直接在后臺(tái)管理信息反饋?zhàn)侄卫锾砑樱琩dno 的初始值設(shè)為:<?=$ddno?>
后臺(tái)表單模板里手工加入以下代碼,不要使用自動(dòng)生成,否則用戶可以自己修改訂單號(hào)了:
<?=$ddno?>
<input name="ddno" type="hidden" id="ddno" value="<?=$ddno?>">
上傳以下圖片:
第二步 修改源代碼
/e/tool/feedback/index.php
找個(gè)位置,添加反饋編號(hào)生成的代碼
$ddno=time();//反饋編號(hào)
修改/e/admin/tool/showfeedback.php 增加回饋回復(fù),處理訂單功能
這個(gè)頁面主要就是增加一個(gè)FORM,幾個(gè)文本框,大家可以對(duì)照自己的代碼添加上去,form input這些都是我加上去的
<form name="form1" method="post" action="feedback.php">
<input name="enews" type="hidden" id="enews" value="ReOrder">
<input name="bid" type="hidden" id="id" value="<?=$bid?>">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder>
<tr class=header>
<td height="25" colspan="2">所屬分類:<?=$br[bname]?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="19%" height="25">提交者:</td>
<td width="81%" height="25">
<?=$username?>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">發(fā)布時(shí)間:</td>
<td height="25">
<?=$r[saytime]?>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">IP地址:</td>
<td height="25">
<?=$r[ip]?>
</td>
</tr>
<?=$feedbackinfo?>
<tr class=header>
<td height="25" colspan="2">訂單處理</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">客服回復(fù):</td>
<td height="25">
<textarea name="retext" cols="60" rows="9" id="retext"><?=$r[retext]?></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"><div align="center">[ <a href="javascript:window.close();">關(guān)
閉</a> ]</div></td>
</tr>
</table>
</form>
修改/e/admin/tool/feedback 獲取表單的值
找到
include "../".LoadLang("pub/fun.php");
在上面添加
elseif($enews=="ReOrder")
{
$id=$_POST['id'];
$bid=$_POST['bid'];
$retext=$_POST['retext'];
ReOrder($id,$bid,$retext,$logininid,$loginin);
}
修改/e/class/com_functions.php 增加ReOrder函數(shù)
//回復(fù)反饋 2010-10-16 by 成名
function ReOrder($id,$bid,$retext,$userid,$username){
global $empire,$dbtbpre;
$id=(int)$id;
$bid=(int)$bid;
if(!$id||!$retext)
{
printerror("EmptyReGbooktext","history.go(-1)");
}
//驗(yàn)證權(quán)限
//CheckLevel($userid,$username,$classid,"feedback");
$sql=$empire->query("update {$dbtbpre}enewsfeedback set retext='$retext' where id='$id';");
if($sql)
{
//操作日志
insert_dolog("id=".$id);
echo"<script>opener.parent.main.location.href='feedback.php?bid=$bid';window.close();</script>";
exit();
}
else
{printerror("DbError","history.go(-1)");}
}
上傳以下圖片:
第三步,為你的反饋增加搜索功能,當(dāng)然前臺(tái)你也可以加上這個(gè)功能,方便用戶查找
修改一個(gè)文件就可以了/e/admin/tool/feedback.php
具體怎么修改大家參考:/e/admin/shopsys/listdb.php,
上傳以下圖片:
新聞熱點(diǎn)
疑難解答
圖片精選