Exemplo n.º 1
0
 function getListResForList()
 {
     $model = $this->getModelForList();
     $type = Http::getGET('type', 0);
     $state = Http::getGET('state', 0);
     $p_id = Http::getGET('p_id', 0);
     $extra = '';
     if ($type) {
         $extra .= " `type`='{$type}' ";
     }
     if ($state) {
         if (!empty($extra)) {
             $extra .= ' AND ';
         }
         $extra .= " `state`='{$state}' ";
     }
     if ($p_id) {
         if (!empty($extra)) {
             $extra .= ' AND ';
         }
         $extra .= " `p_id`='{$p_id}' ";
     }
     if (!empty($extra)) {
         if (!empty($extra)) {
             $extra .= ' AND ';
         }
     }
     $extra = ' WHERE ' . $extra . " `deleted`='n' ";
     $res = $model->getList(array(), $extra);
     return $res;
 }
Exemplo n.º 2
0
 function getConditionsForDeleted()
 {
     $id = intval(Http::getPOST('id', 0));
     if ($id <= 0) {
         $this->responseMsg(1, 'Wrong Argument!');
     }
     $conditions = array(array('field' => 'id', 'sign' => '=', 'value' => $id));
     return $conditions;
 }
Exemplo n.º 3
0
 private function validatePassword()
 {
     $username = Http::getPOST('username');
     $password = md5(Http::getPOST('password'));
     $user = new User();
     if (!$user->validatePassword($username, $password)) {
         Http::redirect(GAPP_PASSWORD_VERIFY_FAILED);
     }
 }
Exemplo n.º 4
0
 function execute()
 {
     $id = Http::getGET('id', 0);
     if ($id) {
         $model = new User();
         $info = $model->getRowById($id);
         $this->setRenderValues('info', $info);
         $this->render('index/user_info.php');
     }
 }
Exemplo n.º 5
0
 function getListResForList()
 {
     $model = $this->getModelForList();
     $type = Http::getGET('type', 0);
     $res = array();
     if ($type != 0) {
         $res = $model->getList(array(), " WHERE `type`='{$type}' AND `deleted`='n'");
     } else {
         $res = $model->getList();
     }
     return $res;
 }
Exemplo n.º 6
0
 function execute()
 {
     /*
     if(5 != $_SESSION['_USER_INFO']['type']){
     
     }
     */
     if ($this->isPost) {
     } else {
         $id = Http::getGET('id');
         $user = new User();
         $userInfo = $user->getRowById($id);
         $this->setRenderValues('postData', $userInfo);
         $this->addToken();
         $this->render('index/user_add.php');
     }
 }
Exemplo n.º 7
0
 function execute()
 {
     $case = Http::getGET('case');
     if ('top' == $case) {
         $this->render('index/frame_top.php');
     } else {
         if ('left' == $case) {
             $this->render('index/frame_top.php');
         } else {
             if ('footer' == $case) {
                 $this->render('index/frame_top.php');
             } else {
                 $this->render('index/frame_top.php');
             }
         }
     }
 }
Exemplo n.º 8
0
 function afterForInsert($insert_id)
 {
     Http::redirect('index.php?c=circulate&a=list');
 }
Exemplo n.º 9
0
 function afterForInsert($insert_id)
 {
     Http::redirect('index.php?c=equipment&a=list');
 }
Exemplo n.º 10
0
 function getHtmlByUrl($url, $data = '')
 {
     $res = Http::https_request($url, $data);
     return $res;
 }
Exemplo n.º 11
0
 function execute()
 {
     unset($_SESSION['_USER_INFO']);
     Http::redirect('index.php');
 }
Exemplo n.º 12
0
 /**
  * 验证token
  * @param $tokenCode
  * 验证完成后重置session中的值(防止重复提交)
  */
 function verifyToken($tokenCode)
 {
     if ($_SESSION['_token'] !== $tokenCode) {
         Http::redirect(GAPP_TOKEN_VERIFY_FAILED);
     }
     $_SESSION['_token'] = '';
 }