public function PrjDetail($PubNumber = null) { if ($PubNumber == null) { Util::go(URL . "/error/0"); } else { } echo $PubNumber; }
public function update($id) { $this->authority(40); $title = Util::fetch_post('title'); $content = Util::fetch_post('content'); if ($title == null || $content == null) { $this->error(2); } $news_table = new NewsTable(); $news_table->update($id, $title, $content); Util::go(URL . 'news/manage/'); }
public function addNotify() { $this->authority(21); $title = Util::fetch_post('title'); $content = Util::fetch_post('content'); if ($title == null || $content == null) { $this->error(2); } $notify_table = new NotifyTable(); $notify_table->insert($title, $content); Util::go(URL . 'association/manageNotify/'); }
public function add() { $this->authority(51); if (isset($_FILES['document'])) { $file = $_FILES['document']; } else { $this->error(2); } if ($file['size'] > 2097152) { $this->errorMsg('文件大小不能超过2M'); } $doc_table = new DocumentTable(); $time = Util::get_datetime(); $id = $doc_table->insert($file['name'], $time); move_uploaded_file($file["tmp_name"], $this->location . $id . '_' . $file['name']); Util::go(URL . 'document/manage/'); }
public function signupHandler() { $username = Util::fetch_post('username'); $password = Util::fetch_post('password'); $realname = Util::fetch_post('realname'); if ($username == null || $password == null || $realname == null) { $this->error(2); } $userTable = new UserTable(); if ($userTable->is_exist($username)) { $this->errorMsg('该用户已存在'); } // 插入数据 $userTable->insert($username, $password, $realname); $result = $userTable->select($username, $password); $userExtraTable = new UserExtraTable(); $userExtraTable->insert($result['user_id']); SQLUtil::login($username, $password); Util::go(URL . 'manager/'); }
public static function need_to_login() { if (!Util::is_login()) { Util::go(URL . 'manager/'); } }