📄 indexof_today.php
字号:
<?
require_once("../include/admin_or_user.php");
require_once('../include/connection1.php');
require_once('../include/sqlfuns.php');
require_once('../dept_3/delete.php');
require_once('../include/classes.php');
$deptno=2;
?>
<?
if(isset($_POST['delete']))
{ $p=new author("","admin",$deptno);
$p->check();
delete("dept_2",$_POST['select']);
}
if(isset($_POST['modefiy']))
{
$rs1=modefiy("dept_2",$_POST['select']);
}
if(isset($_POST['s1']))
{
for($j=1;$j<=$_POST['total'];$j++)
{
$sql = sprintf("update dept_2 set room_number=%s,dieing_prise=%s,other_prise=%s,descript=%s where id=%s",
GetSQLValueString($_POST['room_number'.$j], "text"),
GetSQLValueString($_POST['dieing_prise'.$j], "double"),
GetSQLValueString($_POST['other_prise'.$j], "double"),
GetSQLValueString($_POST['descript'.$j], "text"),
GetSQLValueString($_POST['id'.$j], "int"));
//echo $sql;
odbc_exec($conn,$sql);
}
}
$today=date("Y")."-".(date("m")*1)."-".date("d")*1;
$selectsql = "select * from dept_2 where time like '".$today."%' order by id desc";
$rs=odbc_exec($conn,$selectsql);
?>
<!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>
<script>
function funk(a)
{
if(a.checked)
document.form1.selectid.value=parseInt(document.form1.selectid.value)+1;
else
document.form1.selectid.value=parseInt(document.form1.selectid.value)-1;
}
function sub()
{ if(document.form1.selectid.value==0)
{
alert("请选择");
return false;
}
else
return true;
}
</script>
<body>
<table width="100%" border="1">
<tr>
<td><? require("dieingdept_top.php");
?></td>
</tr>
<tr>
<td>
<? if(!isset($_POST['modefiy'])) { ?>
<p> 今日登记</p>
<form method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1" onsubmit="return sub()">
<table width="100%" border="1">
<tr>
<td width="4%"><div align="center">操作</div></td>
<td width="5%"><div align="center">编号</div></td>
<td width="8%"><div align="center">房间号</div></td>
<td width="10%"><div align="center">饮食费用</div></td>
<td width="10%"><div align="center">其它费用</div></td>
<td width="18%"><div align="center">时间</div></td>
<td width="55%">备注</td>
</tr>
<?
$total=0;
$totalprise1=0;
$totalprise2=0;
if(odbc_fetch_row($rs))
{
do {
$total++;
$totalprise1+=odbc_result($rs,'dieing_prise');
$totalprise2+=odbc_result($rs,'other_prise');
?>
<tr>
<td><label>
<div align="center">
<input type="checkbox" name="select[]" value="<? echo odbc_result($rs,'id');?>" onclick="funk(this)"/>
</div>
</label></td>
<td> <? echo $total;?></td>
<td> <? echo odbc_result($rs,'room_number');?></td>
<td> <span class="redclore">¥</span><? echo odbc_result($rs,'dieing_prise');?></td>
<td> <span class="redclore">¥</span><? echo odbc_result($rs,'other_prise');?></td>
<td> <? echo odbc_result($rs,'time');?></td>
<td> <? echo odbc_result($rs,'descript');?></td>
</tr>
<? }while(odbc_fetch_row($rs));
echo '
<tr>
<td colspan="3" align="center">共:</td>
<td> <span class="redclore">¥</span>'.$totalprise1.'</td>
<td> <span class="redclore">¥</span>'.$totalprise2.'</td>
<td colspan="2"> </td>
</tr>
<tr>';
}
else
echo "
<tr><td colspan='7'>
无记录
</td>
</tr>";
?>
<td colspan="7"><label>
<input name="modefiy" type="submit" id="modefiy" value="修改" />
<? if($p->isadmin()) echo '
<input type="submit" name="delete" value="删除" />';?>
</label>
<input name="selectid" type="hidden" value="0" /></td>
</tr>
</table>
</form>
<? }
else
{
?>
<form action="" method="post" enctype="application/x-www-form-urlencoded" name="modey">
<table width="100%" border="1" align="center">
<tr>
<td width="9%">房间号</td>
<td width="9%">饮食费用</td>
<td width="9%">其它费用</td>
<td width="64%">备注</td>
</tr>
<?
$total=0;
while(odbc_fetch_row($rs1)) {
$total++;
?>
<tr>
<td><label>
<input name="room_number<? echo $total;?>" type="text" id="name<? echo $total;?>" size="10" maxlength="30" value="<? echo odbc_result($rs1,'room_number');?>" />
</label></td>
<td><label>
<span class="redclore">¥</span>
<input name="dieing_prise<? echo $total;?>" type="text" id="mount<? echo $total;?>" size="6" maxlength="10" value="<? echo odbc_result($rs1,'dieing_prise');?>"/>
</label></td>
<td><label>
<span class="redclore">¥</span>
<input name="other_prise<? echo $total;?>" type="text" id="other_prise<? echo $total;?>" size="6" maxlength="10" value="<? echo odbc_result($rs1,'other_prise');?>"/>
</label></td>
<td><label>
<input name="descript<? echo $total;?>" type="text" id="descript<? echo $total;?>" value="<? echo odbc_result($rs1,'descript');?>" size="63"/>
</label></td>
<input name="id<? echo $total;?>" type="hidden" value="<? echo odbc_result($rs1,'id');?>" />
</tr>
<? }?>
<tr>
<td colspan="5"><label>
<br />
<input name="s1" type="submit" id="s1" value="修改" />
<input type="reset" name="Submit2" value="重置" />
<input name="total" type="hidden" id="total" value="<? echo $total;?>" />
<br />
<div align="center"><a href="indexof_today.php">返回</a></div>
</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 + -