Revision 4001,
1.2 KB
checked in by rafaelraymundo, 13 years ago
(diff) |
Ticket #1615 - Componente novo para agenda......................................
|
Rev | Line | |
---|
[4001] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | Copyright DHTMLX LTD. http://www.dhtmlx.com
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 |
|
---|
| 7 | require_once 'pdfGenerator.php';
|
---|
| 8 | require_once 'pdfWrapper.php';
|
---|
| 9 | require_once 'tcpdf_ext.php';
|
---|
| 10 |
|
---|
| 11 | $error_handler = set_error_handler("PDFErrorHandler");
|
---|
| 12 |
|
---|
| 13 | if (get_magic_quotes_gpc()) {
|
---|
| 14 | $xmlString = stripslashes($_POST['mycoolxmlbody']);
|
---|
| 15 | } else {
|
---|
| 16 | strstr($_SERVER['HTTP_USER_AGENT'],"MSIE")?$xmlString = utf8_encode($_POST['mycoolxmlbody']):$xmlString = $_POST['mycoolxmlbody'];
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | $i = 1;
|
---|
| 20 | while( $i == 1)
|
---|
| 21 |
|
---|
| 22 | {
|
---|
| 23 | $a = stripos($xmlString,'<img');
|
---|
| 24 | if ($a === FALSE)
|
---|
| 25 | {
|
---|
| 26 | $i = 0;
|
---|
| 27 | continue;
|
---|
| 28 | }
|
---|
| 29 | $aux1 = substr($xmlString,0,$a);
|
---|
| 30 | $aux2 = substr($xmlString,$a+4);
|
---|
| 31 | //$aux3 = $aux1 . $aux2;
|
---|
| 32 | $b = strpos($aux2,'>');
|
---|
| 33 | if ($b === FALSE)
|
---|
| 34 | {
|
---|
| 35 | $i = 0;
|
---|
| 36 | continue;
|
---|
| 37 | }
|
---|
| 38 | $aux3 = substr($aux2,$b + 1);
|
---|
| 39 | $xmlString = $aux1 . $aux3;
|
---|
| 40 |
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | $xml = new SimpleXMLElement($xmlString, LIBXML_NOCDATA);
|
---|
| 44 | $scPDF = new schedulerPDF();
|
---|
| 45 | $scPDF->printScheduler($xml);
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | function PDFErrorHandler ($errno, $errstr, $errfile, $errline) {
|
---|
| 49 | global $xmlString;
|
---|
| 50 | if ($errno < 1024) {
|
---|
| 51 | error_log($xmlString, 3, 'error_report_'.date("Y_m_d__H_i_s").'.xml');
|
---|
| 52 | exit(1);
|
---|
| 53 | }
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.