<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php");

$api_url = 'https://eduportal.pk/website/apiresponse.php';

// Read JSON file
$json_data = file_get_contents($api_url);

$ClientData=json_decode($json_data, true); 

 ?>
<!DOCTYPE html>
<html lang="en">
  <head>
    
    <title>Client Request | EduPortal</title>
    <?php include('RootMe/css_links.php');?>  

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
     
            <?php include('RootMe/sidebar.php');?>

              <?php include('RootMe/header.php');?>
     
        <!-- page content -->
          <div class="right_col" role="main">

             <a href="<?php echo $_SESSION['dashboard'];?>">Dashboard </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 
             Client Request
          <br><br>

          <div class="row" style="background-color: white;">
           
        
 <h3>Client Request List</h3>
<table id="listofstudents" class="table table-striped table-bordered"style="background-color: white;">
                      <thead>
                        <tr>
                          <th width="1%">S.No</th>                         
                          <th width="10%">Name</th>
                          <th width="15%">School Name</th>
                          <th width="5%">Strength</th>
                          <th width="12%">Email</th>
                          <th width="8%">Country Name</th>
                          <th width="8%">Phone No</th>                          
                          <th width="6%">Role</th>
                         

                        </tr>
                      </thead>
                      <tbody>
  <?php
          
          
?>
                        
<?php  $count=1; 
foreach($ClientData as list("name" => $name, "school_name" => $school_name, "student_strength" => $student_strength, "email" => $email, "country_name" => $country_name, "phone_no" => $phone_no, "role_in_school" => $role_in_school) ) {


$m->where("country_id", $country_name);
$CountryName=$m->get("eduportal_country_name");
?>
                        <tr>
                          <td style="text-align:center;"><?php echo $count; $count++;?></td>
                          <td><?php echo $name;?></td>
                          <td><?php echo $school_name;?></td>
                          <td><?php echo $student_strength;?></td>
                          <td><?php echo $email;?></td>
                          <td><?php echo $CountryName[0]['country_name'];?></td>
                          <td><?php echo $phone_no;?></td>
                          <td><?php echo $role_in_school;?></td>

                        </tr>
<?php } ?>
                      

                      </tbody>
                    </table>
           
          </div>
        </div>

            </div>
          </div>
        </div>
        <!-- /page content -->
  

    
  <?php include('RootMe/js_linksscript.php');?>

<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
 <script>
        
  $(document).ready(function() {
    $('#listofstudents').DataTable({
      "pageLength": 100
    });
    } 
  );

  $("#checkAll").change(function () {

      $("input:checkbox").prop('checked', $(this).prop("checked"));
  });


</script>
  </body>
</html>
