<? include 'ไฟล์ส่วนหัว'; //$sql ="select data_table order by id"; //$result = mysql_query($sql); ///////// การวนลูปโดยใช้ while loop จากฐานข้อมูล //while($array = mysql_fetch_array($result)){ ////// การวนลูปโดยใช้ for for($i=1;$i<20;$i++){ $page_print = $i; /////รับค่าจากค่าที่วนลูป โดย for loop /// $array['id']; /// ใช้คำสั่งนี้เมื่อรับค่าจาก while loop $data_show = 10;////////////// จำนวนที่จะสั่งปริ้นต่อหน้า if($page_print%$data_show==0) { include'ไฟล์ส่วนท้าย'; echo "<div style='page-break-after: always'>"; echo "</div>"; include'ไฟล์ส่วนหัว'; } echo "ข้อมูลที่จะแสดงทั้งหมด"; //echo $array['data']; } ////จบการวนลูปข้อมูล include'ไฟล์ส่วนท้าย'; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>ใบเสนอราคา</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> body { font-family: Tahoma, Geneva, sans-serif; } body { font-size: large; } body { font-size: small; } #apDiv1 { position:absolute; left:985px; top:397px; width:118px; height:104px; z-index:1; } #apDiv2 { position:absolute; left:62px; top:210px; width:161px; height:105px; z-index:2; } #apDiv3 { position:absolute; left:957px; top:137px; width:111px; height:108px; z-index:3; } </style> <style type="text/css"> table.coll { border-collapse: collapse } table.sep { border-collapse: separate } #apDiv4 { position:absolute; left:16px; top:48px; width:166px; height:171px; z-index:1; } .fontsmall { font-size: small; } .fontsmall { color: #000; } .fontsmall { color: #000; } .fonthead { font-size: 36px; color: #000; font-weight: bold; font-family: "Angsana New"; } .fontbig { font-size: large; } .fontsmall { font-weight: normal; } .fontsmallbold { font-weight: bold; } .fontsmallbold { font-size: small; } .fontsmallbold { font-size: small; } </style> <link href="css/font.css" rel="stylesheet" type="text/css"> <style type="text/css"> #apDiv5 { position:absolute; left:789px; top:180px; width:180px; height:61px; z-index:2; } #apDiv6 { position:absolute; left:372px; top:198px; width:226px; height:39px; z-index:3; } #apDiv7 { position:absolute; left:166px; top:345px; width:635px; height:39px; z-index:4; } #apDiv8 { position:absolute; left:187px; top:55px; width:666px; height:98px; z-index:5; } .fontbig { font-size: x-large; } .fontsmall { font-family: "Angsana New"; } .fontsmall { font-size: 24px; } .fontsmall { font-size: medium; } #apDiv9 { position:absolute; left:380px; top:227px; width:432px; height:48px; z-index:6; } .fontbig1 { font-size: large; } .fontbig1 { font-size: x-large; } #apDiv10 { position:absolute; left:127px; top:291px; width:722px; height:46px; z-index:7; } #apDiv11 { position:absolute; left:128px; top:421px; width:723px; height:271px; z-index:8; } .fontsmall1 { font-size: small; } .fontsmall1 { color: #000; } .fontsmall1 { color: #000; } .fontsmall1 { font-weight: normal; } .fontsmall1 { font-family: "Angsana New"; } .fontsmall1 { font-size: 24px; } .fontsmall1 { font-size: large; } .fontsmallbold { font-family: "Angsana New"; } .fontsmallbold { font-size: large; } </style> <body> <? include 'connect.php'; include 'headquot.php'; for($i=1;$i<20;$i++){ $page_print = $i; $data_show = 12; if($page_print%$data_show==0) { include'tailquot.php'; echo "<div style='page-break-after: always'>"; echo "</div>"; include'headquot.php'; }?> <div id="apDiv11"> <table width="100%" height="97" border="1" align="center" cellspacing="0" bordercolor="#000000"> <tr> <td width="77" height="25" align="center" class="fontsmall1" >รหัสสินค้า</td> <td width="556" align="center" class="fontsmall1">รายการ</td> <td width="68" align="center" class="fontsmall1">จำนวน</td> <td width="90" align="center" class="fontsmall1">หน่วยนับ</td> <td width="83" align="center" class="fontsmall1">ราคาต่อหน่วย</td> <td width="74" align="center" class="fontsmall1">จำนวนเงิน</td> </tr> <tr> <td align="center" class="fontsmall1"><? $sql_item = "select * from itemstb inner join quotdetail ON itemstb.item_id_type = quotdetail.itemid where ref_quotid ='$id' "; $result_item = mysql_query($sql_item) or die (mysql_error()); while($data= mysql_fetch_array($result_item) ) { echo "<br>".$data['itemid']; } ?></td> <td class="fontsmall1"><? $sql_item = "select * from itemstb inner join quotdetail ON itemstb.item_id_type = quotdetail.itemid where ref_quotid ='$id' "; $result_item = mysql_query($sql_item) or die (mysql_error()); while($data= mysql_fetch_array($result_item) ) { echo "<br>".$data['itemname']; } ?></td> <td align="center" class="fontsmall1"><? $sql_count = "select quotcount from quotdetail where itemid ='$data[itemid]' "; $result_count = mysql_query($sql_item) or die (mysql_error()); while($data_count= mysql_fetch_array($result_count) ) { if($data_count['quotamount']=='2'){ $count=$data_count['quotcount']/12; echo "<br>".$count; }elseif($data_count['quotamount']=='3'){ $count_dozen=$data_count['quotcount']/144; echo "<br>".$count_dozen; }else{ echo "<br>".$data_count['quotcount']; } }?></td> <td align="center" class="fontsmall1"><? $sql_count = "select quotamount from quotdetail where itemid ='$data[itemid]' "; $result_count = mysql_query($sql_item) or die (mysql_error()); while($data_count= mysql_fetch_array($result_count) ){ if($data_count['quotamount']=='3'){ $count=$data_count['buycount']/144; echo "<br>"."กุรุส"; }elseif($data_count['quotamount']=='2'){ $count_dozen=$data_count['buycount']/12; echo "<br>"."โหล"; }elseif($data_count['quotamount']=='1'){ echo "<br>"."อัน"; }elseif($data_count['quotamount']=='4'){ echo "<br>"."กล่อง"; }elseif($data_count['quotamount']=='5'){ echo "<br>"."ด้าม"; }elseif($data_count['quotamount']=='6'){ echo "<br>"."แท่ง"; }elseif($data_count['quotamount']=='7'){ echo "<br>"."เล่ม"; }elseif($data_count['quotamount']=='8'){ echo "<br>"."แฟ้ม"; }elseif($data_count['quotamount']=='9'){ echo "<br>"."ม้วน"; }elseif($data_count['quotamount']=='10'){ echo "<br>"."ซอง"; }elseif($data_count['quotamount']=='11'){ echo "<br>"."ก้อน"; }elseif($data_count['quotamount']=='12'){ echo "<br>"."เครื่อง"; }elseif($data_count['quotamount']=='13'){ echo "<br>"."ห่อ"; }elseif($data_count['quotamount']=='14'){ echo "<br>"."แพ็ค"; } }?></td> <td align="center" class="fontsmall1"><? $sql_eachprice = "select * from quotdetail where ref_quotid ='$id' "; $result_eachprice = mysql_query($sql_eachprice) ; while($data_eachprice= mysql_fetch_array($result_eachprice) ) { echo "<br>".number_format($data_eachprice['quotprice'],2); } ?></td> <td align="right" class="fontsmall1"><? $sql_price = "select * from quotdetail where itemid ='$data[itemid]' "; $result_price = mysql_query($sql_item) or die (mysql_error()); while($data_price= mysql_fetch_array($result_price) ) { $quotprice=$data_price['quotcount']*$data_price['quotprice']; echo "<br>".number_format($quotprice,2); } ?></td> </tr> </table> <? } include'tailquot.php'; ?> </span> <p> </p> </body> </html>
<? include('../Connections/conndb.php'); echo'**ไฟล์ส่วนหัว**<br/>'; $sql ="select * from employee"; $result = mysql_query($sql); ///////// การวนลูปโดยใช้ while loop จากฐานข้อมูล while ($array = mysql_fetch_array($result)) { ////// การวนลูปโดยใช้ for for($i=1;$i<20;$i++){ $page_print = $i; /////รับค่าจากค่าที่วนลูป //โดย for loop /// $array['id']; /// ใช้คำสั่งนี้เมื่อรับค่าจาก while loop $data_show = 5;////////////// จำนวนที่จะสั่งปริ้นต่อหน้า if($page_print%$data_show==0) { echo'**ไฟล์ส่วนท้าย**<br/>'; echo "<div style='page-break-after: always'>"; echo "</div>"; echo'**ไฟล์ส่วนหัว**<br/>'; } //echo "ข้อมูลที่จะแสดงทั้งหมด<br/>"; echo $array['Ename']."<br/>"; } } ////จบการวนลูปข้อมูล echo'**ไฟล์ส่วนท้าย**<br/>'; ?>
<? include('../Connections/conndb.php'); echo'**ไฟล์ส่วนหัว**<br/>'; $sql ="select * from employee"; $result = mysql_query($sql); ///////// การวนลูปโดยใช้ while loop จากฐานข้อมูล $i = 1; while ($array = mysql_fetch_array($result)) { $page_print = $i; /////รับค่าจากค่าที่วนลูป //โดย for loop /// $array['id']; /// ใช้คำสั่งนี้เมื่อรับค่าจาก while loop $data_show = 5;////////////// จำนวนที่จะสั่งปริ้นต่อหน้า if($page_print%$data_show==0) { echo'**ไฟล์ส่วนท้าย**<br/>'; echo "<div style='page-break-after: always'>"; echo "</div>"; echo'**ไฟล์ส่วนหัว**<br/>'; } //echo "ข้อมูลที่จะแสดงทั้งหมด<br/>"; echo $array['Ename']."<br/>"; $i++; }// endwhile; ////จบการวนลูปข้อมูล echo'**ไฟล์ส่วนท้าย**<br/>'; ?>
<? include('../Connections/conndb.php'); echo'**ไฟล์ส่วนหัว**<br/>'; $sql ="select * from employee"; $result = mysql_query($sql); ///////// การวนลูปโดยใช้ while loop จากฐานข้อมูล $i = 1; while ($array = mysql_fetch_array($result)) { $page_print = $i; /////รับค่าจากค่าที่วนลูป //โดย for loop /// $array['id']; /// ใช้คำสั่งนี้เมื่อรับค่าจาก while loop $data_show = 5;////////////// จำนวนที่จะสั่งปริ้นต่อหน้า if($page_print%$data_show==0) { echo'**ไฟล์ส่วนท้าย**<br/>'; echo "<div style='page-break-after: always'>"; echo "</div>"; echo'**ไฟล์ส่วนหัว**<br/>'; } //echo "ข้อมูลที่จะแสดงทั้งหมด<br/>"; echo $i; echo $array['Ename']."<br/>"; $i++; }// endwhile; ////จบการวนลูปข้อมูล echo'**ไฟล์ส่วนท้าย**<br/>'; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง