<h2>แสดงกลุ่มเรียนที่ลงทะเบียน ภาคเรียนที่ <?=$semester?> ปีการศึกษา <?=$academicYear?> </h2>
<div align="right"><a href="?op=summarize&module=groups-list&show=all" class="btn btn-secondary" role="button"> <i class="fa fa-share" aria-hidden="true"></i> แสดงกลุ่มเรียนทั้งหมด</a> </div>
<p>จะเป็นการจัดกลุ่มของค่าธรรมเนียมที่เรียนเก็บนักศึกษา เพื่อความสะดวกในการเพิ่มค่าธรรมเนียมให้นักเรียน นักศึกษาแต่ละกลุ่ม</p>




 <?php
global $connect;	
$sql="Select * From regis_level order by level_id  ASC";
$db_query=mysqli_query($connect,$sql);
$num_rows=mysqli_num_rows($db_query); /* นับ Reccord ที่พบ */
//echo "มีจำนวน <b>$num_rows</b> รายการ <font color=\"#9E0002\">คลิก ปุ่มรายละเอียด เพื่อแสดงกลุ่มเรียน </font>";

?>
  <table class="table table-hover table-striped table-condensed table-sm ">
    <thead>
      <tr>
        <th><center>#</center></th>
        <th>ระดับ</th>
		  <th style="text-align: right">จำนวนกลุ่มเรียน</th>
  		 <th style="text-align: center">จัดการข้อมูล</th> 
      </tr>
    </thead>
    <tbody>
	<?php
$a=0;
$no=1;
while($a < $num_rows)
{
	$result = mysqli_fetch_array($db_query);
	$level_id=$result['level_id'];
	$level_name=$result['level_name'];

	$num_regis_group=num_record("regis_group","where level_no='$level_id' AND academicYear='$academicYear' AND semester='$semester' AND status='1' ");
	//echo num_regis_group;
	if($num_regis_group!=0){
	?>	
    	
		
      <tr>
        <td align="center"><?php echo $no;?>.<a name="<?=$level_id?>" id="<?=$level_id?>"></a></td>
        <td> <?php if($_GET['id']==$level_id){ echo"<i class=\"fa fa-check fa-2x\" aria-hidden=\"true\" style=\"color:green\"></i> ";}
		echo "$level_name"; ?></td>
		 <td align="right"><?=$num_regis_group?> กลุ่มเรียน</td> 	   

		<td><center><a href="?op=summarize&module=groups&detail=list&id=<?=$level_id?>#data" class="btn btn-sm btn-primary" role="button"><i class="fa fa-list-ol" aria-hidden="true"></i> รายละเอียด</a></center>
			
			</td></td>  
      </tr>



   <?php
				$no++;
			}
		$a++;
}
	
	?>
    </tbody>
  </table>

<a name="data" id="data"></a>
<?php
if($_GET['detail']=="list"){
	$id=$_GET['id'];
	include("admin-summarize-groups-list.php");
}
	

?>
</div>