给帝国CMS的错误报告增加个分类功能

 错误报告页面增加选择分类

说明:在填写错误报告的页面增加可选择的分类(后台增加的分类) 如:默认、新建 等信息分类
 
方法1、增加下拉框选择分类
  在\e\template\public\report.php 中加入以下代码
  <select name=cid id=cid>
    <option value= selected=selected>请选择</option>
    <option value=1>默认</option>
    <option value=2>新建</option>
  </select>
--------------------------------------------------------------
实例:表单部分
<form name=form1 method=post action=../../enews/index.php>
  <table width=600 border=0 align=center cellpadding=3 cellspacing=1class=tableborder>
  <input type=hidden name=cid value=<?=$cid?>>
    <tr class=header> 
      <td height=23 colspan=2>提交错误报告</td>
    </tr>
    
    
    <tr>
      <td width='16%' height=25 bgcolor='ffffff'><div align=right>选需求:</div></td>
      <td bgcolor='ffffff'>
        <select name=cid id=cid>
        <option value= selected=selected>请选择</option>
      <option value=1>默认</option>
      <option value=2>新建</option>
    </select></td>
    </tr>    
    
    
    <tr bgcolor=#FFFFFF> 
      <td width=137 height=23><div align=left>信息标题:</div></td>
      <td width=448 height=23><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td height=23><div align=left>您的邮箱:</div></td>
      <td height=23><input name=email type=text id=email>
        (方便回复您)</td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td height=23><div align=left>报告内容(*):</div></td>
      <td height=23><textarea name=errortext cols=60 rows=12 id=name4></textarea></td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td height=23>&nbsp;</td>
      <td height=23><input type=submit name=Submit value=提交> <input type=reset name=Submit2 value=重置> 
        <input name=enews type=hidden id=enews value=AddError>
        <input name=id type=hidden id=id value=<?=$id?>>
        <input name=classid type=hidden id=classid value=<?=$classid?>></td>
    </tr>
  </table>
</form>
 
==============================================================================================
方法2、单选方式
在\e\template\public\report.php 中的“信息标题:”下面加入以下代码(在“信息标题:”以上添加时,信息标题会不显示)
<?php
$sql=$empire->query(select classid,classname from {$dbtbpre}enewserrorclass order by classid desc);
?>
<?
  while($r=$empire->fetch($sql))
  {
  ?>
<input name=cid type=radio value=<?=$r[classid]?>><?=$r[classname]?>
<?
  }
  db_close();
  $empire=null;
  ?>
 
--------------------------------------------------------------
实例:表单部分
 
<form name=form1 method=post action=../../enews/index.php>
  <table width=600 border=0 align=center cellpadding=3 cellspacing=1class=tableborder>
  <input type=hidden name=cid value=<?=$cid?>>
    <tr class=header> 
      <td height=23 colspan=2>提交错误报告</td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td width=137 height=23><div align=left>信息标题:</div></td>
      <td width=448 height=23><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
    </tr>
   
     <tr bgcolor=#FFFFFF> <td height=23><div align=left>选择分类:</div></td>
      <td  height=23><?php $sql=$empire->query(select classid,classname from {$dbtbpre}enewserrorclass order by classid desc);?>
<? while($r=$empire->fetch($sql)){ ?><input name=cid type=radio value=<?=$r[classid]?>><?=$r[classname]?>
<? } db_close();$empire=null;?></td>      
    </tr>
   
   
    <tr bgcolor=#FFFFFF> 
      <td height=23><div align=left>您的邮箱:</div></td>
      <td height=23><input name=email type=text id=email>
        (方便回复您)</td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td height=23><div align=left>报告内容(*):</div></td>
      <td height=23><textarea name=errortext cols=60 rows=12 id=name4></textarea></td>
    </tr>
    <tr bgcolor=#FFFFFF> 
      <td height=23>&nbsp;</td>
      <td height=23><input type=submit name=Submit value=提交> <input type=reset name=Submit2 value=重置> 
        <input name=enews type=hidden id=enews value=AddError>
        <input name=id type=hidden id=id value=<?=$id?>>
        <input name=classid type=hidden id=classid value=<?=$classid?>></td>
    </tr>
  </table>
</form>

简简单单挺好的

联系我们 订单查询