Example #1
0
 /**
  * 邮件接收记录
  */
 public function view_emailNoticeList_receive()
 {
     $this->view_lang();
     $this->smarty->assign("title", "邮件接受记录");
     $where = '';
     $isAdmin = $_SESSION['isAdmin'];
     if ($isAdmin == '0') {
         $where = " AND `to_name` = '{$_SESSION['cnName']}' ";
     }
     $from_name = post_check($_GET['sender']);
     $to_name = post_check($_GET['receiver']);
     if ($from_name != '') {
         $where .= " AND (`from_name` like '%{$from_name}%' OR `from_login_name` like '%{$from_name}%' )";
     }
     if ($to_name != '') {
         $where .= " AND (`to_name`  like  '%{$to_name}%' OR `to_login_name`  like  '%{$to_name}%') ";
     }
     if (!empty($_GET['start_date']) && !empty($_GET['end_date'])) {
         $starTime = strtotime(trim($_GET['start_date']) . " 00:00:00 ");
         $endTime = strtotime(trim($_GET['end_date']) . " 23:59:59 ");
         if ($starTime > $endTime) {
             $temp = $starTime;
             $starTime = $endTime;
             $endTime = $temp;
         }
         $where .= " AND (addtime>{$starTime} OR addtime = {$starTime} ) AND (addtime < {$endTime} OR addtime = {$endTime})";
     }
     $perNum = 20;
     $list = NoticeAct::act_getEmailsPage($where, $perNum, "");
     self::view_comm();
     $this->smarty->assign("emailNoticelist", $list[0]);
     //消息数据
     $this->smarty->assign("pageIndex", $list[1]);
     //导航条
     $this->smarty->assign("searchResults", $list[2]);
     //总数
     $this->smarty->display('emailNoticeList.htm');
 }