4 $result = $this->db
->safe_query_fetch("SELECT * FROM `lock`;");
7 echo $this->html
->form("$URL/2", 'POST', array(
8 array('reason','','textarea',false,'autofocus','reason:'),
9 array('lock','lock','submit')
12 echo $this->html
->render_item_table($result);
13 echo $this->html
->form("$URL/2", 'POST', array(
14 array('unlock','unlock','submit')
20 if(isset($_POST['lock'])) {
21 $user=$this->db
->auth
->get_user_id();
22 $username=$this->db
->auth
->get_username_by_id($user);
23 $lock = $this->db
->quote($username.': '.$_POST['reason']);
24 $this->db
->safe_query("INSERT INTO `lock` (lock_name) VALUES ($lock);");
25 $this->post_redirect_get("$URL_INTERNAL/1", T('Lock set'));
27 if(isset($_POST['unlock'])) {
28 $this->db
->safe_query("TRUNCATE TABLE `lock`;");
29 $this->post_redirect_get("$URL_INTERNAL/1", T('Lock unset'));
31 $this->post_redirect_get("$URL_INTERNAL/1","Lock: No value passed!", true);
This page took 0.484373 seconds and 4 git commands to generate.