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

<?php  include("sessioncheck.php"); ?>

<?php





 $branch=$_SESSION['branch'];

 



 $sql = " select first_name, last_name,candidate_roll_no,ref_no,class_id,section_id,session_id,cell_no,father_cellno,mother_cell,home_number,father_Bnumber from  edu_student_details where status='0' AND branch_id=".$_SESSION['branch'];



if($_REQUEST['class_id']=="All"){

    

    } else {

     $sql .= " AND class_id = '" .$_REQUEST['class_id']. "' ";



    } 



    if($_REQUEST['section']=="All"){

    

    } else {

     $sql .= " AND section_id = '" .$_REQUEST['section']. "' ";



    }

  

   if($_REQUEST['session']!=NULL){

    $sql .= " AND session_id = '" .$_REQUEST['session']. "' ";

  }else {

    $sql .= " AND session_id = '" .$_SESSION['current_session']. "' ";

  }



  $sql .= " order by class_id asc, first_name asc ";

  //print_r($sql);



  $WorkAssignListings = $m->query($sql);

 

     ?>





<!DOCTYPE html>

<html lang="en">

  <head>

    

    <title>Search Students with Fee | EduPortal</title>

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

   

  </head>

  

  <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">

          <div class="" style="background-color: white;">



   

    <section class="add_sub_agent" id="table_sub_agent">

  <div class="container">



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

    

         <a href="students_reports_link.php">Students Reports </a> &nbsp; <i style="" class="fa fa-angle-double-right"></i>  &nbsp; 

              

          Contacts Numbers Reports



          <br><br>





   



 <div class="" style="margin-top:10px;">

     

      <div class="clearfix"></div>

    </div>



<div style="overflow-x:auto;">

      



<form class="form-style-7" action="contact_reports.php" method="get"  enctype="multipart/form-data">



  <input type="hidden" id="session"  name="session" value="<?php echo $_GET['session']; ?>" />

  <input type="hidden" id="date"  name="date" value="<?php echo $_GET['date']; ?>" />



      

              

              <div class="col-md-2 col-xs-12" style="padding: 8px;">

                <div class="form-group ">

                  <label class="required">Session</label>

                    <select name="session" class="form-control">



                              

                        <?php



                       $match;

                        if(!isset($_REQUEST['session'])){

                          $match=$_SESSION['current_session'];

                        }else { $match=$_REQUEST['session']; }

                       

                                 

                        $WorkAssignList = $m->get("edu_session_config");

                        foreach($WorkAssignList as $WorkAssignListVal)

                        { ?>



                           <option <?php if($match==$WorkAssignListVal['session_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal['session_id']; ?>"><?php echo $WorkAssignListVal['session_year']; ?></option>





                                <?php

                        } ?>



                    </select>

                </div>

              </div>





            





             

             <div class="col-md-2 col-xs-12" style="padding: 8px;">

                <div class="form-group ">

                  <label class="required">Class</label>

 



                  <select name="class_id" class="chosen-multi-select form-control" onChange="getsec(this.value)"  >

                    <option value="All">All</option>



                    <?php

                    $m->where("branch_id", $_SESSION['branch']);

                    $WorkAssignList = $m->get("edu_class_config");

                    foreach($WorkAssignList as $WorkAssignListVal)

                    { ?>



                       <option <?php if($_REQUEST['class_id']==$WorkAssignListVal['class_id']){echo 'selected';}?> value="<?php echo $WorkAssignListVal['class_id']; ?>"><?php echo $WorkAssignListVal['Class_Name']; ?></option>





                            <?php

                    } ?>



                </select> 

                </div>

              </div>





              <div class="col-md-2 col-xs-12" style="padding: 8px;">

                <div class="form-group ">

                  <label class="required">Section</label>

                    <select name="section" id="txt_section" class="chosen-multi-select form-control"   >

                      <option value="All">All</option>

                   <?php

                              if(isset($_REQUEST['section']))

                              { 



                              $m->where("class_id", $_REQUEST['class_id']);    



                              $secondLevel = $m->get("edu_adm_section_detail");

                              

                              foreach($secondLevel as $secondLevel_val)

                              {

                              

                               ?>

                                <option <?php if($_REQUEST['section']==$secondLevel_val['section_id']){echo "selected";} ?> value="<?php echo $secondLevel_val['section_id']; ?>"><?php echo trim(utf8_encode_all($secondLevel_val['section_name'])); ?></option>



                              <?php }   ?>

                                

                          <?php } ?>



                    </select>



                  

                </div>

              </div>



              
          <div class="col-md-2 col-xs-12" style="padding: 8px;">

          <div class="form-group ">

          <label class="required">Order By</label>

          <select name="orderby" class="form-control" >

          <option <?php if($_GET['orderby']=="class"){echo 'selected';}?> value='class'>Class Wise</option>

          <option <?php if($_GET['orderby']=="adm"){echo 'selected';}?> value='adm'>Admission Wise</option>

          </select>

          </div>

          </div>


              

 



              <div class="col-md-2 " style="padding:2px;">

    

        

                <div class="form-group ">

                   

                <button type="submit" class="btn btn-primary" style="margin-top: 29px;">Search</button>

                     <?php 

           if( $_REQUEST['class_id']!=""){

          ?>

            <a target="_blank" title="Print Contact Report" href="print_contact_reports.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&session=<?php echo $_GET['session'];?>&section=<?php echo $_GET['section'];?>&class_id=<?php echo $_GET['class_id'];?>&orderby=<?php echo $_GET['orderby'];?>&8lqc1oclfi4llgnioo156a61oe8lqc1oclfi4llgnioo156a61oe8lqc1" class="fa fa-print btn btn-primary" style="margin-top: 32px;padding: 9px;">&nbsp;Print             

            </a>
          <?php 

          }

          ?>

                </div>



           



        

              </div>



     <?php  if(!isset($_REQUEST['class_id'])){?>



        <div class="col-md-12">



          

           <div id="check_std_msg" style="color:white;font-size:18px;" class="alert alert-danger alert-dismissible">

                    <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>

                     <strong>Warning!</strong> Please select class, Section and search !!!

            </div>

    



        </div>



  <?php   }?>         





    <table id="listofstudents" data-page-length='100' class="table table-striped table-bordered" style="width:100%">

          

         <thead>

            <tr style="font-size: 12px;">

                <th width="3%" class=" center"> S.No</th>

                <th width="10%" class="center"> Name</th>

                <th width="10%" class="center"> F.Name</th>

                <th width="10%" class=" center"> Roll No / Adm </th>  

                <th width="10%" class=" center"> Class / Sec</th>

                <th width="10%" class=" center">Reporting Cell </th>  

                <th width="10%" class=" center" > Father Cell  </th>

                <th width="10%" class=" center" > Father Busi Cell </th>  

                <th width="10%" class=" center"> Mother Cell  </th>

                <th width="10%" class=" center"> Home Cell </th>

                <th width="10%" class=" center"> Whatsapp No</th>  

                

                

                 

            </tr>

        </thead>

        <tbody>

  <?php 

$count=1;

      foreach($WorkAssignListings as $WorkAssignListVal)

      { 



        $m->where("section_id", $WorkAssignListVal['section_id']);

        $section=$m->get("edu_adm_section_detail");

         

        $m->where("class_id", $WorkAssignListVal['class_id']);

        $class=$m->get("edu_class_config");





       

      

     ?>

        <tr> 

                <td class="center"> <?php echo $count; $count++;?> </td>

                  <td style="padding-left:1%;"><?php echo $WorkAssignListVal['first_name'];  ?></td>

                  <td style="padding-left:1%;"><?php echo $WorkAssignListVal['last_name'];  ?></td>

                  <td class="center">  <?php echo $WorkAssignListVal['candidate_roll_no']." / ".$WorkAssignListVal['ref_no'];?>  </td>                  

                  <td style="padding-left:1%;"><?php echo  $class[0]['Class_Name']." / ".$section[0]['section_name'];  ?></td>

                  <td class="center">  <?php echo $WorkAssignListVal['cell_no'];?>  </td>                  

                  <td class="center" >  <?php echo $WorkAssignListVal['father_cellno'];?> </td>

                   <td class="center" >  <?php echo $WorkAssignListVal['father_Bnumber'];?> </td>

                  <td class="center">  <?php echo $WorkAssignListVal['mother_cell'];?>   </td>



                  <td class="center">  <?php echo $WorkAssignListVal['home_number'];?>   </td>

                  <td class="center">  <?php echo $WorkAssignListVal['whatsapp_number'];?>   </td>                  

                                 

              </tr>



       <?php } ?>



                 

            

           

        </tbody>

        

    </table>



</form>

</div>



    <br><br>





  </div>

  <div class="clearfix"></div>

</section>



           

          </div>

        </div>



            </div>

          </div>

        </div>

        <!-- /page content -->

  



    <script src="js/ajax_functions.js"></script> 

  <?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();

        } 

        );

    </script>



    <!-- searchable dropdown -->

    

    <link href="autosearch_select/select2.css" rel="stylesheet">

    <link href="autosearch_select/select2-default.css" rel="stylesheet">

    <script src="autosearch_select/select2.min.js"></script>

    

   <script>

    $(function() {

    $('.chosen-select').select2( { width:'100%', maximumSelectionSize: 1 } );

    $(document).ready(function() {

    $(".chosen-multi-select").select2( { width:'100%', } ); }); }); function slideout(){ setTimeout(function(){

    $(".alert-success").fadeOut("slow", function () { });

    $(".alert-danger").fadeOut("slow", function () { }); }, 4000);}

    </script>

  </body>

</html>

