File manager - Edit - /var/www/ams.cmtc.ac.th/pages/export-studentRegisDate.php
Back
<?php session_start(); $session=session_id(); require("../inc/config.inc.php"); require("../inc/common.php"); //echo $_SESSION['login']; if(empty($_SESSION['login'])){ echo"Error"; exit(); } $date=$_GET['date']; if($_GET['ex']=='xls'){ $strExcelFileName="รายชื่อนักศึกษาลงทะเบียน ปีการศึกษา $academicYear ภาคเรียน $semester วันที่ $date.xls"; header("Content-Type: application/x-msexcel; name=\"$strExcelFileName\""); header("Content-Disposition: inline; filename=\"$strExcelFileName\""); header("Pragma:no-cache"); } ?> <?php //echo FCPATH."images/logo_e2e.png"; ?> <html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns="http://www.w3.org/TR/REC-html40"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta charset="utf-8"> </head> <body> <!-- <div id="SiXhEaD_Excel" align=center x:publishsource="Excel"> --> <div id="SiXhEaD_Excel" x:publishsource="Excel"> <!-------- เริ่มข้อมูล ------------------------> <h3>สรุปข้อมูลนักศึกษาลงทะเบียน ภาคเรียนที่ <?=$semester?> ปีการศึกษา <?=$academicYear?><br> วันที่ <?php echo thai9($date);?> </h3> <?php //ตรวจสอบว่ามีการชำระเงินหรือไม่ $sql="Select * From regis_payment_log,std2018_student,prefix where regis_payment_log.PaymentDate='$date' AND regis_payment_log.studentCode=std2018_student.studentCode AND std2018_student.prefixID=prefix.prefix_id order by regis_payment_log.studentCode ASC"; $db_query=mysqli_query($connect,$sql); $num_rows=mysqli_num_rows($db_query); /* นับ Reccord ที่พบ */ echo "มีจำนวน <b>$num_rows</b> คน"; if($num_rows==0) { echo " ไม่พบข้อมูลนักศึกษา"; }else{ ?> <table width="820" border="1"> <thead> <tr> <th width="48" bgcolor="#E7E7E7"><center>ลำดับ</center></th> <th width="100" bgcolor="#E7E7E7"><center>รหัสกลุ่ม<br>นักศึกษา</center></th> <th width="100" bgcolor="#E7E7E7"><center>เลขประจำตัว<br>ประชาชน</center></th> <th width="140" bgcolor="#E7E7E7"><center>รหัสประจำตัว<br>นักศึกษา</center></th> <th width="152" bgcolor="#E7E7E7">ชื่อ</th> <th width="127" bgcolor="#E7E7E7">นามสกุล</th> <th width="50" bgcolor="#E7E7E7">ระดับ</th> <th width="150" bgcolor="#E7E7E7">สาขา</th> <th width="47" bgcolor="#E7E7E7"><center>TranC</center></th> <th width="95" bgcolor="#E7E7E7"><center>วันที่ชำระเงิน</center></th> <th width="75" bgcolor="#E7E7E7"><center>จำนวนเงิน</center></th> </tr> </thead> <tbody> <?php $a=0; $total=0; while($a < $num_rows) { $result = mysqli_fetch_array($db_query); $prefix_name=$result['prefix_name']; $firstname=$result['firstname']; $surname=$result['surname']; $groupCode=$result['groupCode']; $studentCode=$result['studentCode']; $idcard=$result["idcard"]; $studentStatusCode=$result['studentStatusCode']; $gpax=$result["gpax"]; if($studentStatusCode=='03'){ $studentStatus="<font color=\"#0A7E02\">กำลังศึกษา</<font>"; }else{ $studentStatus="<font color=\"#FB4447\">พ้นสภาพ</<font>"; } //ดึงข้อมูลกลุมเรียน $result_std2018_studentgroup=select("std2018_studentgroup","where groupCode='$groupCode' "); $grade=$result_std2018_studentgroup["grade"]; $groupName=$result_std2018_studentgroup["groupName"]; //ตรวจสอบว่ามีการชำระเงินหรือไม่ $num_payment=num_record("regis_payment_log","where academicYear='$academicYear' AND semester='$semester' AND studentCode='$studentCode' "); if($num_payment!=0){ //ดึงยอดการชำระเงิน $result_regis_payment_log=select("regis_payment_log","where academicYear='$academicYear' AND semester='$semester' AND studentCode='$studentCode' "); $PaymentDate=$result_regis_payment_log["PaymentDate"]; $TransactionCode=$result_regis_payment_log["TransactionCode"]; $cost_total=$result_regis_payment_log["cost_total"]; $total=$total+$cost_total; $cost_totalx=number_format($cost_total); $comment_pay="/"; }else{ $PaymentDate="-"; $TransactionCode="-"; $comment_pay="x"; $cost_totalx="-"; } ?> <tr> <td><center><?php echo $a+1;?></center></td> <td><center><?=$groupCode?></center></td> <td><center><?php echo" $idcard";?></center></td> <td><center><?php echo" $studentCode";?></center></td> <td><?php echo "$prefix_name$firstname";?></td> <td><?=$surname?></td> <td style="text-align: center"><?php echo"$grade";?></td> <td><?php echo"$groupName";?></td> <td style="text-align: center"><?=$TransactionCode?> </td> <td style="text-align: center"><?=$PaymentDate?> </td> <td style="text-align: right"><?=$cost_totalx?> </td> </tr> <?php $a++; } ?> <tr> <td colspan="10"><center><b>รวม</b></center></td> <td style="text-align: right"><b><?php echo number_format($total); ?></b></td> </tr> </tbody> </table> <?php } $login_name=$_SESSION['login_name']; $Publisher_day=thai3($today); echo"ผู้พิมพ์ $login_name วันที่พิมพ์รายงาน $Publisher_day "; echo"<br>$dev"; ?> <!------ สิ้นสุดข้อมูล ------------------------> </div> </body> </html> <?php /* if($ex2!='xls'){ $html = ob_get_contents(); ob_end_clean(); $pdf = new mPDF('th', 'A4', '0', 'THSaraban'); $pdf->SetAutoFont(); $pdf->SetDisplayMode('fullpage'); $pdf->WriteHTML($html, 2); $pdf->Output(); }*/ ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.44 |
proxy
|
phpinfo
|
Settings