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

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

$branch=getBranch($m);

$class_id=$_REQUEST['class_id'];
$section=$_REQUEST['section'];
$sql = " select * from  edu_student_details  where class_id='$class_id' AND section_id='$section' AND status='0' AND branch_id=".$_SESSION['branch'];
 
$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 Voucher</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: 48%;
    float: left;
    height: 7cm;
    padding: 7.7px;
}  
   
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 black;
  /*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/8;

$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<=8 ; $i++) {

if ($WorkAssignValue[$counter]['first_name'] == NULL) {
    break;
  }

   ?>


<div class="box" >


<div style="/*padding: 2%;
    height: 235px;
    border-radius: 5px;
    border: 1px solid black;*/
    margin-left: 2%;">

      
     <div style="background: <?php echo $_SESSION['color'];?>;color: white;height: 50px;border-radius: 10px;">

       <div style="width:17%;float: left; background: white;margin-top: 15px;margin-left: 15px;">

        <?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:60px;height:60px;"   />

       <?php }else { ?>   

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


       <?php } ?>

       </div>


       <div style="width:78%;float: left;text-align: center;padding-top: 15px;font-size: 14px;"><b><?php echo $branch_details[0]['Branch_Name']; ?></b></div>

     </div>
     


     <div>
   <br><br> 
      <div style="width:75%;float:left;margin-top: 0px;">

        <div style="font-size: 6px;color:white;">&nbsp;&nbsp; 123</div>
        <div style="font-size: 20px;margin-top: -15px;margin-left: -11px;">&nbsp;&nbsp; <b><?php echo $WorkAssignValue[$counter]['first_name'];?></b></div>
        
        
        <div style="border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;width: 263px;font-size: 13px;"><span style="background:<?php echo $_SESSION['color'];?>;padding-bottom:1px ;padding-top:1px ;color: white;padding-left: 5px;border-top-right-radius: 15px;border-top-left-radius: 6px;border-bottom-right-radius: 15px;border-bottom-left-radius: 6px;">F.Name:&nbsp;&nbsp;&nbsp;</span> <?php echo $WorkAssignValue[$counter]['last_name'];?></div>

        <div style="width:48%;font-size: 13px;float:left;border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;margin-top: 5px;"><span style="background:<?php echo $_SESSION['color'];?>;color: white;padding-left: 5px;padding-bottom:1px;border-top-right-radius: 15px;border-top-left-radius: 6px;border-bottom-right-radius: 15px;border-bottom-left-radius: 6px;">Class:&nbsp;&nbsp;&nbsp;</span>&nbsp;<?php echo $className[0]['Class_Name'];?></div>

        <div style="width:43.9%;font-size: 13px;float:left;border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;margin-left: 5px;margin-top: 5px;"><span style="background:<?php echo $_SESSION['color'];?>;color: white;padding-left: 5px;padding-top: 2px;padding-bottom:1px;border-top-right-radius: 15px;border-top-left-radius: 6px;border-bottom-right-radius: 15px;border-bottom-left-radius: 6px;font-size: 11px;">Adm/Roll:&nbsp;</span><span style="font-size: 11px;">&nbsp;<?php echo $WorkAssignValue[$counter]['ref_no']."/".$WorkAssignValue[$counter]['candidate_roll_no'];?></span></div>

        

        <div style="width:263px;font-size: 13px;float:left;border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;margin-top: 5px;"><span style="background:<?php echo $_SESSION['color'];?>;color: white;padding-left: 5px;padding-bottom:1px;border-top-right-radius: 15px;border-top-left-radius: 6px;border-bottom-right-radius: 15px;border-bottom-left-radius: 6px;">Cell No #:&nbsp;&nbsp;</span><span>&nbsp;<?php echo $WorkAssignValue[$counter]['cell_no']." , ".$WorkAssignValue[$counter]['father_cellno'];?></span></div>
        

        <div style="width:263px; height: 15px; font-size: 10px;float:left;border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;margin-top: 5px;padding-bottom: 2em;"><span style="background:<?php echo $_SESSION['color'];?>;color: white;padding-left: 5px;padding-bottom:1px;border-top-right-radius: 15px;border-top-left-radius: 6px;border-bottom-right-radius: 15px;border-bottom-left-radius: 6px;">Address:&nbsp;&nbsp;</span><span style="padding: 3px;"><?php echo substr($WorkAssignValue[$counter]['address'], 0, 100);?></span></div>

        <!-- <div style="width:263px;font-size: 13px;float:left;border: 1px solid <?php echo $_SESSION['color'];?>;border-radius: 5px;margin-top: 5px;"><span style="color:white;">1</span><?php echo substr($WorkAssignValue[$counter]['address'], 30);?></div> -->

       
      </div>


      <div style="width:25%;float:left">

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

            <img src="<?php echo DOMAIN;?>Production/students_pics/<?php echo $WorkAssignValue[$counter]['image'];?>" id="preview" class="img-thumbnail" style="width: 79px;height: 115px;border: 2px solid <?php echo $_SESSION['color'];?>;margin-left: 5px;margin-top: -27px;border-radius: 5px;"   />

         <?php }else { ?>   

             <img src="<?php echo DOMAIN;?>Production/images/studenticon.png" id="preview"  class="img-thumbnail" style="width: 79px;height: 115px;border: 2px solid <?php echo $_SESSION['color'];?>;margin-left: 5px;margin-top: -27px;border-radius: 5px;" />


         <?php } ?>


      </div>

       <div style="font-size: 14px;
    float: right;
    margin-right: 7%;
    margin-top: -6%;"><?php if($signatures[0]['principal_signature']!=NULL){ ?>
                        
            <img src="<?php echo DOMAIN;?>Production/signatures/<?php echo $signatures[0]['principal_signature'];?>" id="preview" class="img-thumbnail" style="width:45px;height:40px;margin: 11px -9px 0px -45px;"   />

         <?php } ?></div>

        <div style="font-size:11px;margin: 118px 0px 0px 291px;">Principal</div>
        <div style="width:100%;float:left;margin-top: 5px;background:<?php echo $_SESSION['color'];?>;color:white;text-align: center;margin-top: 2px;border-radius: 5px;padding: 1px;font-size: 10px;padding: 5px;"><?php echo $brid[0]['Branch_Location']." # ".$brid[0]['branch_contact'];?>


      </div>
        

      </div>
       

    

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

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

 <?php 

 $counter++;
 
   } ?>

</page>
<br><br>
<?php } ?>

</body>
</html>
