]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 28 Sep 2018 15:33:22 +0000 (16:33 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 28 Sep 2018 15:33:22 +0000 (16:33 +0100)
lib/php/db/table.php
lib/php/out/table.php
www/dbq/dbq.php
www/dbq/html/default.css
www/dbq/html/default.min.css

index d72e9d159cbad93c76c7c6f0ec18bd43fdd1f931..72ec66697c7e5d144ff07828ba5152fa67c5d3e4 100644 (file)
@@ -633,7 +633,7 @@ Class Table extends nb {
                        #.'<div class="btn-group-vertical mx-auto">'
                        .'<div class="db buttons btn-group form-group mx-auto d-table bottom">'
                        .( empty($_SERVER['HTTP_REFERER']) ? '' : '<input type="button" class="btn btn-danger" onclick="document.location=document.referrer" value="Cancel" />')
-                       .'<input class="btn btn-secondary" type="reset" />'
+                       .'<input class="btn btn-warning" type="reset" />'
                        .'<input class="btn btn-primary" type="submit" />'
                        .'</div>'.NB_EOL
                        #.'</div>'.NB_EOL
@@ -2169,10 +2169,10 @@ Class Table extends nb {
                #$r .= '<input id="skill" type="range" min="1" max="100" value="0" />';
                #$r .= '<input id="startdate" name="startdate" min="2012-01-01" max="2013-01-01" type="date" />';
 
+               $options = (bool)($this->p('table-menu-options')!=='0');
                //
                // Options
                //
-               $options = (bool)($this->p('table-menu-options')!=='0');
                if ($options) {
                        $option_html = '';
 
@@ -2250,15 +2250,6 @@ Class Table extends nb {
 
                }
 
-               //
-               // Hidden
-               //
-               if ($this->show_hidden_params) $r .= ''#.print_r(self::$params,true)
-                       .self::form_hidden($form_hidden_ignore)
-                       // Embed for no html format (rent)
-# NB 08.06.18                          .'<input type="'.($this->p('debug') ? 'text' : 'hidden').'" name="download" value="0"/>';
-               ;
-
                //
                // Criterias
                //
@@ -2277,13 +2268,21 @@ Class Table extends nb {
                        ;
 
                }
-
                if (!$options) $r .= $buttons;
                $r .= '</div>'; # < Criterias
 
-               ///
-               // Bye
-               ///
+               //
+               // Hidden
+               //
+               if ($this->show_hidden_params) $r .= ''#.print_r(self::$params,true)
+                       .self::form_hidden($form_hidden_ignore)
+                       // Embed for no html format (rent)
+# NB 08.06.18                          .'<input type="'.($this->p('debug') ? 'text' : 'hidden').'" name="download" value="0"/>';
+               ;
+
+               //
+               // End menu
+               //
                $r .= '</form>'.NB_EOL;
                return $r;
        }
index 8f73838b7b9fe00b9b375da40c37a3e6cafb1b1c..bfaf16f099359d006068726a4616c6f8f254da80 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 return [
   'is_html' => true,
-  'enclose' => array("<table class=\"table table-bordered db-rows widefat striped\">".NB_EOL,"</table>".NB_EOL),
+  'enclose' => array("<table class=\"table table-striped table-responsive table-sm db-rows widefat striped\">".NB_EOL,"</table>".NB_EOL),
   'tag_enclose' => 'tr class="db-row"',
   'tag_head' => 'th',
   'tag' => 'td',
index 698243b750fb7c941d0a5c337f32d064f1e1b2cb..9773d3558ff8f35401df6cb6ce34c8e303db4922 100644 (file)
@@ -345,34 +345,38 @@ class DbQ extends nb {
 
                        $bottom = [];
 
-                       if ($this->http->user()) {
-                               $bottom[] = '<a href="' . $this->base . '/logout"'
-                                       .(
-                                               ( !empty($this->db->conf['ldap']) and $this->http->user() )
-                                               ? ' style="background:url(\'' . $this->base . '/ldap/me.jpg?w=20\') right no-repeat;padding-right:22px"'
-                                               : ''
-                                       )
-                                       .'>Logout: '
-                                       .$this->http->user()
-                                       .' (can: '.$this->perm2h().')'
-                               .'</a>';
-                       }
+                       $this->page_bottom();
 
+                       $this->page->end();
+               }
 
-                       if ($this->perm >= self::ADMIN and !empty($this->db->pdo)) {
-                               $r = [
-                               '/(^|;)password=[^;]*/' => '',
-                               '/;/' => ' ',
-                               ];
-                               $bottom[] = 'Database: '.preg_replace(array_keys($r),$r,$this->db->pdo);
-                       }
+               exit;
+       }
 
-                       if ($bottom and $this->is_html) echo $this->page->tag('div class="block bottom card"',join('<br />'.NB_EOL,$bottom));
+       private function page_bottom() {
+               if ($this->http->user()) {
+                       $bottom[] = '<a href="' . $this->base . '/logout"'
+                               .(
+                                       ( !empty($this->db->conf['ldap']) and $this->http->user() )
+                                       ? ' style="background:url(\'' . $this->base . '/ldap/me.jpg?w=20\') right no-repeat;padding-right:22px"'
+                                       : ''
+                               )
+                               .'>Logout: '
+                               .$this->http->user()
+                               .' (can: '.$this->perm2h().')'
+                       .'</a>';
+               }
 
-                       $this->page->end();
+
+               if ($this->perm >= self::ADMIN and !empty($this->db->pdo)) {
+                       $r = [
+                       '/(^|;)password=[^;]*/' => '',
+                       '/;/' => ' ',
+                       ];
+                       $bottom[] = 'Database: '.preg_replace(array_keys($r),$r,$this->db->pdo);
                }
 
-               exit;
+               if ($bottom and $this->is_html) echo $this->page->tag('div class="block bottom border rounded p-2 d-table"',join('<br />'.NB_EOL,$bottom));
        }
 
        public function user() {
@@ -559,7 +563,7 @@ class DbQ extends nb {
 
                                $r = $this->ar_unshift($r,'view',''
                                        .'<form action="'.$this->table->base.'/vi'.'" method="post" class="vi">'
-                                       .'<a class="button select vi btn btn-primary" href="'.$this->table->base.'/vi'.'" onclick="parentNode.submit();return false;">View</a>'
+                                       .'<a class="button select vi btn btn-sm btn-primary" href="'.$this->table->base.'/vi'.'" onclick="parentNode.submit();return false;">View</a>'
                                        .$hidden
                                        .'</form>'
                                );
@@ -575,7 +579,7 @@ class DbQ extends nb {
                                $rm = $this->uri_add_referer($this->table->base.'/rm');
                                $r['delete'] = ''
                                        .'<form action="'.$rm.'" method="post" class="rm">'
-                                       .'<a class="button rm btn btn-danger" href="'.$rm.'" onclick="parentNode.submit();return false;">Delete</a>'
+                                       .'<a class="button rm btn btn-sm btn-danger" href="'.$rm.'" onclick="parentNode.submit();return false;">Delete</a>'
                                        .$hidden
                                        .'</form>'
                                ;
index 5cfcc54a5c1e3b4b4c7bb688bd0886bcf6d0b640..5eb0ec031f64815082fa14f8ad7fc69d1c4b0aa9 100644 (file)
@@ -13,6 +13,13 @@ body {
        color: #444444;
 }
 
+h1 select {
+       padding: 0;
+       border: none;
+       background: inherit;
+       font: inherit;
+}
+
 a {
        color: inherit;
 }
@@ -322,14 +329,18 @@ body.loader {
 
 h1 {
        margin: 0 0 0.2em 0;
-       font-size: 160%;
+       font-size: 140%;
        padding-bottom: 0.3em;
        margin-bottom: 0.5em;
 }
 
-h1.zaza select {
-       padding: 0;
-       border: none;
-       background: inherit;
-       font: inherit;
+.menu * {
+       font-size: 90%;
+}
+.menu .btn,
+.menu .form-control {
+       max-width: 5rem;
+       height: 1.7rem;
+       padding-top: 0;
+       padding-bottom: 0;
 }
index 8fb25b9869a8d0e2d080f79f3be664c5de9ab35c..ee71ab9da9853e26b9ef0dac3028cbeffcdf5c2e 100644 (file)
@@ -1 +1 @@
-@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:160%;padding-bottom:.3em;margin-bottom:.5em}h1.zaza select{padding:0;border:none;background:inherit;font:inherit}
+@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:140%;padding-bottom:.3em;margin-bottom:.5em}.menu *{font-size:90%}.menu .btn,.menu .form-control{max-width:5rem;height:1.7rem;padding-top:0;padding-bottom:0}