hedera-web/web/report.php

40 lines
666 B
PHP
Raw Permalink Normal View History

<?php
namespace Vn\Web;
2018-05-23 10:14:20 +00:00
class Report {
var $db;
var $name;
var $html;
2018-05-23 10:14:20 +00:00
function __construct($db, $reportName, $params) {
$this->db = $db;
$this->name = $reportName;
2018-05-23 10:14:20 +00:00
extract($params);
2018-05-23 10:14:20 +00:00
\Vn\Lib\Locale::addPath("reports/$reportName");
2018-05-23 10:14:20 +00:00
ob_start();
include __DIR__.'/report.html.php';
2018-05-23 10:14:20 +00:00
$this->html = ob_get_contents();
ob_end_clean();
2018-05-23 10:14:20 +00:00
if (isset($title))
$this->title = $title;
}
2018-05-23 10:14:20 +00:00
function getTitle() {
return $this->title;
}
2018-05-23 10:14:20 +00:00
function getHtml() {
return $this->html;
}
2018-05-23 10:14:20 +00:00
function sendMail($mail) {
$mailer = new Mailer($this->db);
$mailer->send($mail, $this->html, $this->title);
}
}