<?
session_start();
require_once "../init.php";
require_once "../authority.inc.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>订单交费通知</title>
<LINK href="../share/style.css" rel=stylesheet>
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<? include "../share/top.php"?>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
  <tr>
    <td><? include "order_nav.inc.php"?></td>
  </tr>
  <tr>
    <td height="3" bgcolor="#555555"></td>
  </tr>
  <tr>
    <td valign="top" align="center">
        <table width="100%"  border="0" cellpadding="5" cellspacing="1" bgcolor="#DDDDDD">
          <tr align="center" bgcolor="#EEEEEE">
            <td>订单交费通知</td>
          </tr>
          <tr bgcolor="#FFFFFF" height="300">
            <td bgcolor="#FFFFFF">
<?
$AgentInfo = GetAgentInfo();
for($i=0;$i<count($feeOrder);$i++){
	  $sql="select users.Contact_GB,users.Email,`order`.About,`order`.dtCreate from `order` left join users on order.UserName=users.UserName where OrderID=$feeOrder[$i]";
	  $resultset=$DB->query($sql);
	  $UInfo=$DB->fetch_array($resultset);
	  $day=round((strtotime("now")-strtotime($UInfo[dtCreate]))/3600/24);
	  $endday=date("Y-m-d",strtotime("$UInfo[dtCreate] +7 day"));
	  $sendday=date("Y-m-d");
$body="
尊敬的用户 $UInfo[Contact_GB] :
	您好，您在我司申请的订单( $UInfo[About] )，请在 $endday 前交费，否则系统将会
自动删除您的订单,谢谢合作。
																			".$AgentInfo[Company]."
																			$sendday
";
	  $order=new MailTemplate($body);
	  $order->SmtpServer = $AgentInfo[SmtpServer] ; 
	  $order->SmtpUser = $AgentInfo[SmtpUser] ;
	  $order->SmtpPW = $AgentInfo[SmtpPW] ;
	  $res=$order->sendmail($UInfo[Email],"$UInfo[About] 订单交费通知",$AgentInfo[Company]."<".$AgentInfo[SmtpUser].">");
	  if($res)echo "邮件已成功发送到 $UInfo[Contact_GB] 的邮箱 $UInfo[Email] <br>";
	  flush();
}
?>
            </td>
        </table>
     </td>
  </tr>
</table>
<? 
$DB->close();
include "../share/bottom.php";
?>
</body>
</html>