237 lines
8.8 KiB
PHP
Executable File
237 lines
8.8 KiB
PHP
Executable File
<?php
|
||
/*********************************************************
|
||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE>ѯ<EFBFBD><D1AF>ʾ<EFBFBD><CABE>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>־
|
||
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
|
||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||
<09><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||
<09><><EFBFBD>ߣ<EFBFBD>
|
||
|
||
<EFBFBD><EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
|
||
NO.1
|
||
Name: Li Long
|
||
Date: Monday, March 01, 2004
|
||
Description: fix "Next" and "Previous" button display sort by different date.
|
||
NO.1
|
||
Name: Li Long
|
||
Date: 2004-5-26
|
||
Description: fix show all log error after show each days' log.
|
||
*********************************************************/
|
||
require("../../inc/header.inc");
|
||
$DEBUG=0;
|
||
$sel_date=$_REQUEST['sel_date'];
|
||
$sort_field=$_REQUEST['sort_field'];
|
||
$number_of_records=$_REQUEST['number_of_records'];
|
||
$initial_record=$_REQUEST['initial_record'];
|
||
$userName=$_REQUEST['userName'];
|
||
$operTypeNo=$_REQUEST['operTypeNo'];
|
||
$bgn_time=$_REQUEST['bgn_time'];
|
||
$end_time=$_REQUEST['end_time'];
|
||
|
||
|
||
|
||
|
||
?>
|
||
<html>
|
||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||
|
||
<?php
|
||
adjust_head_frame("down");
|
||
adjust_title_head_frame("down");
|
||
adjust_title_tail_frame("down");
|
||
|
||
adjust_content_head_frame("down");
|
||
$db=$omc_db;
|
||
/*********************************/
|
||
//ע<>⣺<EFBFBD><E2A3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><DEB8><EFBFBD>Ӧ<EFBFBD><D3A6>case<73>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ݡ<EFBFBD>
|
||
/*********************************/
|
||
|
||
|
||
if(!$sort_field){
|
||
$sort_field = 'datetime'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
}
|
||
|
||
|
||
$sort_direction = 'DESC'; //<2F><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
|
||
$number_records_to_display = 100; //ÿҳ<C3BF><D2B3>¼<EFBFBD><C2BC>
|
||
$where = (isset($where)==1) ? urldecode($where) : ''; //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url<72><6C>
|
||
$where = (isset($where)==1) ? stripslashes($where) : ''; //<2F><><EFBFBD>һЩ'/'
|
||
//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD>汾
|
||
if($language == 'chn'){
|
||
$show_log_def='name_1';
|
||
}else{
|
||
$show_log_def='name_2';
|
||
}
|
||
?>
|
||
<script LANGUAGE="JavaScript">
|
||
function goto(){
|
||
var url_1,url_2,url_3,url_4;
|
||
var initial_record,gotopage,number_records_to_display,where,number_of_records,sort_field;
|
||
gotopage=document.selectform.gotopage.value;
|
||
number_records_to_display=<?php echo $number_records_to_display; ?>;
|
||
where=document.selectform.where.value;
|
||
initial_record=number_records_to_display*(gotopage-1);
|
||
number_of_records=document.selectform.number_of_records.value;
|
||
sel_date=document.selectform.sel_date.value;
|
||
sort_field=document.selectform.sort_field.value;
|
||
url_1='<?php echo $PHP_SELF;?>?initial_record='+initial_record;
|
||
url_2="&where="+where;
|
||
url_3="&number_of_records="+number_of_records;
|
||
url_4="&sort_field="+sort_field;
|
||
url_5="&sel_date="+sel_date;
|
||
window.location.href=url_1+url_2+url_3+url_4+url_5;
|
||
}
|
||
</script>
|
||
<?php
|
||
|
||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
if($DEBUG) echo "sel_date=$sel_date,bgn_time=$bgn_time<br>";
|
||
if( isset($sel_date) && ($sel_date != -1) && ($sel_date != '') ){
|
||
$bgn_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));
|
||
$end_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y")));
|
||
}
|
||
elseif($sel_date == -1 || $sel_date==''){
|
||
$bgn_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||
$end_time=date("Y-m-d H:i:s", mktime());
|
||
}
|
||
$where=" WHERE datetime>='$bgn_time' AND datetime<='$end_time'";
|
||
if($DEBUG) echo "where = $where<br>";
|
||
if (isset($number_of_records)!=1){
|
||
$initial_record = 0;
|
||
$select_sql_all="SELECT count(*) as number_of_records FROM $sysoperlog_table ".$where;
|
||
if($DEBUG) echo "<br>select_sql_all=$select_sql_all";
|
||
$result = mysqli_query($pubConn,$select_sql_all);
|
||
$record = mysqli_fetch_object($result);
|
||
$number_of_records = $record->number_of_records;
|
||
}
|
||
$select = "SELECT $sysoperlog_table.userName as userName,
|
||
$sysoperlog_table.datetime as datetime,
|
||
$sysoperlog_table.remark as remark,
|
||
$sysoperconf_table.$show_log_def as logType
|
||
FROM $sysoperlog_table,$sysoperconf_table
|
||
";
|
||
$order = " ORDER BY $sort_field $sort_direction ";
|
||
$initial_record = isset($initial_record)?$initial_record:'0';
|
||
$limit = " LIMIT $initial_record, $number_records_to_display ";
|
||
//echo "a=$order";
|
||
$log_sql= $select.$where.$order.$limit;
|
||
if($DEBUG) echo "<br>log_sql=$log_sql";
|
||
$log_result = @mysqli_query($pubConn,$log_sql);
|
||
$log_rows = @mysqli_fetch_array($log_result);
|
||
echo mysqli_error($pubConn);
|
||
if(!$log_rows){
|
||
echo "$strNotFindRecord";
|
||
exit();
|
||
}
|
||
//<2F><><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
|
||
if (!$all_page_num){
|
||
$page_num= ($initial_record / $number_records_to_display) +1; //<2F><>ҳҳ<D2B3><D2B3>
|
||
$all_page_num= ceil($number_of_records / $number_records_to_display); //<2F><>ҳ<EFBFBD><D2B3>
|
||
}
|
||
?>
|
||
|
||
|
||
<?php
|
||
//$number_of_records_on_current_page = mysqli_num_rows($log_result);
|
||
|
||
if ($number_of_records >= 1) {
|
||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF>Ʒ<EFBFBD>ҳ<EFBFBD><D2B3>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>
|
||
$next_index = $initial_record + $number_records_to_display; //<2F><>ҳ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
||
if ($next_index > $number_of_records){
|
||
$next_index = $number_of_records;
|
||
}
|
||
$t1 = $initial_record + 1;
|
||
$prev_index = $initial_record - $number_records_to_display;
|
||
if ($prev_index < 0) {
|
||
$prev_index = 0;
|
||
}
|
||
}
|
||
$show_initital_record=$initial_record+1;
|
||
?>
|
||
|
||
<form name="selectform" method="post" action="<?php echo"$PHP_SELF";?>">
|
||
<table border="0" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF">
|
||
<tr>
|
||
<TD width="50%">
|
||
<?php echo "$strDisplayRecords:<FONT color=#0000ff> $show_initital_record - $next_index</FONT>, ($strTotalRecords:$number_of_records ) "; ?>
|
||
</TD>
|
||
<TD align="right">
|
||
<?php
|
||
// NEW: Display a link for the previous set of records.
|
||
if ($initial_record != 0) {
|
||
$t1 = "initial_record=$prev_index&number_of_records=$number_of_records";
|
||
$t2 = "userName=$userName&operTypeNo=$operTypeNo";
|
||
$t3 = " bgn_time=$bgn_time&end_time=$end_time";
|
||
if(isset($sel_date)==1){
|
||
$t4 = "sel_date=$sel_date";
|
||
echo "<a href=\"$PHP_SELF?$t1&$t2&$t3&$t4\">";
|
||
}
|
||
else{
|
||
echo "<a href=\"$PHP_SELF?$t1&$t2&$t3\">";
|
||
}
|
||
echo "Previous <IMG alt=$strPreviousPage align=absBottom border=0 src=../../images/left.gif ></a> ";
|
||
}else{
|
||
echo "<font color=\"#808080\">Previous </font><IMG alt=$strPreviousPage align=absBottom border=0 src=../../images/left_1.gif ></a> ";
|
||
}
|
||
|
||
echo "<select size=\"1\" name=\"gotopage\" onChange=\"javascript:goto()\">";
|
||
for($i=1;$i<=$all_page_num;$i++){
|
||
if($i== $page_num ){
|
||
echo "<option selected value=\"$i\" >$i</option>";
|
||
}else{
|
||
echo "<option value=\"$i\">$i</option>";
|
||
}
|
||
}
|
||
echo "</select>";
|
||
|
||
// NEW: Display a link for the next set of records.
|
||
if ($next_index != $number_of_records && $number_of_records >0) {
|
||
$t1 = "initial_record=$next_index&number_of_records=$number_of_records";
|
||
$t2 = "userName=$userName&operTypeNo=$operTypeNo";
|
||
$t3 = " bgn_time=$bgn_time&end_time=$end_time";
|
||
if(isset($sel_date)==1){
|
||
$t4="sel_date=$sel_date";
|
||
echo "<a href=\"$PHP_SELF?$t1&$t2&$t3&$t4\">";
|
||
}else{
|
||
echo "<a href=\"$PHP_SELF?$t1&$t2&$t3\">";
|
||
}
|
||
echo "<IMG alt=$strNextPage align=absBottom border=0 src=../../images/right.gif> Next</a>";
|
||
}else{
|
||
echo "<IMG alt=$strNextPage align=absBottom border=0 src=../../images/right_1.gif ><font color=\"#808080\"> Next</font>";
|
||
}
|
||
?>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF" bordercolordark="#FFFFFF" style="table-layout:fixed;">
|
||
<tr bgcolor="#E6E6E6" align="center">
|
||
<td width="10%"><?php echo "<a href=\"$PHP_SELF?sort_field=userName&where=$where&number_of_records=$number_of_records&sel_date=$sel_date\">$strOperator</a>";?></td>
|
||
<td width="20%"><?php echo "<a href=\"$PHP_SELF?sort_field=datetime&where=$where&number_of_records=$number_of_records&sel_date=$sel_date\">$strTime</a>";?></td>
|
||
<td width="70%"><?php echo "$strDescription";?></td>
|
||
</tr>
|
||
<?php
|
||
do{
|
||
?>
|
||
<tr>
|
||
<td width="10%"> <?php echo "$log_rows[userName]";?></td>
|
||
<td width="20%" align="center" > <?php echo"$log_rows[datetime]";?></td>
|
||
<td width="70%" align="left" style="word-wrap : break-word ;"> <?php echo"$log_rows[remark]";?></td>
|
||
</tr>
|
||
<?php
|
||
}while( $log_rows=mysqli_fetch_array($log_result));
|
||
?>
|
||
</table>
|
||
|
||
<input type="hidden" name="where" value="<?php echo $where; ?>">
|
||
<input type="hidden" name="number_of_records" value="<?php echo $number_of_records; ?>">
|
||
<input type="hidden" name="sort_field" value="<?php echo $sort_field; ?>">
|
||
<input type="hidden" name="sel_date" value="<?php echo $sel_date; ?>">
|
||
|
||
</form>
|
||
<?php
|
||
adjust_content_tail("down");
|
||
?>
|
||
</body>
|
||
</html>
|