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

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







   $session;



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



      $session=$_REQUEST['session'];

      

    }else {

      

      $session=$_SESSION['current_session'];

    }



    $pageName=basename($_SERVER['PHP_SELF']);

    

     $m->where("page_name", $pageName);

     $video = $m->get("eduportal_modules_pages_detail");

    

 //echo $video[0]['video_url'];





$branch=$_SESSION['branch'];



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

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



if ($classOrder[0]['class_order']!='0') {



$sql = "SELECT sec.*, cls.* FROM edu_adm_section_detail as sec LEFT JOIN edu_class_config as cls ON sec.class_id = cls.class_id where cls.class_id!='' and cls.branch_id='$branch' and sec.branch_id='$branch' ORDER BY cls.orderno asc";


} else {


$sql = "SELECT sec.*, cls.* FROM edu_adm_section_detail as sec LEFT JOIN edu_class_config as cls ON sec.class_id = cls.class_id where cls.class_id!='' and cls.branch_id='$branch' and sec.branch_id='$branch' ORDER BY cls.orderno asc";

}

//echo $sql;

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



/*  if(isset($_COOKIE['classes_sections'])) {



    // Storing code

      

   

    echo "cookie has set... <br>";



  $datass = json_decode($_COOKIE['classes_sections'], true);

  print_r($datass);





      } else { 



      

      setcookie('classes_sections', json_encode($WorkAssignListings), time()+3600);

    



      }*/



?>

<input type="hidden" name="" value="<?php print_r($sql);?>">

<!DOCTYPE html>

<html lang="en">

  <head>

  

    <title> Students Reports | 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 -->

          <!-- Modal -->

            <div id="Modal<?php echo $_GET['class_id'];?>-<?php echo $_GET['section'];?>" class="modal fade" role="dialog">





              <div class="modal-dialog">



                <!-- Modal content-->

                <div class="modal-content">



                   

               <form action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" method="post" enctype="multipart/form-data">



                  <input type="hidden" name="action" value="ClassPrintParameter">

             

                  <div class="modal-header">

                    <button type="button" class="close" data-dismiss="modal">&times;</button>

                    <h4 class="modal-title"> Choose The Parametters To Display in Print Report </h4>

                  </div>

                  <div class="modal-body">

                  <!-- <label class="container1">Check All<input  type="checkbox" class="checkAll"/><span class="checkmark"></span></label> -->

                           

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

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

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



                  <label style="text-align: left; float: left;"> <b>Select Listing Order:</b>

                  <select name="orderBy" style="width: 562px;" id="orderBy" class="form-control" >

                     
                     <option  value="classWise">Class Wise</option>

                     <!-- <option  value="alphabetic">Alphabetic</option> -->

                     <option  value="RollNoWise">Roll No Wise</option>

                     <option  value="Admascending">Adm# Ascending</option>

                       

                    </select>

                 </label>  

                 

                 <label style="text-align: left;"> <b>Sub Heading:</b>

                    <input type="text"  style="width: 562px; height:40px;" name="studnetlist" value="Student List"/>

                 </label>




                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="registration" checked value="1"/>

                    Registration

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="adm_fee" checked value="1"/>

                    Admission Fee

                    <span class="checkmark"></span>

                  </label>


                   <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="tution_fee" checked value="1"/>

                    Monthly Fee

                    <span class="checkmark"></span>

                  </label>

               

                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="admission" checked value="1"/>

                    Admission No

                    <span class="checkmark"></span>

                  </label>

                  

                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="student_name" checked value="1"/>

                    Student Name

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_name" checked value="1"/>

                    Father Name

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="class_sec" checked value="1"/>

                    Class_Sec

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="roll_no" checked value="1"/>

                    Roll No

                    <span class="checkmark"></span>

                  </label>




                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="loginid_paswrd" checked value="1"/>

                    Student Login Id & Password

                    <span class="checkmark"></span>

                  </label>



                  



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="cell_no" checked value="1"/>

                    SMS Reporting No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_cellno" checked value="1"/>

                    Father No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="mother_cell" checked value="1"/>

                    Mother No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="home_number" checked value="1"/>

                    Home No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_Bnumber" checked value="1"/>

                    Father Business No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="address" checked value="1"/>

                    Address

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="dob" checked value="1"/>

                    DOB

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="B-Form" checked value="1"/>

                    B-Form

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_cnic" checked value="1"/>

                    Father CNIC

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="date_admission" checked value="1"/>

                    Date of Admission

                    <span class="checkmark"></span>

                  </label>



                  </div>

                  <div class="modal-footer" style="text-align: right;">

                    <input type="submit" class="btn btn-primary" checked value="Print" />

                  </div>





                   </form>

                </div>



              </div>

            </div>

            <!-- Modal -->











        <div class="right_col" role="main">

        <div class="row">





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

              

          Classwise Students Reports



          <br><br>







          <h3 style="float: left;">Class & Section Wise Report </h3>



          <a target="_blank" class="btn btn-success pull-right" title="Print Students List" href="print_students_report.php?<?php echo session_id().session_id().session_id().session_id().session_id(); ?>&class_id=<?php echo $_GET['class_id'];?>&section=<?php echo $_GET['section'];?>">

          <i class="fa fa-print m-right-xs" target="_blank"></i> &nbsp; Print Report

        </a>



        <a target="_blank" class="btn btn-warning pull-right" title="Print Students List" data-toggle="modal" data-target="#Modal<?php echo $_GET['class_id'];?>-<?php echo $_GET['section'];?>" style=""><i class="fa fa-print m-right-xs" target="_blank"></i>&nbsp;Print All Students List

            

          </a>





         

  

  <a href="watch_video.php?videourl=6q_-ZLWVtaI" target="_blank" class="btn btn-success" style="padding: 5px 5px; font-size:14px;color:white;float: right;"><i class="fa fa-play"></i>&nbsp;&nbsp;Watch Video</a>



  <!-- <a href="class_drag.php" target="_blank" class="btn btn-success" style="padding: 5px 5px; font-size:14px;color:white;float: right;"><i class="fa fa-sort"></i>&nbsp;&nbsp;Class Order</a> -->







  

  <table  class="table table-striped table-bordered" style="width:100%;background-color:#FFFFFF;">

        <thead>

            <tr>



                <th width="5%" style="text-align:center;"> S.No </th>

                <th width="25%"> Class </th>

                <th width="7%" style="text-align:center;"> Students </th>

                <th width="7%" style="text-align:center;"> Boys </th>

                <th width="7%" style="text-align:center;"> Girls </th>

                <th width="60%" style="text-align:center;">Action </th>

                

            </tr>

        </thead>

        <tbody>





   

     

     <?php 



   

     $count=1;

     $std=0;

      foreach($WorkAssignListings as $WorkAssignListVal)

      { 



        

      $cls=$WorkAssignListVal['class_id'];

      $section=$WorkAssignListVal['section_id'];

      

       // getting strength of students 

       

      $stds_record = $m->query("SELECT COUNT(*) as total, COUNT(IF(gender = 'Male', 1, NULL)) 'Boys', COUNT(IF(gender = 'Female', 1, NULL)) 'Girls' FROM edu_student_details  where class_id=$cls and section_id=$section and STATUS=0 and branch_id=".$_SESSION['branch']);



      $std+=count($total);

      //echo $std;

      ?>



        <tr>





                  

                  <td style="text-align:center;"> <?php echo $count; $count++;?> </td>



                  <td> <?php echo  $WorkAssignListVal['Class_Name']." - ".$WorkAssignListVal['section_name']; ?> </td>



                  <td  style="text-align:center;"> <?php echo $stds_record[0]['total'];?> </td>



                  <td  style="text-align:center;"> <a target="_blank" style="font-size:14px;"  href="genderwise_report.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>&gender=Male" style="cursor:pointer;"  class="btn btn-success">

                  <?php echo $stds_record[0]['Boys'];?>

                  </a> </td>



                  <td  style="text-align:center;"> <a target="_blank" style="font-size:14px;"  href="genderwise_report.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>&gender=Female" style="cursor:pointer;"  class="btn btn-success">

                  <?php echo $stds_record[0]['Girls'];?>

                  </a> </td>

                  

                  <td style="text-align:center;"> 



                  <a target="_blank" style="font-size:14px;"  href="manage_students.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>" style="cursor:pointer;"  class="btn btn-success">



                  View Class

                  </a>



                  <!-- <a target="_blank" style="font-size:14px;"  href="genderwise_report.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>" style="cursor:pointer;"  class="btn btn-success">



                  Gender Report

                  </a> -->            



                  <a style="padding: 6px 8px; font-size:14px;" data-toggle="modal" data-target="#Modal<?php echo $WorkAssignListVal['class_id'];?>-<?php echo $WorkAssignListVal['section_id'];?>"  href="#" class="btn btn-success">

                  Print </a>



                  <a style="padding: 6px 8px; font-size:14px;" href="update_student_classwise.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>" class="btn btn-success">

                  Update Student Info </a>

          



              <a target="_blank" style="padding: 6px 8px; font-size:14px;" href="fee_settings.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&session=<?php echo $_SESSION['current_session']; ?>" class="btn btn-success">

                  Update Fee  </a>



   





                  <a style="padding: 6px 8px; font-size:14px;" href="studentsInfo_export_excel.php?<?php echo session_id().session_id().session_id().session_id().session_id();?>&class_id=<?php echo $WorkAssignListVal['class_id'];?>&section=<?php echo $WorkAssignListVal['section_id'];?>" style="cursor:pointer;"  class="btn btn-success" class="btn btn-success  fa fa-download pull-right"> Export </a>





            <!-- Modal -->

            <div id="Modal<?php echo $WorkAssignListVal['class_id'];?>-<?php echo $WorkAssignListVal['section_id'];?>" class="modal fade" role="dialog">

              <div class="modal-dialog">



                <!-- Modal content-->

                <div class="modal-content">



                   

               <form action="<?php echo DOMAIN.AgentDirectory;?>parent/InsertMe.php" target="_blank" method="post" enctype="multipart/form-data">



                  <input type="hidden" name="action" value="ClassPrintParameter">

             

                  <div class="modal-header">

                    <button type="button" class="close" data-dismiss="modal">&times;</button>

                    <h4 class="modal-title"> Choose The Parametters To Display in Print Report </h4>

                  </div>

                  <div class="modal-body">

                  



                  <input type="hidden" name="class_id" value="<?php echo $WorkAssignListVal['class_id'];?>" />

                  <input type="hidden" name="section" value="<?php echo $WorkAssignListVal['section_id'];?>" />

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

                 

                  <label style="text-align: left; float: left;"> <b>Select Listing Order:</b>    </label> 

                  <select name="orderBy" style="width: 562px;" id="orderBy" class="form-control" >

            

                     <option  value="classWise">Class Wise</option>

                     <!-- <option  value="alphabetic">Alphabetic</option> -->

                     <option  value="RollNoWise">Roll No Wise</option>

                     <option  value="Admascending">Admission No Wise</option>

                       

                    </select>

               

                  <!-- <label style="text-align: left; float: left;"> <b>Blank Column</b>    </label> 

                   <select name="blank_column" style="width: 562px;" id="orderBy" class="form-control" >

            

                     <option  value="no">No</option>

                     <option  value="yes">Yes</option>

                       

                    </select> -->

               <br>



                 <label style="text-align: left;"> <b>Page Heading:</b>

                    <input type="text"  style="width: 562px; height:40px;" name="studnetlist" value="Student List"/>

                 </label>

                 <br><br>



               <!--   <label class="container1" style="text-align: right; float: right;">

                    <input type="checkbox" name="blank_column"  value="yes"/>

                    Add Blank Column

                    <span class="checkmark"></span>

                 </label>



                 <label class="container1" style="text-align: right; float: right;">

                    <input type="checkbox" name="remarks_column"  value="yes"/>

                    Remarks Column

                    <span class="checkmark"></span>

                 </label> -->



               <!-- <br><br> -->



                <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="registration" checked value="1"/>

                    Registration

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="adm_fee" checked value="1"/>

                    Admission Fee

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="tution_fee" checked value="1"/>

                    Monthly Fee

                    <span class="checkmark"></span>

                  </label>



                 <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="admission" checked value="1"/>

                    Admission No

                    <span class="checkmark"></span>

                  </label>

                  

                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="student_name" checked value="1"/>

                    Student Name

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_name" checked value="1"/>

                    Father Name

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="class_sec" checked value="1"/>

                    Class_Sec

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="roll_no" checked value="1"/>

                    Roll No

                    <span class="checkmark"></span>

                  </label>                  



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="cell_no" checked value="1"/>

                    SMS Reporting No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_cellno" checked value="1"/>

                    Father No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="mother_cell" checked value="1"/>

                    Mother No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="home_number" checked value="1"/>

                    Home No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_Bnumber" checked value="1"/>

                    Father Business No

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="address" checked value="1"/>

                    Address

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="localities" checked value="1"/>

                    Localities

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="dob" checked value="1"/>

                    DOB

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="gender" checked value="1"/>

                    Gender

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="age" checked value="1"/>

                    Age

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="B-Form" checked value="1"/>

                    B-Form

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="father_cnic" checked value="1"/>

                    Father CNIC

                    <span class="checkmark"></span>

                  </label>



                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="student_image" checked value="1"/>

                    Student Image

                    <span class="checkmark"></span>

                  </label>





                  <label class="container1" style="text-align: left;">

                    <input type="checkbox" name="date_admission" checked value="1"/>

                    Date of Admission

                    <span class="checkmark"></span>

                  </label>

                                                  



                  </div>

                  <div class="modal-footer" style="text-align: right;">

                    <input type="submit" class="btn btn-primary" checked value="Print" />

                  </div>





                   </form>

                </div>



              </div>

            </div>

            <!-- Modal -->



                  </td>



              </tr>



              <?php

      }   ?>



  

           

        </tbody>

        

    </table>



        </div> 

        </div>



            </div>

          </div>

        </div>

        <!-- /page content -->

  



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

  

  </body>

</html>

