public function Footer() { $txt = ''; if ($this->footer_param['form']) { $txt = HTML2PDF::textGET('pdf05'); } if ($this->footer_param['date'] && $this->footer_param['heure']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf03'); } if ($this->footer_param['date'] && !$this->footer_param['heure']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf01'); } if (!$this->footer_param['date'] && $this->footer_param['heure']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf02'); } if ($this->footer_param['page']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf04'); } if (strlen($txt) > 0) { $txt = str_replace('[[date_d]]', date('d'), $txt); $txt = str_replace('[[date_m]]', date('m'), $txt); $txt = str_replace('[[date_y]]', date('Y'), $txt); $txt = str_replace('[[date_h]]', date('H'), $txt); $txt = str_replace('[[date_i]]', date('i'), $txt); $txt = str_replace('[[date_s]]', date('s'), $txt); $txt = str_replace('[[current]]', $this->PageNo(), $txt); $txt = str_replace('[[nb]]', '{nb}', $txt); parent::SetY(-11); $this->setOverline(false); $this->SetFont('helvetica', 'I', 8); $this->Cell(0, 10, $txt, 0, 0, 'R'); } }
/** * generer une erreur HTML2PDF * * @param int numero de l'erreur * @param mixed indications suplementaires sur l'erreur * @return string code HTML eventuel associé à l'erreur */ public final function __construct($err = 0, $other = null, $html = '') { // creation du message d'erreur $msg = ''; switch ($err) { case 1: $msg = HTML2PDF::textGET('err01'); $msg = str_replace('[[OTHER]]', $other, $msg); $this->tag = $other; break; case 2: $msg = HTML2PDF::textGET('err02'); $msg = str_replace('[[OTHER_0]]', $other[0], $msg); $msg = str_replace('[[OTHER_1]]', $other[1], $msg); $msg = str_replace('[[OTHER_2]]', $other[2], $msg); break; case 3: $msg = HTML2PDF::textGET('err03'); $msg = str_replace('[[OTHER]]', $other, $msg); $this->tag = $other; break; case 4: $msg = HTML2PDF::textGET('err04'); $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); break; case 5: $msg = HTML2PDF::textGET('err05'); $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); break; case 6: $msg = HTML2PDF::textGET('err06'); $msg = str_replace('[[OTHER]]', $other, $msg); $this->image = $other; break; case 7: $msg = HTML2PDF::textGET('err07'); break; case 8: $msg = HTML2PDF::textGET('err08'); $msg = str_replace('[[OTHER]]', $other, $msg); $this->tag = $other; break; case 9: $msg = HTML2PDF::textGET('err09'); $msg = str_replace('[[OTHER_0]]', $other[0], $msg); $msg = str_replace('[[OTHER_1]]', $other[1], $msg); $this->tag = $other[0]; break; } // creation du message HTML $this->message_html = '<span style="color: #AA0000; font-weight: bold;">' . HTML2PDF::textGET('txt01') . $err . '</span><br>'; $this->message_html .= HTML2PDF::textGET('txt02') . ' ' . $this->file . '<br>'; $this->message_html .= HTML2PDF::textGET('txt03') . ' ' . $this->line . '<br>'; $this->message_html .= '<br>'; $this->message_html .= $msg; // creation du message classique $msg = HTML2PDF::textGET('txt01') . $err . ' : ' . strip_tags($msg); if ($html) { $this->message_html .= "<br><br>HTML : ..." . trim(htmlentities($html)) . '...'; $this->html = $html; $msg .= ' HTML : ...' . trim($html) . '...'; } parent::__construct($msg, $err); }
function makeError($err, $file, $line, $other = null) { $msg = ''; switch ($err) { case 1: $msg = HTML2PDF::textGET('err01'); $msg = str_replace('[[OTHER]]', $other, $msg); break; case 2: $msg = HTML2PDF::textGET('err02'); $msg = str_replace('[[OTHER_0]]', $other[0], $msg); $msg = str_replace('[[OTHER_1]]', $other[1], $msg); $msg = str_replace('[[OTHER_2]]', $other[2], $msg); break; case 3: $msg = HTML2PDF::textGET('err03'); $msg = str_replace('[[OTHER]]', $other, $msg); break; case 4: $msg = HTML2PDF::textGET('err04'); $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); break; case 5: $msg = HTML2PDF::textGET('err05'); $msg = str_replace('[[OTHER]]', print_r($other, true), $msg); break; case 6: $msg = HTML2PDF::textGET('err06'); $msg = str_replace('[[OTHER]]', $other, $msg); break; } echo '<span style="color: #AA0000; font-weight: bold;">' . HTML2PDF::textGET('txt01') . $err . '</span><br>'; echo HTML2PDF::textGET('txt02') . ' ' . $file . '<br>'; echo HTML2PDF::textGET('txt03') . ' ' . $line . '<br>'; echo '<br>'; echo $msg; exit; }