4 $result = $this->db
->safe_query_fetch("SELECT * FROM `lock`;");
6 echo T('Not locked...');
7 echo $this->html
->form("$URL/2", 'POST', array(
8 array('reason','','textarea',false,'autofocus','reason:'),
9 array('lock','lock','submit')
11 echo(T('By locking you will disable all other users from manipulating records.'));
13 echo $this->html
->render_item_table($result, 'lock');
14 echo $this->html
->form("$URL/2", 'POST', array(
15 array('unlock','unlock','submit')
21 if(isset($_POST['lock'])) {
22 $user=$this->db
->auth
->get_user_id();
23 $username=$this->db
->auth
->get_username_by_id($user);
24 $lock = $this->db
->quote($username.': '.$_POST['reason']);
25 $author = $this->db
->quote($user);
26 $this->db
->safe_query("INSERT INTO `lock` (lock_name,lock_author) VALUES ($lock,$author);");
27 $this->post_redirect_get("$URL_INTERNAL/1", T('Lock set'));
29 if(isset($_POST['unlock'])) {
30 $this->db
->safe_query("TRUNCATE TABLE `lock`;");
31 $this->post_redirect_get("$URL_INTERNAL/1", T('Lock unset'));
33 $this->post_redirect_get("$URL_INTERNAL/1","Lock: No value passed!", true);
This page took 0.45591 seconds and 5 git commands to generate.