public function set_password() { $id = $this->acter_id; $O_Role = new O_Role(); if ($id) { $O_Sys = O_Sys::readone(O_Sys::SYS_ROLES); if (isset($O_Sys->list[$id])) { $O_Role = $O_Sys->list[$id]; } else { $this->on_ajax(); } $password = Lib_Req::post('password'); if ($password) { $O_Role->passwd = $password; $O_Sys->list[$O_Role->id] = $O_Role; $O_Sys->set('list'); $O_Sys->flush(); $this->ajax->add_eval_js('cls("add_role");'); $this->on_msg('成功'); } } $this->view->O_Role = $O_Role; $this->ajax->popup('role/password'); $this->on_ajax(); }
public function login() { $name = Lib_Req::post('login_name'); $passwd = Lib_Req::post('passwd'); $name = trim($name); $error = false; if ($name) { $Config_Admin = new Config_Admin(); $role = $Config_Admin->get_acter($name); if ($role) { if ($passwd == $role->passwd) { $this->_login_session($role); } else { $error = true; } } else { $error = true; } } else { $error = true; } if ($error) { $this->on_msg('登陆名或者密码错误'); } if (!Lib_Req::post('login_state')) { $this->ajax->add_eval_js('LOGIN_STATE = 1;'); $this->_after_login(); } $this->ajax->innerhtml('#login_acter', $role->id); $this->ajax->add_eval_js('cls("login-form");'); $this->ajax->add_eval_js('keep_session();'); $this->on_ajax(); }
public function index() { $id = Lib_Req::post('id'); $O_Ticket = new O_Ticket(); $O_Ticket->init_from_id($id); if (!$O_Ticket->is_in_db()) { $this->on_msg('ID 不正确'); } $this->view->ticket = $O_Ticket; $this->ajax->popup('ticket'); $this->on_ajax(); }
public function test_report() { $row = Lib_Req::post('row'); $O_Ticket = new O_Ticket(); $O_Ticket->init_from_id($row['id']); if (!$O_Ticket->is_in_db()) { $this->on_msg('不存在'); } foreach ($row as $k => $v) { if ($k != $O_Ticket->get_pk_name()) { $O_Ticket->set($k, '=', $v); } } $content = Lib_Req::post('content'); $O_TicketTestReport = new O_TicketTestReport(); $O_TicketTestReport->acter_name = $this->acter->id; $O_TicketTestReport->status = $O_Ticket->test_status; $O_TicketTestReport->content = $content; $O_Ticket->test_report[] = $O_TicketTestReport; $O_Ticket->set('test_report'); $O_Ticket->flush(); $this->view->ticket = $O_Ticket; $this->ajax->add_innerhtml('#ticket_report', 'ticket_report'); $this->ajax->add_eval_js('FCKeditorAPI.GetInstance("ticket_test_report_content").SetData("");'); $this->on_ajax(); }
public function set_department() { $name = trim(Lib_Req::post('name')); if ('' == $name) { $this->on_ajax(); } $O_Sys = O_Sys::readone(O_Sys::SYS_DEPARTMENT); if (Lib_Req::post('delete')) { if ('admin' == $name) { $this->on_ajax(); } if (!isset($O_Sys->list[$name])) { $this->on_ajax(); } unset($O_Sys->list[$name]); $O_Ticket = new O_Ticket(); $db = $O_Ticket->get_db(); $sql = 'update ' . $O_Ticket->get_table() . ' set department="admin" where department="' . $name . '"'; $db->query($sql); } else { $O_Sys->list[$name] = $name; } $O_Sys->set('list'); $O_Sys->flush(); $this->get_department_list(); }