Example #1
0
 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;
     }
 }