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

        if(isset($_REQUEST['cat_id'])){

       $m->where("cat_id", $_REQUEST['cat_id']);
       $m->where("branch_id", $_SESSION['branch']);
       $m->where("status",'0');
       $m->orderBy("contact_id","desc");
       $WorkAssignListings = $m->get("eduportal_contacts");

      } else {

       $m->where("branch_id", $_SESSION['branch']);
       $m->where("status",'0');
       $m->orderBy("contact_id","desc");
       $WorkAssignListings = $m->get("eduportal_contacts");

     }

   // getting branch details

  $m->where("branch_id", $_SESSION['branch']);
  $branch=$m->get("edu_branch_config");
  
     ?>
<!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 Contacts</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:1%;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;
  }
}
</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:14px;"><?php echo $branch[0]['Branch_Location']." Cell: ".$branch[0]['Owner_no'];?> </div>

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

<div style="width:33%; float:left; "> <b> Date:</b> <?php echo date("M-Y");?> </div>

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



<br>


  <table width="100%" class="table"  cellspacing="0" >
  
    
  <thead>
    <tr>
      <th width="5%" class=""><strong>S.No</strong></th>
      <th width="15%" class=" alignment"><strong>User Name</strong></th>
      <th width="15%" class=" alignment"><strong>Contact</strong></th>
      <th width="20%" class=" alignment"><strong>Details</strong></th>
      <th width="5%"   style="border-right:1px solid black;" ><strong>Categories</strong></th>
      
    </tr>
   
    </thead>
       <tbody>
    
<?php 

$count=1;
foreach($WorkAssignListings as $WorkAssignListVal)
     { 
        
    $query="select * from eduportal_contacts_category where cat_id=".$WorkAssignListVal['cat_id'];
        $conts_cat = $m->query($query);
     
         $number1=$number1."</br>".$WorkAssignListVal['contact_no'];
?>
    <tr>
      <td  class="center"><?php echo  $count; ?> </td>
      <td  class="alignment"><?php echo  $WorkAssignListVal['contact_title']; ?></td>
      <td  class="alignment"><?php echo  $WorkAssignListVal['contact_no']; ?></td>
      <td  class="center"><?php echo $WorkAssignListVal['contact_details']; ?></td>
      <td  class="center"  style="border-right:1px solid black;"> <?php echo  $conts_cat[0]['cat_name']; ?></td>
      
    </tr>
   
<?php $count++; 
    }
?>

      </tbody>

  </table>

</body>
</html>
