📄 export_bat.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/check_type.php");
include_once("inc/utility_all.php");
ob_end_clean();
Header("Cache-control: private");
Header("Content-type: application/vnd.ms-excel");
Header("Content-Disposition: attachment; filename= 内部邮件.xls");
?>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body topmargin="5">
<table border="1" cellspacing="1" width="95%" class="small" cellpadding="3">
<tr style="BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;">
<td align="center">收件人</td>
<td align="center">发件人</td>
<td align="center">抄送</td>
<td align="center">重要级别</td>
<td align="center">主题</td>
<td align="center">时间</td>
<td align="center">内容</td>
</tr>
<?
$query = "SELECT * from EMAIL where find_in_set(EMAIL_ID,'$DELETE_STR')";
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$TO_ID=$ROW["TO_ID"];
$FROM_ID=$ROW["FROM_ID"];
$COPY_TO_ID=$ROW["COPY_TO_ID"];
$IMPORTANT=$ROW["IMPORTANT"];
$SUBJECT=$ROW["SUBJECT"];
$CONTENT=$ROW["CONTENT"];
$SEND_TIME=$ROW["SEND_TIME"];
if($TO_ID!=$LOGIN_USER_ID&&$FROM_ID!=$LOGIN_USER_ID)
continue;
$SUBJECT=str_replace("<","<",$SUBJECT);
$SUBJECT=str_replace(">",">",$SUBJECT);
$SUBJECT=stripslashes($SUBJECT);
$CONTENT=str_replace(" "," ",$CONTENT);
$CONTENT=str_replace("\n","<br>",$CONTENT);
$query1 = "SELECT * from USER where USER_ID='$FROM_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$FROM_NAME=$ROW["USER_NAME"];
$query1 = "SELECT * from USER where USER_ID='$TO_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$TO_NAME=$ROW["USER_NAME"];
$COPY_TO_NAME="";
$TOK=strtok($COPY_TO_ID,",");
while($TOK!="")
{
$query1 = "SELECT * from USER where USER_ID='$TOK'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$COPY_TO_NAME.=$ROW["USER_NAME"].",";
$TOK=strtok(",");
}
if(substr($COPY_TO_NAME,-1)==",")
$COPY_TO_NAME=substr($COPY_TO_NAME,0,-1);
if($IMPORTANT=='0' || $IMPORTANT=="")
$IMPORTANT_DESC="";
else if($IMPORTANT=='1')
$IMPORTANT_DESC="<font color=\"#FF6600\">重要</font>";
else if($IMPORTANT=='2')
$IMPORTANT_DESC="<font color=\"#FF0000\">非常重要</font>";
?>
<tr>
<td nowrap align="center"><?=$TO_NAME?></td>
<td nowrap align="center"><?=$FROM_NAME?></td>
<td><?=$COPY_TO_NAME?></td>
<td nowrap align="center"><?=$IMPORTANT_DESC?></td>
<td nowrap><?=$SUBJECT?></td>
<td nowrap align="center" x:str="'<?=$SEND_TIME?>"><?=$SEND_TIME?></td>
<td><?=$CONTENT?></td>
</tr>
<?
}
?>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -