Beispiel #1
0
 public function getAnalysisContent(Analyse $analysis, $nameFrom)
 {
     $html = "<div>";
     $html .= "<span>Olá! {$nameFrom} enviou uma Análise para você do Bureau Inteligencia!</span>";
     $html .= "<div style='display: inline-block; border: 1px solid #710E0E; border-top-width: 3px; border-left: 0; border-right: 0; width: 95%; height: auto; margin-bottom: 15px; margin-top: 15px; padding: 5px 0;'>";
     $html .= "<div style='width: 132px; height: 132px; float: left;'>";
     $html .= "<img src='" . LinkController::getBaseURL() . "/images/bg-logo.gif'/>";
     //$html .=            "<div style='z-index: 1000; position: absolute;'>";
     //$html .=                $this->objectFlash();
     //$html .=            "</div>";
     $html .= "</div>";
     $html .= "<a style='float: left; margin-left: 10px; margin-top: 35px; border: 0' href='" . LinkController::getBaseURL() . "'>";
     $html .= "<img style='border: 0;' src='" . LinkController::getBaseURL() . "/images/escrito-bureau.gif'/>";
     $html .= "</a>";
     $html .= "</div>";
     $html .= "<div style='color: #333333;'>";
     $html .= "<h1 style='text-align: center; margin: 0; padding: 0; font-size: 28.5px; font-weight: bold; letter-spacing: -1px'>" . $analysis->title() . "</h1>";
     $html .= "<br />";
     //$html .=        "<div style='font-weight: normal; font-size: 13px; letter-spacing: -0.3px; line-height: 30px; text-align: left;'>";
     //$html .=                $analysis->text();
     //$html .=        "</div>";
     $html .= "<div style='width: 90%; margin: 5px auto; padding: 5px; background-color: #EEEEEE;'>";
     $html .= "<a href='" . LinkController::getBaseURL() . "/analise/" . $analysis->link() . ".html' style='font-size: 16px; font-weight: bold; color: #710E0E !important;'>" . LinkController::getBaseURL() . "/analise/" . $analysis->link() . ".html</a>";
     $html .= "</div>";
     $html .= "</div>";
     $html .= "</div>";
     return $html;
 }
 public function saveAnalysis(Analyse $publication)
 {
     $statement = "INSERT INTO analysis (title, text, link, theme, state, date) VALUES (:title, :text, :link, :subarea, :state, :date)";
     $query = $this->session->prepare($statement);
     $query->bindParam(":title", $publication->title());
     $query->bindParam(":subarea", $publication->getSubareaId());
     $query->bindParam(":link", $publication->link());
     $query->bindParam(":state", $publication->getStateId());
     $query->bindParam(":text", $publication->text());
     $query->bindParam(":date", $publication->date());
     try {
         $query->execute();
     } catch (PDOException $err) {
         throw new PDOException($err->getMessage());
     }
 }
 public static function printAnalysis(Analyse $publication)
 {
     $html = "<li>";
     $html .= "<span class='date-publication'>[";
     $html .= $publication->getDateFormatted();
     $html .= "]</span>";
     $html .= "<a target='_blank' href='" . LinkController::getBaseURL() . "/analise/" . $publication->link() . ".html'>";
     $html .= $publication->title();
     $html .= "</a><br />";
     $qtdComments = $publication->getComments()->count();
     $html .= "<span class='number-comments'>";
     $html .= $qtdComments . ' ' . ($qtdComments == 1 ? "comentário" : "comentários");
     $html .= "</span>";
     $html .= "</li>";
     echo $html;
 }