--- /dev/null
+#!/usr/bin/env bash
+#####################################################################
+#
+# bin/nb-run-parts
+#
+#####################################################################
+
+USAGE="nb-run-parts PATH"
+DIR=${1:?$USAGE}
+LOG_DIR="/var/log/nb"
+LOCK_DIR="/var/run/nb"
+#run-parts --report $NB_ROOT/etc/cron.daily
+
+for script in $DIR/*; do
+
+ [ -r "$script" -a -x "$script" ] || continue
+ name=$(basename "$script")
+ name=${name%%.*}
+ lock="$LOCK_DIR/$name.lock"
+ [ -e "$lock" ] && continue
+
+ log="$LOG_DIR/$name.log"
+
+ echo $name $script
+
+done
public $formats = [ 'table','div','csv','xml','json','yaml','sh','sql','php' ];
public $limits = ['20','50','100','500','1000'];
public $limit; # Here not in Table becouse of Db::out()
+ public $base;
+ public $html_base;
# Classes
public $out;
$flat = [];
foreach ($params as $k=>$v) { $flat[] = $k.'='.urlencode($v); }
- return $flat ? '?'. join('&',$flat) : '';
+ #debug( $this->db()->base.'?'. join('&',$flat) );
+ return $flat ? $this->request_uri().'?'. join('&',$flat) : '';
}
if (!empty($opt['buttons'])) $buttons = $opt['buttons'];
#$r = '<form class="menu" method="get" action="?">'.NB_EOL;
- $r = '<form class="menu" method="get" action="'.preg_replace('/\?.*$/','',$_SERVER["REQUEST_URI"]).'">'.NB_EOL;
+ $r = '<form class="menu" method="get" action="'.$this->request_uri().'">'.NB_EOL;
+ #$r = '<form class="menu" method="get" action="'.$this->db()->base.preg_replace('/\?.*$/','',$_SERVER["REQUEST_URI"]).'">'.NB_EOL;
# See: http://html5doctor.com/html5-forms-input-types/
#$r .= '<input id="skill" type="range" min="1" max="100" value="0" />';
$row = $new_row;
}
+ function request_uri() {
+ return $this->db()->html_base.preg_replace('/\?.*$/','',$_SERVER["REQUEST_URI"]);
+ }
} # < Class
?>
$this->db->__construct($connect);
$this->db->connect();
+ $this->db->html_base = $this->base;
$this->db->base = $this->base.'/'.$this->db->id;
return $this->db;
}
}
$this->db = new Db(['conf'=>$DB_CONFS]);
- $this->db->base = $this->base;
return $this->db;
}