From 487334a439c2800790198b863663d5231ca1557c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 1 Mar 2016 01:04:05 +0000 Subject: [PATCH] clean code --- lib/php/db/table.php | 61 +++----------------------------------------- 1 file changed, 4 insertions(+), 57 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 98071b80..ef40de97 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -27,12 +27,10 @@ class table extends nb { public $fields_keys = null; public $replace = array(); # replace by javascript public $extras = array(); - public $params = array( # hidden, sort, ... fields - 'table', - 'limit', - 'debug', - 'action', - ); + + # hidden, sort, ... fields + public $params = array( 'table', 'limit', 'debug', 'action',); + public $order_by = null; function __construct($name,$opt=array()) { @@ -454,57 +452,6 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } - function form_criterias($opt=array()) { - // Legacy from sem - NB 25.07.15 !!!!!!!!!!!!!!!!!!! - - echo '
'.PHP_EOL; - echo '
Use: '.join(' | ',$this->db->help_criterias).'
'.PHP_EOL; - - foreach ($this->params as $k) { - $v = $this->p($k); - if ($k == 'limit') $v = ''; - echo ''.PHP_EOL; - } - - $criteria = array(); - foreach ( array_keys($this->fields()) as $k ) { - - $v = empty($_REQUEST[$k]) ? '' : $_REQUEST[$k]; - - $criteria[] = '' - .'' - . '' - . '' - .'' - ; - - } - - $criteria[] = html_select_array(array( - 'AND', - 'OR', - ),array( - 'html' => 'name="op"', - 'selected' => $this->p('op'), - )); - - $criteria[] = html_select_array(array( - array('','HTML'), - array('csv','CSV'), - array('xml','XML'), - array('yaml','YAML'), - array('json','JSON'), - ),array( - 'html' => 'name="format"', - 'selected' => $this->p('format'), - )); - - $criteria[] = ''; - echo join(''.PHP_EOL,$criteria); - echo '
'.PHP_EOL; - - } - function where($fields,$hvalues,$need_all_values=false) { // Construct where -- 2.47.3