简单的报名系统,经过修改调试好了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title></title><link href="dadmin/style/style.css" rel="stylesheet" type="text/css" /><script src="js/My97DatePicker/WdatePicker.js"></script></head><body ><?php//设置工程相对路径$root_path="./";require_once("$root_path/data/dconfig.php");require_once("$root_path/lib/config.php");require_once("$root_path/lib/fun_com.php");$table="tf_baoming";$db=new MySql();if(isset($_POST['submit']) and isset($_POST['id'])){$id=$_POST['id'];$tablef=$db->metadata($table);//取出表结构 二维$data = $_POST; //取出post 一维$udate=array("pic");//为空,不更新$mdate=array('tmpvar1');//有些这段不操作$tmpiu=getIU($tablef,$data,$id,$udate,$mdate);//post数据,转成插入,更新语句 if ($id) { $sql="update ".$table." set ".$tmpiu[2]." where id='".$id."'"; $db->query($sql);}else { //增加数据$sql="insert into ".$table."(".$tmpiu[0].")values(".$tmpiu[1].")"; $sql = $db->query($sql);}if($db->affected_rows()){showmessage("保存成功!");location("index.php");}else{showmessage("保存失败!");//location($_SESSION['CURPAGE']);}}?><div class="main" ><div class="content" ><div class="title">用户报名信息表</div></div><div class="list"><form name="fom" id="fom" method="post" action="index.php"><table cellpadding=0 cellspacing=0 width=100% class="role_table" ><tbody><tr><td class="tRight" width="150">考生编号</td><td class="tLeft" ><input type="text" name="order_id" value="<?echo $rsone['order_id']?>"/></td> <td class="tRight" width="150"> 编号</td><td class="tLeft" ><input type="text" name="id" value="<?echo $rsone['id']?>"/></td></tr><tr><td class="tRight" width="150">报名科目</td><td class="tLeft" colspan="3" ><input type="text" name="pro_name" value="<?echo $rsone['pro_name']?>"/> </td></tr></tr><tr><td class="tRight" width="150">姓名</td><td class="tLeft" ><input type="text" name="realname" value="<?echo $rsone['realname']?>"/> </td> <td class="tRight" width="150">手机</td><td class="tLeft" ><input type="text" name="tel" value="<?echo $rsone['tel']?>"/> </td></tr><tr><td class="tRight" width="150">性别</td><td class="tLeft" ><input type="text" name="sex" value="<?echo $rsone['sex']?>"/> </td> <td class="tRight" width="150">详细地址</td><td class="tLeft" ><input type="text" name="addess" value="<?echo $rsone['addess']?>"/> </td></tr><tr><td class="tRight" width="150">QQ号码</td><td class="tLeft" ><?echo $rsone['qq']?> </td> <td class="tRight" width="150">Email</td><td class="tLeft" ><?echo $rsone['email']?> </td></tr><tr><td class="tRight" width="150">留言</td><td class="tLeft" ><?echo $rsone['guest']?> </td> <td class="tRight" width="150"></td><td class="tLeft" > </td></tr><tr><td class="tRight">付款方式</td><td class="tLeft" ><?echo $rsone['pay_type']?> </td> <td class="tRight" width="150">下单时间</td><td class="tLeft" ><input type="text" name="lastdate" value="<?echo $rsone['lastdate']?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate"/></td></tr><tr><td class="tRight" width="150">处理</td><td class="tLeft"><select id=stat name=stat > <OPTION value="未审核" <?if($rsone['stat']=="未审核"){echo "selected";}?>>未审核</OPTION> <OPTION value="电话已确认" <?if($rsone['stat']=="电话已确认"){echo "selected";}?>>电话已确认</OPTION> <OPTION value="电话不通" <?if($rsone['stat']=="电话不通"){echo "selected";}?>>电话不通</OPTION> <OPTION value="作废" <?if($rsone['stat']=="作废"){echo "selected";}?>>作废</OPTION> <OPTION value="审核通过" <?if($rsone['stat']=="审核通过"){echo "selected";}?>>审核通过</OPTION> <OPTION value="其它原因" <?if($rsone['stat']=="其它原因"){echo "selected";}?>>其它原因</OPTION> </select></td> <td class="tRight" width="150">是否在线支付</td><td class="tLeft" ><? if($payok==1){ echo "是,支付金额:".$paymoney."元,支付时间:".$payoktime; }else{ echo "无"; } ?></td></tr><tr><td class="tRight">用户详细信息</td><td class="tLeft" colspan="3"><textarea name="admininfo" cols="30" rows="3" id="admininfo"><?echo $rsone['admininfo']?></textarea></td></tr><tr><td> </td><td class="center" colspan="3"><input type="hidden" name="id" value="<?echo $id?>"><input type="submit" value="保 存" name="submit" class="button small"> <input type="reset" class="button small" onClick="window.location='<?echo $gopath?>'" value="返 回" ></td></tr></tbody></table></form></div></div></body></html>
评论