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


//getting branch details 

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


$branch=getBranch($m);

$class_id=$_REQUEST['class_id'];
$section=$_REQUEST['section'];
$sql = " select * from  edu_user_config as usr, eduportal_designation_config as desig, eduportal_hrm_department_config as dep  where usr.status='0' AND desig.designation_id=usr.designation_id AND dep.department_id=usr.department_id AND usr.branch_id=".$_SESSION['branch'];
 //print_r($sql);
$WorkAssignListings = $m->query($sql);

  $sql1 = " select * from  edu_class_config  where class_id='$class_id'";
  $className = $m->query($sql1);

  $sql2 = " select * from  edu_adm_section_detail  where section_id='$section'";
  $sectionName = $m->query($sql2);

$total_fee;
?>
 <!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">
<!-- Favicons-->
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<title>Print Staff Cards</title>
<!-- Favicons-->
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
// window.print();
</script>
<style> 

.section{width:95%; height:auto;float:left;border-right: 2px solid black;border-right-style:dotted;padding-right:2.5%;margin-left:2%;}
.box{
    width: 2.2in;
    float: left;
    height: 3.6in;
    padding: 0.5%;
    margin-top: 13px;
    margin-left: 30px;
}  
   
tr th {background-color:gray; text-align:center;font-size:14px;border:1px solid gray;}
tr td {border-bottom:1px solid gray;border-left:1px solid gray;padding:.7%;}



.tdalign{text-align:center;border:1px solid black;}
  

body {
 /* background: rgb(204,204,204);*/
  font-weight:bold; 
}
page {
  background: white;
  display: block;
  margin: 0 auto;
  margin-bottom: 0.5cm;
  border:1px solid lightgray;
  /*box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);*/
  /*padding:1%;*/
  height: 21cm; 
}
page[size="A4"] {  
  width: 21cm;
  height: 29.7cm; 
}
page[size="A4"][layout="landscape"] {
  width: 29.7cm;
  height: 21cm;  
}
page[size="A3"] {
  width: 29.7cm;
  height: 42cm;
}
page[size="A3"][layout="landscape"] {
  width: 42cm;
  height: 29.7cm;  
}
page[size="A5"] {
  width: 14.8cm;
  height: 21cm;
}
page[size="A5"][layout="landscape"] {
  width: 21cm;
  height: 14.8cm;  
}
@media print {
  body, page {
    margin: 0;
    box-shadow: none;
    border:none;
  }
}
  </style>

</head>
<body>

<?php 
$WorkAssignValue=$WorkAssignListings;

$divission =count($WorkAssignValue);

 $DivideByFour=$divission/9;

$counter=0;

$fee_fine=0;

// loop just printing the number of pages 

for($k=0;$k<$DivideByFour;$k++){


?>

<page size="A4">


	<?php 
	for ($i=1; $i<=9 ; $i++) {

    if ($WorkAssignValue[$counter]['user_fname']==null) {
      continue;
    }

	 ?>


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


<div style="padding: 2%;
    height: 3.6in;
    /*border-radius: 30px;*/
    border: 1px solid <?php echo $_SESSION['color'];?>;
    margin-left: 2%;
    padding-left: 0%;">

    <div style="background-color: <?php echo $_SESSION['color'];?>;width: 100%;height: 35px;border: 2px solid <?php echo $_SESSION['color'];?>;margin-top: -5px;"></div>
    
    <div style="height:3px;width:102%;margin-top:3px;background-color:<?php echo $_SESSION['color'];?>"></div>

    <div style="width: 100%;text-align: center;">

      <?php if($brid[0]['logo']!=NULL){ ?>
          
          <img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $brid[0]['logo'];?>" id="preview" class="img-thumbnail" style="width:55px;height:55px;margin-top: 3px;"   />

       <?php }else { ?>   

           <img src="http://cdn.onlinewebfonts.com/svg/img_234957.png" id="preview" style="width:55px;height:55px;margin-top: 3px;" class="img-thumbnail" />


       <?php } ?>

     </div>

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

      <div style="text-align: center;font-size:13px; color: <?php echo $_SESSION['color'];?>"><?php echo $branch_details[0]['Branch_Name']; ?>

           
        </div>

    </div>
    <div>
    <div style="width: 15%;float: left;color: white;">.</div>
    <div style="width: 70%;float: left;height: 16px;text-align: center;color: white;background-color:<?php echo $_SESSION['color'];?>;border-radius: 20px;margin-top: 4px;padding: 2px;font-size: 14px;">
            STAFF CARD
        </div>
        <br/>
    <div style="width: 15%;float: left;"></div>
    </div>


    <div style="width: 100%;text-align: center;">

          <?php if($WorkAssignValue[$counter]['attach_image']!=NULL){ ?>

            <img src="<?php echo DOMAIN;?>Production/staff_pics/<?php echo $WorkAssignValue[$counter]['attach_image'];?>" id="preview" class="img-thumbnail" style="width:70px;height:75px;margin-top: 3px;"   />

         <?php }else { ?>   

             <img src="<?php echo DOMAIN;?>Production/staff_pics/employee-icon.png" id="preview" class="img-thumbnail" style="width:70px;height:75px;margin-top: 3px;" />


         <?php } ?>
    </div>

    <div style="width: 100%;text-align: center;">
      <?php echo $WorkAssignValue[$counter]['user_fname'];?>
    </div>


<div style="width:100%; font-weight: normal;float: left;margin-top: 0px;">

 <div style="width:32%;float:left;font-size: 11px;line-height:1.6;margin-top:5px;margin-left: 10px;text-align: center;">

          
      
        Department <span style="float:right;">:</span><br>
        Designation <span style="float:right;">:</span><br>
       

    </div>

    <div style="width: 62%;float:left;padding-left: 0%;text-align:center;font-size: 11px;line-height:1.6;margin-top:5px;">


   
    
      <?php echo $WorkAssignValue[$counter]['department_name'];?> <br>
      <?php echo $WorkAssignValue[$counter]['designation_name'];?> <br>
      

    </div>

   
 </div>  <!-- row -->
<div style="height:3px;width:102%;margin-top: 60px;background-color:<?php echo $_SESSION['color'];?>;"></div>

<div style="font-size: 14px;
    float: right;
    margin-right: 7%;
    margin-top: 4%;"></div>


</div>

<div style="background-color: <?php echo $_SESSION['color'];?>;width: 96%;height: 35px;border: 2px solid <?php echo $_SESSION['color'];?>;margin-top: -40px;margin-left: 4px;">

  <p style="font-size: 14px;
    float: right;
    margin-right: 10%;
    margin-top: 6%;color: white;">Principal</p></div>

</div>
 
<!-- ending section  -->



  </div>  <!-- ending box  -->



 <?php 

 $counter++;
 
 


   } ?>

</page>

<?php } //usset($_SESSION['color']); ?>

</body>
</html>
