Exemplo n.º 1
0
 function event_espresso_generat_pdf($name = "Invoice", $content)
 {
     require_once 'html2fpdf.php';
     //exit($content);
     $pdf = new HTML2FPDF('P', 'mm', 'Letter');
     $pdf->AddPage();
     $pdf->WriteHTML($content);
     $pdf->Output($name . '.pdf', 'D');
 }
Exemplo n.º 2
0
 function pdf()
 {
     exit("deactivated for now...");
     if ($ID = Director::urlParam("ID")) {
         if ($invoice = DataObject::get_one("ShopInvoice", "PublicURL = '" . Convert::Raw2SQL($ID) . "'")) {
             $this->Invoice = $invoice;
             if (!isset($_REQUEST['view'])) {
                 //generate pdf
                 require dirname(__FILE__) . '/Thirdparty/html2fpdf/html2fpdf.php';
                 //to get work HTML2PDF
                 error_reporting(E_ALL ^ (E_NOTICE | E_DEPRECATED));
                 $pdf = new HTML2FPDF();
                 $pdf->AddPage();
                 $pdfPath = $invoice->generatePDF();
                 $outputPath = TEMP_FOLDER . "/shopsystem/";
                 $outputFile = $outputPath . $invoice->PublicURL . ".pdf";
                 $fp = fopen($pdfPath, "r");
                 $strContent = fread($fp, filesize($pdfPath));
                 fclose($fp);
                 $pdf->WriteHTML($strContent);
                 $pdf->Output($outputFile);
                 header('Content-type: application/pdf');
                 header('Content-Disposition: attachment; filename="invoice.pdf"');
                 echo file_get_contents($outputFile);
                 //PDF file is generated successfully!
                 exit;
             }
             if (isset($_REQUEST['remove'])) {
                 //remove invoice from public by generating a new public url
                 $invoice->PublicURL = ShopInvoice::generatePublicURL();
                 $invoice->write();
             }
         }
     }
     return array();
 }
Exemplo n.º 3
0
 function Create()
 {
     $this->content = utf8_decode($this->_ParseHTML($this->content));
     $pdf = new HTML2FPDF();
     $pdf->ShowNOIMG_GIF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->content);
     $pdf->Output(\Cx\Lib\FileSystem\FileSystem::replaceCharacters($this->title));
 }
Exemplo n.º 4
0
function PDF_html_2_pdf($data)
{
    global $auth;
    $pdf = new HTML2FPDF();
    $pdf->UseCSS();
    $pdf->UseTableHeader();
    $pdf->AddPage();
    $pdf->WriteHTML(AdjustHTML($data));
    $pdf->Output();
}
Exemplo n.º 5
0
 public function createPDF($url)
 {
     $url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
     require_once '/html2pdf/html2fpdf.php';
     // Create new HTML2PDF class for an A4 page, measurements in mm
     $pdf = new HTML2FPDF('P', 'mm', 'A4');
     $buffer = file_get_contents($url);
     var_dump($buffer);
     // Optional top margin
     $pdf->SetTopMargin(1);
     $pdf->AddPage();
     // Control the x-y position of the html
     $pdf->SetXY(0, 0);
     $pdf->WriteHTML($buffer);
     // The 'D' arg forces the browser to download the file
     $pdf->Output('MyFile.pdf', 'D');
 }
Exemplo n.º 6
0
function getContent($pageId, $action, $userId, $permission, $recursed = 0)
{
    if ($action == "login") {
        if ($userId == 0) {
            ///Commented the requirement of login.lib.php because it is already included in /index.php
            //require_once("login.lib.php");
            $newUserId = login();
            if (is_numeric($newUserId)) {
                return getContent($pageId, "view", $newUserId, getPermissions($newUserId, $pageId, "view"), 0);
            } else {
                return $newUserId;
            }
            ///<The login page
        } else {
            displayinfo("You are logged in as " . getUserName($userId) . "! Click <a href=\"./+logout\">here</a> to logout.");
        }
        return getContent($pageId, "view", $userId, getPermissions($userId, $pageId, "view"), $recursed = 0);
    }
    if ($action == "profile") {
        if ($userId != 0) {
            require_once "profile.lib.php";
            return profile($userId);
        } else {
            displayinfo("You need to <a href=\"./+login\">login</a> to view your profile.!");
        }
    }
    if ($action == "logout") {
        if ($userId != 0) {
            $newUserId = resetAuth();
            displayinfo("You have been logged out!");
            global $openid_enabled;
            if ($openid_enabled == 'true') {
                displaywarning("If you logged in via Open ID, make sure you also log out from your Open ID service provider's website. Until then your session in this website will remain active !");
            }
            return getContent($pageId, "view", $newUserId, getPermissions($newUserId, $pageId, "view"), 0);
        } else {
            displayinfo("You need to <a href=\"./+login\">login</a> first to logout!");
        }
    }
    if ($action == "search") {
        require_once "search.lib.php";
        $ret = getSearchBox();
        if (isset($_POST['query'])) {
            $ret .= getSearchResultString($_POST['query']);
        } elseif (isset($_GET['query'])) {
            $ret .= getSearchResultString($_GET['query']);
        }
        return $ret;
    }
    if (isset($_GET['subaction']) && $_GET['subaction'] == 'getchildren') {
        if (isset($_GET['parentpath'])) {
            global $urlRequestRoot;
            require_once 'menu.lib.php';
            $pidarr = array();
            parseUrlReal(escape($_GET['parentpath']), $pidarr);
            $pid = $pidarr[count($pidarr) - 1];
            $children = getChildren($pid, $userId);
            $response = array();
            $response['path'] = escape($_GET['parentpath']);
            $response['items'] = array();
            foreach ($children as $child) {
                $response['items'][] = array($urlRequestRoot . '/home' . escape($_GET['parentpath']) . $child[1], $child[2]);
            }
            //echo json_encode($response);
            exit;
        }
    }
    if ($permission != true) {
        if ($userId == 0) {
            $suggestion = "(Try <a href=\"./+login\">logging in?</a>)";
        } else {
            $suggestion = "";
        }
        displayerror("You do not have the permissions to view this page. {$suggestion}<br /><input type=\"button\" onclick=\"history.go(-1)\" value=\"Go back\" />");
        return '';
    }
    if ($action == "admin") {
        require_once "admin.lib.php";
        return admin($pageId, $userId);
    }
    ///default actions also to be defined here (and not outside)
    /// Coz work to be done after these actions do involve the page
    $pagetype_query = "SELECT page_module, page_modulecomponentid FROM " . MYSQL_DATABASE_PREFIX . "pages WHERE page_id='" . escape($pageId) . "'";
    $pagetype_result = mysql_query($pagetype_query);
    $pagetype_values = mysql_fetch_assoc($pagetype_result);
    if (!$pagetype_values) {
        displayerror("The requested page does not exist.");
        return "";
    }
    $moduleType = $pagetype_values['page_module'];
    $moduleComponentId = $pagetype_values['page_modulecomponentid'];
    if ($action == "settings") {
        ///<done here because we needed to check if the page exists for sure.
        require_once "pagesettings.lib.php";
        return pagesettings($pageId, $userId);
    }
    if ($action == "widgets") {
        return handleWidgetPageSettings($pageId);
    }
    if ($recursed == 0) {
        $pagetypeupdate_query = "UPDATE " . MYSQL_DATABASE_PREFIX . "pages SET page_lastaccesstime=NOW() WHERE page_id='" . escape($pageId) . "'";
        $pagetypeupdate_result = mysql_query($pagetypeupdate_query);
        if (!$pagetypeupdate_result) {
            return '<div class="cms-error">Error No. 563 - An error has occured. Contact the site administators.</div>';
        }
    }
    if ($moduleType == "link") {
        return getContent($moduleComponentId, $action, $userId, true, 1);
    }
    if ($action == "grant") {
        return grantPermissions($userId, $pageId);
    }
    if ($moduleType == "menu") {
        return getContent(getParentPage($pageId), $action, $userId, true, 1);
    }
    if ($moduleType == "external") {
        $query = "SELECT `page_extlink` FROM `" . MYSQL_DATABASE_PREFIX . "external` WHERE `page_modulecomponentid` =\n\t\t\t\t\t(SELECT `page_modulecomponentid` FROM `" . MYSQL_DATABASE_PREFIX . "pages` WHERE `page_id`= '" . escape($pageId) . "')";
        $result = mysql_query($query);
        $values = mysql_fetch_array($result);
        $link = $values[0];
        header("Location: {$link}");
    }
    global $sourceFolder;
    global $moduleFolder;
    require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php";
    $page = new $moduleType();
    if (!$page instanceof module) {
        displayerror("The module \"{$moduleType}\" does not implement the inteface module</div>");
        return "";
    }
    $createperms_query = " SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action = 'create' AND page_module = '" . $moduleType . "'";
    $createperms_result = mysql_query($createperms_query);
    if (mysql_num_rows($createperms_result) < 1) {
        displayerror("The action \"create\" does not exist in the module \"{$moduleType}\"</div>");
        return "";
    }
    $availableperms_query = "SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action != 'create' AND page_module = '" . $moduleType . "'";
    $availableperms_result = mysql_query($availableperms_query);
    $permlist = array();
    while ($value = mysql_fetch_assoc($availableperms_result)) {
        array_push($permlist, $value['perm_action']);
    }
    array_push($permlist, "view");
    $class_methods = get_class_methods($moduleType);
    foreach ($permlist as $perm) {
        if (!in_array("action" . ucfirst($perm), $class_methods)) {
            displayerror("The action \"{$perm}\" does not exist in the module \"{$moduleType}\"</div>");
            return "";
        }
    }
    if ($action == "pdf") {
        if (isset($_GET['depth'])) {
            $depth = $_GET['depth'];
        } else {
            $depth = 0;
        }
        if (!is_numeric($depth)) {
            $depth = 0;
        }
        global $TITLE;
        global $sourceFolder;
        require_once "{$sourceFolder}/modules/pdf/html2fpdf.php";
        $pdf = new HTML2FPDF();
        $pdf->setModuleComponentId($moduleComponentId);
        $pdf->AddPage();
        $pdf->WriteHTML($page->getHtml($userId, $moduleComponentId, "view"));
        $cp = array();
        $j = 0;
        if ($depth == -1) {
            $cp = child($pageId, $userId, $depth);
            if ($cp[0][0]) {
                for ($i = 0; $cp[$i][0] != NULL; $i++) {
                    require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                    $page1 = new $cp[$i][2]();
                    $modCompId = $cp[$i][5];
                    $pdf->setModuleComponentId($modCompId);
                    $pdf->AddPage();
                    $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                }
            }
        } else {
            if ($depth > 0) {
                $cp = child($pageId, $userId, $depth);
                --$depth;
                while ($depth > 0) {
                    $count = count($cp);
                    for ($j; $j < $count; $j++) {
                        $cp = array_merge((array) $cp, (array) child($cp[$j][0], $userId, $depth));
                    }
                    --$depth;
                }
                if ($cp[0][0]) {
                    for ($i = 0; isset($cp[$i]); $i++) {
                        require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php";
                        $page1 = new $cp[$i][2]();
                        $modCompId = $cp[$i][5];
                        $pdf->setModuleComponentId($modCompId);
                        $pdf->AddPage();
                        $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view"));
                    }
                }
            }
        }
        $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . ".pdf";
        while (file_exists($filePath)) {
            $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . "-" . rand() . ".pdf";
        }
        $pdf->Output($filePath);
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false);
        header("Content-Type: application/pdf");
        header("Content-Disposition: attachment; filename=\"" . basename($filePath) . "\";");
        header("Content-Transfer-Encoding: binary");
        header("Content-Length: " . filesize($filePath));
        @readfile("{$filePath}");
        unlink($filePath);
    }
    return $page->getHtml($userId, $moduleComponentId, $action);
}
Exemplo n.º 7
0
{  
    $farr = array(  
        "/\s+/", //过滤多余空白  
         //过滤 <script>等可能引入恶意内容或恶意改变显示布局的代码,如果不需要插入flash等,还可以加入<object>的过滤  
        "/<(\/?)(script|i?frame|style|html|body|title|link|meta|INPUT|A|img|\?|\%)([^>]*?)>/isU", 
        "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",//过滤javascript的on事件  
   );  
   $tarr = array(  
        " ",  
        "",//如果要直接清除不安全的标签,这里可以留空  
        "",
   );  
  $str = preg_replace( $farr,$tarr,$str);  
   return $str;  
}
$pdf=new HTML2FPDF();
$pdf->AddGBFont('GB','仿宋_GB2312');
$pdf->SetFontSize('8');
$pdf->AddPage();
$fp = fopen("sample.html","r");
$strContent = fread($fp, filesize("sample.html"));
fclose($fp);
$msg=urldecode($_POST['userdefine']);
$msg=str_replace("class=TableBlock", "border=1", $msg);
$msg=str_replace("class=TableHeader", "bgcolor=#DDDDDD", $msg);
$msg=str_replace("class=TableContent", "bgcolor=#EEEEEE", $msg);
$msg=str_replace("class=TableDatat", "bgcolor=#FFFFFF", $msg);
$msg=str_replace("<tr>", "<TR>", $msg);
$msg=str_replace("</tr>", "</TR>", $msg);
$msg=str_replace("<td", "<TD", $msg);
$msg=str_replace("</td>", "</TD>", $msg);
Exemplo n.º 8
0
                                                    <tr class="fil">
                                                        <td><span>5.2 PRESUPUESTO DEL PROYECTO : <?php 
    echo strtoupper(utf8_encode($value[39]));
    ?>
</span> </td>
                                                      
                                                    </tr>
                                                    <tr class="fil">
                                                        <td><span>5.3 FINANCIAMIENTO : <?php 
    echo strtoupper(utf8_encode($value[41]));
    ?>
 </strong></span> </td>
                                                       
                                                    </tr>
                             <?php 
}
?>
                        </tbody></table>
     </div> 

<?php 
$content = ob_get_clean();
$pdf = new HTML2FPDF('P', 'mm', 'A4', 'UTF-8');
$pdf->UseCSS($opt == true);
$pdf->AddPage();
$pdf->WriteHTML($content);
$pdf->ReadCSS($content);
$pdf->Output('proyecto.pdf');
?>

Exemplo n.º 9
0
}
// this query is for Clientorder's components list
$fields = array('name', 'type', 'number', 'paper');
$query = "SELECT name, type, number, paper FROM `clientorders_components` WHERE parent_id='" . $focus->id . "' AND deleted=0";
$result = $focus->db->query($query, true, "Error filling layout fields: ");
while (($row = $focus->db->fetchByAssoc($result)) != null) {
    foreach ($fields as $field) {
        $data[$field] = $row[$field];
    }
    $list[] = $data;
}
//////////////
$xtpl = new XTemplate("modules/{$currentModule}/CreatePDF.html");
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$pdf = new HTML2FPDF();
$xtpl->assign("HEADER", $pdf->headerPDF());
$xtpl->assign("FOOTER", $pdf->footerPDF());
$xtpl->assign("ROWS", $pdf->CompRows($list));
$xtpl->parse("main.row1");
//Assign layout attributes
$xtpl->assign("LABEL_COLOR", $pdfColors["label"]);
$xtpl->assign("FIELD_COLOR", $pdfColors["field"]);
$xtpl->assign("colspan", count($fields));
$xtpl->assign("fSize", $pdfFontSize["default"]);
$xtpl->assign("headingFontSize", $pdfFontSize["heading"]);
$xtpl->assign("headingColor", $pdfColors["heading"]);
$xtpl->assign("titleColor", $pdfColors["headerFld"]);
$xtpl->assign("firstCol", "20%");
$xtpl->assign("secCol", "30%");
//Line divider attributes
Exemplo n.º 10
0
<HEAD><TITLE>test</TITLE></HEAD>
<BODY>

   <a href=>est</a>
   	   <table border=1><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr><tr><td>1</td></tr>
   	   </table>

</BODY>
</HTML>

<?php 
$html = ob_get_contents();
ob_end_clean();
// PDFの書式設定
$pdf = new HTML2FPDF("l", "mm", "A4");
$pdf->Open();
$pdf->SetCompression(false);
$pdf->SetDisplayMode("real");
$pdf->UseCSS();
$pdf->UsePRE();
$pdf->setBasePath("http://google.com");
$pdf->AddPage();
//ファイル情報
$pdf->SetAuthor("Kazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko HiroseKazuhiko Hirose");
$pdf->Bookmark("BookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmarkBookmark");
$pdf->SetTitle("SetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitleSetTitle");
$pdf->SetCreator("SetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreatorSetCreator");
// 本文
$pdf->SetMargins(10, 10);
$pdf->DisplayPreferences('HideWindowUI');
Exemplo n.º 11
0
function getAdvancedReportPDF($resultid)
{
    global $g_db, $G_SESSION, $DOCUMENT_FPDF, $lngstr, $srv_settings, $i_rSet2, $i_rSet3, $i_rSet4, $i_rSet5, $i_rSet6;
    ob_start();
    include_once $DOCUMENT_FPDF . 'html2fpdf.php';
    $i_pdf = false;
    $i_can_access = false;
    if ($G_SESSION['access_reportsmanager'] > 1) {
        $i_can_access = true;
    } else {
        $i_rSet1 = $g_db->Execute("SELECT resultid FROM " . $srv_settings['table_prefix'] . "results WHERE id=" . $G_SESSION['id'] . " AND resultid=" . $resultid);
        if (!$i_rSet1) {
            showDBError(__FILE__, 1);
        } else {
            $i_can_access = $i_rSet1->RecordCount() > 0;
        }
    }
    $i_isok = $i_can_access;
    if ($i_isok) {
        $i_isok = $i_rSet2 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "results WHERE resultid=" . $resultid, 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet2->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "tests WHERE testid=" . $i_rSet2->fields['testid'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet3->EOF;
    }
    if ($i_isok) {
        $i_isok = $i_rSet3->fields['rtemplateid'] > 0 && ($i_rSet3->fields['test_reportgradecondition'] == 0 || $i_rSet3->fields['test_reportgradecondition'] >= $i_rSet2->fields['gscale_gradeid']);
    }
    if ($i_isok) {
        $i_isok = $i_rSet6 = $g_db->SelectLimit("SELECT * FROM " . $srv_settings['table_prefix'] . "users WHERE id=" . $i_rSet2->fields['id'], 1);
    }
    if ($i_isok) {
        $i_isok = !$i_rSet6->EOF;
    }
    $i_result_detailed_1_items = array();
    $i_result_detailed_2_items = array();
    $i_result_detailed_3_items = array();
    $i_result_detailed_4_items = array();
    if ($i_isok) {
        $i_isok = $i_rSet7 = $g_db->Execute("SELECT * FROM " . $srv_settings['table_prefix'] . "results_answers, " . $srv_settings['table_prefix'] . "questions WHERE resultid=" . $resultid . " AND " . $srv_settings['table_prefix'] . "results_answers.questionid=" . $srv_settings['table_prefix'] . "questions.questionid ORDER BY result_answerid");
    }
    if ($i_isok) {
        $i_questionno = 0;
        while (!$i_rSet7->EOF) {
            $i_questionno++;
            $i_answers = array();
            $i_rSet5 = $g_db->Execute("SELECT answer_text, answer_correct FROM " . $srv_settings['table_prefix'] . "answers WHERE questionid=" . $i_rSet7->fields['questionid'] . " ORDER BY answerid");
            if (!$i_rSet5) {
                showDBError(__FILE__, 5);
            } else {
                $i_answerno = 1;
                while (!$i_rSet5->EOF) {
                    $i_answers[$i_answerno] = $i_rSet5->fields['answer_text'];
                    $i_answers_correct[$i_answerno] = $i_rSet5->fields['answer_correct'];
                    $i_answerno++;
                    $i_rSet5->MoveNext();
                }
                $i_rSet5->Close();
            }
            $i_detailed_correct = $i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT;
            $i_result_detailed_3_items[$i_questionno] = $i_questionno . '. ' . getTruncatedHTML($i_rSet7->fields['question_text'], 0);
            $i_result_detailed_1_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno] . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_iscorrect'] . ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_UNDEFINED ? $lngstr['label_undefined'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_CORRECT ? $lngstr['label_yes'] : ($i_rSet7->fields['result_answer_iscorrect'] == IGT_ANSWER_IS_PARTIALLYCORRECT ? $lngstr['label_partially'] : $lngstr['label_no']))) . '<br />';
            $i_result_detailed_1_items[$i_questionno] .= $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '<br />';
            if (!$i_detailed_correct) {
                $i_result_detailed_2_items[$i_questionno] = $i_result_detailed_1_items[$i_questionno];
            }
            $i_result_detailed_3_items[$i_questionno] = '<tr><td>' . $i_result_detailed_3_items[$i_questionno] . '</td></tr>';
            for ($i = 1; $i < $i_answerno; $i++) {
                switch ($i_rSet7->fields['question_type']) {
                    case QUESTION_TYPE_MULTIPLECHOICE:
                    case QUESTION_TYPE_TRUEFALSE:
                        $i_answers_given = (int) $i_rSet7->fields['result_answer_text'];
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : ($i == $i_answers_given ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_MULTIPLEANSWER:
                        $i_answers_given = explode(QUESTION_TYPE_MULTIPLEANSWER_BREAK, $i_rSet7->fields['result_answer_text']);
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td><img src="images/button-checkbox-' . ($i_answers_correct[$i] ? '2' : (in_array($i, $i_answers_given) ? '4' : '0')) . '.gif" width=13 height=13> &nbsp; ' . $i_answers[$i] . '</tr>';
                        break;
                    case QUESTION_TYPE_FILLINTHEBLANK:
                        $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_answers[$i]) . '</td></tr>';
                        break;
                }
            }
            if ($i_rSet7->fields['question_type'] == QUESTION_TYPE_ESSAY) {
                $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . nl2br($i_rSet7->fields['result_answer_text']) . '</td></tr>';
            }
            $i_result_detailed_3_items[$i_questionno] .= '<tr><td>' . $lngstr['email_answer_points'] . $i_rSet7->fields['result_answer_points'] . '</td></tr>';
            if (!$i_detailed_correct) {
                $i_result_detailed_4_items[$i_questionno] = $i_result_detailed_3_items[$i_questionno];
            }
            $i_rSet7->MoveNext();
        }
        $i_rSet7->Close();
        $i_result_detailed_1_text = implode('<br />', $i_result_detailed_1_items);
        $i_result_detailed_2_text = implode('<br />', $i_result_detailed_2_items);
        $i_result_detailed_3_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_3_items) . '</table>';
        $i_result_detailed_4_text = '<table cellpadding=0 cellspacing=0 border=0 width="100%">' . implode("\n", $i_result_detailed_4_items) . '</table>';
        $i_result_detailed_5_text = '';
        $i_result_detailed_6_text = '';
        $i_pdf = eventOnQueryCustomReportPDF();
        if (empty($i_pdf)) {
            $i_pdf = new HTML2FPDF();
            $i_pdf->AddPage();
            $i_pdf->SetFont('Arial', '', 11);
            $i_pdf->SetTextColor(0, 0, 0);
            $g_vars['page']['grade'] = getGradeData($i_rSet2->fields['gscaleid'], $i_rSet2->fields['gscale_gradeid']);
            $g_vars['page']['subjects'] = getTestResultSubjectsData($resultid);
            $i_template_body = getReportTemplate(array('rtemplateid' => $i_rSet3->fields['rtemplateid'], 'username' => $i_rSet6->fields['username'], 'email' => $i_rSet6->fields['email'], 'title' => $i_rSet6->fields['user_title'], 'firstname' => $i_rSet6->fields['user_firstname'], 'lastname' => $i_rSet6->fields['user_lastname'], 'middlename' => $i_rSet6->fields['user_middlename'], 'address' => $i_rSet6->fields['user_address'], 'city' => $i_rSet6->fields['user_city'], 'state' => $i_rSet6->fields['user_state'], 'zip' => $i_rSet6->fields['user_zip'], 'country' => $i_rSet6->fields['user_country'], 'phone' => $i_rSet6->fields['user_phone'], 'fax' => $i_rSet6->fields['user_fax'], 'mobile' => $i_rSet6->fields['user_mobile'], 'pager' => $i_rSet6->fields['user_pager'], 'ipphone' => $i_rSet6->fields['user_ipphone'], 'webpage' => $i_rSet6->fields['user_webpage'], 'icq' => $i_rSet6->fields['user_icq'], 'msn' => $i_rSet6->fields['user_msn'], 'aol' => $i_rSet6->fields['user_aol'], 'gender' => $i_rSet6->fields['user_gender'], 'birthday' => $i_rSet6->fields['user_birthday'], 'husbandwife' => $i_rSet6->fields['user_husbandwife'], 'children' => $i_rSet6->fields['user_children'], 'trainer' => $i_rSet6->fields['user_trainer'], 'photo' => $i_rSet6->fields['user_photo'], 'company' => $i_rSet6->fields['user_company'], 'cposition' => $i_rSet6->fields['user_cposition'], 'department' => $i_rSet6->fields['user_department'], 'coffice' => $i_rSet6->fields['user_coffice'], 'caddress' => $i_rSet6->fields['user_caddress'], 'ccity' => $i_rSet6->fields['user_ccity'], 'cstate' => $i_rSet6->fields['user_cstate'], 'czip' => $i_rSet6->fields['user_czip'], 'ccountry' => $i_rSet6->fields['user_ccountry'], 'cphone' => $i_rSet6->fields['user_cphone'], 'cfax' => $i_rSet6->fields['user_cfax'], 'cmobile' => $i_rSet6->fields['user_cmobile'], 'cpager' => $i_rSet6->fields['user_cpager'], 'cipphone' => $i_rSet6->fields['user_cipphone'], 'cwebpage' => $i_rSet6->fields['user_cwebpage'], 'cphoto' => $i_rSet6->fields['user_cphoto'], 'ufield1' => $i_rSet6->fields['user_ufield1'], 'ufield2' => $i_rSet6->fields['user_ufield2'], 'ufield3' => $i_rSet6->fields['user_ufield3'], 'ufield4' => $i_rSet6->fields['user_ufield4'], 'ufield5' => $i_rSet6->fields['user_ufield5'], 'ufield6' => $i_rSet6->fields['user_ufield6'], 'ufield7' => $i_rSet6->fields['user_ufield7'], 'ufield8' => $i_rSet6->fields['user_ufield8'], 'ufield9' => $i_rSet6->fields['user_ufield9'], 'ufield10' => $i_rSet6->fields['user_ufield10'], 'test_name' => $i_rSet3->fields['test_name'], 'result_id' => $resultid, 'result_date' => getDateLocal($lngstr['language']['date_format_full'], $i_rSet2->fields['result_datestart']), 'result_time_spent' => getTimeFormatted($i_rSet2->fields['result_timespent']), 'result_time_exceeded' => $i_rSet2->fields['result_timeexceeded'] > 0 ? $lngstr['label_yes'] : $lngstr['label_no'], 'result_points_scored' => $i_rSet2->fields['result_points'], 'result_points_possible' => $i_rSet2->fields['result_pointsmax'], 'result_percents' => $i_rSet2->fields['result_pointsmax'] > 0 ? round($i_rSet2->fields['result_points'] * 100 / $i_rSet2->fields['result_pointsmax']) : 0, 'result_grade' => $g_vars['page']['grade']['name'], 'result_grade_feedback' => $g_vars['page']['grade']['feedback'], 'result_subjects' => $g_vars['page']['subjects'], 'result_detailed_1' => $i_result_detailed_1_text, 'result_detailed_2' => $i_result_detailed_2_text, 'result_detailed_3' => $i_result_detailed_3_text, 'result_detailed_4' => $i_result_detailed_4_text, 'result_detailed_5' => $i_result_detailed_5_text, 'result_detailed_6' => $i_result_detailed_6_text));
            $i_pdf->WriteHTML($i_template_body);
        }
    } else {
        $i_pdf = false;
    }
    ob_end_clean();
    return $i_pdf;
}
Exemplo n.º 12
0
if ($_GET[pdf] == 'ok') {
    echo $moneda;
} else {
    echo $lnkmoneda;
}
?>
&nbsp;&nbsp;</font>
</td></tr></table>  
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="tab" align="center" bgcolor="#FFFFFF">
	<?php 
$Reporte->partidas();
?>
</table>
<script language="javascript">
FullScreen();
</script>
</body>
</html>
<?php 
if ($_GET[pdf] == 'ok') {
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf = new HTML2FPDF('P', 'mm', 'a4x');
    $pdf->ubic_css = "../../style.css";
    //agreg mio
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output('presup_por_part_mensual.pdf', 'D');
}
Exemplo n.º 13
0
    if ($pfDebug) {
        echo @"\n<style type=\"text/css\">\n#debugdiv {\nfloat: none;\nposition: absolute;\n/*top: 120;\nleft: 500;*/\ndisplay: none;\n}\n</style>\n<script language=\"javascript\">\nfunction toggleDebugDiv() {\n  var dbgdiv = document.getElementById('debugdiv'); \n  var displ = dbgdiv.style.display;\n  if ((displ == 'none') || (displ == '')) {\n    dbgdiv.style.display = 'block';\n  } else {\n    dbgdiv.style.display = 'none'; \n  }\n}\n</script>\n";
        echo '<div style="text-align: left;"><a href="javascript: toggleDebugDiv();" />DEBUG:</a></div><div id="debugdiv"><table style="background-color: aliceblue; padding: 8pt; border: thick dotted khaki; width: 700px; margin-top: 24pt;"><tr><td><h2>performs.php</h2></td></tr><tr><td>';
        $tabs = new mosTabs(0);
        //startTab (joomla.php line 4318 version 1.0.11) only ever adds tabs to tabPane1 ...
        $tabs->startPane("session");
        report_env($tabs, 1);
        // $tabs->startTab("MAKE", 'session');
    }
    /*============================================================================*/
    $strResult = $objMyForm->make();
    if ($pfDebug) {
        $tabs->endTab();
        $tabs->endPane();
    }
    if ($printpdf) {
        $pdf = new HTML2FPDF();
        $pdf->DisplayPreferences('HideWindowUI');
        $pdf->AddPage();
        $pdf->WriteHTML($strResult);
        ob_end_clean();
        $pdf->Output('doc.pdf', 'D');
    } else {
        echo $strResult;
    }
}
function die2($dietxt)
{
    global $pfDebug;
    die($dietxt);
}
Exemplo n.º 14
0
 function DisplayPDF($smarty, $invoicetype, $template)
 {
     require_once 'pdf-invoices/html2pdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->DisplayPreferences('HideWindowUI');
     $pdf->AddPage();
     $pdf->WriteHTML($this->GetHTML($smarty, $invoicetype, $template));
     // TODO: find a better name
     return $pdf->Output('Invoice_' . date("d/m/Y-H:i") . '.pdf', 'I');
 }
Exemplo n.º 15
0
		  </tr>
		  <tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td>&nbsp;</td>
			<td><div align="right">
			  <input type="submit" name="Submit" value="Ver Reporte" class = "boton"/>
		    </div></td>
		  </tr>
	  </table>
	</form>
	<?php 
}
?>
	
</body>
</html>
<?php 
if ($_REQUEST["tipo"] == 1) {
    $pdf = new HTML2FPDF('P', 'mm', 'a4');
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf->ubic_css = "css/reporte.css";
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output("Reporte_Busqueda.pdf", 'I');
}
Exemplo n.º 16
0
' . $arrNichesRecord[0]["Section"] . '
</td>
<td>
' . $arrNichesRecord[0]["row"] . '
</td>
<td>
' . $arrNichesRecord[0]["columns"] . '
</td>
</tr>
</table>
<br />

<label> <strong>Extra 1</strong></label>
<label class="text">
' . $UrnExtra1 . '</label>
<br/>
<br/>
<label> <strong>Extra 2</strong></label>
<label class="text">' . $UrnExtra2 . '</label>
<br/>
<br />

</body>
</html>
';
$pdf = new HTML2FPDF();
$pdf->AliasNbPages();
//$pdf->Footer($varFooter);
$pdf->AddPage();
$pdf->WriteHTML($varStrContent);
$pdf->Output('urns_detail.pdf', 'D');
            }
            $plink = '<a href="' . $PHP_SELF . "?id=" . $_SESSION['id_ff_anp'][$i] . "&pga=" . $cPga . '">' . $cPgan . '</a>' . "\n";
            echo "&nbsp;" . $plink;
        }
        echo " >>";
    }
}
//pdf
?>
&nbsp;	</td>
  </tr>
</table>
</body>
</html>
<?php 
if ($_GET[pdf] == 'ok') {
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf = new HTML2FPDF();
    $pdf->ubic_css = "../../style.css";
    //agreg mio
    $pdf->DisplayPreferences('HideWindowUI');
    //$pdf->SetAutoPageBreak(false);
    //$pdf->usetableheader=true; $pdf->Header('Objetivos Estrategicos');  //titulo
    $pdf->AddPage();
    //$pdf->SetFont('Arial','',12);
    // $pdf->setBasePath("../../../");
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output('ficha_subactividad.pdf', 'D');
}
Exemplo n.º 18
0
    $result2 = mysql_query("SELECT * FROM secondhs WHERE admno='{$adm}'") or die(mysql_error());
    $row2 = mysql_fetch_array($result2);
    $result3 = mysql_query("SELECT * FROM thirdhs WHERE admno='{$adm}'") or die(mysql_error());
    $row3 = mysql_fetch_array($result3);
    $str = "<html>\n\t\t\t  <head>\n\t\t\t  </head>\n\t\t\t  <body>\n\t\t\t  <center><h1>Salvation Army Higher Secondary School</h1></center>\n\t\t\t  <center><h2>Kowdiar</h2></center>\n\t\t\t  <br><br><br><br>\n\t\t\t  \n\t\t\t  <table align='center' border='1'>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Admission No.&nbsp;</th><td>" . $row['admno'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;First Name&nbsp;</th><td>" . $row['fname'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Last Name&nbsp;</th><td>" . $row['lname'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Fathers Name&nbsp;</th><td>" . $row['father'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Mothers Name&nbsp;</th><td>" . $row['mother'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Guardian Name&nbsp;</th><td>" . $row['guardian'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Sex&nbsp;</th><td>" . $row['sex'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Category&nbsp;</th><td>" . $row['category'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Class&nbsp;</th><td>" . $row['std'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Division&nbsp;</th><td>" . $row['division'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Address&nbsp;</th><td maxwidth='500'>" . $row['address'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>&nbsp;Identification Marks&nbsp;</th><td>1. " . $row['ident1'] . "<br>2. " . $row['ident2'] . "</td>\n\t\t\t  </tr>\n\t\t\t  </table>\n\t\t\t  <br>\n\t\t\t  <br>\n\t\t\t  <table align='center' border='1'>\n\t\t\t  <tr>\n\t\t\t  <th rowspan='2'>Mark Details</th>\n\t\t\t  <th colspan='2'>First Term</th>\n\t\t\t  <th colspan='2'>Second Term</th>\n\t\t\t  <th colspan='2'>Third Term</th>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th>Mark</th><th>Grade</th>\n\t\t\t  <th>Mark</th><th>Grade</th>\n\t\t\t  <th>Mark</th><th>Grade</th>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Malayalam 1</th>\n\t\t\t  <td align='center'>" . $row1['malayalam1'] . "</td><td align='center'>" . $row1['malayalam1g'] . "</td>\n\t\t\t  <td align='center'>" . $row2['malayalam1'] . "</td><td align='center'>" . $row2['malayalam1g'] . "</td>\n\t\t\t  <td align='center'>" . $row3['malayalam1'] . "</td><td align='center'>" . $row3['malayalam1g'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Malayalam 2</th>\n\t\t\t  <td align='center'>" . $row1['malayalam2'] . "</td><td align='center'>" . $row1['malayalam2g'] . "</td>\n\t\t\t  <td align='center'>" . $row2['malayalam2'] . "</td><td align='center'>" . $row2['malayalam2g'] . "</td>\n\t\t\t  <td align='center'>" . $row3['malayalam2'] . "</td><td align='center'>" . $row3['malayalam2g'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Sanskrit</th>\n\t\t\t  <td align='center'>" . $row1['sanskrit'] . "</td><td align='center'>" . $row1['sanskritg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['sanskrit'] . "</td><td align='center'>" . $row2['sanskritg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['sanskrit'] . "</td><td align='center'>" . $row3['sanskritg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>English</th>\n\t\t\t  <td align='center'>" . $row1['english'] . "</td><td align='center'>" . $row1['englishg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['english'] . "</td><td align='center'>" . $row2['englishg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['english'] . "</td><td align='center'>" . $row3['englishg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Hindi</th>\n\t\t\t  <td align='center'>" . $row1['hindi'] . "</td><td align='center'>" . $row1['hindig'] . "</td>\n\t\t\t  <td align='center'>" . $row2['hindi'] . "</td><td align='center'>" . $row2['hindig'] . "</td>\n\t\t\t  <td align='center'>" . $row3['hindi'] . "</td><td align='center'>" . $row3['hindig'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Physics</th>\n\t\t\t  <td align='center'>" . $row1['physics'] . "</td><td align='center'>" . $row1['physicsg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['physics'] . "</td><td align='center'>" . $row2['physicsg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['physics'] . "</td><td align='center'>" . $row3['physicsg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Chemistry</th>\n\t\t\t  <td align='center'>" . $row1['chemistry'] . "</td><td align='center'>" . $row1['chemistryg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['chemistry'] . "</td><td align='center'>" . $row2['chemistryg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['chemistry'] . "</td><td align='center'>" . $row3['chemistryg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Biology</th>\n\t\t\t  <td align='center'>" . $row1['biology'] . "</td><td align='center'>" . $row1['biologyg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['biology'] . "</td><td align='center'>" . $row2['biologyg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['biology'] . "</td><td align='center'>" . $row3['biologyg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Social Science</th>\n\t\t\t  <td align='center'>" . $row1['socialscience'] . "</td><td align='center'>" . $row1['socialscienceg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['socialscience'] . "</td><td align='center'>" . $row2['socialscienceg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['socialscience'] . "</td><td align='center'>" . $row3['socialscienceg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Maths</th>\n\t\t\t  <td align='center'>" . $row1['maths'] . "</td><td align='center'>" . $row1['mathsg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['maths'] . "</td><td align='center'>" . $row2['mathsg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['maths'] . "</td><td align='center'>" . $row3['mathsg'] . "</td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Information Technology</th>\n\t\t\t  <td align='center'>" . $row1['informationtechnology'] . "</td><td align='center'>" . $row1['informationtechnologyg'] . "</td>\n\t\t\t  <td align='center'>" . $row2['informationtechnology'] . "</td><td align='center'>" . $row2['informationtechnologyg'] . "</td>\n\t\t\t  <td align='center'>" . $row3['informationtechnology'] . "</td><td align='center'>" . $row3['informationtechnologyg'] . "</td>\n\t\t\t  </tr>";
    $total1 = $row1['malayalam1'] + $row1['malayalam2'] + $row1['sanskrit'] + $row1['english'] + $row1['hindi'] + $row1['physics'] + $row1['physics'] + $row1['biology'] + $row1['socialscience'] + $row1['maths'] + $row1['informationtechnology'];
    $avg1 = round($total1 / 11, 3);
    $total2 = $row2['malayalam1'] + $row2['malayalam2'] + $row2['sanskrit'] + $row2['english'] + $row2['hindi'] + $row2['physics'] + $row2['physics'] + $row2['biology'] + $row2['socialscience'] + $row2['maths'] + $row2['informationtechnology'];
    $avg2 = round($total2 / 11, 3);
    $total3 = $row3['malayalam1'] + $row3['malayalam2'] + $row3['sanskrit'] + $row3['english'] + $row3['hindi'] + $row3['physics'] + $row3['physics'] + $row3['biology'] + $row3['socialscience'] + $row3['maths'] + $row3['informationtechnology'];
    $avg3 = round($total3 / 11, 3);
    $str .= "<tr>\n\t\t\t  <th align='left'>Total</th>\n\t\t\t  <td align='center'>" . $total1 . "</td><td align='center'></td>\n\t\t\t  <td align='center'>" . $total2 . "</td><td align='center'></td>\n\t\t\t  <td align='center'>" . $total3 . "</td><td align='center'></td>\n\t\t\t  </tr>\n\t\t\t  <tr>\n\t\t\t  <th align='left'>Average</th>\n\t\t\t  <td align='center'>" . $avg1 . "</td><td align='center'>" . grade($avg1) . "</td>\n\t\t\t  <td align='center'>" . $avg2 . "</td><td align='center'>" . grade($avg2) . "</td>\n\t\t\t  <td align='center'>" . $avg3 . "</td><td align='center'>" . grade($avg3) . "</td>\n\t\t\t  </tr>\n\t\t\t  </table>\n\t\t\t  </body>\n\t\t\t  </html>";
}
fwrite($handle, $str);
include 'html\\html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$fp = fopen("textcheck.html", "r");
$strContent = fread($fp, filesize("textcheck.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output("sample.pdf");
?>
<html>
<head>
<title>Salvation Army</title>
</head>
<body>
<iframe src="sample.pdf" width="100%" height="100%" ></iframe>
</body>
</html>
Exemplo n.º 19
0
				
				<tr bgcolor="#FFFFFF"><td align="right"><?php 
    echo number_format($total_presupuesto, 2);
    ?>
</td></tr><?php 
}
?>
		</table>
	</td>
	<td></td>
	<td></td>  
  </tr>
</table>
<script language="javascript">
FullScreen();
</script>
</body>
</html>
<?php 
if ($_GET[pdf] == 'ok') {
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf = new HTML2FPDF('P', 'mm', 'a4x');
    $pdf->ubic_css = "../../style.css";
    //agreg mio
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output('tareas_por_anp.pdf', 'D');
}
Exemplo n.º 20
0
    echo $contentfile;
    /*define('FPDF_FONTPATH','font/');
    		require('fpdf.php');
    		require('html2fpdf.php');
    		$pdf2 = new HTML2FPDF();
    		$pdf = new FPDF();
    		$pdf->SetFont('Arial','B',16);
    		$pdf->AddPage();
    		//$pdf->Cell(40,10,'This one is my Testing.I hate this code. It is very tough code.Creating the pdf but not generated automatically.');
    		//$pdf->WriteHTML2($contentfile);
    		$pdf2->WriteHTML($contentfile);
    		echo $docs = $_SERVER['DOCUMENT_ROOT']."/rao/mayo-admin/welcome/includes/pdf-generator/caseno-".$_REQUEST['fid']."-".date('d-m-y-s').".pdf";
    		
    		$pdf->Output($docs);*/
    require 'html2fpdf.php';
    $pdf = new HTML2FPDF();
    $pdf->AddPage();
    //echo $fp = fopen("$contentfile","r");
    //$strContent = fread($fp, filesize("$contentfile"));
    //fclose($fp);
    //$pdf = new HTML2PDF();
    $pdf->WriteHTML($contentfile);
    echo $docs = $_SERVER['DOCUMENT_ROOT'] . "/rao/mayo-admin/welcome/includes/pdf-generator/caseno-" . $_REQUEST['fid'] . "-" . date('d-m-y-s') . ".pdf";
    $pdf->Output($docs);
    echo "PDF file is generated successfully!";
    echo $sql = "INSERT INTO `final_billing` (`user_id`,`form_id`,`pdf_name`) VALUES ('{$_REQUEST['uid']}','{$_REQUEST['fid']}','caseno-" . $_REQUEST['fid'] . "-" . date('d-m-y-s') . ".pdf')";
    $data = mysql_query($sql);
    $page = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
    //	header("Refresh: 2; url=$page");
}
echo $query = "SELECT * FROM  `final_billing` WHERE  `user_id` = '{$_REQUEST['uid']}' && `form_id`='{$_REQUEST['fid']}' && id = (SELECT MAX(id))";
Exemplo n.º 21
0
<?php

/*    ob_start();
    include("../../view/template/receipt.php");
    $content = ob_get_clean();*/
$htmlfile = "http://localhost/source/view/template/receipt.php";
require "html2pdf.class.php";
try {
    $html2pdf = new HTML2FPDF('P', 'mm', 'Letter');
    //        $fp = fopen("../../view/template/receipt.php", "r");
    $contents = file_get_contents($htmlfile);
    //        fclose($fp);
    //        echo $contents;
    $html2pdf->WriteHTML($contents);
    $html2pdf->Output('receipt.pdf');
} catch (HTML2PDF_exception $e) {
    echo $e;
    exit;
}
Exemplo n.º 22
0
    echo gettext("No calls in your selection");
    ?>
.</h3></center>
<?php 
}
?>
</center>

<?php 
if ($exporttype != "pdf") {
    ?>

<?php 
    include "PP_footer.php";
    ?>

<?php 
} else {
    // EXPORT TO PDF
    $html = ob_get_contents();
    // delete output-Buffer
    ob_end_clean();
    $pdf = new HTML2FPDF();
    $pdf->imgpath = "../../";
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->ShowNOIMG_GIF();
    $pdf->AddPage();
    $pdf->WriteHTML($html);
    $html = ob_get_contents();
    $pdf->Output('CC_invoice_' . date("d/m/Y-H:i") . '.pdf', 'I');
}
Exemplo n.º 23
0
              else*/
            if ($lessonIndex !== false) {
                $html .= "bgcolor=\"#" . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200), 2, "0", STR_PAD_LEFT) . str_pad(dechex(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200), 2, "0", STR_PAD_LEFT) . "\"";
            }
            $html .= ">";
            if ($lessonIndex !== false) {
                $html .= "<font color=\"#" . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][0]) ? $colors[$bookings[$lessonIndex][0]][0] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][1]) ? $colors[$bookings[$lessonIndex][0]][1] : 200)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(getSingleContrastColor(isset($colors[$bookings[$lessonIndex][0]][2]) ? $colors[$bookings[$lessonIndex][0]][2] : 200)), 2, "0", STR_PAD_LEFT) . "\">";
            }
            if ($lessonIndex !== false) {
                $html .= $bookings[$lessonIndex][2];
            } else {
                $html .= "&nbsp;";
            }
            if ($lessonIndex !== false) {
                $html .= '</font>';
            }
            $html .= "</td>";
        }
        $html .= "</tr>";
    }
    $html .= '</table>';
}
$html .= '</body>
</html>';
$pdf = new HTML2FPDF("L");
$pdf->AddPage();
$pdf->WriteHTML($html);
//echo $html;
$pdf->Output();
//Outputs on browser screen
//$pdf->Output('antrag.pdf'); // save document on server
        echo $r[unidad_medida];
        ?>
</td>
			<td align="right"><?php 
        echo $r[meta_anp_objetivo_especifico];
        ?>
</td>
			</tr>
	<?php 
    }
}
?>
</table>
<script language="javascript">
FullScreen();
</script>
</body>
</html>
<?php 
if ($_GET[pdf] == 'ok') {
    $htmlbuffer = ob_get_contents();
    ob_end_clean();
    header("Content-type: application/pdf");
    $pdf = new HTML2FPDF('P', 'mm', 'a4');
    $pdf->ubic_css = "../../style.css";
    //agreg mio
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($htmlbuffer);
    $pdf->Output('reporte.pdf', 'D');
}
Exemplo n.º 25
0
        <td align="right" bgcolor="#f2f8ff"><font color="#000000" face="verdana" size="1">105</font></td>
        
		<td align="right" bgcolor="#f2f8ff"><font color="#000000" face="verdana" size="1">$ 2,280.54</font></td>
    </tr>
	
	
	<tr bgcolor="#600101">

		<td align="right"><font color="#ffffff"><b>TOTAL</b></font></td>
		<td colspan="2" align="center"><font color="#ffffff"><b>95:10 </b></font></td>
		<td align="center"><font color="#ffffff"><b>164</b></font></td>
		<td align="center"><font color="#ffffff"><b>$ 2,385.43</b></font></td>
	</tr>
</table>





<?php 
if ($_GET["printable"] != 'yes') {
    $html = ob_get_contents();
    // delete output-Buffer
    ob_end_clean();
    $pdf = new HTML2FPDF();
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($html);
    $html = ob_get_contents();
    $pdf->Output('doc.pdf', 'I');
}
	  &nbsp;&nbsp;&nbsp;<img src="<?php 
echo Images_Path;
?>
/terminated.jpg">&nbsp; <?php 
echo gettext("Disconnected");
?>
	  
	  </td>
</table>
	

<?php 
if ($exporttype != "pdf") {
    ?>

<?php 
    //include( 'footer.php');
    ?>

<?php 
} else {
    // EXPORT TO PDF
    $html = ob_get_contents();
    // delete output-Buffer
    ob_end_clean();
    $pdf = new HTML2FPDF();
    $pdf->DisplayPreferences('HideWindowUI');
    $pdf->AddPage();
    $pdf->WriteHTML($html);
    $pdf->Output('UnBilledDetails_' . date("d/m/Y-H:i") . '.pdf', 'I');
}
 public function onPreInit($param)
 {
     $myPDF = new HTML2FPDF();
     $myPDF->setBasePath(Prado::getFrameworkPath());
     $url = "http://" . $this->Application->Parameters['PDFHost'] . "/rliq/index.php?page=reports.protokoll.a_Protokoll&idtm_protokoll=2&idtm_termin=0";
     $html = "";
     $html = file_get_contents($url);
     $myPDF->WriteHTML($html);
     $myPDF->Output();
     $this->getResponse()->appendHeader("Content-Type:" . $this->header);
     $this->getResponse()->appendHeader("Content-Disposition:inline;filename=" . $this->docName . '.' . $this->ext);
     $writer->save('php://output');
     exit;
 }
Exemplo n.º 28
-1
<?php

function load($url)
{
    curl_setopt($curld, CURLOPT_URL, $url);
    curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec($curld);
    curl_close($curld);
    return $output;
}
ob_start();
echo load("http://localhost/nuker/");
$htmlbuffer = ob_get_contents();
ob_end_clean();
require '../html2fpdf/html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$pdf->WriteHTML($htmlbuffer);
$pdf->Output('doc.pdf', 'I');
Exemplo n.º 29
-6
 public function Pdf_do($config = array())
 {
     $source_name = $config['name'];
     $task_name = $config['output'];
     require 'htmlofpdf/html2fpdf.php';
     $pdf = new HTML2FPDF();
     $pdf->AddGBFont('GB', 'GB2312');
     $pdf->AddPage();
     $fp = fopen($source_name, "r");
     $strContent = fread($fp, filesize($source_name));
     fclose($fp);
     $pdf->WriteHTML(iconv("UTF-8", "GB2312", $strContent));
     ob_clean();
     $pdf->Output($task_name, true);
 }
Exemplo n.º 30
-14
<?php

$handle = fopen("invoice_gen.html", 'w+');
if ($handle) {
    if (!fwrite($handle, "<table border=1px>\n\t   <tr> <td>dfddfdfdf</td></tr>\t\n\t</table>")) {
        die("couldn't write to file.");
    }
    echo "success writing to file";
}
require 'html2fpdf.php';
$pdf = new HTML2FPDF();
$pdf->AddPage();
$fp = fopen("invoice_gen.html", "r");
$strContent = fread($fp, filesize("invoice_gen.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output("invoice_gen.pdf");
echo "PDF file is generated successfully!";