From db18d49407fcdc32c07df72fb3a09d8a58468bf0 Mon Sep 17 00:00:00 2001 From: Devops Date: Fri, 12 May 2017 16:51:59 +0100 Subject: [PATCH] lib/php/db/table.php --- lib/php/db/field.php | 3 ++- lib/php/db/table.php | 10 ++-------- www/dbq/dbq.php | 4 +++- www/dbq/html/default.min.js | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 889e3d0f..a2cb070a 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -82,7 +82,8 @@ class field extends nb { if ($this->extras) { $html = ''.$this->out($value).''; } elseif (strpos($this->type,'Zbool') !== false) { - $html = 'Yes No'; + $html .= ''; + $html .= ''; } else { $html = '<'.$tag .' name="'.$this->name.'"' diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 9ca09082..fb0456b0 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1634,18 +1634,13 @@ Class Table extends nb { return $this->db()->exec($sql); } - # dbq t=nb.mime_type a=table.update type=application/rss+xml name='RSS - Really Simple Syndication' ext=rss debug=2 public function update($post,&$info=[]) { -# NB 30.01.17 if (empty($info['values'])) $info['values'] = []; $keys = []; $keys_values = []; $fields = []; $fields_values = []; - #$update = []; - #$where = []; - foreach ($this->fields() as $name => $field) { if (!isset($post[$name])) { @@ -1660,7 +1655,7 @@ Class Table extends nb { $_value = isset($post[self::$key_preff.$name]) ? $post[self::$key_preff.$name] : null; - if ($_value) {# and $_value !== $value) { + if ($_value) { $fields[] = $name; $fields_values[] = $value; $keys_values[] = $_value; @@ -1722,7 +1717,6 @@ Class Table extends nb { } #return $sql; - #bye($info); if (self::p('debug')) { $this->debug($info,1); return false; @@ -1739,7 +1733,7 @@ Class Table extends nb { #bye($info); #return true; #debug($execute); - return $query->rowCount(); + return $info['rowCount']; } diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 0effa376..fc8f8022 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -254,7 +254,9 @@ class DbQ extends nb { $values = $add ? array_fill(0,count($keys),'') : explode($this->param_args_sep,$this->params['args']); - $this->table->html_edit(array_combine($keys,$values),$this->table->base.'/'.($add ? 'insert' : 'update'.'/'.$this->params['args']).'/',$add); + $this->table->html_edit(array_combine($keys,$values), + $this->table->base . '/' . ($add ? 'insert' : 'update' . '/' . urlencode($this->params['args'])) . '/' + ,$add); } public function table_rw() { diff --git a/www/dbq/html/default.min.js b/www/dbq/html/default.min.js index 571552cc..0302e723 100644 --- a/www/dbq/html/default.min.js +++ b/www/dbq/html/default.min.js @@ -1 +1 @@ -function form_clean(e){var t;for(i=0;i'+document.querySelector(".nav.bottom").innerHTML+""),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm'+(window._dbq.perm>=window._dbq.perms.write?' ':""))})}); +function form_clean(e){var t;for(i=0;i'+document.querySelector(".nav.bottom").innerHTML+""),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm'+(window._dbq.perm>=window._dbq.perms.write?' ':""))})}); -- 2.47.3