X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=94d800268479350da856fd6a0ac8a2d25ebcbcd1;hb=539ab3c14dbbc9f63623eab416033856574c348b;hp=d4c3cb3c5e151873f8282a4554465f8aa8ae07c6;hpb=98f4d4120541dd9e7b9026a993afcdf055d93217;p=mirrors%2FSokoMan.git diff --git a/index.php b/index.php index d4c3cb3..94d8002 100755 --- a/index.php +++ b/index.php @@ -1019,6 +1019,14 @@ class Sklad_UI { return true; } + function check_locks() { + $result = $this->db->safe_query_fetch("SELECT * FROM `lock`;"); + if(!empty($result)) { + echo T('There are locks:').' '.$this->html->render_item_table($result); + $this->post_redirect_get('', 'There are locks!', true); + } + } + function process_http_request_post($action=false, $class=false, $id=false, $force_redirect=false) { if($_SERVER['REQUEST_METHOD'] != 'POST') return; //echo('
'); //DEBUG (maybe todo remove), HEADERS ALREADY SENT!!!! @@ -1030,6 +1038,7 @@ class Sklad_UI { * do: $values[$table][$id][$column] */ if(isset($_POST['values'])) { + $this->check_locks(); $values=array(); foreach($_POST['values'] as $table => $columns) { foreach($columns as $column => $ids) { @@ -1050,6 +1059,7 @@ class Sklad_UI { case 'new': $replace = false; case 'edit': + $this->check_locks(); if(!isset($replace)) $replace = true; $table = $class ? $class : 'item'; //print_r($values); //debug @@ -1060,6 +1070,7 @@ class Sklad_UI { $this->post_redirect_get($last, $message); break; case 'delete': + $this->check_locks(); if(!isset($_POST['sure']) || !$_POST['sure']) $this->post_redirect_get("$class/$id/edit", 'Sure user expected :-)'); $this->db->delete($class, $id) || $this->post_redirect_get("$class/$id/edit", "V tabulce $class jentak neco mazat nebudes chlapecku :-P"); $this->post_redirect_get("$class", "Neco (pravdepodobne /$class/$id) bylo asi smazano. Fnuk :'-(");