Exemple #1
0
 public function scedit()
 {
     if ($this->req['get']['type'] == 'sj') {
         $this->req['get']['name'] ? $set['s_sender'] = $this->req['get']['name'] : '';
         $this->req['get']['status'] ? $set['s_status'] = $this->req['get']['status'] : '';
         $this->db->set(array('table' => 'xgm_sender', 'key' => array_keys($set), 'value' => array_values($set), 'where' => array('and' => array('s_id' => $this->req['get']['id']))));
     }
     if ($this->req['get']['type'] == 'cp') {
         $this->req['get']['name'] ? $set['car_no'] = $this->req['get']['name'] : '';
         $this->req['get']['status'] ? $set['car_status'] = $this->req['get']['status'] : '';
         $this->db->set(array('table' => 'xgm_car', 'key' => array_keys($set), 'value' => array_values($set), 'where' => array('and' => array('car_id' => $this->req['get']['id']))));
     }
     N8_Helper_Helper::showMessage('修改成功', $_SERVER['HTTP_REFERER']);
 }
Exemple #2
0
 public function scard()
 {
     if ($this->req['get']['ctype'] || $this->req['get']['buyname'] || $this->req['get']['exp'] || $this->req['get']['cvalue'] || $this->req['get']['cstatus'] != '') {
         $page = $this->req['get']['page'] ? $this->req['get']['page'] : 1;
         $perNum = 30;
         $start = ($page - 1) * $perNum;
         $cWhere = array('table' => 'xgm_cardlib', 'key' => array('count(*)'));
         $dWhere = array('table' => 'xgm_cardlib', 'key' => array('ci_id', 'co_id', 'cl_num', 'cl_state', 'cl_otime', 'cl_expire', 'ci_money', 'co_order'), 'limit' => array($start, $perNum));
         $theOrInfo = array();
         if ($this->req['get']['buyname']) {
             $cOrder = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('co_id', 'co_order', 'cu_name', 'cview_name'), 'where' => array('and' => array('cu_name' => $this->req['get']['buyname']))));
             for ($i = 0, $j = count($cOrder); $i < $j; $i++) {
                 $cOrderId[] = $cOrder[$i][0];
                 $theOrInfo[$cOrder[$i][0]] = $cOrder[$i];
             }
             $and['co_id'] = $cOrderId;
         }
         $this->req['get']['exp'] ? $and['cl_expire'] = array($this->req['get']['exp'] . ' 00:00:00', $this->req['get']['exp'] . ' 23:59:59') : '';
         $this->req['get']['cvalue'] ? $and['ci_money'] = $this->req['get']['cvalue'] : '';
         $this->req['get']['cstatus'] || $this->req['get']['cstatus'] === 0 ? $and['cl_state'] = $this->req['get']['cstatus'] : '';
         if ($and) {
             $cWhere['where']['and'] = $and;
             $dWhere['where']['and'] = $and;
             $cWhere['where']['oper']['cl_expire'] = array('>=', '<=');
             $dWhere['where']['oper']['cl_expire'] = array('>=', '<=');
         }
         $allNums = $this->db->get($cWhere);
         $data = $this->db->get($dWhere);
         $cardInfoArr = array();
         for ($i = 0, $l = sizeof($data); $i < $l; $i++) {
             if (!array_key_exists($data[$i][1], $theOrInfo)) {
                 $cOrderInfo = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('co_id', 'co_order', 'cu_name', 'cview_name'), 'where' => array('and' => array('co_id' => $data[$i][1])), 'limit' => array(0, 1)));
                 $theOrInfo[$data[$i][1]] = $cOrderInfo[0];
             }
             if (!array_key_exists($data[$i][0], $cardInfoArr)) {
                 $cInfoName = $this->db->get(array('table' => 'xgm_cardinfo', 'key' => array('ci_name'), 'where' => array('and' => array('ci_id' => $data[$i][0])), 'limit' => array(0, 1)));
                 $cardInfoArr[$data[$i][0]] = $cInfoName[0][0];
             }
             $myData[] = array($theOrInfo[$data[$i][1]][1], $data[$i][2], $cardInfoArr[$data[$i][0]], $theOrInfo[$data[$i][1]][3], $theOrInfo[$data[$i][1]][2], $data[$i][4], $data[$i][5], $data[$i][3]);
         }
         $page = N8_Helper_Helper::setPage(array('allNums' => $allNums[0][0], 'curPage' => $page, 'perNum' => $perNum));
     }
     $this->render(array('tplDir' => $this->conf->get('view->rDir'), 'cardlist' => $myData, 'page' => $page));
 }
Exemple #3
0
 public function orderuseredit()
 {
     if (!$this->req['get']['ouid'] && !$this->req['post']['ouid']) {
         N8_Helper_Helper::showMessage('数据错误');
     }
     if ($this->req['post']['submit'] && ($ouid = $this->req['post']['ouid'])) {
         $set = array();
         $this->req['post']['username'] ? $set['ou_username'] = $this->req['post']['username'] : '';
         $this->req['post']['truename'] ? $set['ou_truename'] = $this->req['post']['truename'] : '';
         $this->req['post']['py'] ? $set['ou_pinyin'] = $this->req['post']['py'] : '';
         $this->req['post']['phone'] ? $set['ou_phone'] = $this->req['post']['phone'] : '';
         $this->req['post']['tel'] ? $set['ou_tel'] = $this->req['post']['tel'] : '';
         $this->req['post']['total'] ? $set['ou_total'] = $this->req['post']['total'] : '';
         $this->req['post']['email'] ? $set['ou_email'] = $this->req['post']['email'] : '';
         if ($set) {
             $rs = $this->db->set(array('table' => 'xgm_orderuser', 'key' => array_keys($set), 'value' => array_values($set), 'where' => array('and' => array('ou_id' => $ouid))));
             if ($rs == false) {
                 N8_Helper_Helper::showMessage('操作失败');
             } else {
                 N8_Helper_Helper::showMessage('操作成功', 'index.php?control=user&action=orderuseredit&ouid=' . $ouid);
             }
         } else {
             N8_Helper_Helper::showMessage('数据未改动');
         }
     }
     $info = $this->db->get(array('table' => 'xgm_orderuser', 'key' => array('*'), 'where' => array('and' => array('ou_id' => $this->req['get']['ouid'])), 'limit' => array(0, 1)));
     if (!$info) {
         N8_Helper_Helper::showMessage('数据错误');
     }
     $this->render(array('tplDir' => $this->conf->get('view->rDir'), 'info' => $info[0]));
 }
Exemple #4
0
 public function chstatus()
 {
     if ($this->req['get']['gosubmit']) {
         $this->req['get']['cl_flag'] = intval(trim($this->req['get']['cl_flag']));
         $this->db->set(array('table' => 'xgm_cardlib', 'key' => array('cl_flag', 'cl_state'), 'value' => array($this->req['get']['cl_flag'], $this->req['get']['cl_state']), 'where' => array('and' => array('cl_id' => $this->req['get']['cl_id']))));
         N8_Helper_Helper::showMessage('修改成功');
     } else {
         N8_Helper_Helper::showMessage('非法提交');
     }
 }