📄 modefiyroomlevel.php
字号:
<?
require_once('../include/connectionadmin.php');
include('../include/admin_or_user.php');
require_once('../include/sqlfuns.php');
?>
<?
if(isset($_POST['i'])&&$_POST['i']!="")
{$i=$_POST['i'];
$selected=0;
for($j=1;$j<=$i;$j++)
if(isset($_POST["checkbox".$j]))
$selected=1;
if(!$selected)
{ ?>
<script>
alert("请选择!");
window.history.back();
</script>
<?
exit;
}
}
if(isset($_POST['modefiy'])&&$_POST['modefiy']=="修改")
{
if(isset($_POST['total'])&&$_POST['total']!="")
$i=$_POST['total'];
for($j=1;$j<=$i;$j++)
{
if(isset($_POST['room_prise'.$j])&&!empty($_POST['room_prise'.$j]))
{
$updatesql=sprintf("update roomlevel set room_prise=%s,room_introduction=%s where room_level=%s",
GetSQLValueString($_POST['room_prise'.$j],'int'),
GetSQLValueString($_POST['room_introduction'.$j],'text'),
GetSQLValueString($_POST['room_level'.$j],'int'));
odbc_exec($conn,$updatesql);
}
}
odbc_close($conn);
echo "<p align=center class=STYLE1>修改成功</p>";
exit;
}
if(isset($_POST['delete']))
{
for($j=1;$j<=$i;$j++)
{
if(isset($_POST['checkbox'.$j])&&$_POST['checkbox'.$j]!="")
{
$detelesql=sprintf("delete from roomlevel where room_level=%s",
GetSQLValueString($_POST['checkbox'.$j],'int'));
odbc_exec($conn,$detelesql);
}
}
odbc_close($conn);
$goto="roomlevel.php";
header("Location: ".$goto);
exit;
}
?>
<!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" />
<style type="text/css">
<!--
body {
margin-left: 36px;
margin-right: 36px;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<body>
<form id="form1" name="form1" method="post" action="modefiyroomlevel.php">
<table width="100%" border="1">
<tr>
<td width="13%"><div align="center">房间星级</div></td>
<td width="15%"><div align="center">房间价格/天/人</div></td>
<td width="62%"><div align="center">房间介绍</div></td>
</tr>
<?
if(isset($_POST['i'])&&$_POST['i']!="")
for($j=1;$j<=$i;$j++)
if(isset($_POST["checkbox".$j])&&$_POST["checkbox".$j]!="")
{
$rlevel=$_POST['checkbox'.$j];
$selectsql="select * from roomlevel where room_level =".$rlevel;
$result=odbc_exec($conn,$selectsql);
?>
<tr>
<td nowrap="nowrap"><div align="center">
<? echo odbc_result($result,'room_level');?>
</div></td>
<td nowrap="nowrap"><div align="center">
<label>
<input name="room_prise<? echo $j;?>" type="text" id="room_prise<? echo $j;?>" size="6" maxlength="6" value="<? echo odbc_result($result,'room_prise');?>"/>
</label>
</div></td>
<td nowrap="nowrap">
<label>
<input name="room_introduction<? echo $j;?>" type="text" id="room_introduction<? echo $j;?>" value="<? echo odbc_result($result,'room_introduction');?>" size="103" maxlength="255" />
</label></td>
</tr>
<input name="room_level<? echo $j;?>" type="hidden" id="room_level<? echo $j;?>" value="<? echo odbc_result($result,'room_level');?>" />
<?
}
?>
</table>
<p>
<label>
<input name="modefiy" type="submit" id="modefiy" value="修改" />
</label>
<input name="total" type="hidden" id="total" value="<? echo $_POST['i'];?>" />
</p>
</form>
<p align="center"><a href="#" onClick="window.history.back();">返回</a></p>
<p \>
<script src="../copyright.inc">
</script>
</body>
</html>
<? odbc_close($conn); ?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -