<? $num_col = 1; $num_row = 2; $page_size = $num_col*$num_row; $sql = "SELECT COUNT(*) FROM training_finish where Main_Course ='$category_main' and Sub_Course ='$cat'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $num_product = $row["COUNT(*)"]; // Number of Page $num_page = ceil($num_product/$page_size); // Start Record $start_record = $page_no*$page_size; // Action $sql = "SELECT * FROM training_finish where Main_Course ='$category_main' and Sub_Course ='$cat'" . " ORDER BY Fin_ID ASC" . " LIMIT $start_record, $page_size"; $result = mysql_query($sql) or die(mysql_error()); $msql = mysql_query("select * from course_cat where ID ='$category_main' ") or die (mysql_error()); $mrow=mysql_fetch_array($msql); $subsql = mysql_query("select * from course_sub where ID ='$cat' ") or die (mysql_error()); $subrow=mysql_fetch_array($subsql); $scsql = mysql_query("select * from schedule_course where ID ='$scid' ") or die (mysql_error()); $scrow=mysql_fetch_array($scsql); $sdate = $scrow["Star_Day"]; $edate = $scrow["End_Day"]; $sday = explode('-',$sdate); $startdate = $sday[2]; ?> <?php for($p=1;$p<=$num_page;$p++){ ?> <div class="page-break<?=($p==1)?"-no":""?>"> </div> <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left"> </td> </tr> <tr> <td align="center" class="headTitle" style="font-size:16px;">แบบรายงานการฝึกอบรมหลักสูตร<?=$mrow['Name_Course'];?><br /></td> </tr> <tr> <td height="25" align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="28" colspan="2" valign="bottom">ชื่อหน่วยงานที่ได้รับการรับรอง <input name="textfield" type="text" class="box_data1" value=" " id="textfield" style="text-align:left;width:610px;" /></td> </tr> <tr> <td width="46%" height="28" valign="bottom">หมายเลขทะเบียน <input name="textfield" type="text" class="box_data1" id="textfield" style="text-align:left;width:260px;" /></td> <td width="54%" height="28" valign="bottom">ใบรับรองหมดอายุวันที่ <input name="textfield" type="text" class="box_data1" id="textfield" style="text-align:left;width:285px;" /></td> </tr> <tr> <td height="28" colspan="2" valign="bottom">วัน เดือน ปี ที่ฝึกอบรม <input name="textfield" type="text" class="box_data1" id="textfield" value="<? echo $startdate; ?> - <? echo thai_date($edate); ?>" style="text-align:left;width:650px;" /></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td align="left"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="39" height="30" rowspan="2" align="center" valign="middle" class="headerTitle01">ลำดับที่<br /> </td> <td width="114" height="30" rowspan="2" align="center" valign="middle" class="headerTitle01">หมายเลขบัตรประจำตัว<br /> ประชาชน</td> <td width="198" height="30" rowspan="2" align="center" valign="middle" class="headerTitle01">ชื่อ - นามสกุล<br /> </td> <td width="368" height="30" rowspan="2" align="center" valign="middle" class="headerTitle01">ชื่อและที่ตั้งหน่วยงานของผู้ผ่านการอบรม<br /> </td> <td width="92" height="30" rowspan="2" align="center" valign="middle" class="headerTitle01">หลักสูตร<br /> </td> <td height="30" colspan="2" align="center" valign="bottom" class="headerTitle01">ผลการประเมิน<br /> </td> <td width="103" height="30" rowspan="2" align="center" valign="middle" class="headerTitle02">เลขทะเบียนวุฒิบัตร<br /> </td> </tr> <tr> <td width="45" height="30" align="center" class="headerTitle01_r">ก่อน<br /></td> <td width="41" height="30" align="center" class="headerTitle01_r">หลัง<br /></td> </tr> <? for ($i = 0; $row = mysql_fetch_array($result); $i++) { if ($i%$num_col == 0) { $title = $row['Title']; $j = $i+1; $sqlt = "SELECT * FROM title_namedb where Title_ID ='$title'"; $resultt = mysql_query($sqlt) or die(mysql_error()); $rowt = mysql_fetch_array($resultt); ?> <tr> <td height="30" align="center" class="left_bottom"><?=$j;?></td> <td align="center" class="left_bottom"><?=$row['Card_ID'];?></td> <td align="left" class="left_bottom"> <?=$rowt['Title_Name'];?><?=$row['Name'];?> <?=$row['Surname'];?></td> <td align="left" class="left_bottom"><?=$row['OfficeName'];?><br /><?=$row['OfficeAddress'];?></td> <td align="center" class="left_bottom"><?=$subrow['Name_Coursesub'];?></td> <td align="center" class="left_bottom"><?=$row['Score_First'];?></td> <td align="center" class="left_bottom"><?=$row['Score_After'];?></td> <td align="center" class="left_right_bottom"><?=$row['Code_No'];?></td> </tr> <? } } ?> </table></td> </tr> <tr> <td align="left"> </td> </tr> <tr> <td align="left"> </td> </tr> <tr> <td align="left"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="50%" rowspan="2" align="left"><table border="0" width="95%" cellspacing="0" cellpadding="0"> <tr> <td width="32" height="28">ลงชื่อ</td> <td width="230" height="28"> <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:200px;" /></td> <td width="238" height="28">วิทยากร</td> </tr> <tr> <td height="28"> </td> <td height="28">( <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:210px;" /> )</td> <td height="28"> </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td width="32" height="28">ลงชื่อ</td> <td width="230" height="28"> <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:200px;" /></td> <td width="238" height="28">วิทยากร</td> </tr> <tr> <td height="28"> </td> <td height="28">( <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:210px;" /> )</td> <td height="28"> </td> </tr> <tr> <td colspan="3"> </td> </tr><tr> <td width="32" height="28">ลงชื่อ</td> <td width="230" height="28"> <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:200px;" /></td> <td width="238" height="28">วิทยากร</td> </tr> <tr> <td height="28"> </td> <td height="28">( <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:210px;" /> )</td> <td height="28"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table></td> <td width="50%" align="left"> </td> </tr> <tr> <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="46"> </td> <td width="27" height="28">ลงชื่อ</td> <td width="234" height="28"> <input name="textfield10" type="text" class="box_data1" id="textfield10" style="text-align:center;width:200px;" /></td> <td width="193" height="28">ผู้บริหารจัดการฝึกอบรม</td> </tr> <tr> <td> </td> <td height="28"> </td> <td height="28">( <input name="textfield10" type="text" class="box_data1" value=" " id="textfield10" style="text-align:center;width:210px;" /> )</td> <td height="28"> </td> </tr> <tr> <td height="28" colspan="4">วัด/ เดือน/ ปี ที่จัดทำรายงาน <input name="textfield10" type="text" class="box_data1" value="<? echo thai_date($edate); ?>" id="textfield10" style="text-align:center;width:160px;" /></td> </tr> </table></td> </tr> </table></td> </tr> </table> <?php } ?>
<?php $dbhost="localhost"; $dbusername="root"; $dbpassword="root"; $dbdatabase="data"; mysql_connect($dbhost,$dbusername,$dbpassword) or die ('ไม่สามารถติดต่อ Server ได้'); mysql_select_db($dbdatabase) or die ('ไม่สามารถติดต่อ Database Server ได้'); for($i=0; $i<=30; $i++){//For if($i%5==0) echo '<br />'; $pertable=$i*5; $sql="select * from table limit $pertable,5"; $query=mysql_query($sql); ?> <table align='center' border='1'> <?php while ($result = mysql_fetch_array($query)) {//While $iid=$result[id]; ?> <tr><td><?php echo $id; ?></td></tr> <?php }//While ?> </table> <br> <?php }//For ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง