Esempio n. 1
0
 public function manframe()
 {
     if (!session('?adminid')) {
         redirect(U(C('USER_AUTH_GATEWAY')));
     }
     $config = M('config')->where('id=1')->find();
     $xiaohao_config = json_decode($config['xiaohao_config'], true);
     $kongbao_config = json_decode($config['kongbao_config'], true);
     $this->assign('xiaohao_config', $xiaohao_config);
     $user_array = array();
     $counts = M('user')->count();
     $user_array['user_counts'] = $counts;
     $model = new UserViewModel();
     $user_array['user_detail'] = $model->field('user_type,type_name,count(1) counts')->group('user_type')->order('user_type asc')->select();
     $this->assign('user_array', $user_array);
     $recharge = array();
     $where = array();
     $where['type'] = 1;
     $recharge_list = M('pay_order')->where($where)->field('status,count(1) counts,sum(pay_money) money')->group('status')->select();
     foreach ($recharge_list as $rk => $rv) {
         if ($rv['status'] == 0) {
             $recharge['n'] = $rv;
         } else {
             $recharge['y'] = $rv;
         }
     }
     $recharge['a']['counts'] = $recharge['n']['counts'] + $recharge['y']['counts'];
     $recharge['a']['money'] = $recharge['n']['money'] + $recharge['y']['money'];
     $this->assign('recharge', $recharge);
     $where['type'] = 0;
     $buy_order['y'] = M('pay_order')->where($where)->field('count(1) counts,sum(pay_money) money')->find();
     $this->assign('buy_order', $buy_order);
     $tixian = array();
     $where = array();
     $tixian_list = M('tixian')->where($where)->field('status,count(1) counts,sum(money) money')->group('status')->select();
     foreach ($tixian_list as $tk => $tv) {
         if ($tv['status'] == 1) {
             $tixian['n'] = $tv;
         } else {
             if ($tv['status'] == 2) {
                 $tixian['y'] = $tv;
             } else {
                 if ($tv['status'] == 3) {
                     $tixian['f'] = $tv;
                 }
             }
         }
     }
     $tixian['a']['counts'] = $tixian['n']['counts'] + $tixian['y']['counts'] + $tixian['f']['counts'];
     $tixian['a']['money'] = $tixian['n']['money'] + $tixian['y']['money'] + $tixian['f']['money'];
     $this->assign('tixian', $tixian);
     $kongbao = array();
     $model = new KongbaoViewModel();
     $kongbao['n'] = M('kongbao')->where('isused=0')->count();
     $kongbao['detail'] = $model->field('type_id,name,count(1) counts')->where('isused=0')->group('type_id')->order('type_id asc')->select();
     $this->assign('kongbao', $kongbao);
     $tixing_kb = $kongbao_config['tixing'];
     $tixing_text_kb = '';
     if ($kongbao['n'] <= $tixing_kb) {
         $close_url = '     <a href=\'javascript:void(0)\' onclick=\'btn_close("kongbao")\'>【关闭提示】</a>';
         $tixing_text_kb = '你当前的未使用空包数量已不足,请及时补货!' . $close_url;
     }
     $this->assign('tixing_text_kb', $tixing_text_kb);
     if ($xiaohao_config['valid'] == 1) {
         $xiaohao = array();
         $model = new XiaohaoViewModel();
         $xiaohao['n'] = M('xiaohao')->where('isused=0')->count();
         $xiaohao['detail'] = $model->field('type_id,name,count(1) counts')->where('isused=0')->group('type_id')->order('type_id asc')->select();
         $this->assign('xiaohao', $xiaohao);
         $tixing_xh = $xiaohao_config['tixing'];
         $tixing_text_xh = '';
         if ($xiaohao['n'] <= $tixing_xh) {
             $close_url = '     <a href=\'javascript:void(0)\' onclick=\'btn_close("xiaohao")\'>【关闭提示】</a>';
             $tixing_text_xh = '你当前的未使用小号数量已不足,请及时补货!' . $close_url;
         }
         $this->assign('tixing_text_xh', $tixing_text_xh);
     }
     $auth_code = '';
     if ($config['auth_code'] != '') {
         $auth_code = $config['auth_code'];
         $key_code = $config['auth_keycode'];
         $CommonAction = new CommonAction();
         $auth_code = $CommonAction->passport_decrypt($auth_code, $key_code);
         $auth_code = explode('&', $auth_code);
     }
     $this->assign('auth_code', $auth_code);
     $array['osinfo'] = PHP_OS;
     $array['osinfo'] .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
     $array['serverinfo'] = $_SERVER['SERVER_SOFTWARE'];
     $sqlinfo = M()->query('SELECT VERSION()');
     $array['sqlinfo'] = $sqlinfo[0]['VERSION()'];
     $array['serverip'] = $_SERVER['SERVER_NAME'] . ' [ ' . gethostbyname($_SERVER['SERVER_NAME']) . ' ]';
     $array['servertime'] = date('Y年n月j日 H:i:s');
     if (@ini_get('file_uploads')) {
         $upload = ini_get('upload_max_filesize');
     } else {
         $upload = '<font color="red">不支持上传</font>';
     }
     $array['upload'] = $upload;
     $this->assign('config', $config);
     $this->assign($array);
     $this->display();
 }
Esempio n. 2
0
 public function invalid_index()
 {
     $config = M('config')->where('id=1')->find();
     $kongbao_config = json_decode($config['kongbao_config'], true);
     import('ORG.Util.Page');
     $type_list = $this->get_kongbao_type();
     $this->assign('type_list', $type_list);
     $kb_model = new KongbaoViewModel();
     $keyword = I('keyword');
     $ftype = I('ftype');
     $where = array();
     if (!empty($keyword) && !empty($ftype)) {
         $where[$ftype] = array('like', '%' . $keyword . '%');
     }
     $type_id = I('type_id', '');
     if ($type_id != '') {
         $where['type_id'] = $type_id;
     }
     $where['isused'] = 2;
     $starttime = I('starttime', '');
     $endtime = I('endtime', '');
     if ($starttime != '') {
         $_POST['starttime'] = urldecode($starttime);
     }
     if ($endtime != '') {
         $_POST['endtime'] = urldecode($endtime);
     }
     if ($starttime == '') {
         $starttime = '2014-01-01 00:00:00';
     }
     if ($endtime == '') {
         $endtime = '2099-12-30 23:59:59';
     }
     $where['addtime'] = array('between', array($starttime, $endtime));
     if ($_REQUEST['action'] == 'del') {
         $mod = new Model('kongbao');
         $delcount = $mod->where($where)->delete();
         $this->message2('共删除' . $delcount . '条!', __URL__ . '/invalid_index');
         exit;
     }
     $count = $kb_model->where($where)->count();
     $numsOfpage = $kongbao_config['numsofpage'];
     if ($numsOfpage == '') {
         $numsOfpage = 30;
     }
     $page = new Page($count, $numsOfpage);
     $show = $page->show();
     $kongbao = $kb_model->where($where)->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('count', $count);
     $this->assign('show', $show);
     $this->assign('kongbao_list', $kongbao);
     $this->display();
 }