123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- /**
- * 退信列表管理
- */
- require_once( ONU_ROOT . 'application/module/ctrl/Action.class.php');
- require_once ( ONU_ROOT . 'application/lib/data/adminAction.php');
- class Ndr_adminAction extends Action{
-
- public function __construct(){
- parent::__construct();
- if(empty($_SESSION['mds_user'])){
- header("Location:/?a=index&m=admin_login");
- exit();
- }
- }
- //退信列表管理的用户列表
- public function index(){
- $admin = new AdvertAdminAction();
- $api_user = $_SESSION['API_USER'];
- $api_key = $_SESSION['API_KEY'];
- $uid = $_SESSION['user_infos']['id'];
- $info = $_REQUEST['info'];
- $post_url = 'http://api.sendcloud.net/apiv2/bounce/list';
- $e_date = date('Y-m-d',strtotime("+1 day"));
- $s_date = date("Y-m-d", strtotime("-30 day"));
- $date_show = trim($_REQUEST['date_show']);
- if($date_show){
- $date_array = explode("-",$_REQUEST['date_show']);
- $BeginDate2 = $date_array[0];
- $BeginDate2 = date('Y-m-d',strtotime($BeginDate2));
- $EndDate = $date_array[1];
- $EndDate = date('Y-m-d',strtotime($EndDate));
- }
- $start_date = $BeginDate2 ? $BeginDate2 : $s_date;
- $end_date = $EndDate ? $EndDate : $e_date;
- $B = date('Y/m/d',strtotime($start_date));
- $e = date('Y/m/d',strtotime($end_date));
- $date_show = $B.'-'.$e;
- $params = array(
- 'apiUser' => $api_user,
- 'apiKey' => $api_key,
- 'limit' => 100,//返回前100条数据
- 'startDate' => $start_date,
- 'endDate' => $end_date
- );
- $result = make_curl($post_url,$params);
- $list = $result['info']['dataList'];
- $where = "uid ='$uid'";
- foreach($list as $ls){
- $email = $ls['email'];
- $r = $admin->select_ndr_user($where,$email);
- if(empty($r)){
- $data['email'] = $email;
- $data['uid'] = $uid;
- $insert = $admin->insert_ndr_user($data);
- }
- }
- $this->assign('list',$list);
- $this->assign('date_show',$date_show);
- $this->assign('info',$info);
- $this->display("index.html");
- }
- //退信列表管理-删除操作
- public function delete(){
- $api_user = $_SESSION['API_USER'];
- $api_key = $_SESSION['API_KEY'];
- $post_url = 'http://api.sendcloud.net/apiv2/bounce/delete';
- $e_date = date('Y-m-d',time());
- $s_date = date("Y-m-d", strtotime("-30 day"));
- $params = array(
- 'apiUser' => $api_user,
- 'apiKey' => $api_key,
- 'startDate' => $s_date,
- 'endDate' => $e_date
- );
- $result = make_curl($post_url,$params);
- $info = $result['message'];
- header("Location:/?a=ndr_admin&m=index&info=$info");
- exit();
- }
- // class end
- }
- ?>
|