File manager - Edit - /var/www/ams.cmtc.ac.th/pages/admin-student-list.php
Back
<?php $groupCode=$_GET['groupCode']; $form=$_GET['form']; $id=$_GET['id']; $show=$_GET['show']; $studentStatusCode=$_GET['studentStatusCode']; ?> <style> li{ list-style-type:none; } </style> <h4>ข้อมูลนักศึกษา ภาคเรียนที่ <?=$semester?> ปีการศึกษา <?=$academicYear?> </h4> <div align="right"> <?php if($form=="summarize" and $show==""){?> <a href="?op=summarize&module=groups&detail=list&id=<?=$id?>#<?=$groupCode?>" class="btn btn-secondary" role="button"> <i class="fa fa-reply" aria-hidden="true"></i> ย้อนกลับ</a> <?php }elseif($form=="advisor" and $show==""){ ?> <a href="?" class="btn btn-secondary" role="button"> <i class="fa fa-reply" aria-hidden="true"></i> ย้อนกลับ</a> <?php }elseif($form=="summarize" and $show=="all"){ ?> <a href="?op=summarize&module=groups-list&show=all" class="btn btn-secondary" role="button"> <i class="fa fa-reply" aria-hidden="true"></i> ย้อนกลับ</a> <?php }else{ ?> <a href="?op=student&module=groups-list&show=all#<?=$groupCode?>" class="btn btn-secondary" role="button"> <i class="fa fa-reply" aria-hidden="true"></i> ย้อนกลับ</a> <?php } ?> </div><br> <?php if($_GET['groupCode']!="search"){ //global $connect; //ดึงข้อมูลกลุ่มเรียน $result_std2018=select("std2018_studentgroup","where groupCode='$groupCode'"); $grade=$result_std2018['grade']; $groupCode=$result_std2018['groupCode']; $groupName=$result_std2018['groupName']; $teacherFirstname=$result_std2018['teacherFirstname']; $teacherLastname=$result_std2018['teacherLastname']; $result_regis_group=select("regis_group","where groupCode='$groupCode' AND academicYear='$academicYear' AND semester='$semester' "); $cost_credit=$result_regis_group['cost_credit']; $cost_value=$result_regis_group['cost_value']; //ยอดเงินที่ต้องลงทะเบียน $total_cost=$cost_credit+$cost_value; $num_student=num_record("std2018_student","where groupCode='$groupCode' AND studentStatusCode='03'"); $num_student_all=num_record("std2018_student","where groupCode='$groupCode' "); $num_out=$num_student_all-$num_student; $num_payment=num_record("regis_payment_log","where academicYear='$academicYear' AND semester='$semester' AND groupCode='$groupCode' "); ?> <p>ระดับ <b><?=$grade?></b><br> รหัสกลุ่ม <b><?=$groupCode?></b> <b><?=$groupName?></b> <br> ครูที่ปรึกษา <b><?php if($teacherFirstname!=""){ echo "ครู$teacherFirstname $teacherLastname"; }?></b><br> จำนวนนักศึกษาทั้งหมด <b><?=$num_student?></b> คน <br> <br> </p> <?php }else{ ?> <div class="card"> <div class="card-body"> <form action="" method="post" class="form-inline"> <label for="email">ค้นหาจาก ชื่อ, นามสกุล, รหัสนักศึกษา </label> <input name="fsearch" type="text" required="required" class="form-control" id="fsearch" placeholder="คำที่ค้นหา"> <button type="submit" class="btn btn-primary" id="btnSearch" ><i class="fa fa-search fa-fw"></i> ค้นหา</button> <input name="action" type="hidden" id="action" value="search"> </form> </div> </div> <?php } ?> <?php $action2=$_POST['action']; //echo "action2=$action2"; if($_POST['action']=="save"){ echo "<center><img src=\"images/reload.gif\" width=\"48\" height=\"48\" alt=\"\"/><br>บันทึกข้อมูล</center>"; $studentCodeSave=$_POST['studentCodeSave']; $groupCode=$_POST['groupCode']; $select=$_POST['select']; //echo "Save $studentCodeSave"; insert(" '','เปลี่ยนสถานภาพนักศึกษา รหัส $studentCodeSave เป็น $select','$today $time','$_SESSION[name]' ","regis_system_log"); update("std2018_student","studentStatusCode='$select' ","where studentCode='$studentCodeSave'"); echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=student&module=list&groupCode=$groupCode#S$studentCodeSave\">"; exit(); } ?> <?php if($_GET['groupCode']!="search"){ ?> <div align="right"><a href="pages/export-studentRegisQRCode.php?ex=&groupCode=<?=$groupCode?>" target="_blank" class="btn btn-info btn-sm " role="button"><i class="fa fa-qrcode" aria-hidden="true"></i> ส่งออกข้อมูล QR Code </a> <a href="pages/export-studentRegis.php?ex=xls&groupCode=<?=$groupCode?>" class="btn btn-primary btn-sm " role="button"><i class="fa fa-file-excel-o" aria-hidden="true"></i> ส่งออกข้อมูลเป็นไฟล์ Excel (xls)</a></div><?php } ?><br> <?php //$sql="Select * From std2018_student,prefix where std2018_student.groupCode='$groupCode' AND std2018_student.studentStatusCode='03' AND std2018_student.prefixID=prefix.prefix_id order by std2018_student.studentCode ASC"; if($_POST['action']=="search"){ $fsearch=$_POST['fsearch']; echo "<br>fsearch=$fsearch"; $sql="Select * From std2018_student where firstname LIKE '%$fsearch%' OR surname LIKE '%$fsearch%' OR studentCode LIKE '%$fsearch%' order by studentCode ASC"; }else{ if($_GET['studentStatusCode']=='03'){ $sql="Select * From std2018_student,prefix where std2018_student.groupCode='$groupCode' AND std2018_student.prefixID=prefix.prefix_id AND std2018_student.studentStatusCode='03' order by std2018_student.studentCode ASC"; }else{ $sql="Select * From std2018_student,prefix where std2018_student.groupCode='$groupCode' AND std2018_student.prefixID=prefix.prefix_id order by std2018_student.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 "<div class=\"alert alert-warning\"><strong>Warning!</strong> ไม่พบข้อมูลนักศึกษา.</div>"; }else{ ?> <table border="1" class="table table-hover table-striped table-condensed table-sm"> <thead> <tr> <th><center>#</center></th> <th><center>รหัสประจำตัวนักศึกษา</center></th> <th>ชื่อ</th> <th>นามสกุล</th> <th><center>GPA</center></th> <th><center>สถานะภาพ</center></th> <th><center> มา </center></th> <th align="center">ขาด</th> <th><center> % </center></th> <th> จัดการ</th> </tr> </thead> <tbody> <?php $a=0; while($a < $num_rows) { $result = mysqli_fetch_array($db_query); $prefix_name=$result['prefix_name']; $firstname=$result['firstname']; $surname=$result['surname']; $studentCode=$result['studentCode']; $studentStatusCode=$result['studentStatusCode']; $gpax=$result["gpax"]; if($studentStatusCode=='03'){ $studentStatus="<font color=\"#0A7E02\">กำลังศึกษา</<font>"; }else{ $studentStatus="<font color=\"#FB4447\">พ้นสภาพ</<font>"; } //------- ดึงข้อมูลค่าหน่วยกิต และค่าธรรมเนียมการศึกษา ------ $result_regis_student_log=select("regis_student_log","where studentCode='$studentCode' AND academicYear='$academicYear' AND semester='$semester' "); $cost_total=$result_regis_student_log["cost_total"]; $cost_total=number_format($cost_total); $confirm=$result_regis_student_log['confirm']; //ตรวจสอบว่ามีการชำระเงินหรือไม่ $num_payment=num_record("regis_payment_log","where academicYear='$academicYear' AND semester='$semester' AND studentCode='$studentCode' "); ?> <tr> <td><center><?php echo $a+1;?>.<a name="S<?=$studentCode?>" id="S<?=$studentCode?>"></a> </center></td> <td><center><?=$studentCode?></center></td> <td><?php echo "$prefix_name$firstname";?></td> <td><?=$surname?></td> <td><center><?=$gpax?></center></td> <td><center><?php echo"$studentStatus";?> </center></td> <td><center> <?php //ตรวจสอบการเข้าระบบของนักศึกษา $num_incom=num_record("checking_logs","where academicYear='$academicYear' AND semester='$semester' AND studentCode='$studentCode' "); if($num_incom==0){ echo"<font color=\"#FB4447\">-</font>"; }else{ echo"<font color=\"#0A7E02\"><b>$num_incom</b></font>"; } ?> </center> </td> <td align="center"> </td> <td><center></center></td> <td><?php if($form!="summarize"){ if($studentStatusCode=='03'){ $btncolor="success"; }else{ $btncolor="danger"; } echo"<a data-id=\"$studentCode\" class=\"open-AddBookDialog btn btn-$btncolor btn-sm\" data-toggle=\"modal\" data-target=\"#myModalDeatail$studentCode\" onclick=\"setval($studentCode);\"><i class=\"fa fa-user\" aria-hidden=\"true\"></i></a>"; } ?> <?php //ตรวจสอบว่ามีรายการค่าธรรมเนียมที่ให้เลือกหรือไม่ $result44=num_record("cost_groups_item_list,cost_item_list,cost_item","where cost_groups_item_list.academicYear='$academicYear' AND cost_groups_item_list.semester='$semester' AND cost_groups_item_list.GroupCode='$groupCode' AND cost_groups_item_list.cost_item_id=cost_item_list.cost_item_id AND cost_item_list.option=1 AND cost_item_list.cost_item_id=cost_item.cost_item_id"); //echo $result44; //echo $confirm; if($result44!=0){ if($studentStatusCode=='03' AND $num_payment==0 AND $confirm==1){ ?> <a href="pages/pdf-StudentInvoice.php?studentCode=<?php echo base64_encode(base64_encode($studentCode)); ?>" target="_blank" class="btn btn-sm btn-info" role="button" ><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a><?php }else{ ?> <a href="pages/pdf-StudentInvoice.php?studentCode=<?php echo base64_encode(base64_encode($studentCode)); ?>" target="_blank" class="btn btn-sm btn-info" role="button" ><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a> <?php } }else{ ?> <!-- <a href="pages/pdf-StudentInvoice.php?studentCode=<?php echo base64_encode(base64_encode($studentCode)); ?>" target="_blank" class="btn btn-sm btn-info" role="button" ><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a> --> <?php } ?> <!-- The Modal --> <div class="modal fade" id="myModalDeatail<?=$studentCode?>"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">รายละเอียดนักศึกษา</h4> </div> <form method="post" id="form1"> <!-- Modal body --> <div class="modal-body"> <div class="row"> <div class="col-sm-3"><div align="right"> <img src="<?=$link_img_student?><?=$studentCode?>.jpg" width="100" alt=""/></div></div> <div class="col-sm-9"> <?php //ดึงข้อมูลนักศึกษา $result_std2018_student=select("std2018_student","where studentCode='$studentCode'"); $tel=$result_std2018_student["tel"]; $studentStatusName=$result_std2018_student["studentStatusName"]; $tel=$result_std2018_student["tel"]; $groupCode2=$result_std2018_student["groupCode"]; $groupName=$result_std2018_student["groupName"]; $minorNameTH=$result_std2018_student["minorNameTh"]; $gpax=$result_std2018_student["gpax"]; $idcard_student=$result_std2018_student["idcard"]; //ดึงข้อมูลกลุ่มเรียน $result_std20181=select("std2018_studentgroup","where groupCode='$groupCode2'"); $teacherFirstname=$result_std20181['teacherFirstname']; $teacherLastname=$result_std20181['teacherLastname']; ?> <ui> <li>รหัสประจำตัวนักศึกษา : <b><?php echo"$studentCode"; ?></b></li> <li>เลขประจำตัวประชาชน : <b><?php echo"$idcard_student"; ?></b></li> <li>ชื่อ นามสกุล : <b><?php echo"$prefix_name$firstname $surname"; ?></b></li> <li>เบอร์โทรศัพท์ : <b><?php echo"$tel"; ?></b></li> <li>สาขางาน : <b><?php echo"$minorNameTH"; ?></b></li> <li>กลุ่ม : <b><?php echo"$groupName"; ?></b></li> <li>ผลการเรียนเฉลี่ย : <b><?php echo"$gpax"; ?></b></li> <li>สถานะภาพ : <b><?php echo"$studentStatusName"; ?></b></li> <li>ครู่ที่ปรึกษา : <b><?php echo"$teacherFirstname $teacherLastname"; ?></b></li> </ui> <?php if($_SESSION['login']=="admin"){ ?> <label for="select">เปลี่ยนสถานะภาพ:</label> <select name="select" id="select"> <?php if($studentStatusCode=='03'){ echo"<option value=\"03\">กำลังศึกษา</option>"; }else{ echo"<option value=\"11\">พ้นสภาพ</option>"; } ?> <option value="03">กำลังศึกษา</option> <option value="11">พ้นสภาพ</option> </select> <?php } ?> </div> </div> <!---end body --> <?php //ดึงข้อมูลนักศึกษา $result_regis_payment_log=select("regis_payment_log","where academicYear='$academicYear' and semester='$semester' and studentCode='$studentCode'"); $PaymentDate=$result_regis_payment_log["PaymentDate"]; $cost_total=$result_regis_payment_log["cost_total"]; //echo $PaymentDate; if($PaymentDate!=""){ echo "<div class=\"alert alert-success\"><center>ชำระเงินค่าลงทะเบียน วันที่ ".thai2($PaymentDate)." จำนวน <b>".number_format($cost_total)."</b> บาท</div>"; } ?> </div> <!-- Modal footer --> <div class="modal-footer"> <?php if($_SESSION['login']=="admin"){?> <button type="submit" class="btn btn-success" id="btnAdd" ><i class="fa fa-save fa-fw"></i> บันทึก</button> <?php } ?> <button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button> <input name="action" type="hidden" id="action" value="save"> <input name="studentCodeSave" type="hidden" id="studentCodeSave" value="<?=$studentCode?>"> <input name="groupCode" type="hidden" id="groupCode" value="<?=$groupCode?>"> </div> </form> </div> </div> </div> <!-- End The Modal --> </td> </tr> <?php $a++; } ?> </tbody> </table> <?php } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.41 |
proxy
|
phpinfo
|
Settings