📄 report.php
字号:
<?
include_once 'inc/auth.php';
include_once 'inc/check_type.php';
include_once 'inc/utility_all.php';
echo '
<html>
<head>
<title>手机短信统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="/inc/sort_table.js"></script>
<script>
function delete_sms(USER_ID)
{
msg=\'确认要删除该用户的发送记录么?\';
if(window.confirm(msg))
{
URL="delete_user.php?USER_ID=" + USER_ID;
window.location=URL;
}
}
</script>
</head>
<body class="bodycolor" topmargin="5" onload="SortTable(\'beSortTable\');">
';
if ($BEGIN_DATE != '')
{
$TIME_OK = is_date_time ($BEGIN_DATE);
if (!($TIME_OK))
{
message ('错误', '起始时间格式不对,应形如 1999-1-2 14:55:20');
button_back ();
exit ();
}
}
if ($END_DATE != '')
{
$TIME_OK = is_date_time ($END_DATE);
if (!($TIME_OK))
{
message ('错误', '截止时间格式不对,应形如 1999-1-2 14:55:20');
button_back ();
exit ();
}
}
$query_sms = 'SELECT count(*) from SMS2 where 1=1';
if ($END_DATE != '')
{
$query_sms .= ' and SEND_TIME<=\'' . $END_DATE . '\'';
}
if ($BEGIN_DATE != '')
{
$query_sms .= ' and SEND_TIME>=\'' . $BEGIN_DATE . '\'';
}
echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/system.gif" WIDTH="22" HEIGHT="20" align="absmiddle"><span class="big3"> 手机短信发送统计</span>
</td>
</tr>
</table>
';
$query1 = 'SELECT * from USER,USER_PRIV,DEPARTMENT where DEPARTMENT.DEPT_ID=USER.DEPT_ID and USER.USER_PRIV=USER_PRIV.USER_PRIV and NOT_LOGIN!=\'1\' order by DEPT_NO,PRIV_NO,USER_NO,USER_NAME';
$cursor = exequery ($connection, $query1);
$USER_COUNT = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$USER_COUNT;
$USER_ID = $ROW['USER_ID'];
$DEPT_NAME = $ROW['DEPT_NAME'];
$USER_NAME = $ROW['USER_NAME'];
$query = $query_sms . (' and SEND_FLAG=\'1\' and FROM_ID=\'' . $USER_ID . '\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$COUNT1 = $ROW[0];
}
$query = $query_sms . (' and SEND_FLAG=\'0\' and FROM_ID=\'' . $USER_ID . '\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$COUNT2 = $ROW[0];
}
$query = $query_sms . (' and SEND_FLAG=\'2\' and FROM_ID=\'' . $USER_ID . '\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$COUNT3 = $ROW[0];
}
if ($USER_COUNT == 1)
{
echo ' <table id="beSortTable" border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3">
<tr class="TableHeader">
<td nowrap align="center">部门</td>
<td nowrap align="center">用户</td>
<td nowrap align="center">发送成功</td>
<td nowrap align="center">未发送</td>
<td nowrap align="center">发送失败</td>
<td nowrap align="center">操作</td>
</tr>
';
}
if ($USER_COUNT % 2 == 1)
{
$TableLine = 'TableLine1';
}
else
{
$TableLine = 'TableLine2';
}
echo ' <tr class="';
echo $TableLine;
echo '">
<td nowrap align="center">';
echo $DEPT_NAME;
echo '</td>
<td nowrap align="center">';
echo $USER_NAME;
echo '</td>
<td nowrap align="center">';
echo $COUNT1;
echo ' <td nowrap align="center">';
echo $COUNT2;
echo '</td>
<td nowrap align="center">';
echo $COUNT3;
echo '</td>
<td nowrap align="center">
<a href="javascript:delete_sms(\'';
echo $USER_ID;
echo '\');">删除该用户的发送记录</a>
</td>
</tr>
';
}
echo '</table>';
button_back ();
echo '
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -