📄 add.php
字号:
<?
require_once("../include/admin_or_user.php");
require_once('../include/connection1.php');
require_once('../include/sqlfuns.php');
require_once('../include/check.inc');
?>
<?
if(isset($_POST['add']))
{
$insertsql = sprintf("INSERT INTO dept_2 (room_number,other_prise ,dieing_prise,descript) VALUES(%s, %s, %s,%s)",
GetSQLValueString($_POST['room_number'], "text"),
GetSQLValueString($_POST['other_prise'], "double"),
GetSQLValueString($_POST['dieing_prise'], "double"),
GetSQLValueString($_POST['descript'], "text"));
odbc_exec($conn,$insertsql);
$updatesql = sprintf("update coustom set other_prise=other_prise+%s,dieing_prise=dieing_prise+%s where room_number=%s",
GetSQLValueString($_POST['other_prise'], "double"),
GetSQLValueString($_POST['dieing_prise'], "double"),
GetSQLValueString($_POST['room_number'], "text"));
odbc_exec($conn,$updatesql);
echo "<script>
alert('操作成功');
</script>";
}
$sql="select room_number,name from coustom order by room_number";
$rs=odbc_exec($conn,$sql);
?>
<!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="../css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="1">
<tr>
<td><? include("dieingdept_top.php"); ?></td>
</tr>
<tr>
<td>
<form method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1" onsubmit="return (empty(room_number)&&empty(dieing_prise)&&numbercheck(other_prise)&&numbercheck(dieing_prise))" >
<table width="100%" border="0">
<tr>
<td width="10%">登记费用</td>
<td width="90%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> 房间号</td>
<td><label>
<select name="room_number" id="room_number">
<option value="">请选择</option>
<? while (odbc_fetch_row($rs)) { ?>
<option value="<? echo odbc_result($rs,'room_number');?> "><? echo odbc_result($rs,'room_number');echo "(".odbc_result($rs,'name').")";?></option>
<? }?>
</select>
*
</label></td>
</tr>
<tr>
<td> 餐饮费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="dieing_prise" type="text" id="dieing_prise" size="6" maxlength="6" />
*</label></td>
</tr>
<tr>
<td> 其它费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="other_prise" type="text" id="other_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 备注</td>
<td><label>
<textarea name="descript" cols="30" rows="6" id="descript"></textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="add" value="提交" />
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
</table>
</form>
</td>
</tr>
<? if(isset($_GET['modefy'])) { ?>
<br></br>
<tr>
<td>
<form enctype="application/x-www-form-urlencoded" name="form1" id="form1" >
<table width="100%" border="0">
<tr>
<td width="10%">修改记录</td>
<td width="90%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> 房间号</td>
<td><label>
<select name="select">
<option>请选择</option>
</select>
*
</label></td>
</tr>
<tr>
<td> 餐饮费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="dieing_prise" type="text" id="dieing_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 其它费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="other_prise" type="text" id="other_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 备注</td>
<td><label>
<textarea name="descript" cols="30" rows="6" id="descript"></textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="modefiy" value="修改" />
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
<? }?>
</table>
</form>
</td>
</tr>
</table>
<p \>
<script src="../copyright.inc">
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -