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

📄 search.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
字号:
<?php
 

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/check_type.php" );
echo "\r\n<html>\r\n<head>\r\n<title>订餐查询</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n<script>\r\nfunction open_ems(ORDER_ID)\r\n{\r\n URL=\"detail";
if ( $EMS_TYPE == 1 )
{
	echo "1";
}
echo ".php?ORDER_ID=\"+ORDER_ID;\r\n myleft=(screen.availWidth-650)/2;\r\n window.open(URL,\"read_ems\",\"height=300,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=100,left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction delete_order(ORDER_ID)\r\n{\r\n msg='确认要删除该订餐信息么?';\r\n if(window.confirm(msg))\r\n {\r\n  URL=\"delete.php?ORDER_ID=\" + ORDER_ID;\r\n  window.location=URL;\r\n }\r\n}\r\n\r\n</script>\r\n\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
if ( $BEGIN_DATE != "" )
{
	$TIME_OK = is_date( $BEGIN_DATE );
	if ( !$TIME_OK )
	{
		message( "错误", "起始日期格式不对,应形如 1999-1-2" );
		button_back( );
		exit( );
	}
}
if ( $END_DATE != "" )
{
	$TIME_OK = is_date( $END_DATE );
	if ( !$TIME_OK )
	{
		message( "错误", "截止日期格式不对,应形如 1999-1-2" );
		button_back( );
		exit( );
	}
}
echo "\r\n";
$connection = openconnection( );
$query = "SELECT COUNT(*) from DINING_ORDER,DINING_MENU,USER where DINING_ORDER.USER_ID=USER.USER_ID and DINING_ORDER.MENU_ID=DINING_MENU.MENU_ID";
if ( $BEGIN_DATE != "" )
{
	$where_str .= " and SEND_TIME>='".$BEGIN_DATE." 00:00:00'";
}
if ( $END_DATE != "" )
{
	$where_str .= " and SEND_TIME<='".$END_DATE." 23:59:59'";
}
if ( $USER_NAME != "" )
{
	$where_str .= " and USER_NAME LIKE '%".$USER_NAME."%'";
}
if ( $REMARK != "" )
{
	$where_str .= " and REMARK LIKE '%".$REMARK."%'";
}
if ( $MENU_NAME != "" )
{
	$where_str .= " and MENU_NAME LIKE '%".$MENU_NAME."%'";
}
if ( $COUNT1 != "" )
{
	$where_str .= " and COUNT>='".$COUNT1."'";
}
if ( $COUNT2 != "" )
{
	$where_str .= " and COUNT<='".$COUNT2."'";
}
if ( $STATUS != "" )
{
	$where_str .= " and STATUS='".$STATUS."'";
}
$query .= $where_str;
$cursor = exequery( $connection, $query );
$ORDER_COUNT = 0;
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$ORDER_COUNT = $ROW[0];
}
if ( $ORDER_COUNT == 0 )
{
	echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n  <tr>\r\n    <td class=\"Big\"><img src=\"/images/menu/dining.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 订餐查询</span><br>\r\n    </td>\r\n  </tr>\r\n</table>\r\n<br>\r\n\r\n";
	message( "", "无订餐" );
	button_back( );
	exit( );
}
$PER_PAGE = 10;
$PAGES = 10;
$PAGE_COUNT = ceil( $ORDER_COUNT / $PER_PAGE );
if ( $CUR_PAGE <= 0 || $CUR_PAGE == "" )
{
	$CUR_PAGE = 1;
}
if ( $PAGE_COUNT < $CUR_PAGE )
{
	$CUR_PAGE = $PAGE_COUNT;
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n  <tr>\r\n    <td class=\"Big\"><img src=\"/images/menu/dining.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 订餐查询</span><br>\r\n    </td>\r\n    <td align=\"right\" valign=\"bottom\" class=\"small1\">共<span class=\"big4\">&nbsp;";
echo $ORDER_COUNT;
echo "</span>&nbsp;条\r\n    </td>\r\n    <td align=\"right\" valign=\"bottom\" class=\"small1\">\r\n       <a class=\"A1\" href=\"search.php?CUR_PAGE=1\">首页</a>&nbsp;\r\n       <a class=\"A1\" href=\"search.php?CUR_PAGE=";
echo $PAGE_COUNT;
echo "\">末页</a>&nbsp;&nbsp;\r\n";
if ( $CUR_PAGE % $PAGES == 0 )
{
	$J = $PAGES;
}
else
{
	$J = $CUR_PAGE % $PAGES;
}
if ( $PAGES < $CUR_PAGE )
{
	echo "       <a class=\"A1\" href=\"search.php?CUR_PAGE=";
	echo $CUR_PAGE - $J - $PAGES + 1;
	echo "\">上";
	echo $PAGES;
	echo "页</a>&nbsp;&nbsp;\r\n";
}
$I = $CUR_PAGE - $J + 1;
for ( ;	$I <= $CUR_PAGE - $J + $PAGES;	++$I	)
{
	if ( $PAGE_COUNT < $I )
	{
		break;
	}
	if ( $I == $CUR_PAGE )
	{
		echo "       [";
		echo $I;
		echo "]&nbsp;\r\n";
	}
	else
	{
		echo "       [<a class=\"A1\" href=\"search.php?CUR_PAGE=";
		echo $I;
		echo "\">";
		echo $I;
		echo "</a>]&nbsp;\r\n";
	}
}
echo "      &nbsp;\r\n";
if ( $I - 1 < $PAGE_COUNT )
{
	echo "       <a class=\"A1\" href=\"search.php?CUR_PAGE=";
	echo $I;
	echo "\">下";
	echo $PAGES;
	echo "页</a>&nbsp;&nbsp;\r\n";
}
if ( 1 <= $CUR_PAGE - 1 )
{
	echo "       <a class=\"A1\" href=\"search.php?CUR_PAGE=";
	echo $CUR_PAGE - 1;
	echo "\">上一页</a>&nbsp;\r\n";
}
else
{
	echo "       上一页&nbsp;\r\n";
}
if ( $CUR_PAGE + 1 <= $PAGE_COUNT )
{
	echo "       <a class=\"A1\" href=\"search.php?CUR_PAGE=";
	echo $CUR_PAGE + 1;
	echo "\">下一页</a>&nbsp;\r\n";
}
else
{
	echo "       下一页&nbsp;\r\n";
}
echo "       &nbsp;\r\n    </td>\r\n    </tr>\r\n</table>\r\n\r\n<br>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\r\n  <tr class=\"TableHeader\">\r\n      <td nowrap align=\"center\">姓名 </td>\r\n      <td nowrap align=\"center\">菜单名称 </td>\r\n      <td nowrap align=\"center\">份数</td>\r\n      <td nowrap align=\"center\">备注</td>\r\n      <td nowrap align=\"center\">登记时间 <img border=0 src=\"/images/arrow_down.gif\" width=\"11\" height=\"10\"></td>\r\n      <td nowrap align=\"center\">状态</td>\r\n      <td nowrap align=\"center\">操作</td>\r\n    </tr>\r\n\r\n";
$query = "SELECT * from DINING_ORDER,DINING_MENU,USER where DINING_ORDER.MENU_ID=DINING_MENU.MENU_ID and DINING_ORDER.USER_ID=USER.USER_ID";
$query .= $where_str;
$query .= "  order by SEND_TIME desc";
$cursor = exequery( $connection, $query );
$ORDER_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	++$ORDER_COUNT;
	if ( !( $ORDER_COUNT < $CUR_PAGE * $PER_PAGE - $PER_PAGE + 1 ) )
	{
		if ( $CUR_PAGE * $PER_PAGE < $ORDER_COUNT )
		{
			break;
		}
		$ORDER_ID = $ROW['ORDER_ID'];
		$USER_NAME = $ROW['USER_NAME'];
		$MENU_NAME = $ROW['MENU_NAME'];
		$REMARK = $ROW['REMARK'];
		$COUNT = $ROW['COUNT'];
		$SEND_TIME = $ROW['SEND_TIME'];
		$STATUS = $ROW['STATUS'];
		if ( $STATUS == 1 )
		{
			$STATUS_DESC = "已派送";
		}
		else
		{
			$STATUS_DESC = "等待中";
		}
		if ( $ORDER_COUNT % 2 == 1 )
		{
			$TableLine = "TableLine1";
		}
		else
		{
			$TableLine = "TableLine2";
		}
		echo "    <tr class=\"";
		echo $TableLine;
		echo "\">\r\n      <td nowrap align=\"center\">";
		echo $USER_NAME;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $MENU_NAME;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $COUNT;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $REMARK;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $SEND_TIME;
		echo "</td>\r\n      <td nowrap align=\"center\">";
		echo $STATUS_DESC;
		echo "</td>\r\n      <td nowrap align=\"center\" width=\"80\">\r\n";
		if ( $STATUS == 1 )
		{
			echo "          <a href=\"add.php?ORDER_ID=";
			echo $ORDER_ID;
			echo "&STATUS=0\">撤销</a>&nbsp;\r\n";
		}
		else
		{
			echo "          <a href=\"add.php?ORDER_ID=";
			echo $ORDER_ID;
			echo "&STATUS=1\">派送</a>&nbsp;\r\n";
		}
		echo "          <a href=\"javascript:delete_order(";
		echo $ORDER_ID;
		echo ");\"> 删除</a>\r\n      </td>\r\n    </tr>\r\n";
	}
}
echo "\r\n</table>\r\n<br>\r\n<div align=\"center\">\r\n <input type=\"button\"  value=\"返回\" class=\"BigButton\" onClick=\"location='index.php';\">\r\n</div>\r\n\r\n</body>\r\n\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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