File manager - Edit - /var/www/ams.cmtc.ac.th/pages/fix-costtotal.php
Back
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>FIX Cost Total</title> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!-- Bootstrap core CSS --> <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Kanit:400,300&subset=thai,latin' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css"> </head> <body> <?php require('../inc/config.inc.php'); require('../inc/common.php'); $up=$_GET['up']; //ตรวจสอบว่านักศึกษาคนไหนเข้าระบบบ้าง global $connect; $sql="Select * From regis_student_log,std2018_student where regis_student_log.academicYear='$academicYear' AND regis_student_log.semester='$semester' AND regis_student_log.confirm='1' AND regis_student_log.studentCode=std2018_student.studentCode order by regis_student_log.studentCode ASC"; $db_query=mysqli_query($connect,$sql); $num_rows=mysqli_num_rows($db_query); /* นับ Reccord ที่พบ */ //echo "มีจำนวน <b>$num_rows</b> Users<br>"; ?> <div class="container"> <h2><?php echo "ภาคเรียน $semester/$academicYear"; ?></h2> <p>แก้ไขปํญายอดเงินไม่ตรงกัน <?php echo "มีจำนวน <b>$num_rows</b> Users"; ?></p> <table class="table table-hover"> <thead> <tr> <th>#</th> <th>รหัสนักศึกษา</th> <th>ชือ</th> <th>นามสกุล</th> <th>รหัสกลุ่ม</th> <th>ค่าลงทะเบียน</th> <th>ค่าที่ Error</th> <th></th> </tr> </thead> <tbody> <?php $a=0; while($a < $num_rows) { $result = mysqli_fetch_array($db_query); $id=$result['id']; $studentCode=$result['studentCode']; $firstname=$result['firstname']; $surname=$result['surname']; $groupCode=$result['groupCode']; $cost_total=$result['cost_total']; //เช็ค กลุ่ม $result_regis_group=select("regis_group","where academicYear='$academicYear' AND semester='$semester' AND groupCode='$groupCode'"); $cost_value=$result_regis_group["cost_value"]; $cost_credit=$result_regis_group["cost_credit"]; $cost_value2=$cost_value+$cost_credit; //ตรวจสอบว่าตรงกันหรือเปล่า if($cost_total==$cost_value2){ $tt="/"; }else{ $tt="x"; } //echo "$id : $studentCode $groupCode $cost_value2 $cost_total $tt <br>"; ?> <tr> <td><?php echo $a+1; ?></td> <td><?=$studentCode?></td> <td><?=$firstname?></td> <td><?=$surname?></td> <td><?=$groupCode?></td> <td><?=number_format($cost_value2)?></td> <td><?=number_format($cost_total)?></td> <td><?=$tt?></td> </tr> <?php //update("regis_student_log","cost_total='$cost_value' ","where academicYear='$academicYear' AND semester='$semester' AND studentCode='$studentCode'"); if($up==1){ update("regis_student_log","cost_total='$cost_value2' ","where id='$id' "); } $a++; } if($up==1){ echo "<meta http-equiv=\"refresh\" content=\"0;url=?\">"; exit(0); } ?> </tbody> </table> <form><center> <a href="fix-costtotal.php?up=1" class="btn btn-outline-danger" role="button">ปรับปรุงข้อมูล</a><hr> </center> </form> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.5 |
proxy
|
phpinfo
|
Settings