⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modefiy_bookroom.php

📁 SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStockObject CFont GetWindo
💻 PHP
字号:
<? 
require_once('include/connection.php'); 
include('include/admin_or_user.php');
require_once('include/sqlfuns.php');

$sql2="select room_number from book where id=".$_POST['id'];
$rs0=odbc_exec($conn,$sql2);
$roomarray1=explode("@", odbc_result($rs0,'room_number'));
$k=0;
while(isset($roomarray1[$k]))
{ 
if($roomarray1[$k]!="")
{
   $sql="select count(id) as a from book where room_number=(select room_number from book where id=".$_POST['id'].")";
   $rs=odbc_exec($conn,$sql);
   if(odbc_result($rs,'a')<=1)

$sql3="update room set room_state=-1 where room_number='".$roomarray1[$k]."'";

odbc_exec($conn,$sql3);
}
$k++;
}




$roomarray=explode(" ", $_POST['room_number']);
$k=0;
while(isset($roomarray[$k]))
{

if($roomarray[$k]!=" ")
{
$sql1="update room set room_state=0 where room_number='".$roomarray[$k]."'";

odbc_exec($conn,$sql1);
}
$k++;
}


$i=0;
$room_number="";
while(isset($roomarray[$i]))
 {if($roomarray[$i]!=" ")
   
	  $room_number.=$roomarray[$i]."@";
	

  $i++;
  }	  
$sql = sprintf("update bookbak set name=%s ,bookdays=%s, room_number=%s,longintime=%s,person=%s,phone=%s  where room_number='%s'",
	                   GetSQLValueString($_POST['name'], "text"),
                       GetSQLValueString($_POST['indays'], "int"),
					    GetSQLValueString($room_number, "text"),
						 GetSQLValueString($_POST['selectmonth']."-".$_POST['selectday'], "text"),
						  GetSQLValueString($_POST['person'], "int"),
						  GetSQLValueString($_POST['phone'], "text"),
						  odbc_result($rs0,'room_number'));

	$result=odbc_exec($conn,$sql);


$sql = sprintf("update book set name=%s ,bookdays=%s, room_number=%s,longintime=%s,person=%s,phone=%s  where id=%s",
	                   GetSQLValueString($_POST['name'], "text"),
                       GetSQLValueString($_POST['indays'], "int"),
					    GetSQLValueString($room_number, "text"),
						 GetSQLValueString($_POST['selectmonth']."-".$_POST['selectday'], "text"),
						  GetSQLValueString($_POST['person'], "int"),
						  GetSQLValueString($_POST['phone'], "text"),
						  $_POST['id']);

	$result=odbc_exec($conn,$sql);
	
	odbc_close($conn);

?>

<!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>
</head>

<body>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -