59 $this->task_id=$p_task_id;
61 $this->
value = $this->
db->get_value(
"select p_value from progress where p_id=$1",
65 if ( $this->
db->size()==0)
68 $this->
db->exec_sql(
"insert into progress(p_id,p_value) values ($1,0)",
70 $this->
db->exec_sql(
"delete from progress where p_created < now() - interval '3 hours' ");
80 if ( $p_value > 100 || $p_value < 0 ) {
83 $this->
value=$p_value;
85 $this->
db->exec_sql(
"update progress set p_value=$1 where p_id=$2",
86 [$this->
value,$this->task_id]);
95 $this->
value = $this->
db->get_value(
"select p_value from progress where p_id=$1",
109 header(
'Content-Type: application/json');
110 echo json_encode([
"value"=>$this->
value]);
111 if ($this->
value>=100) {
112 $this->
db->exec_sql(
"delete from progress where p_id=$1",[$this->task_id]);
contains the class for connecting to Noalyss
Use one db for tracking progress bar value, the task id must be unique and let you follow the progres...
increment($p_step)
increment value with $p_step
answer()
Json answer of the task progressing if value is equal or greater than 100 , delete the row.
set_value($p_value)
Store the progress value into the db.
$value
task id (progress_bar.p_id)
get_value()
Get the progress value from db.