public function main() { switch ($_GET['action']) { case "add": $this->add(); break; case "show": $this->show(); break; case "state": $this->state(); break; case "deleteAll": $this->deleteAll(); break; case "delete": $this->delete(); break; case "update": $this->update(); break; } if (Tools::isSession("username")) { header("Location:index.php?a=admin&action=admin_login"); } $permission = new permissionModel(); $data = $permission->getPID("广告管理"); if (!strstr($_SESSION['oneAdmin']->permission, $data->id)) { exit("权限不够"); } $this->smarty->display("admin/ad.html"); }
public function main() { switch ($_GET['action']) { case "add": $this->add(); break; case "show": $this->show(); break; case "adminShow": $this->adminShow(); break; case "deleteAll": $this->deleteAll(); break; case "state": $this->state(); break; case "delete": $this->delete(); break; } $permission = new permissionModel(); $data = $permission->getPID("评论管理"); if (!strstr($_SESSION['oneAdmin']->permission, $data->id)) { exit("权限不够"); } $this->smarty->display("admin/comment.html"); }
public function main() { switch ($_GET['action']) { case "show": $this->show(); break; case "delete": $this->delete(); break; case "deleteAll": $this->deleteAll(); break; case "state": $this->state(); break; case "member": $this->member(); break; case "member2": $this->member2(); break; case "update": $this->update(); break; } $permission = new permissionModel(); $data = $permission->getPID("前台会员管理"); if (!strstr($_SESSION['oneAdmin']->permission, $data->id)) { exit("权限不够"); } $this->smarty->display('admin/user.html'); }
public function main() { //Tools::dump($this->model->getAllSubject()); switch ($_GET['action']) { case "addMainNav": $this->addMainNav(); break; case "addSubNav": $this->addSubNav(); break; case "showMainNav": $this->showMainNav(); break; case "showSubNav": $this->showSubNav(); break; case "state": $this->state(); break; case "delete": $this->delete(); break; case "update": $this->update(); break; case "deleteAll": $this->deleteAll(); break; } if (Tools::isSession("username")) { header("Location:index.php?a=admin&action=admin_login"); } $permission = new permissionModel(); $data = $permission->getPID("导航管理"); if (!strstr($_SESSION['oneAdmin']->permission, $data->id)) { exit("权限不够"); } $this->smarty->display("admin/nav.html"); }
private function show() { $permission = new permissionModel(); $data = $permission->getPID("管理员管理"); if (!strstr($_SESSION['oneAdmin']->permission, $data->id)) { exit("权限不够"); } $level = new levelModel(); $AllLevel = $level->getAllLevel(); $levelStr = null; foreach ($AllLevel as $value) { $levelStr .= $value->id . ","; } $levelStr = rtrim($levelStr, ","); //echo $levelStr; if (empty($_GET['level'])) { $this->model->level_id = $levelStr; } else { $this->model->level_id = $_GET['level']; } parent::page($this->model->getAllAdminTotal()); $data = $this->model->getAllAdmin(); //Tools::dump($data); $this->level($_GET['level']); $this->smarty->assign("data", $data); $this->smarty->assign("show", true); }
private function permission($num = null) { $permission = new permissionModel(); $AllPermission = $permission->getAllPermission(); //Tools::dump($AllPermission); $n = explode(",", $num); $str = null; foreach ($AllPermission as $value) { if (in_array($value->id, $n)) { $checked = "checked='checked'"; } else { $checked = ''; } $str .= "<input type='checkbox' value='" . $value->id . "' name='permission[]' " . $checked . ">" . $value->name . " "; } $this->smarty->assign("permission", $str); }