43 lines
608 B
PHP
43 lines
608 B
PHP
|
<?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);
|
||
|
|
||
|
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)
|
||
|
{
|
||
|
Mailer::send ($this->db, $mail, $this->html, $this->title);
|
||
|
}
|
||
|
}
|
||
|
|