Esempio n. 1
0
 public static function buildLineWithCurrentFisicaOrIndicador(Cotation $cot, $bool)
 {
     $html = "";
     $tdImg = self::buildImgTag($cot->getImage()) . "<a class='open-chart-window'>" . $cot->getName() . "</a>";
     if ($bool) {
         $html .= self::buildTD($tdImg, "first-arabica");
     } else {
         $html .= self::buildTD($tdImg, "first-indicador");
     }
     $html .= self::buildTD($cot->getLast());
     $class = $cot->getDiff() >= 0 ? "positive" : "negative";
     $html .= self::buildTD($cot->getDiff(), $class);
     $html .= self::buildTD($cot->getClose());
     return $html;
 }
Esempio n. 2
0
 private function saveOrUpdateCotations(PDOStatement $query, Cotation $cotation)
 {
     //$query = $this->session->prepare($sql);
     $query->bindParam(":code", $cotation->getCode());
     $query->bindParam(":open", str_replace(",", "", $cotation->getOpen()));
     $query->bindParam(":close", str_replace(",", "", $cotation->getClose()));
     $query->bindParam(":max", str_replace(",", "", $cotation->getMax()));
     $query->bindParam(":min", str_replace(",", "", $cotation->getMin()));
     $query->bindParam(":diff", str_replace(",", "", $cotation->getDiff()));
     $query->bindParam(":openCont", str_replace(",", "", $cotation->openContracts()));
     $query->bindParam(":date", date('Y-m-d'));
     $query->execute();
     return $query->rowCount();
 }