$s_no = $checked = ' checked="checked"';
if ( ( $s_yes = preg_match('/^(1|yes|on|true)/i',$checked_value) ? $checked : '' ) != '' ) $s_no = '';
+ $name = $this->preffix.$this->name;
- $t1 = 'span'; $t2 = "</$t1>"; $t1 = "<$t1>";
- #$t1 = "<$t1 id=\"$this->name\">";
- #$t1 = $t2 = '';
-
- return $t1
- .'Yes <input type="radio" class="yes form-control" name="'.$this->preffix.$this->name.'" value="1"'.$s_yes.'>'
- .' | '
- .'No <input type="radio" class="no form-control" name="'.$this->preffix.$this->name.'" value="0"'.$s_no.'>'
+ return '<span class="form-check form-check-inline ml-1 mt-1">'
+ .'<input type="radio" class="yes form-check-input" name="'.$name.'" value="1"'.$s_yes.'><label class="form-check-label">Yes</label>'
+ .' '
+ .'<input type="radio" class="no form-check-input" name="'.$name.'" value="0"'.$s_no.'><label class="form-check-label">No</label>'
#.'<input type="text" id="'.$this->name.'" style="display:none" value="'.($s_yes ? 1 : 0).'">'
- .$t2;
+ .'</span>';
}
echo ''
#.'<div class="btn-group-vertical mx-auto">'
- .'<div class="db buttons btn-group form-group mx-auto d-table bottom">'
+ .'<div class="db buttons btn-group btn-group-sm 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-warning" type="reset" />'
.'<input class="btn btn-primary" type="submit" />'
$buttons = '<div class="btn-group"><input type="submit" class="button button-small btn btn-primary" value="Go"/></div>';
if (!empty($opt['buttons'])) $buttons = $opt['buttons'];
- $r = '<form class="menu card d-table list-group-item form-inline" id="db-table-html-menu-form" method="get" action="'.$this->request_uri().'">'.NB_EOL;
+ $r = '<form class="menu db-menu card d-table list-group-item form-inline" id="db-table-html-menu-form" method="get" action="'.$this->request_uri().'">'.NB_EOL;
# See: http://html5doctor.com/html5-forms-input-types/
#$r .= '<input id="skill" type="range" min="1" max="100" value="0" />';
self::row_parse($row,$o);
foreach ($row as $k => $v) {
- if (isset($o['tag_val'])) {
+ if (!empty($o['tag_val'])) {
$v = '<'.$o['tag_val'].'>'.$v.'</'.preg_replace('/ .*$/','',$o['tag_val']).'>';
}
# Inside tag, ex: label
- if (isset($o['tag_key'])) {
+ if (!empty($o['tag_key'])) {
$v = '<'.$o['tag_key'].'>'.$k.'</'.preg_replace('/ .*$/','',$o['tag_key']).'>'.$v;
}
# Tag = o[tag] or key
- if (isset($o['tag'])) {
+ if (!empty($o['tag'])) {
$class = is_numeric($k) ? '' : ' class="'.$k.'"';
$k = $o['tag'];
} else {
return [
'is_html' => true,
'enclose' => ["<div class=\"db-rows\">".NB_EOL,"</div>".NB_EOL],
- 'tag_enclose' => 'div class="db-row"',
- 'tag' => 'div',
+ 'tag_enclose' => 'div class="db-row border rounded p-2 my-2"',
+ 'tag' => 'div class="row"',
'row' => 'out_tag',
- 'tag_key' => 'label',
- 'tag_val' => 'span',
+ 'tag_key' => 'label class="col col-lg-1"',
+ 'tag_val' => 'div class="col col-lg-11"',
+ #'tag_val' => 'span',
];
?>
display: none !important;
}
+body {
+ font-size: 0.9rem;
+ line-height: 1.2;
+}
h1 {
margin: 0 0 0.2em 0;
font-size: 140%;
document.querySelectorAll("form").forEach(function(e) {
e.onsubmit = function() {
if (this.elements['limit']) {
- var limit = this.elements['limit'];
- if (window._dbq['default_limit'] != 'undefined' && limit.value == window._dbq['default_limit']) limit.removeAttribute("value");
+ var limit = this.elements['limit'];
+ if (window._dbq['default_limit'] != 'undefined' && limit.value == window._dbq['default_limit']) limit.removeAttribute("value");
}
+ // NB 30.09.18: TODO
+ /*
+ if (this.elements['format']) {
+ this.elements['format'].removeAttribute('name');
+ var ex = '';
+ if (ex != window._dbq['default.format'] && ex != 'html') ex = '.'+this.elements['format']
+ this.form.setAttribute('action',window._dbq['table.base']+ex);
+ }
+ */
return form_submit_clean(this);
};
});
form.setAttribute('action',window.location.toString().replace(/\?.*$/,''));
/* Format */
- form.querySelectorAll("form.menu select.format").forEach(function(e) {
+ form.querySelectorAll("form.menu select[name=format]").forEach(function(e) {
e.removeAttribute('name');
e.onchange = function() {
- this.form.setAttribute('action',window._dbq['table.base']+'.'+this.value);
+ var ex = '';
+ if (ex != window._dbq['default.format'] && ex != 'html') ex = '.'+this.value
+ this.form.setAttribute('action',window._dbq['table.base']+ex);
return this.form.onsubmit();
}
});
/* Table */
- form.querySelectorAll("form.menu select.tables").forEach(function(e) {
+ form.querySelectorAll("form.menu select[name=table]").forEach(function(e) {
e.removeAttribute('name');
e.onchange = function() {
this.form.setAttribute('action',window._dbq['db.base']+'/'+this.value+ext);
-@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}
+@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}body{font-size:.9rem;line-height:1.2}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}