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; }
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; }
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); } }
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'); } }
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; }
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'); } }
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'); } } } }
function afterForInsert($insert_id) { Http::redirect('index.php?c=circulate&a=list'); }
function afterForInsert($insert_id) { Http::redirect('index.php?c=equipment&a=list'); }
function getHtmlByUrl($url, $data = '') { $res = Http::https_request($url, $data); return $res; }
function execute() { unset($_SESSION['_USER_INFO']); Http::redirect('index.php'); }
/** * 验证token * @param $tokenCode * 验证完成后重置session中的值(防止重复提交) */ function verifyToken($tokenCode) { if ($_SESSION['_token'] !== $tokenCode) { Http::redirect(GAPP_TOKEN_VERIFY_FAILED); } $_SESSION['_token'] = ''; }