2016-10-13 15:07:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Vn\Web;
|
|
|
|
|
|
|
|
class Report
|
|
|
|
{
|
|
|
|
var $db;
|
|
|
|
var $name;
|
|
|
|
var $html;
|
|
|
|
|
|
|
|
function __construct ($db, $reportName, $params)
|
|
|
|
{
|
|
|
|
$this->db = $db;
|
|
|
|
$this->name = $reportName;
|
|
|
|
|
|
|
|
extract ($params);
|
|
|
|
|
2016-10-15 18:58:30 +00:00
|
|
|
\Vn\Lib\Locale::addPath ("reports/$reportName");
|
|
|
|
|
2016-10-13 15:07:48 +00:00
|
|
|
ob_start ();
|
|
|
|
include __DIR__.'/report.html.php';
|
|
|
|
$this->html = ob_get_contents ();
|
|
|
|
ob_end_clean ();
|
|
|
|
|
|
|
|
if (isset ($title))
|
|
|
|
$this->title = $title;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTitle ()
|
|
|
|
{
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getHtml ()
|
|
|
|
{
|
|
|
|
return $this->html;
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendMail ($mail)
|
|
|
|
{
|
2017-11-29 10:01:48 +00:00
|
|
|
$mailer = new Mailer ($this->db);
|
|
|
|
$mailer->send ($mail, $this->html, $this->title);
|
2016-10-13 15:07:48 +00:00
|
|
|
}
|
|
|
|
}
|