File manager - Edit - /var/www/ams.cmtc.ac.th/pages/admin-calendar-group.php
Back
<div class="card"> <div class="card-body"> <!-- <div align="right"><a href="?op=dues" class="btn btn-secondary" role="button"><i class="fa fa-share" aria-hidden="true"></i> ขั้นตอนต่อไป</a> </div> --> <h4>ภาคเรียนที่ <?=$semester?> ปีการศึกษา <?=$academicYear?></h4> <?php //echo "num_regis_payment_date=$num_regis_payment_date"; if($_POST['action']=="save"){ $holiday_date_add=$_POST['holiday_date_add']; $holiday_name_add=$_POST['holiday_name_add']; $holiday_note_add=$_POST['holiday_note_add']; //ตรวจสอบว่ามีการกำหนดระยะเวลวการชำระเงินหรือยัง $num_holiday_date=num_record("holiday","where academicYear='$academicYear' and semester='$semester' and holiday_date='$holiday_date_add' "); //echo "num_regis_payment_date=$num_regis_payment_date"; if($num_holiday_date==0){ insert("NULL,'$academicYear','$semester','$holiday_name_add','$holiday_date_add','$holiday_note_add' ","holiday"); $_SESSION['msg']="<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button><center><strong>Success!</strong> บันทึกข้อมูลเรียบร้อยแล้ว</center></div>"; }else{ $_SESSION['msg']="<div class=\"alert alert-warning\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button><center><strong>Warning!</strong> มีข้อมูลวันหยุดนี้แล้ว</center></div>"; } echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=calendar&module=holiday\">"; exit(); } //แก้ไขวันหยุด if($_POST['action']=="edit"){ $holiday_id_edit=$_POST['holiday_id_edit']; $holiday_date_edit=$_POST['holiday_date_edit']; $holiday_name_edit=$_POST['holiday_name_edit']; $holiday_note_edit=$_POST['holiday_note_edit']; //ตรวจสอบว่ามีการกำหนดระยะเวลวการชำระเงินหรือยัง update("holiday","holiday_date='$holiday_date_edit',holiday_name='$holiday_name_edit',holiday_name='$holiday_name_edit',holiday_note='$holiday_note_edit' ","where holiday_id='$holiday_id_edit'"); echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=calendar&module=holiday\">"; exit(); } //แก้ไขวันหยุด if($_POST['action']=="del" AND $_POST['confirm']=="yes" ){ $holiday_id_del=$_POST['holiday_id_del']; //echo"ลบข้อมูล $holiday_id_del"; //ตรวจสอบว่ามีการกำหนดระยะเวลวการชำระเงินหรือยัง delete("holiday","where holiday_id='$holiday_id_del'"); echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=calendar&module=holiday\">"; exit(); } ?> <div class="container"> <div class="row"> <div class="container"> <h3><i class="fa fa-calendar fa-1x" aria-hidden="true"></i> วันในสัปดาห์ ภาคเรียนที่ <u><?=$semester?></u> ปีการศึกษา <u><?=$academicYear?></u> </h3> <?php global $connect; $sql="Select * From week_day where status='1' order by day_id ASC"; $db_query=mysqli_query($connect,$sql); $num_rows=mysqli_num_rows($db_query); /* นับ Reccord ที่พบ */ echo "วันที่ร่วมกิจกรรมฯ จำนวน <u>$num_rows</u> วัน "; ?> <table class="table table-hover table-striped table-condensed table-sm table-bordered "> <thead> <tr> <th><center>#</center></th> <th><center>ชื่อวัน</center></th> <th><center>ตัวย่อ</center></th> <th><center>(w)</center></th> <th><center>จำนวนกลุ่มเรียน/ห้องเรียน</center></th> <th><center>จำนวนนักเรียน นักศึกษา</center></th> <th><center>จัดการ</center></th> </tr> </thead> <tbody> <?php $a=0; $no=1; $num_group_all=0; $num_student_all=0; while($a < $num_rows) { $result = mysqli_fetch_array($db_query); $day_id=$result['day_id']; $day_name=$result['day_name']; $day_name_eng=$result['day_name_eng']; $day_name_short=$result['day_name_short']; $w=$result['w']; //นับจำนวนกลุ่มเรียน $num_week_group=num_record("week_group","where academicYear='$academicYear' AND semester='$semester' AND day_id='$day_id' "); $num_group_all=$num_group_all+$num_week_group; //นับจำนวนผู้นักเรียน นักศึกษา $sql_week_group="Select * From week_group where academicYear='$academicYear' AND semester='$semester' AND day_id='$day_id' "; $db_query_week_group=mysqli_query($connect,$sql_week_group); $num_rows_week_group=mysqli_num_rows($db_query_week_group); //echo "num_rows_week_group=$num_rows_week_group"; $a_week_group=0; $num_student=0; while($a_week_group < $num_rows_week_group){ $result_week_group = mysqli_fetch_array($db_query_week_group); $groupCode=$result_week_group['groupCode']; $num_student2=num_record("std2018_student","where groupCode='$groupCode' AND studentStatusCode='03'"); $num_student=$num_student+$num_student2; $num_student_all=$num_student_all+$num_student2; //echo "groupCode=$groupCode<br>"; $a_week_group++; } ?> <tr> <td align="center"><?php echo $no;?>.<a name="<?=$day_id?>" id="<?=$day_id?>"></a></td> <td><center><?=$day_name?></center></td> <td><center><?=$day_name_short?></center></td> <td><center><?=$w?></center></td> <td><center><?php if($num_week_group==0){ echo "-"; }else{ echo $num_week_group; } ?></center></td> <td><center><?php if($num_student==0){ echo "-"; }else{ echo $num_student; } ?></center></td> <td><center> <a href="?op=calendar&module=group-day&p=&day=<?=$day_id?>&w=<?=$w?>&sday_name=<?=$day_name?>#data" class="btn btn-sm btn-outline-info" ><i class="fa fa-cube" aria-hidden="true"></i> รายละเอียด</a> </center> </td> </tr> <?php $no++; $a++; } ?> <tr> <td colspan="4"><center><b>รวม</b></center></td> <td><center><?=$num_group_all?></center></td> <td><center><?=number_format($num_student_all)?></center></td> </tr> </tbody> </table> <hr> </div> </div> </div> </div> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.41 |
proxy
|
phpinfo
|
Settings