#!/bin/sh
#This script is created by ssparser automatically. The parser first created by MaoShouyan
printf "Content-type: text/html;charset=gb2312
Cache-Control: no-cache

"
echo -n "";
. ../common/common.sh 
myself="/cgi-bin/Maintain/`basename $0`"

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script language=\"javascript\">
function onCancel() 
{
	window.location.href = \"/cgi-bin/Maintain/history_alert\";
}
</script>
</script>
";
[ "${CGI_logfile}" = "" ] && CGI_logfile="alert_`date +%Y.%m.%d`.log"
fhead="`echo ${CGI_logfile} | cut -d'_' -f1`"
if [ "${fhead}" != "alert" ]; then
	afm_dialog_msg "Ч־ļ!"
	afm_load_page 0 "/cgi-bin/Maintain/history_alert"
	exit 0
fi
if [ "`echo ${CGI_logfile} | cut -d'.' -f4`" != "log" ]; then
	afm_dialog_msg "Ч־ļ!"
	afm_load_page 0 "/cgi-bin/Maintain/history_alert" 
	exit 0
fi

echo -n "
<body>
"; 
if [ "${CGI_logfile}" = "" ]; then
	cgi_show_title "ϵͳ澯->־" 
else
	cgi_show_title "ϵͳ澯->ʷ־ʾ"
fi

echo -n "
<br>
<table width=950 border=0 cellspacing=1 cellpadding=1>
<tr id=tblhdr height=22>
	<td width=120 align=center>û</td>
	<td width=120 align=center>¼ַ</td>
	<td width=150 align=center>ʱ</td>
	<td width=120 align=center></td>
	<td width=* align=center></td>
</tr>
";
if [ -f ${DATAPATH}/${CGI_logfile} ]; then
	tblid="row1"
	exec 0<${DATAPATH}/${CGI_logfile}
	while read optime opuser oper operesule from opaddr theothers;
	do

echo -n "
		<tr id=${tblid}>
		<td align=center>${opuser}</td>
		<td align=center>${opaddr}</td>
		<td align=center>${optime}</td>
		<td align=center>${oper}</td>
		<td align=center>${operesule}</td>
		</tr>
";
	done
	if [ "${tblid}" = "row1" ]; then
		tblid="row2"
	else
		tblid="row1"
	fi
fi

echo -n "
</table>
<table style=\"width:950; border-bottom:1px #787882 solid; color:#0000ff\">
<tr><td align=right>&nbsp;</td></tr>
</table>
<table style=\"width:950\"> 
<tr><td align=right><input type=\"button\" style=\"width:80\" value=\"\" onclick=\"onCancel();\"></input></td></tr>
</table>
</body>
</html>
";