 |
|
Code (PHP)
<?php
require ('report.php');
require_once('C:\AppServ\www\project\mpdf.php');
ob_start();
?>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<style type="text/css">
<!--
@page rotated { size: landscape; }
.style1 {
font-family: "TH SarabunPSK";
font-size: 18pt;
font-weight: bold;
}
.style2 {
font-family: "TH SarabunPSK";
font-size: 16pt;
font-weight: bold;
}
.style3 {
font-family: "TH SarabunPSK";
font-size: 16pt;
}
.style5 {cursor: hand; font-weight: normal; color: #000000;}
.style9 {font-family: Tahoma; font-size: 12px; }
.style11 {font-size: 12px}
.style13 {font-size: 9}
.style16 {font-size: 9; font-weight: bold; }
.style17 {font-size: 12px; font-weight: bold; }
-->
</style>
<?php require_once('Connections/project.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
mysql_connect("localhost","root","root");
mysql_select_db("project");
$strSQL = "SELECT * FROM member,userpra,scorep WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
.
.
.
.
.
<?Php
$html = ob_get_contents();
ob_end_clean();
$pdf = new mPDF('th', 'A4-L', '0', 'THSaraban');
$pdf->SetAutoFont();
$pdf->SetDisplayMode('fullpage');
$pdf->WriteHTML($html, 6);
$pdf->Output();
?>
ดาวโหลดรายงานในรูปแบบ PDF <a href="MyPDF/MyPDF.pdf">คลิกที่นี้</a>
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2015-05-12 08:40:53 |
By :
Saharatza |
View :
2060 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |