最近在用反饋表單在做旅游預訂的功能,已基本上實現。因為其中涉及改動不少源文件及數據庫結構,所以大家在使用過程請自行根據需要選擇。
因為我做的功能比較復雜,不適合大眾的需求,所以我只挑出了一部分比較實用的功能,中間如果有什么錯誤,歡迎在此帖反饋。我也是個菜鳥,能幫多少幫多少。
第一步 添加字段
phome_enewsfeedback增加
ddno varchar(30) 訂單號retext varchar(120) 客服回復
如果你不想改動數據庫結構,方便以后升級,建議直接在后臺管理信息反饋字段里添加,ddno 的初始值設為:<?=$ddno?>
后臺表單模板里手工加入以下代碼,不要使用自動生成,否則用戶可以自己修改訂單號了:
<?=$ddno?><input name="ddno" type="hidden" id="ddno" value="<?=$ddno?>">
上傳以下圖片:
第二步 修改源代碼
/e/tool/feedback/index.php找個位置,添加反饋編號生成的代碼
$ddno=time();//反饋編號修改/e/admin/tool/showfeedback.php 增加回饋回復,處理訂單功能
這個頁面主要就是增加一個FORM,幾個文本框,大家可以對照自己的代碼添加上去,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">發布時間:</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">客服回復:</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();">關 閉</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函數
function ReOrder($id,$bid,$retext,$userid,$username){ global $empire,$dbtbpre; $id=(int)$id; $bid=(int)$bid; if(!$id||!$retext) { printerror("EmptyReGbooktext","history.go(-1)"); } //驗證權限 //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)");}}
上傳以下圖片:
第三步,為你的反饋增加搜索功能,當然前臺你也可以加上這個功能,方便用戶查找
修改一個文件就可以了/e/admin/tool/feedback.php具體怎么修改大家參考:/e/admin/shopsys/listdb.php,
上傳以下圖片:
新聞熱點
疑難解答