Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > TCPDF Footer ออกรายงาน 2 หน้า แตกต่างกัน คือในหน้าที่ 1 ต้องเป็นยกยอดไปครับ



 

TCPDF Footer ออกรายงาน 2 หน้า แตกต่างกัน คือในหน้าที่ 1 ต้องเป็นยกยอดไปครับ

 



Topic : 133968



โพสกระทู้ ( 34 )
บทความ ( 0 )



สถานะออฟไลน์




ภาพ




ข้อมูลเนื้อหา
 <table width="100%" border="0" cellspacing="1" cellpadding="0">
   <?php
				$queryExamineShow = "SELECT * FROM quotationlist WHERE quotation_id = '$_GET[quotation_id]' ORDER BY quotationlist_id ASC  ";
					$resultExamineShow = $mysqli->query($queryExamineShow);
					if($resultExamineShow && $resultExamineShow->num_rows>0){ 
					$i= 1; 
					while($rowExamineShow = $resultExamineShow->fetch_assoc()){ 
	   ?>
  <tr>
    <th align="center" width="5%"><?php echo ++$unit; ?></th>
    <th align="left" width="44%"><?php echo $rowExamineShow["quotationlist_name"]; ?></th>
    <th align="left" width="15%"><?php echo $rowExamineShow["quotationlist_number"]; ?>
    <?php $queryMeasure = "SELECT measure_name FROM measure WHERE measure_id = '$rowExamineShow[measure_id]' ";
							$resultMeasure = $mysqli->query($queryMeasure);
							$resultMeasure && $resultMeasure->num_rows>0;
							$rowMeasureShow = $resultMeasure->fetch_assoc();
						echo $rowMeasureShow["measure_name"]; ?></th>
    <th align="right" width="12%"><?php echo number_format($rowExamineShow["quotationlist_price"],2,'.',',');?>&nbsp;</th>
    <th align="right" width="9%"><?php if($rowExamineShow["quotationlist_discount"]<>""){echo number_format($rowExamineShow["quotationlist_discount"],2,'.',',');}else{echo "-";} ?>&nbsp;</th>
    <th align="right" width="15%"><?php echo number_format($rowExamineShow["quotationlist_sum"],2,'.',',');?>&nbsp;</th>
  </tr>
    <? }} ?>
</table>


Code (PHP)
 // ส่วนจัดการ footer

    public function Footer() {
		 $queryQuotationSum = "select sum(quotationlist_sum) as result from quotationlist where quotation_id= '$_GET[quotation_id]' ";
							$resultQuotationSum = $mysqli->query($queryQuotationSum);
							$resultQuotationSum && $resultQuotationSum->num_rows>0;
							$rowQuotationSum = $resultQuotationSum->fetch_assoc();
							$quotationlist_sum =	number_format($rowQuotationSum["result"],2,'.',',');	
		 //$quotationlist_sum;
							$bf = bathformat($quotationlist_sum);
		
	$html = "
	<style>
td {
       border: 0.5px solid #ffc000; 
    }
</style>
	
	<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bordercolor=\"#ffc000\">
  <tr>
    <td rowspan=\"4\"  width=\"60%\">&nbsp;<strong>หมายเหตุ</strong> : </td>
    <td align=\"right\"  width=\"18%\">รวม&nbsp;&nbsp;</td>
    <td align=\"right\"  width=\"22%\">$quotationlist_sum&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align=\"right\">ส่วนลด&nbsp;&nbsp;</td>
    <td align=\"right\">-&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align=\"right\">มูลค่าสินค้า&nbsp;&nbsp;</td>
    <td align=\"right\">$quotationlist_sum&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align=\"right\">ภาษีมูลค่าเพิ่ม 7%&nbsp;&nbsp;</td>
    <td align=\"right\">-&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align=\"center\"><strong>($bf)</strong></td>
    <td align=\"right\"> <strong>สุทธิ</strong>&nbsp;&nbsp;</td>
    <td align=\"right\"><strong>$quotationlist_sum</strong>&nbsp;&nbsp;</td>
  </tr>
</table>";
	$this->SetFont('thsarabun', '', _conversion(20,'px-pt'), '', true); 
    $this->writeHTMLCell(0, 0, '', '', $html, 0, 1, false,true, "L", true);
    }
}




Tag : PHP, MySQL, IIS









ประวัติการแก้ไข
2019-08-01 10:38:18
2019-08-01 10:38:49
2019-08-01 14:42:25
2019-08-01 14:42:28
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2019-08-01 10:36:14 By : sookurb View : 1496 Reply : 3
 

 

No. 1



โพสกระทู้ ( 421 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ลองแบ่งข้อมูลออกเป็น 2 ชุดดูหรือยังครับ
Code (PHP)
$html1 ="<table>....</table>";
$pdf->writeHTML($html1);

$html2="<table>...</table>";
$pdf->writeHTML($html2);







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-08-01 14:03:49 By : nobetaking
 


 

No. 2



โพสกระทู้ ( 34 )
บทความ ( 0 )



สถานะออฟไลน์


ผมทำเป็น Footer ครับ
ผมลอง if(เลขหน้า == เลขสุดท้าย) แสดงผล แล้ว ยังเป็นเหมือนกันทุกหน้าครับ


ประวัติการแก้ไข
2019-08-02 11:12:26
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-08-01 15:02:48 By : sookurb
 

 

No. 3



โพสกระทู้ ( 34 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วครับ เผื่อใครกำลังหาอยู่ครับ

Code (PHP)
public function Close() {
$this->last_page_flag = true;
parent::Close();
}

And then on the Footer() function I do something like:

function Footer(){
if($this->last_page_flag){
$footer_html = '...'; //HTML for the footer on the last page
}
else{
$footer_html = '...'; //HTML for the rest of the pages
}


https://sourceforge.net/p/tcpdf/discussion/435311/thread/eed0b01d/?limit=25
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-08-05 12:12:42 By : sookurb
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : TCPDF Footer ออกรายงาน 2 หน้า แตกต่างกัน คือในหน้าที่ 1 ต้องเป็นยกยอดไปครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่