<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php  count($NameOfTerms)-1?>
<?php   
$TermNumberCol;

$NameOfTerms=explode(",",$_REQUEST['terms']);

$TermNumber=count($NameOfTerms);

if ($TermNumber=='1') {
  
  $TermNumberCol=$TermNumber;
} else {

  $TermNumberCol=$TermNumber-1;
}

   
   if($_REQUEST['class_id']!=NULL){  
  
      if($_REQUEST['class_id']!=NULL){
        $m->where("class_id", $_REQUEST['class_id']);  
      }      
      if($_REQUEST['session']!=NULL){
        $m->where("session_id", $_REQUEST['session']);        
      }
      if($_REQUEST['section']!="All"){
        $m->where("section_id", $_REQUEST['section']);        
      }
     
       $m->where("status", '0');
       $m->where("branch_id", $_SESSION['branch']);

       $WorkAssignListings = $m->get("edu_student_details");
 }


   // getting branch details

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

 

 function ordinal($number) {
    $ends = array('th','st','nd','rd','th','th','th','th','th','th');
    if ((($number % 100) >= 11) && (($number%100) <= 13))
        return $number. 'th';
    else
        return $number. $ends[$number % 10];
}


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

$m->where("session_id", $_SESSION['current_session']);
$sessionName = $m->get("edu_session_config");


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

?>



 <!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> Student Report Card</title>
<!-- Favicons-->
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />

<script type="text/javascript">
  //window.print();
</script>
<style> 

.section{width:100%; height:28.5cm;float:left; /*background-color:lightgray;border: 1px solid black;*/margin:0 auto;padding:1%;margin-left:1%;}
 
 tr td {
    
    padding:.8%;
 }

  tr th {
    padding:0.5%;
    font-size:14px;
    background:lightgray; 
 }
.tdalign{text-align:center;border:1px solid black;}
  

body {
  background: rgb(204,204,204);
  font-weight:; 
}
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-right: 7%;
  padding-left: 7%;
 /* padding:3%;*/
}
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;  
}
page[size="A4"] {  
  width: 21.6cm;
  height: 27.9cm; 
}
@media print {
  body, page {
    margin: 0;
    box-shadow: none;
    border:none;
  
  }
}


.centertable {
  margin-left: auto;
  margin-right: auto;
}
  </style>


</head>
<body >
  
     <?php 
     $count=1;
     $SR=1;
     $new_array = array();

     // getting all the marks of students and other data

      foreach($WorkAssignListings as $WorkAssignListVal)
      { 
        $total_marks;
        $total_obt;

        $m->where("class_id", $_REQUEST['class_id']);
        $class=$m->get("edu_class_config");

        $m->where("session_id", $_REQUEST['session']);
        $session=$m->get("edu_session_config");

                                   
                            
           // printing all the relevant subjects of each class
         if($_REQUEST['class_id']!=NULL){  
     
             $qrr="SELECT csb.*,sb.* FROM eduportal_class_subjects as csb,eduportal_subject_config as sb WHERE  csb.class_id=".$_REQUEST['class_id']." and csb.section_id=".$_REQUEST['section']." and csb.branch_id=".$_SESSION['branch']." and csb.subject_id=sb.subject_id";

            $teacher_sbj = $m->query($qrr);

          }

          
          foreach($teacher_sbj as $teacher_sb) {

                      
                $m->where("subject_id", $teacher_sb['subject_id']);
                $subjects = $m->get("eduportal_subject_config");

     

                

   ?>
         <tr>  
         
      

            <?php
          $GrandTotalMarks0;
          $GrandObtainMarks0;
          foreach($NameOfTerms as $NameOfTerm) { 

                $b=$_SESSION['branch'];
                $session1=$_REQUEST['session'];
                $clsID=$teacher_sb['class_id'];
                $secID=$teacher_sb['section_id'];
                $subID=$teacher_sb['subject_id'];

                $subMarks="select * from eduportal_exam_marksheet where branch_id='$b' and session_id='$session1' AND term_id='$NameOfTerm' AND class_id='$clsID' AND section_id='$secID' AND subject_id='$subID' AND student_id=".$WorkAssignListVal['student_id'];
               
                $SubjectMarks =  $m->query($subMarks);
                         
                $GrandTotalMarks0+=$SubjectMarks[0]['total_marks'];
                $GrandObtainMarks0+=$SubjectMarks[0]['obtained_marks'];

                $Grandavg0=0+intVal($GrandObtainMarks0)/intVal($GrandTotalMarks0)*100;

                
                $Grandaverage0=explode(",",getGradeRemarks($Grandavg0,$m));

}
               $new_array['name_cell']=$WorkAssignListVal['first_name'];
               $new_array['roll']=$WorkAssignListVal['candidate_roll_no'];
               $new_array['ref_no']=$WorkAssignListVal['ref_no'];           
               $new_array['total_marks']=$GrandTotalMarks0;
               $new_array['obt_marks']=$GrandObtainMarks0;           
               $new_array['branch_id']=$_SESSION['branch'];             
               $new_array['student_id']=$WorkAssignListVal['student_id'];
               $new_array['cell_no']=$WorkAssignListVal['cell_no'];
               $new_array['address']=$WorkAssignListVal['address'];  
               $new_array['total_aggregate']=$GrandObtainMarks0/$GrandTotalMarks0*100;        
               $new_array['last_name']=$WorkAssignListVal['last_name'];
               if(isset($WorkAssignListVal['image'])){
                $new_array['img']=$WorkAssignListVal['image'];
                }else {
                $new_array['img']=""; 
                }               
               $new_array['class_id']=$WorkAssignListVal['class_id'];
               $new_array['section_id']=$WorkAssignListVal['section_id'];
                      
        
              // print_r($new_array);        
              
            
         }     

          $m->insert("eduportal_multi_test_positions_temp",$new_array);
        ?>
              
            
         </tr>


   <?php $GrandTotalMarks0="";
   $GrandObtainMarks0="";    

}


  $query="select * from eduportal_multi_test_positions_temp where branch_id=".$_SESSION['branch']." order by obt_marks desc";
  $std_data=$m->query($query); 
   //echo $query;

  //print_r($std_data);

  $pos=1;

  for($i=0;$i<count($std_data);$i++) { ?>


<page size="A4"> 

 <!-- Vouchere Fist -->
<div class="section">
 
  <div style="width:100%;float:left;margin-top: 30px;padding-top: 25px;">
  
       <?php if ($_REQUEST['header']=="Yes") { ?>      
    
      <div style="width:20%;font-size:13px;text-align:center;float:left;height:80px;">

         <img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $branch[0]['logo']; ?>" style="height:110px;width:110px;" />

      </div>


      
      <div style="width:60%; float:left;text-align:center;">


         <span style="font-size:24px; font-family:times new roman;">

             <b><?php echo $branch[0]['Branch_Name'];?>  </b>

       </span>


      <span style="font-size:18px; font-family:times new roman;">

             <br>(<?php echo $branch[0]['Branch_Location']." Cell: ".$branch[0]['Owner_no'];?>)

       </span>


      </div>

    <?php } ?>


      <div style="width:20%;font-size:15px;text-align:center;float:right;height:80px;">

          <?php if($std_data[$i]['img']!=NULL){ ?>
      
      <img src="<?php echo DOMAIN.AgentDirectory;?>students_pics/<?php echo $std_data[$i]['img'];?>" id="preview" class="img-thumbnail" style="border-radius: 5%; border:4px solid black; width:110px;height:120px;"   />

       <?php }else { ?>   

           <img src="https://image.flaticon.com/icons/png/512/67/67902.png" id="preview" height="100px" class="img-thumbnail" width="100px"  />


       <?php } ?> 
      </div>

</div>



   <div style="width:100%; text-align:center;font-size:20px;margin-top: 8px;">  
    
   <strong><u> Student Performance Report </u>  </strong> </div>

   <br>


   <table width="100%" style=" padding:2%; font-size: 14px; margin-top: 5px; " cellspacing="0"  >  
   
   
      <tr>  
         <td width="15%" style="text-align:left;"> Student Name:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['name_cell'];  ?></td>

         <td width="15%" style="text-align:left;"> Father Name:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['last_name'];?></td>


      </tr>
   
      <tr>  
         <td width="15%" style="text-align:left;"> Class/Sec:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;"> 
         <?php $m->where("section_id", $std_data[$i]['section_id']);
        $sect=$m->get("edu_adm_section_detail"); echo $class[0]['Class_Name']." / ".$sect[0]['section_name'];?> </td>

         <td width="15%" style="text-align:left;"> Session:   </td>
          <td width="35%" style="border-bottom: 1px solid black;text-align:center;"><?php 
           echo $session[0]['session_year'] ;?> </td>



      </tr>
   
        <tr>  
         <td width="15%" style="text-align:left;"> Adm No:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['ref_no'];?></td> 

         <td width="15%">  Roll No:  </td>
         <td width="45%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['roll'];?> </td>


      </tr>

      <tr>  
         <td width="15%" style="text-align:left;"> Cell No:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['cell_no'];?></td> 

         <td width="15%">  Address:  </td>
         <td width="45%" style="border-bottom: 1px solid black;text-align:center;">  <?php echo $std_data[$i]['address'];?> </td>


      </tr>
   
  
    
   
   </table>

   

   <table width="100%" style="font-size:14px; width:100%;" class="centertable" cellspacing="0">  
   
   
         <tr>  
         
            <th width="15%"  class="tdalign" style="border-top-left-radius:15px;">Subjects </th>
             <?php 
         

              foreach ($NameOfTerms as $NameOfTerm) {

                      
                $m->where("term_id", $NameOfTerm);
                $m->where("branch_id", $_SESSION['branch']);
                $m->where("session_id", $_REQUEST['session']);
                $TermTitles = $m->get("eduportal_exam_terms");
                             
                ?>

            <th width="10%" class="center tdalign"> <?php echo $TermTitles[0]['term_title'];?> </th> 
                       
         <?php  }  ?> 

            <th width="8%"  class="tdalign"> Total </th>
            <th width="8%"  class="tdalign"> Obtain  </th>
            <th width="8%"  class="tdalign">   %  </th>
            <th width="8%" style="border-top-right-radius:15px;"  class="tdalign">  Grade </th>
                        
         </tr>
<?php 

                   
                 $counter=1;                 
                 $status;

        $TotalMarks;
        $ObtainMarks;

      // printing all the relevant subjects of each class
         if($_REQUEST['class_id']!=NULL){  
     
             $qrr="SELECT csb.*,sb.* FROM eduportal_class_subjects as csb,eduportal_subject_config as sb WHERE  csb.class_id=".$_REQUEST['class_id']." and csb.section_id=".$_REQUEST['section']." and csb.branch_id=".$_SESSION['branch']." and csb.subject_id=sb.subject_id";

            $teacher_sbj = $m->query($qrr);

          }

              foreach($teacher_sbj as $teacher_sb) {

                      
                $m->where("subject_id", $teacher_sb['subject_id']);
                $subjects = $m->get("eduportal_subject_config");

     



   ?>
         <tr>  
         
         <td   class="tdalign"> <?php echo $subjects[0]['subject']; ?> </td>

            <?php

          foreach($NameOfTerms as $NameOfTerm) { 

                $b=$_SESSION['branch'];
                $session1=$_REQUEST['session'];
                $clsID=$teacher_sb['class_id'];
                $secID=$teacher_sb['section_id'];
                $subID=$teacher_sb['subject_id'];

                $subMarks="select * from eduportal_exam_marksheet where branch_id='$b' and session_id='$session1' AND term_id='$NameOfTerm' AND class_id='$clsID' AND section_id='$secID' AND subject_id='$subID' AND student_id=".$std_data[$i]['student_id'];
                
                $SubjectMarks =  $m->query($subMarks);

                                 
               //echo print_r(array_reverse($sbs))."="; 
                //$SubjectMarks=array_reverse($SubjectMarks);
      
                $TotalMarks1+=$SubjectMarks[0]['total_marks'];
                $ObtainMarks1+=$SubjectMarks[0]['obtained_marks'];
                $GrandTotalMarks+=$SubjectMarks[0]['total_marks'];
                $GrandObtainMarks+=$SubjectMarks[0]['obtained_marks'];

                $avg=0+intVal($ObtainMarks1)/intVal($TotalMarks1)*100;
                $Grandavg=0+intVal($GrandObtainMarks)/intVal($GrandTotalMarks)*100;

                $getGradeRemarks=explode(",",getGradeRemarks($avg,$m));
                
                $Grandaverage=explode(",",getGradeRemarks($Grandavg,$m));
            
              
        ?>

            <td width="8%" class="tdalign" style="text-align:center;<?php if($SubjectMarks[0]['obtained_marks']=="A"){echo "background-color:#E26867;color:white;";}?>"> <?php  if($SubjectMarks[0]['obtained_marks']!=''){echo $SubjectMarks[0]['obtained_marks']."/".$SubjectMarks[0]['total_marks']; } else { echo "N/A";} ?> </td> 
                               <?php   }  ?>
            <td  class="tdalign"> <?php  echo $TotalMarks1;?> </td>
            <td   class="tdalign"> <?php  echo $ObtainMarks1;?> </td>
            <td  class="tdalign">
             
             <?php echo number_format($ObtainMarks1/$TotalMarks1*100,1)."%";  ?>
            </td>
            
            <td style="border: 1px solid black;text-align: center;">
              
              <?php  if($getGradeRemarks[0]!=NULL){echo $getGradeRemarks[0];;}else {echo "--";};?></td> 
                 
            
         </tr>


   <?php $TotalMarks1="";
   $ObtainMarks1="";    } ?>

    <tr style="background-color: lightgray;">  
        
      <td class="tdalign"style=""><b>Total</b> </td>
      <?php

      foreach($NameOfTerms as $NameOfTerm) {

        $qr="SELECT SUM(obtained_marks) as obtain,SUM(total_marks) as total FROM eduportal_exam_marksheet where branch_id='$b' and session_id='$session1' AND term_id='$NameOfTerm' AND class_id='$clsID' AND section_id='$secID' AND student_id=".$std_data[$i]['student_id'];
        $TermTMarks = $m->query($qr);

       ?>
      <td class="tdalign"style=""><?php echo $TermTMarks[0]['obtain']." / ".$TermTMarks[0]['total'];?><br> <?php echo number_format($TermTMarks[0]['obtain']*100 / $TermTMarks[0]['total'],2);?>% </td>
      <?php } ?>
      <td class="tdalign"style=""> </td>
      <td class="tdalign"style=""> </td>
      <td class="tdalign"style=""> </td>
      <td class="tdalign"style=""> </td>
     
      
    </tr>

        
    
  </table>
   
    <table width="100%" style="font-size:14px;width: 100%;" class="centertable" cellspacing="0" >  
    <tr>  
         
        <td colspan="" style="text-align:center;border:1px solid black;">
        
        <b>Position </b>
        (<?php 

                   $postition=ordinal($count);


                   if($std_data[$i]['total_aggregate']==$std_data[$i-1]['total_aggregate']){
                      $postition=ordinal($count-1);

                    }else {
                      
                      $count+=1;
                    }    


                         echo $postition; 

                   ?>)  
        </td> 

         <td style="text-align:center;border:1px solid black;">
   
          <b>Grand Total: (<?php echo $GrandTotalMarks;?>) </b> </td>

          <td style="text-align:center;border:1px solid black;">
       
          <b>Grand Obtain: (<?php echo $GrandObtainMarks;?>) </b> </td>

          <td style="text-align:center;border:1px solid black;">
   
          <b>Percentage</b>
          (<?php echo number_format($GrandObtainMarks/$GrandTotalMarks*100,1)."%";  ?>)
          </td>
          
          <td style="text-align:center;border:1px solid black;">
                 <b>Grade</b> 
          (<?php echo $Grandaverage[0];?>)
          </td>
            
        
            
            
         </tr>

 
    <tr>  
         <td class="tdalign"style="border-bottom-left-radius:12px;"><b>Teacher Remarks</b> </td>
      <td colspan="5" style="text-align:center;border:1px solid black;border-bottom-right-radius:15px;"><?php echo $Grandaverage[2];?> </td>
    </tr>
  
   </table>
         <br>
    <?php if ($_REQUEST['acadmicPerformance']=="YES") { ?>

    <div   style="font-size:16px;text-align: center; width: 100%;font-weight: bold;"> Academic Performance </div>


 <table width="100%" style="font-size:13px; width:100%;" class="centertable" cellspacing="0">  
   
 
   <tr>  

        <th width="15%"  class="tdalign" style="font-size:14px;" >Terms/Tests </th>

        <?php   
          $branID=$_SESSION['branch'];        
          foreach ($acadmic_heads as $acadmic_head) { ?>
          <th width="8%" class="tdalign" style="text-align:center;font-size:13px;"> <?php echo $acadmic_head['heads_title'];?></th>
        <?php } ?>

     </tr>
  
 <?php 


  foreach ($NameOfTerms as $NameOfTerm) {

    $sql9 = "SELECT * FROM  eduportal_test_acadmic_performance_marks WHERE branch_id='$branID' and term_id='$NameOfTerm' ";
    $headhead = $m->query($sql9);

    if ($headhead[0]['student_remarks']=="") {
      continue;
    }
          
    $m->where("term_id", $headhead[0]['term_id']);
    $m->where("branch_id", $_SESSION['branch']);
    $m->where("session_id", $_REQUEST['session']);
    $TermTitles = $m->get("eduportal_exam_terms");
                 
    ?>
    
     <tr>  

        <th width="15%"  class="tdalign" style="font-size:13px;" > <?php echo $TermTitles[0]['term_title'];?> </th>

        <?php           
                foreach ($acadmic_heads as $acadmic_head1) {

                  $branID=$_SESSION['branch'];
                  $headID=$acadmic_head1['heads_id'];
                  $std_id=$std_data[$i]['student_id'];

                  $query7=" select * from eduportal_test_acadmic_performance_marks where branch_id='$branID' and heads_id='$headID' and term_id='$NameOfTerm' and student_id='$std_id'";
                  $stdMarks = $m->query($query7);

                  if ($stdMarks[0]['student_remarks']=="") {
                    continue;
                  }

                  $m->where("marks", $stdMarks[0]['student_remarks']);
                  $m->where("branch_id", $_SESSION['branch']);                  
                  $Remarks = $m->get("eduportal_performance_school_grades");
                
//print_r($query7);
               ?>

                <td class="tdalign"> <?php echo $Remarks[0]['remarks'] ?> </td>

              <?php } ?>

     </tr>

                   
     <?php  }  ?> 

       
            
                        


   </table>

 <?php } ?>

 <br>
  <?php if ($_GET['attendance']=="YES") { ?>


    <?php  $count5=1;

$branchID=$_SESSION['branch'];
$sessionIDs=$_SESSION['current_session'];
$STDid=$std_data[$i]['student_id']; 
$date=date('Y-m');

$qrp="SELECT count(*) as Present FROM eduportal_attendance_detail WHERE student_id='$STDid' and attendance='P' and branch_Id='$branchID' and session_id='$sessionIDs'";
$Presents=$m->query($qrp);

$qra="SELECT count(*) as Absent FROM eduportal_attendance_detail WHERE student_id='$STDid' and attendance='A' and branch_Id='$branchID' and session_id='$sessionIDs'";
$Absents=$m->query($qra);

$qrl="SELECT count(*) as Leavestd FROM eduportal_attendance_detail WHERE student_id='$STDid' and attendance='L' and branch_Id='$branchID' and session_id='$sessionIDs'";
//print_r($qrl);
$Leave=$m->query($qrl);

$qrsl="SELECT count(*) as ShortLeave FROM eduportal_attendance_detail WHERE student_id='$STDid' and attendance='SL' and branch_Id='$branchID' and session_id='$sessionIDs'";
$ShortLeave=$m->query($qrsl);

$qrla="SELECT count(*) as Late FROM eduportal_attendance_detail WHERE student_id='$STDid' and attendance='LA' and branch_Id='$branchID' and session_id='$sessionIDs'";
$Late=$m->query($qrla);

?>
  

   <table  class="" style="width:100%; margin-top: 1%; float: left;border:1px solid black;">
                     

      <thead>
        <tr>
          <th colspan="5">Summarize Attendance History (<?php echo $sessionName[0]['session_year'];?>)</th>
        </tr>
        <tr style="border: 1px solid black;">
          
          <th width="20%" style="border: 1px solid black;border-right: none;border-bottom: none;border-left: none;">Presents (<?php echo $Presents[0]['Present'];?>)</th>
          <th width="20%" style="border: 1px solid black;border-right: none;border-bottom: none;">Absents (<?php echo $Absents[0]['Absent'];?>)</th>
          <th width="20%" style="border: 1px solid black;border-right: none;border-bottom: none;">Leave (<?php echo $Leave[0]['Leavestd'];?>)</th>
          <th width="20%" style="border: 1px solid black;border-right: none;border-bottom: none;">Short Leave (<?php echo $ShortLeave[0]['ShortLeave'];?>)</th>
          <th width="20%" style="border: 1px solid black;border-right: none;border-bottom: none;">Late (<?php echo $Late[0]['Late'];?>)</th>
          
        </tr>
      </thead>
      <tbody>

                        

                        <!-- <tr>
                          <td style="text-align:center;border-right: 1px solid black;"><?php echo $Presents[0]['Present'];?></td>
                          <td style="text-align:center;border-right: 1px solid black;"><?php echo $Absents[0]['Absent'];?></td>
                          <td style="text-align:center;border-right: 1px solid black;"><?php echo $Leave[0]['Leavestd'];?></td>
                          <td style="text-align:center;border-right: 1px solid black;"><?php echo $ShortLeave[0]['ShortLeave'];?></td>
                          <td style="border-right: 1px solid lightgray;text-align:center;"><?php echo $Late[0]['Late'];?></td>
                        </tr> -->

                      

                      </tbody>
                    </table>
  <?php } ?>
   
   <br><br><br>
      <div style="color:white;">
        .<br>.<br>..
      </div>
         <table width="100%" style="font-size:16px;"  cellspacing="0">  
   
   
         <tr>  
         <td  style="text-align:center;border-bottom:1px solid black;">
          <?php if($signatures[0]['teacher_exam_signature']!=NULL){ ?>
                        
            <img src="<?php echo DOMAIN;?>Production/signatures/<?php echo $signatures[0]['teacher_exam_signature'];?>" id="preview" class="img-thumbnail" style="width:130px;height:110px;"   />

         <?php } ?>
          </td>

         <td   >   </td>

         <td  style="text-align:center;border-bottom:1px solid black;">
          
          <?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:130px;height:110px;"   />

         <?php } ?>
         
         </td>
         
         </tr>

         <tr style="margin-top: 30px;"> 

         <?php if ($signatures[0]['signature_type']=='Teacher') { ?>

           <td width="30%"  style="text-align:center;font-weight:bold;"> Teacher's Signature </td> 
         <?php } else { ?>

          <td width="30%"  style="text-align:center;font-weight:bold;"> Exam Controller Signature </td>

         <?php } ?> 
         
         <td width="30%"  style="text-align:center;">  </td> 
         <td width="30%"  style="text-align:center;font-weight:bold;">  Principal's Signature </td> 

         
         </tr>

         <tr>  
            
            <td width="30%" colspan="3"  style="text-align:center;"> 

               <span style="font-size:12px;"><!--  Software Developed By: Aqib Majeed (Software Engineer) 03016138728  --> </span>
            
            </td> 
         
         </tr>


   </table>
  
</div>
  
</page>

<?php
$GrandObtainMarks="";
$GrandTotalMarks="";
}

 $m->delete("eduportal_multi_test_positions_temp"); 

?>

</body>
</html>