<?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 Students 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;padding-right:2.5%;margin-left:2%;}

.box{
    width: 2.2in;
    float: left;
    height: 3.8in;
    padding: 0.5%;
    margin-top: 8px;
    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: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++) {



   ?>


<div class="box" style="background-image: url(images/idcard_bg.jpg); width: 27%; background-size: cover;">


<div style="height: 3.6in;margin-left: 0%;padding-left: 1%;">

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


 <div style="width: 22%;
    float: left;
    font-size: 10px;
    line-height: 1.6;
    margin-top: 9px;
    margin-left: 15px;
    text-align: left;
    color: #fff;
    position: relative;
    top: 14.7em;
    left: 4em;">

        <?php if ($_REQUEST['RollAdm']=='RollNo') {?>
          Roll.No <span style="float:right;">:</span><br>
        <?php } else { ?>
          Adm.No <span style="float:right;">:</span><br>
        <?php } ?> 
        
    </div>


 <div style="width: 22%;float:left;font-size: 10px;line-height:1.6;margin-top: 15.6em; margin-left: 60px;text-align: left;color: #fff;">

<?php if ($_REQUEST['RollAdm']=='RollNo') {?>

      &nbsp;&nbsp;<?php echo $WorkAssignValue[$counter]['candidate_roll_no'];?> <br>

      <?php } else { ?>

      &nbsp;&nbsp;<?php echo $WorkAssignValue[$counter]['ref_no'];?> <br>

      <?php } ?>

    </div>



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

          <?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: 64px;height: 57px;margin-top: 7px;border-radius: 10%;border: 2px solid <?php echo $_SESSION['color'];?>;margin-left: 54px;"   />

         <?php }else { ?>   

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


         <?php } ?>


         <?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: 75px;height: 50px;margin-left:-26px;"   />

         <?php } ?>
    </div>

    

  
        

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

 <div style="width: 22%;float:left;font-size: 10px;line-height:1.6;margin-top:5px;margin-left: 10px;text-align: left;color: #35363A;">

          
        Name <span style="float:right;">:</span><br>
        Father <span style="float:right;">:</span><br>
      
        Class <span style="float:right;">:</span><br>
        
        Contact <span style="float:right;">:</span><br> 
       

    </div>

    <div style="width: 70%;float:left;padding-left: 0%;text-align:left;font-size: 10px;line-height:1.6;margin-top:5px; color:#35363A;">


   
    
      &nbsp;&nbsp;<span style="font-size:9px;"><?php echo $WorkAssignValue[$counter]['first_name'];?></span> <br>
      &nbsp;&nbsp;<span style="font-size:9px;"><?php echo $WorkAssignValue[$counter]['last_name'];?></span> <br>
           
      &nbsp;&nbsp;<?php echo $className[0]['Class_Name']."/".$sectionName[0]['section_name'];?> <br>
<!--       </?php if ($_REQUEST['RollAdm']=='RollNo') {?>

      &nbsp;&nbsp;<?php echo $WorkAssignValue[$counter]['candidate_roll_no'];?> <br>

      </?php } else { ?>

      &nbsp;&nbsp;<?php echo $WorkAssignValue[$counter]['ref_no'];?> <br>

      </?php } ?>
 -->
       &nbsp;&nbsp;<?php echo $WorkAssignValue[$counter]['cell_no'];?> <br> 

     
      

    </div>

   
    <div>
      <img src="images/barcode1.PNG" alt="" style="width: 94%;margin-top: 22px;margin-left: 6px;height: 26px;">
    </div>
   
 </div>  <!-- row -->



</div>




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



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



 <?php 

 $counter++;
 
 


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

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

</body>
</html>
