Пример #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');
 }
Пример #2
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));
 }
Пример #3
0
function PDF_html_2_pdf($data)
{
    global $auth;
    $pdf = new HTML2FPDF();
    $pdf->UseCSS();
    $pdf->UseTableHeader();
    $pdf->AddPage();
    $pdf->WriteHTML(AdjustHTML($data));
    $pdf->Output();
}
Пример #4
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');
 }
Пример #5
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');
}
Пример #6
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');
 }
Пример #7
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);
}
Пример #8
0
        "",//如果要直接清除不安全的标签,这里可以留空  
        "",
   );  
  $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);
$msg=str_replace("nowrap", " ", $msg);
$strContent.=uhtml($msg);
//$strContent="测试";
$pdf->WriteHTML(iconv("UTF-8","GB2312",$strContent));
ob_clean();
$pdf->Output("tmp.pdf",true);
//print $strContent;
//echo "PDF file is generated successfully!";
?>
Пример #9
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');
?>

        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');
}
Пример #11
0
//Assign DetailView Fileds
$xtpl->assign('name', $focus->name);
$xtpl->assign('account_name', $focus->account_name);
$xtpl->assign('account_id', $focus->account_id);
$xtpl->assign('contact_name', $focus->contact_name);
$xtpl->assign('contact_id', $focus->contact_id);
$xtpl->assign('assigned_user_name', $focus->assigned_user_name);
$xtpl->assign('description', nl2br(url2html($focus->description)));
$xtpl->assign('vision', $focus->vision);
$xtpl->assign('period', $app_list_strings['clientorders_period_options'][$focus->period]);
$xtpl->assign('pnum', $focus->number);
$xtpl->assign('category', $app_list_strings['clientorders_category_options'][$focus->category]);
$xtpl->assign('note', $focus->note);
$xtpl->assign('quantity', $focus->quantity);
$xtpl->assign('status', $app_list_strings['clientorder_component_status'][$focus->status]);
$xtpl->assign('samples', $focus->samples);
$xtpl->assign('file', $focus->file);
$xtpl->assign('deadline', $focus->deadline);
$xtpl->assign('date_entered', $focus->date_entered);
$xtpl->assign('date_modified', $focus->date_modified);
$pdf->DisplayPreferences('HideWindowUI');
$pdf->AddPage();
$xtpl->parse("main");
$html = $xtpl->pdf_out('main');
$html_encoded = iconv('utf-8', 'CP1251', $html);
$pdf->UseCSS(true);
$pdf->DisableTags();
$pdf->WriteHTML($html_encoded);
//echo $html_encoded;
$pdf->Output("{$focus->number}.pdf", 'D');
Пример #12
0
   	   <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');
//$pdf->SetFont( HideWindowUI,"",8);
$pdf->WriteHTML($html);
// 出力
$pdf->Output('doc.pdf', 'D');
Пример #13
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> 
</page>
<?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('eventos.pdf');
?>

Пример #14
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');
}
Пример #15
0
 /**
  * convert html to pdf
  *
  * @param string $doc_src	path to source file, include filename
  * @param string $doc_dst	path to output file, include filename
  */
 function html2pdf($doc_src, $doc_dst)
 {
     require_once LIB_PATH . 'html2fpdf/html2fpdf.php';
     $strContent = @file_get_contents($doc_src);
     $strContent = iconv('utf-8', 'gbk', $strContent);
     $pdf = new HTML2FPDF();
     $pdf->AddPage();
     $pdf->writeHTML($strContent);
     $pdf->Output($doc_dst);
 }
Пример #16
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');
}
Пример #18
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();
 }
    $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>
Пример #20
0
</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');
Пример #21
0
    		//$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))";
$getPdf = mysql_query($query) or die(mysql_error());
echo $count = mysql_num_rows($getPdf);
if (mysql_num_rows($getPdf) >= 1) {
    $pdfOfUser = mysql_fetch_object($getPdf);
    ?>
		<h1><a href="../includes/pdf-generator/<?php 
    echo $pdfOfUser->pdf_name;
    ?>
            }
            $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');
}
Пример #23
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');
}
Пример #24
0
		<td>
		' . $arrUrn["UrnTagNumber"] . '
		</td>
		</tr>';
    }
} else {
    $varStrContent .= '<tr>
		<td>N/A
		</td>
		<td>
		N/A
		</td>
		<td>
		N/A
		</td>
		</tr>';
}
$varStrContent .= '</table>
<br/>
<label >&nbsp;</label>
</body>
</html>

';
$pdf = new HTML2FPDF();
$pdf->AliasNbPages();
//$pdf->Footer($varFooter);
$pdf->AddPage();
$pdf->WriteHTML($varStrContent);
$pdf->Output('niches_detail.pdf', 'D');
Пример #25
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');
}
Пример #26
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
Пример #27
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;
}
 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;
 }
Пример #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);
 }
Пример #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!";