private function insertSyntheseDay($day) { $query = "INSERT INTO oko_resume_day ( jour, tc_ext_max, tc_ext_min, conso_kg, dju, nb_cycle ) VALUE "; $rendu = new rendu(); $max = $rendu->getTcMaxByDay($day); $min = $rendu->getTcMinByDay($day); $conso = $rendu->getConsoByday($day); $dju = $rendu->getDju($max->tcExtMax, $min->tcExtMin); $cycle = $rendu->getNbCycleByDay($day); $consoPellet = $conso->consoPellet == null ? 0 : $conso->consoPellet; $nbCycle = $cycle->nbCycle == null ? 0 : $cycle->nbCycle; $query .= "('" . $day . "', " . $max->tcExtMax . "," . $min->tcExtMin . ", " . $consoPellet . ", " . $dju . ", " . $nbCycle . " );"; $this->log->debug("Class " . __CLASS__ . " | " . __FUNCTION__ . " | " . $query); $n = $this->query($query); if (!$n) { $this->log->error("Class " . __CLASS__ . " | " . __FUNCTION__ . " | creation synthèse du " . $day . " impossible"); return false; } else { $this->log->info("Class " . __CLASS__ . " | " . __FUNCTION__ . " | SUCCESS | creation synthèse du " . $day); return true; } }
break; } break; case "graphique": $g = new gstGraphique(); switch ($_GET['action']) { case "getCapteurs": $g->getCapteurs(); break; case "getGrapheAsso": $g->getGrapheAsso($_GET['id']); break; } break; case "rendu": $r = new rendu(); switch ($_GET['action']) { case "getGraphe": $g = new gstGraphique(); $g->getGraphe(); break; case "getGrapheData": $r->getGrapheData($_GET['id'], $_GET['day']); break; case "getIndicByDay": if (isset($_GET['timeStart']) && isset($_GET['timeEnd'])) { $r->getIndicByDay($_GET['day'], $_GET['timeStart'], $_GET['timeEnd']); } else { $r->getIndicByDay($_GET['day']); } break;
case "getGrapheAsso": $g->getGrapheAsso($_GET['graphe']); break; case "updateGrapheAsso": $g->updateGrapheAsso($_POST); break; case "updateGrapheAssoPosition": $g->updateGrapheAssoPosition($_POST); break; case "deleteAssoGraphe": $g->deleteAssoGraphe($_POST); break; } break; case "rendu": $r = new rendu(); switch ($_GET['action']) { case "getGraphe": $g = new gstGraphique(); $g->getGraphe(); break; case "getGrapheData": $r->getGrapheData($_GET['id'], $_GET['jour']); break; case "getIndicByDay": if (isset($_GET['timeStart']) && isset($_GET['timeEnd'])) { //$r->getIndicByDay($_GET['jour'],(int)($_GET['timeStart'] / 1000),(int)($_GET['timeEnd'] / 1000)); $r->getIndicByDay($_GET['jour'], $_GET['timeStart'], $_GET['timeEnd']); } else { $r->getIndicByDay($_GET['jour']); }