<?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.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: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" >


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

    <div style="background-color: <?php echo $_SESSION['color'];?>;width: 100%;height: 22px;border: 2px solid <?php echo $_SESSION['color'];?>;border-top-right-radius: 15px;border-top-left-radius: 15px;margin-top: -5px;"></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:44px;height:44px;margin-top: 3px;"   />

       <?php }else { ?>   

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


       <?php } ?>

     </div>

    <div style="width: 100%;font-size: 12px; padding: 3px;"> 

      <div style="text-align: center; color: <?php echo $_SESSION['color'];?>"><?php echo $branch_details[0]['Branch_Name']; ?><br>
        <!-- <span style="font-size:9px;"><?php echo $branch_details[0]['Branch_Location']; ?></span> -->
           
        </div>

    </div>
    <div>
    <div style="width: 15%;float: left;color: white;">.</div>
    <div style="width: 70%;float: left;height: 10px;text-align: center;color: white;background-color:<?php echo $_SESSION['color'];?>;border-radius: 20px;margin-top: 3px;padding: 5px;font-size: 11px;">
            STUDENT CARD
        </div>
    <div style="width: 15%;float: left;"></div>
    </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: 59px;margin-top: 7px;border-radius: 10%;border: 2px solid <?php echo $_SESSION['color'];?>;"   />

         <?php }else { ?>   

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


         <?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: black;">

          
        Name <span style="float:right;">:</span><br>
        Father <span style="float:right;">:</span><br>
        <?php if ($_REQUEST['DOB']=='YES') { ?>
          DOB <span style="float:right;">:</span><br>
        <?php } ?>
        
        Class <span style="float:right;">:</span><br>
        <?php if ($_REQUEST['RollAdm']=='RollNo') {?>
          Roll.No <span style="float:right;">:</span><br>
        <?php } else { ?>
          Adm.No <span style="float:right;">:</span><br>
        <?php } ?> 
        
        Contact <span style="float:right;">:</span><br> 
        Valid till <span style="float:right;">:</span>
       

    </div>

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


   
    
      &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>
      <?php if ($_REQUEST['DOB']=='YES') { ?>
        
      
      <?php if ($WorkAssignValue[$counter]['dob']!='NULL' || $WorkAssignValue[$counter]['dob']!='') {?>
        &nbsp;&nbsp;<?php echo date("d-M-Y",strtotime($WorkAssignValue[$counter]['dob']));?> <br>
      <?php } else {?>

        &nbsp;&nbsp;-- <br>
        
      <?php } }?>
      
      &nbsp;&nbsp;<span style="font-size:9px;"><?php echo $className[0]['Class_Name']."/".$sectionName[0]['section_name'];?></span> <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> 

       &nbsp;&nbsp;<?php echo date("d-M-Y",strtotime($_REQUEST['valid']));?> <br>
      

    </div>

   
 </div>  <!-- row -->


<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:50px;height:50px;margin: -38px -9px 0px -45px;"   />

         <?php } ?></div>


</div>

<div style="background-color: <?php echo $_SESSION['color'];?>;width: 96%;height: 22px;border: 2px solid <?php echo $_SESSION['color'];?>;border-bottom-right-radius: 15px;border-bottom-left-radius: 15px;margin-top: -27px;margin-left: 4px;"><p style="font-size: 11px;
    float: right;
    margin-right: 7%;
    margin-top: 2%;color: white;">Principal</p>

    
  </div>
<img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $brid[0]['logo'];?>" style=" width: 7em; height: 8em; position: relative; left: 3em; top: -10em;
    opacity: 0.1;"/>
</div>
 
<!-- ending section  -->



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



 <?php 

 $counter++;
 
 


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

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

</body>
</html>
