|  |  | 
          
            | queryข้อมูลออกมาแล้ว เวลาจะขึ้นหน้าใหม่ อยากให้แถบหัวข้อและหัวตารางมา แล้วลำดับข้อมูลก็ต่อจากก่อนหน้า และอยากให้แสดงเลขหน้าด้วยอ่ะค่ะ   คือตอนนี้แสดงออกมา2หน้า แต่หน้าที่2ไม่มีแถบหัวข้อและหัวข้อตารางให้ค่ะ  ต้องทำยังไงเหรอค่ะ ขอบคุณมากๆค่ะ 
 Code (PHP)
 
 @session_start();
require_once('./config/lang/eng.php');
require_once('./tcpdf.php');
// create new PDF document
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setViewerPreferences(array('PrintScaling' => 'None'));
$pageDimensions = $pdf->getPageDimensions();
$yOffset = ceil($pdf->GetY());
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_FOOTER);
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
//set some language-dependent strings
$pdf->setLanguageArray($l);
// ---------------------------------------------------------
// set font
$pdf->SetFont('thsarabun', '', 14);
$pdf->SetMargins(12, 15, 10, true);
$pdf->AddPage(); 
require 'databases.php';
require './academicyear.php';
$html = '
<h3 align="center">
		แบบรายงานผลการประเมินวิทยานิพนธ์/สารนิพนธ์<br/>
		ประจำภาคการศึกษาที่  '.$_POST['term'].'/'.$_POST['year'].'<br/>
</h3>
<table border="1">
	<tr>
		<td width="25" rowspan="2" align="center" style="font-weight:bold;">ที่</td>
		<td width="100" rowspan="2" align="center" style="font-weight:bold;">รหัสประจำตัว</td>
		<td width="230" rowspan="2" align="center" style="font-weight:bold;">ชื่อ-สกุล (รหัสวิชาวิทยานิพนธ์)</td>
		<td width="60" rowspan="2" align="center" style="font-weight:bold;">สาขาวิชา</td>
		<td width="185" colspan="3" align="center" style="font-weight:bold;">หน่วยกิตวิทยานิพนธ์/สารนิพนธ์</td>
		<td width="60" colspan="2" align="center" style="font-weight:bold;">หน่วยกิต</td>
	</tr>
	<tr>
    	<td width="75" align="center" style="font-weight:bold;">ตามหลักสูตร</td>
    	<td width="45" align="center" style="font-weight:bold;">สะสม</td>
    	<td width="65" align="center" style="font-weight:bold;">ลงทะเบียน</td>
        <td width="30" align="center" style="font-weight:bold;">IP</td>
       	<td width="30" align="center" style="font-weight:bold;">U</td>
	</tr>';
	$db = new databases();
	$sql = "SELECT * FROM student LEFT JOIN session ON (student.Std_Session_Code=session.Session_Code) LEFT JOIN major ON (student.Std_Major_Code=major.Major_Code) LEFT JOIN std_type ON (std_type.Std_Type_Code=student.Std_Type_Code) LEFT JOIN estimate ON ((student.Std_Code=estimate.Reg_Std_Code) AND (estimate.Etm_Term=$_POST[term] AND estimate.Etm_Year=$_POST[year])) LEFT JOIN register ON (student.Std_Code=register.Reg_Std_Code) LEFT JOIN register_course ON ((student.Std_Code=register_course.Reg_Std_Code) AND (register_course.Reg_Term=$_POST[term] AND register_course.Reg_Year=$_POST[year]) AND (register_course.Reg_Course_ID='463004' OR register_course.Reg_Course_ID='463005')) LEFT JOIN applicable_course ON (register_course.Reg_Course_ID=applicable_course.Course_ID) WHERE (estimate.Etm_Pfs_Code_Main1='' AND estimate.Etm_Pfs_Code_Main2='') AND (estimate.Etm_Term =$_POST[term] and estimate.Etm_Year =$_POST[year]) ORDER BY session.Session_Name_Eng ASC, estimate.Etm_term ASC, estimate.Etm_Year ASC, student.Std_Code ASC";
	$data_estimate = mysql_query($sql);
	$rows = mysql_num_rows($data_estimate);
	$i=0;
	$pass=0;
	
	while($data = mysql_fetch_array($data_estimate)){
		$html .= '<tr>
					<td width="25" align="center">'. ++$i .'</td>
					<td width="100" align="center">'. $data['Std_Code'] .'</td>
					<td width="230"> '. $data['Std_Name'] .' ('. $data['Reg_Course_ID'] .')</td>
					<td width="60" align="center">'. $data['Session_Name_Eng'] .'</td>
					<td width="75" align="center">'. $data['Course_Unit'] .'</td>
					<td width="45" align="center">'. $data['Etm_Cumulative_Unit'] .'</td>
					<td width="65" align="center">'. $data['Reg_Master_Thesis_Unit'] .'</td>
					<td width="30" align="center">'. $data['Etm_IP'] .'</td>';
					$reg_unit=$data['Reg_Master_Thesis_Unit'];
					$pass_unit=$data['Etm_IP'];
					$nopass_unit=$reg_unit-$pass_unit;
					$html .= '<td width="30" align="center">'. $nopass_unit .'</td>
				</tr>';
				if($data['Etm_IP']!=0){
					$pass++;
				}
  	
  	}
  	
  	$nopass = $i-$pass;
  	$sql_master = "SELECT * FROM professor WHERE Pfs_Type_Code='1'";
  	$query_master = mysql_query($sql_master);
  	$data_master = mysql_fetch_array($query_master);
$html .= '</table>
<h4>ทั้งหมด '. $i .' คน : ผ่าน '. $pass .' คน   ไม่ผ่าน '. $nopass .' คน<br/></h4>
$pdf->writeHTML($html, true, false, true, false, '');
	//$pdf->writeHTML(UTFEncode('HTML'));
$pdf->lastPage();
ob_clean();
$pdf->Output('report.pdf', 'I');
	
 
 
 Tag : PHP
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2013-04-30 14:16:00 | By :
                          nickiie | View :
                          4224 | Reply :
                          2 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |