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

📄 search_result.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
include_once( "inc/function_page_01.php" );
if ( $_REQUEST['cur_page'] == "" )
{
	$cur_page = 1;
}
else
{
	$cur_page = $_REQUEST['cur_page'];
}
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";
echo "<s";
echo "cript>\r\nfunction del(take_id,status){\r\n\tmsg\t= \"你确认要删除此记录吗?\";\r\n\tif(window.confirm(msg)){\r\n\t\turl\t= \"update.php?handle=delete&take_id=\"+take_id+\"&status=\"+status;\r\n\t\tlocation = url;\r\n\t}\r\n}\r\nfunction giveBack(take_id,option)\r\n{\r\n\turl\t= \"update.php?handle=delete&take_id=\" + take_id+\"&option=\"+option;\r\n\tlocation = url;\r\n}\r\n</script>\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n<table border=";
echo "\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">\r\n\t<tr class=\"tablehead1\">\r\n\t\t<td><img src=\"/images/manage/news.gif\" align=\"absmiddle\">使用查询结果</td>\r\n\t</tr>\r\n\t<tr class=\"tablehead2\">\r\n\t\t<td><BUTTON class=btn onClick=\"location='add.php';\"><table><tr valign=top ><td><img src=\"/images/littlegif/b_u.gif\" align=\"center\"></td> <td>";
echo "<s";
echo "pan id=\"showallid\">申请使用</span></td></tr></table></BUTTON> <BUTTON class=btn onClick=\"location='search.php';\"><table><tr valign=top ><td><img src=\"/images/littlegif/b_u.gif\" align=\"center\"></td> <td>";
echo "<s";
echo "pan id=\"showallid\">使用查询</span></td></tr></table></BUTTON> <BUTTON class=btn onClick=\"javscript:history.back();\"><table><tr valign=top ><td><img src=\"/images/littlegif/b_u.gif\" align=\"center\"></td> <td>";
echo "<s";
echo "pan id=\"showallid\">返回</span></td></tr></table></BUTTON></td>\r\n\t</tr>\r\n</table>\r\n<br>\r\n";
if ( $_REQUEST['order'] == "" )
{
	$GLOBALS['_REQUEST']['order'] = "take_date";
}
$connection = openconnection( );
$query = "select ot.*, oa.*, os.* from officeitem_take as ot, officeitem_appellation as oa, officeitem_sort as os where ot.APPELLATION_ID=oa.APPELLATION_ID AND oa.SORT_ID=os.SORT_ID AND TAKE_OPERATOR='".$_SESSION['LOGIN_USER_ID']."'";
$where_str = "";
if ( $_REQUEST['take_date_start'] != NULL )
{
	$where_str .= "and to_days(date_format(ot.TAKE_DATE,'%Y-%m-%d')) >= to_days('".$_REQUEST['take_date_start']."') ";
}
if ( $_REQUEST['take_date_end'] != NULL )
{
	$where_str .= "and to_days(date_format(ot.TAKE_DATE,'%Y-%m-%d')) <= to_days('".$_REQUEST['take_date_end']."') ";
}
if ( $_REQUEST['appellation_id'] != NULL )
{
	$where_str .= "and oa.APPELLATION_ID=".$_REQUEST['appellation_id']." ";
}
if ( $_REQUEST['status'] != "3" )
{
	$where_str .= "and ot.STATUS=".$_REQUEST['status']." ";
}
if ( $_REQUEST['take_amount'] != NULL )
{
	$where_str .= "and ot.TAKE_AMOUNT >= '".$_REQUEST['take_amount']."' ";
}
if ( $_REQUEST['take_amount2'] != NULL )
{
	$where_str .= "and ot.TAKE_AMOUNT <= '".$_REQUEST['take_amount2']."' ";
}
if ( $_REQUEST['modes'] != "0" )
{
	$where_str .= "and ot.MODES =".$_REQUEST['modes']." ";
}
if ( $_REQUEST['take_bill'] != NULL )
{
	$where_str .= "and ot.TAKE_BILL LIKE '%".$_REQUEST['take_bill']."%' ";
}
$query .= $where_str;
switch ( $_REQUEST['order'] )
{
case "sort" :
	$query .= " order by os.SORT";
	break;
case "appellaton" :
	$query .= " order by oa.APPELLATION";
	break;
case "unit" :
	$query .= " order by oa.UNIT";
	break;
case "take_amount" :
	$query .= " order by ot.TAKE_AMOUNT";
	break;
case "take_date" :
	$query .= " order by ot.TAKE_DATE";
	break;
case "take_bill" :
	$query .= " order by ot.TAKE_BILL";
	break;
case "modes" :
	$query .= " order by ot.MODES";
	break;
case "modes_time" :
	$query .= " order by ot.MODE_TIME";
	break;
case "status" :
	$query .= " order by ot.STATUS";
	break;
default :
	$query .= " order by ot.TAKE_ID";
	break;
}
$query .= $_REQUEST['sens'] ? " ASC" : " DESC";
$query = page( $query, 15 );
$cursor = exequery( $connection, $query );
$count = 0;
echo "<table border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"5\" class=\"small\">\r\n";
while ( $row = mysql_fetch_array( $cursor ) )
{
	++$count;
	$take_id = $row['TAKE_ID'];
	$take_date = $row['TAKE_DATE'];
	$take_bill = $row['TAKE_BILL'];
	$take_amount = $row['TAKE_AMOUNT'];
	$take_stockpile = $row['TAKE_STOCKPILE'];
	$modes = $row['MODES'];
	$mode_time = $row['MODE_TIME'];
	$status = $row['STATUS'];
	$operate = $row['OPERATE'];
	$appellation_id = $row['APPELLATION_ID'];
	$appellation = $row['APPELLATION'];
	$sort = $row['SORT'];
	$unit = $row['UNIT'];
	$conceal = $row['CONCEAL'];
	$sql = "select JOIN_APPELLATION, JOIN_APPELLATION_SORT from officeitem_joinstoreroom where APPELLATION_ID=".$appellation_id;
	$cs = exequery( $connection, $sql );
	if ( $r = mysql_fetch_row( $cs ) )
	{
		$join_appellation = $r[0];
		$join_appellation_sort = $r[1];
	}
	$take_date = explode( " ", $take_date );
	$mode_time = explode( " ", $mode_time );
	if ( $count % 2 == 1 )
	{
		$TableLine = "TableLine1";
	}
	else
	{
		$TableLine = "TableLine2";
	}
	$expiredstr = "";
	if ( $status == 2 && $modes == 2 && $conceal == 0 && strtotime( $mode_time ) < time( ) )
	{
		$expiredstr = "<font color=red>(已到期)</font>";
	}
	$query2 = "select d.DEPT_NAME from department as d,user as u where d.DEPT_ID=u.DEPT_ID";
	$cursor2 = exequery( $connection, $query2 );
	if ( $row2 = mysql_fetch_row( $cursor2 ) )
	{
		$dept_name = $row2[0];
	}
	echo "\t<tr class=\"";
	echo $TableLine;
	echo "\">\r\n\t\t<td>";
	echo $sort;
	echo "</td>\r\n\t\t<td>";
	echo $appellation;
	echo $expiredstr;
	echo "</td>\r\n\t\t<td>";
	echo $unit;
	echo "</td>\r\n\t\t<td>";
	echo $take_amount;
	echo "</td>\r\n\t\t<td>";
	echo $dept_name;
	echo "</td>\r\n\t\t<td>";
	echo $take_date[0];
	echo "</td>\r\n\t\t<td>";
	echo $mode_time[0];
	echo "</td>\r\n\t\t<td>";
	echo $take_bill;
	echo "</td>\r\n\t\t<td style=\"font:bold\">";
	if ( $status == "0" )
	{
		echo "审核中";
	}
	else if ( $status == "1" )
	{
		echo "未通过";
	}
	else if ( $status == "2" && $conceal == 0 )
	{
		echo "已通过";
	}
	else if ( $status == 2 && $conceal == 1 )
	{
		echo "已归还";
	}
	echo "</td>\r\n\t\t<td style=\"font:bold\">";
	if ( $modes == "1" )
	{
		echo "领用";
	}
	else if ( $modes == "2" )
	{
		echo "借用";
	}
	echo "</td>\r\n\t<td><a href=\"#\" onClick=\"javascript:window.open('../take_detail.php?TAKE_ID=";
	echo $take_id;
	echo "','','topbar=no,width=200,height=200')\">详细</a></td>\r\n\t\t<td>";
	if ( $status == "2" && $modes == "2" && $conceal == 0 )
	{
		echo "<a href=\"#\" onclick=\"giveBack(".$take_id.",'back');\">归还</a>";
	}
	else if ( $status == 1 || $status == 0 )
	{
		echo "<a href=\"#\" onclick=\"del(".$take_id.",".$status.")\">删除</a>";
	}
	else
	{
		echo "&nbsp;";
	}
	echo "</td>\r\n\t</tr>\r\n";
}
echo "<center>";
if ( $count == 0 )
{
	message( "提示", "暂无记录" );
	exit( );
}
echo "</center>";
$sens = $_REQUEST['sens'] ? 0 : 1;
$sensimg = $_REQUEST['sens'] ? "arrow_up.gif" : "arrow_down.gif";
$sensimg = "/images/".$sensimg;
$sufurl = $_SERVER['PHP_SELF']."?sens=".$sens;
echo "\t<thead class=\"TableHeader\">\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=sort&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">类别";
if ( $_REQUEST['order'] == "sort" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=appellation&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">名称";
if ( $_REQUEST['order'] == "appellation" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=unit&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">单位";
if ( $_REQUEST['order'] == "unit" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=take_amount&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">数量";
if ( $_REQUEST['order'] == "take_amount" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td>部门</td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=take_date&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">申请日期";
if ( $_REQUEST['order'] == "take_date" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=take_date&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "&mode_time=";
echo $_REQUEST['mode_time'];
echo "\"\">到期日期";
if ( $_REQUEST['order'] == "mode_time" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=take_bill&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">申请单据号";
if ( $_REQUEST['order'] == "take_bill" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=modes&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">方式";
if ( $_REQUEST['order'] == "modes" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=status&sens=";
echo $_REQUEST['sens'];
echo "&take_date_start=";
echo $_REQUEST['take_date_start'];
echo "&take_date_end=";
echo $_REQUEST['take_date_end'];
echo "&appellation_id=";
echo $_REQUEST['appellation_id'];
echo "&status=";
echo $_REQUEST['status'];
echo "&take_amount=";
echo $_REQUEST['take_amount'];
echo "&take_amount2=";
echo $_REQUEST['take_amount2'];
echo "&modes=";
echo $_REQUEST['modes'];
echo "&take_bill=";
echo $_REQUEST['take_bill'];
echo "\">当前状态";
if ( $_REQUEST['order'] == "status" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td>说明</td>\r\n\t\t<td>操作</td>\r\n\t</thead>\r\n</table>\r\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\r\n\t<tr>\r\n\t\t<td class=\"TableLine1\" nowrap align=\"right\">";
disp( "sens=".$_REQUEST['sens']."&order=".$_REQUEST['order']."&take_date_start=".$_REQUEST['take_date_start']."&take_date_end=".$_REQUEST['take_date_end']."&appellation_id=".$_REQUEST['appellation_id']."&status=".$_REQUEST['status']."&take_amount=".$_REQUEST['take_amount']."&take_amount2=".$_REQUEST['take_amount2']."&modes=".$_REQUEST['modes']."&take_bill=".$_REQUEST['take_bill'] );
echo "</td>\r\n\t</tr>\r\n</table>\r\n";
if ( 0 < ( $n = $_REQUEST['cur_page'] - $total_page_nums ) )
{
	$cur_page = $_REQUEST['cur_page'] - $n;
	header( "location:".$_SERVER['PHP_SELF']."?&order=".$_REQUEST['order']."&sens=".$_REQUEST['sens']."&cur_page=".$cur_page );
}
echo "</body>\r\n</html>";
?>

⌨️ 快捷键说明

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