<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php   
    
$m->where("branch_id", $_SESSION['branch']);
$branch=$m->get("edu_branch_config");



   $branchID=$_SESSION['branch']; 

   $sql = " select * from  edu_user_config where branch_id='$branchID' and status='0' ";

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

   if($_REQUEST['designation']=="All"){
      $sql;
    } else {
    $sql .= " AND designation_id = '" .$_REQUEST['designation']. "' ";

    }

  if($_REQUEST['department']=="All"){
      $sql;

    } else {

    $sql .= " AND department_id = '" .$_REQUEST['department']. "' ";

    }  

  }
 
  $sql .= " order by user_id asc";

  $WorkAssignListings = $m->query($sql);
  
     ?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Print Class List</title>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
 // window.print();
</script>
<style type="text/css">



.center{text-align:center;}
.alignment{padding-left:5px;text-align:left;}

tr th {border:1px solid black;text-align:center;background-color:lightgray;font-size:14px;}
tr td {border-bottom:1px solid black;border-left:1px solid black;font-size:14px;padding:3px;}
  

@media print {
    #Header, #Footer { display: none !important; }
}
@media screen
   {
      p.bodyText {font-family:verdana, arial, sans-serif;}
   }

   @media print
   {
      p.bodyText {font-family:georgia, times, serif;}
   }
   @media screen, print
   {
      p.bodyText {font-size:10pt}
   }
   @media print {
  a[href]:after {
    content: none !important;
  }
}

.btn-toolbar{
  margin-left: -76em;
}
</style>


</head>
<body>



<div style="text-align:center;font-size:25px;font-weight:bold;margin:0 auto;"><?php echo $branch[0]['Branch_Name'];?> </div> <br>



<div style="text-align:center;font-size:16px;"><b>Staff List</b> </div>

<hr style="width:100%;">

<div style="width:50%; float:left; "> <b> Total Strength:</b> <?php echo count($WorkAssignListings);?> </div>


<br>


  <table id="excelexpo" width="100%" class="table"  cellspacing="0" >
  
    
  <thead>
    <tr>
      <th width="3%" class=""><strong>S.No</strong></th>

      <?php if($_GET['pic']==1){?><th width="8%" class="center" ><strong>Picture</strong></th><?php }?>

      <?php if($_GET['name']==1){?><th width="6%" class=" alignment"><strong>Name# </strong></th><?php }?>

      <?php if($_GET['father_name']==1){?><th width="10%" class=" alignment"><strong>Father/Husband Name</strong></th><?php }?>

      <?php if($_GET['gender']==1){?><th width="6%" class=" alignment"><strong>Gender</strong></th><?php }?>

      <?php if($_GET['marital_status']==1){?><th width="6%" class=" alignment"><strong>Marital Status</strong></th><?php }?>

       <?php if($_GET['qualification']==1){?><th width="6%" class=" alignment"><strong>Qualification</strong></th><?php }?>

       <?php if($_GET['cell_no']==1){?><th width="6%" class=" alignment"><strong>Cell No</strong></th><?php }?>
      
      <?php if($_GET['salary']==1){?><th width="6%" class=" alignment" ><strong>Salary</strong></th><?php }?>

      <?php if($_GET['home_contact']==1){?><th width="6%" class=" alignment" ><strong>Home Contact</strong></th><?php }?>

      <?php if($_GET['email']==1){?><th width="6%" class=" alignment"><strong>Email</strong></th><?php }?>

      <?php if($_GET['cnic']==1){?><th width="6%" class=" alignment" ><strong>CNIC</strong></th><?php }?>

      <?php if($_GET['dob']==1){?><th width="6%" class=" alignment" ><strong>DOB</strong></th><?php }?>

      <?php if($_GET['DOJ']==1){?><th width="6%" class=" alignment"><strong>Date of Joining</strong></th><?php }?>

      <?php if($_GET['Department']==1){?><th width="6%" class=" alignment" ><strong>Department</strong></th><?php }?>

      <?php if($_GET['Designation']==1){?><th width="6%" class=" alignment"><strong>Designation</strong></th><?php }?>

      <!-- <?php if($_GET['lastname']==1){?><th width="10%" ><strong>Father/Husband Name</strong></th><?php }?> -->

      <?php if($_GET['Address']==1){?><th width="6%" class=" alignment"><strong>Address</strong></th><?php }?>

      <?php if($_GET['bank_account']==1){?><th width="6%" class=" alignment" ><strong>Bank Account</strong></th><?php }?>

      <?php if($_GET['paswrd']==1){?><th width="6%" class=" alignment" ><strong>Password</strong></th><?php }?>

       
    </tr>
   


   
    </thead>
       <tbody>
    
<?php 

$count=1;
foreach($WorkAssignListings as $WorkAssignListVal)
{ 

$fee;

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

  $m->where("session_id", $_REQUEST['session']);
  $m->where("student_id", $WorkAssignListVal['student_id']);
  $m->where("class_id", $WorkAssignListVal['class_id']);
  $fees=$m->get("eduportal_student_fee_structure");

} else {

  //$m->where("session_id", $_REQUEST['session']);
  $m->where("student_id", $WorkAssignListVal['student_id']);
 // $m->where("class_id", $WorkAssignListVal['class_id']);
  $fees=$m->get("eduportal_student_fee_structure");  
}

  if(count($fees)>0){
    
    $fee=$fees[0]['std_tution_fee'];
    $Transportfee=$fees[0]['std_transport_fee'];
    $bl=$fees[0]['std_outstanding_blc'];
    $misc=$fees[0]['std_misc_fee'];
  }else {
    $fee="-";
    $Transportfee="-";    
    $bl=0;
    $misc=0;
  }

 

    $m->where("class_id", $WorkAssignListVal['class_id']);
    $class=$m->get("edu_class_config");

    $m->where("section_id", $WorkAssignListVal['section_id']);
    $section=$m->get("edu_adm_section_detail");

    $m->where("department_id", $WorkAssignListVal['department_id']);
    $DepartmentName=$m->get("eduportal_hrm_department_config");

    $m->where("designation_id", $WorkAssignListVal['designation_id']);
    $DesignationName=$m->get("eduportal_designation_config");

  

// print_r($fees);
?>
    <tr>
      <td  class="center"><?php echo  $count; ?> </td>

       <?php if($_GET['pic']==1){?><td  class="center"><?php if($WorkAssignListVal['attach_image']!=NULL){?>
        <img style="height:35px;with:35px;" src="<?php echo DOMAIN;?>Production/staff_pics/<?php echo $WorkAssignListVal['attach_image'];?>"  />
      <?php }else {?>

        <img style="height:35px;with:35px;" src="images/student.png" />

      <?php }?></td><?php }?> 

      <?php if($_GET['name']==1){?><td  class="alignment"><?php echo  $WorkAssignListVal['user_fname']; ?></td><?php }?>

      <?php if($_GET['father_name']==1){?><td  class="alignment"><?php echo  $WorkAssignListVal['user_lname']; ?></td><?php }?>

      <?php if($_GET['gender']==1){?><td  class="alignment"><?php echo  $WorkAssignListVal['user_gender']; ?></td><?php }?>

      <?php if($_GET['marital_status']==1){?><td  class="alignment"><?php echo  $WorkAssignListVal['marital_status']; ?></td><?php }?>

       <?php if($_GET['qualification']==1){?><td style="text-align: center;" class="alignment"><?php echo  $WorkAssignListVal['user_qualification']; ?></td><?php }?>

      <?php if($_GET['cell_no']==1){?><td  class="alignment"><?php echo  $WorkAssignListVal['cell_no']; ?></td><?php }?>

     

      <?php if($_GET['salary']==1){?><td  class=" alignment"> <?php echo  $WorkAssignListVal['user_salary']; ?></td><?php }?>

      <?php if($_GET['home_contact']==1){?><td  class=" alignment"> <?php echo  $WorkAssignListVal['home_no']; ?></td><?php }?>

      <?php if($_GET['email']==1){?><td  class=" alignment"> <?php echo  $WorkAssignListVal['user_email']; ?></td><?php }?>

      <?php if($_GET['cnic']==1){?><td  class=" alignment"> <?php echo  $WorkAssignListVal['user_cnic']; ?></td><?php }?>

      <?php if($_GET['dob']==1){?><td  class=" alignment"> <?php echo date("d-M-Y",strtotime($WorkAssignListVal['DOB']));?></td><?php }?>

      <?php if($_GET['DOJ']==1){?><td  class=" alignment"> <?php echo date("d-M-Y",strtotime($WorkAssignListVal['user_joining']));?></td><?php }?>

      <?php if($_GET['Department']==1){?><td  class=" alignment"> <?php echo $DepartmentName[0]['department_name'];?></td><?php }?>

      <?php if($_GET['Designation']==1){?><td  class=" alignment"> <?php echo $DesignationName[0]['designation_name'];?></td><?php }?>

      <!-- <?php if($_GET['lastname']==1){?><td  class="center"> <?php echo $WorkAssignListVal['user_lname'];?></td><?php }?> -->

      <?php if($_GET['Address']==1){?><td  class=" alignment"> <?php echo $WorkAssignListVal['user_address'];?></td><?php }?>

      <?php if($_GET['bank_account']==1){?><td  class=" alignment"> <?php echo $WorkAssignListVal['account_no'];?></td><?php }?>

      <?php if($_GET['paswrd']==1){?><td  class=" alignment"> <?php echo  $WorkAssignListVal['user_password']; ?></td><?php }?>

    
    </tr>
   
<?php $count++; 
    }
?>

      </tbody>

  </table>


      <?php include('RootMe/js_linksscript.php');?>
  <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
   
   <script src="js/FileSaver.min.js" type="text/javascript"></script>
  <script src="js/tableexport.min.js" type="text/javascript"></script>

  <script type="text/javascript">
    $('#excelexpo').tableExport();
  </script>

</body>
</html>
