<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php   
  
$branch=$_SESSION['branch'];
$term=$_REQUEST['term_id'];
$session=$_REQUEST['session'];
$section=$_REQUEST['section'];
$class=$_REQUEST['class_id'];

 if($_REQUEST['class_id']!=NULL){  
  
      $qrr = "SELECT * FROM  eduportal_exam_marksheet  WHERE branch_id='$branch' and term_id='$term' and session_id='$session' and class_id='$class' and section_id='$section' group by student_id";
//print_r($qrr);
      $WorkAssignListings = $m->query($qrr);

  }


       // getting branch details

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



 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:94%; height:28.5cm;float:left;margin:0 auto;padding:1%;margin-left:1%;}
 
 tr td {
    
    padding:.8%;
    font-size: 13px;
 }

  tr th {
    padding:.8%;
    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);
  
}
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 
     $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("branch_id", $_SESSION['branch']);
          $m->where("student_id", $WorkAssignListVal['student_id']);
          $studentsDetails = $m->get("edu_student_details");

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


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

        // getting status of students marks


          $m->where("branch_id", $_SESSION['branch']);
          $m->where("term_id", $_REQUEST['term_id']);
          $m->where("session_id", $_REQUEST['session']);
          $m->where("student_id", $WorkAssignListVal['student_id']);
          $sms_status = $m->get("eduportal_exam_marksheet");


              

          // printing all the relevant subjects of each class
                    
                            
          $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 order by csb.subject_order asc";

         // echo $qrr; 

              $teacher_sbj = $m->query($qrr);
              $sbs_marks="";
              $sbs_tmarks="";
              $sbs_title="";
              $sbs_msg1;

   
              foreach($teacher_sbj as $teacher_sb) {

                //echo "ali.";

                $m->where("branch_id", $_SESSION['branch']);
                $m->where("term_id", $_REQUEST['term_id']);
                $m->where("class_id", $_REQUEST['class_id']);
                $m->where("session_id", $_REQUEST['session']);
                $m->where("subject_id", $teacher_sb['subject_id']);
                $m->where("student_id", $WorkAssignListVal['student_id']);
                $marks = $m->get("eduportal_exam_marksheet"); 
                
                //echo "umar"."<pre>"; print_r($marks); echo "</pre>";
                $total_marks+=$marks[0]['total_marks'];
                $total_obt+=$marks[0]['obtained_marks'];
                $sbs_marks=$marks[0]['obtained_marks'].",".$sbs_marks;              
                

                  if($marks[0]['obtained_marks']!=NULL && $marks[0]['obtained_marks']!=""){
                  
                  $val=mb_substr($teacher_sb['subject'], 0, 2, "UTF-8")." ".$marks[0]['obtained_marks']."/".$marks[0]['total_marks'];
                  $sbs_msg1=$val.",".$sbs_msg1;              
    
                  }


               
                } // closing subjects marks loop
                
             $avg=($total_obt/$total_marks)*100;
             $avg=intVal($avg+0);
             // getting average of total marks
      		   $query="SELECT * FROM eduportal_exam_school_grades WHERE percantage_start_range <=".round($avg)." and percantage_end_range >=".round($avg)." and branch_id=".$_SESSION['branch'];
     
             $average =  $m->query($query);
               
               $new_array['term_id']=$_REQUEST['term_id'];
               $new_array['session_id']=$_REQUEST['session'];
               $new_array['class_id']=$_REQUEST['class_id'];
               $new_array['section_id']=$_REQUEST['section'];
               $new_array['first_name']=$studentsDetails[0]['first_name'];
               $new_array['candidate_roll_no']=$studentsDetails[0]['candidate_roll_no'];
               $new_array['ref_no']=$studentsDetails[0]['ref_no'];
               $new_array['sub_marks']=$sbs_marks;
               $new_array['total_marks']=$total_marks;
               $new_array['obt_marks']=round($total_obt);
               $new_array['percantage']=number_format($avg,2);
               $new_array['grade']=$average[0]['grade_title'];
               $new_array['branch_id']=$_SESSION['branch'];
               $new_array['session']=session_id();
               $new_array['sms_status']=$sms_status[0]['sms_status'];
               $new_array['student_id']=$WorkAssignListVal['student_id'];
               $new_array['cell_no']=$studentsDetails[0]['cell_no'];
               $new_array['sbs_total']=$sbs_msg1;
               $new_array['last_name']=$studentsDetails[0]['last_name'];
               if(isset($studentsDetails[0]['image'])){
                $new_array['img']=$studentsDetails[0]['image'];
                }else {
                $new_array['img']=""; 
                }

               $new_array['class_id']=$WorkAssignListVal['class_id'];
               $new_array['section_id']=$WorkAssignListVal['section_id'];
               
        
          //echo "<pre>"; print_r($new_array); echo "</pre>";
                       
               $m->insert("eduportal_old_exam_marks",$new_array); 
  

  $total_marks=0; $total_obt=0;  $sbs_msg1="";

  }// closing main loop    
    



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

  //print_r($std_data);

  $postitioncount=1;
  $Failsub=0;
  for($i=0;$i<count($std_data);$i++) { 

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

    ?>


<page size="A4"> 

 <!-- Vouchere Fist -->
<div class="section">
 
 <?php if ($_REQUEST['header']=="Yes") { ?>   

  <div style="width:100%;float:left;">
  
      <div style="width:12%;font-size:13px;text-align:center;float:left;height:80px;">

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

      </div>


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

         <span style="font-size:25px;font-family: Times New Roman;font-weight: bold;">  <?php echo $branchData[0]['Branch_Name'];?> </span>
         <p style="text-align:center;"><?php echo $branchData[0]['Branch_Location'];?></p>
         <p style="text-align:center;"><?php echo $branchData[0]['branch_contact'];?></p>


      </div>


      <div style="width:12%;font-size:10px;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="width:80px;height:80px;"   />

       <?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>

<?php } ?>

<?php if ($_REQUEST['header']=="Custom") { ?>

      <div style="width:100%; height: 9%;">
        <img src="<?php echo DOMAIN;?>Production/signatures/<?php echo $signatures[0]['upload_resultcard_header'];?>" id="preview" style="width:100%;height:108px;"   />
      </div>
      <!--  -->


<?php } ?>

<?php if ($_REQUEST['header']=="No") { ?>

      <div style="width:100%; height: 13%;color:white;">
        .
      </div>
      

<?php } ?>

<br>
   <div style="width:100%; text-align:center;font-size:16px;">  
    
   <strong><u> Student Result Card of (<?php echo $terms[0]['term_title'];?>) </u>  </strong> </div>

   <br>


   <table width="100%" style="border: 2px solid black; border-radius: 10px; padding:2%;" 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]['first_name'];  ?></td>

         <td width="15%" style="text-align:left;"> Father's 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:   </td>
         <td width="35%" style="border-bottom: 1px solid black;text-align:center;"> 
         <?php echo getClassName($m,$_REQUEST['class_id']);?> </td>

         <td width="15%" style="text-align:left;"> Section:   </td>
          <td width="35%" style="border-bottom: 1px solid black;text-align:center;">
        <?php echo getSectionName($m,$_REQUEST['section']);?></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]['candidate_roll_no'];?> </td>


      </tr>
   
  
    
   
   </table>

   <br>



   <table width="100%" style="font-size:18px;" cellspacing="0">  
   
   
         <tr>  
         
            <th width="8%"  class="tdalign" style="border-top-left-radius:10px;">S.NO </th>
            <th width="31%"  class="tdalign"> SUBJECTS </th>
            
            <th width="12%"  class="tdalign"> TOTAL  </th>
           
           
            <th width="12%"  class="tdalign">  OBTAINED  </th>
          

            <th width="12%"  class="tdalign">  PERCENTAGE </th>
            <?php if($_GET['grade']==1){?>
            <th width="10%"  class="tdalign" style="border-top-right-radius:10px; text-align:left;">Grade</th> 
            <?php } ?>
            
         </tr>
<?php 

            // printing all the relevant subjects of each class
            $branch=$_SESSION['branch'];
            $term=$_REQUEST['term_id'];
            $session=$_REQUEST['session'];
            $section=$_REQUEST['section'];
            $class=$_REQUEST['class_id'];

              $qrr1 = "SELECT * FROM  eduportal_exam_marksheet  WHERE branch_id='$branch' and term_id='$term' and session_id='$session' and class_id='$class' and section_id='$section' group by subject_id";

             //print_r($qrr1);
            $teacher_sbj = $m->query($qrr1);

              foreach($teacher_sbj as $teacher_sb) {


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

                $m->where("branch_id", $_SESSION['branch']);
                $m->where("session_id", $_REQUEST['session']);
                $m->where("term_id", $_REQUEST['term_id']);
                $m->where("class_id", $std_data[$i]['class_id']);
                $m->where("section_id", $std_data[$i]['section_id']);
                $m->where("subject_id", $teacher_sb['subject_id']);
                $m->where("student_id", $std_data[$i]['student_id']);
                $marks = $m->get("eduportal_exam_marksheet"); 
              
              $total_marks+=$marks[0]['total_marks']+0;
              $total_obt+=$marks[0]['obtained_marks']+0;
             // $percentage = $total_obt*100/$total_marks;
              $percentage = ($marks[0]['obtained_marks']/$marks[0]['total_marks'])*100;
              

       
        
              $grade = getGrade($percentage,$m); 

               $display;
               if ($grade == "F") {
                  $status = 1;
                  $remarksTeacher = 1;
                  $Failsub+=1;  
                  $display="none";         
                 
               }//

               
               /*if ($marks[0]['obtained_marks']=="A") {
                 $display="none";
               }*/

               // skip row if total marks are not given of any subject

               if ($_GET['display_sub']=="No" && ($marks[0]['total_marks']==NULL || $marks[0]['total_marks']==0)){
                  continue;
               }


           
           ?>

  
         <tr>  
         
            <td   class="tdalign"> <?php echo $SR; $SR++; ?> </td>
            <td   style="border:1px solid black; padding-left:3%;text-align:left;"> <?php echo $subjects[0]['subject']; ?> </td>
            
            <td  class="tdalign"> <?php echo $marks[0]['total_marks']; ?> </td>
           

         
            <td   class="tdalign" style="<?php if($grade=="F"){echo "background-color:#E26867;color:white;";}?>"> <?php echo $marks[0]['obtained_marks']; ?> </td>
          

            <td  class="tdalign">
              <?php if($_GET['percantage']==1){?> 
             <?php if($marks[0]['obtained_marks'] !=NULL ){
             echo number_format(($marks[0]['obtained_marks']/$marks[0]['total_marks'])*100,1)."%";
              } } ?>
            </td>
            <?php if($_GET['grade']==1){?> 
            <td style="border: 1px solid black;text-align: center;"><?php  echo $grade; }?></td> 
                 
            
         </tr>


   <?php     } $SR=1; ?>

      <tr>  
         
            <th  colspan="2" style="text-align:right;font-weight:bold;border:1px solid black;border-bottom-left-radius:10px;">TOTAL </th>

           
            <th   class="tdalign"><?php echo $total_marks; ?> </th>
        

           
            <th  class="tdalign"><?php echo $total_obt;?> </th>
          
            <th  colspan="2" class="tdalign" style="border-bottom-right-radius:10px;">
            <?php if($_GET['percantage']==1){?>
            <?php echo number_format($total_obt/$total_marks*100,1)."%"; } ?> 



      </th>
         </tr>
  </table>
    <br>
       
       <?php $total_obt=""; $total_marks=""; ?>
     
     <table width="100%" style="font-size:18px;" cellspacing="0">  
         <tr>  
         
           <td colspan="" style="text-align:center;border:1px solid black;border-top-left-radius:10px;">
          
            <b>Position: </b> &nbsp;&nbsp;&nbsp;  <!-- <b>Out Of</b> --> 
            <?php  
              $postition=ordinal($postitioncount);


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

              }else {
                
                $postitioncount+=1;
              }    


                   echo $postition; 
 ?><!-- <span style="margin-left:40%;"> <?php echo count($std_data); ?></span> --> </td>
      
      <td style="text-align:center;border:1px solid black;">
      <?php if($_GET['over_all']==1){?>
        <b>Grade:</b> 
      <?php 

            $avg=$std_data[$i]['obt_marks']/$std_data[$i]['total_marks']*100;

       
           $getGradeRemarks=explode(",",getGradeRemarks($avg,$m));
//print_r($getGradeRemarks);
            $grade = $getGradeRemarks[0]; 

            /*if ($status == 1) {
              
           }else {*/

                  echo $grade;
           /*}*/

           $status="";

           }  //print_r($getGradeRemarks);

               

            ?>
      </td>
   
      <td style="text-align:center;border:1px solid black; display: <?php echo $display;?>">
      <?php if($_GET['remarks']==1){?>
        <b>Remarks:</b>                
        
        <?php if ($remarksTeacher == 1){ echo "Fail"; } else { echo $getGradeRemarks[1]; } $remarksTeacher=""; $Failsub=0; $display="";  }?></td>
     
      <td style="text-align:center;border:1px solid black;border-top-right-radius:10px;">
        <?php if($_GET['issuing_date']==1){?>
        <b>Issuing Date:</b> <?php echo date("d-M-Y"); }?> 
         </td>
            
         </tr>

    <?php if($_GET['teacher_remarks']==1) { ?>
    <tr>  
        
      <td class="tdalign"style="border-bottom-left-radius:10px;"><b>Teacher Remarks</b> </td>
      <td colspan="5" style="text-align:center;border:1px solid black;border-bottom-right-radius:10px;font-size:12px;"><?php echo $getGradeRemarks[2];?> </td>
    </tr>
    <?php } ?> 
   </table>

    <?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           
          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 


          
    $m->where("term_id", $_REQUEST['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   
                $NameOfTerm=$_REQUEST['term_id'];        
                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'";
                 // print_r($query7);
                  $stdMarks = $m->query($query7);

                  $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>

                   
    

       
            
                        


   </table>

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

   <table  class="table table-striped table-bordered"style="width:100%; margin-top: 1%; float: left;">
                     

      <thead>
        <tr>
          <th colspan="5" style="border:1px solid black;border-bottom: none;">Summarize Attendance History (<?php echo $sessionName[0]['session_year'];?>)</th>
        </tr>

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

?>
        <tr>
          
          <td width="20%" style="border:1px solid black;border-right: none;">Presents (<?php echo $Presents[0]['Present'];?>)</td>
          <td width="20%" style="border:1px solid black;border-right: none;">Absents (<?php echo $Absents[0]['Absent'];?>)</td>
          <td width="20%" style="border:1px solid black;border-right: none;">Leave (<?php echo $Leave[0]['Leavestd'];?>)</td>
          <td width="20%" style="border:1px solid black;border-right: none;">Short Leave (<?php echo $ShortLeave[0]['ShortLeave'];?>)</td>
          <td width="20%" style="border:1px solid black;">Late (<?php echo $Late[0]['Late'];?>)</td>
          
        </tr>
      </thead>
      <tbody>

                        

                        <!-- <tr>
                          <td style="text-align:center;"><?php echo $Presents[0]['Present'];?></td>
                          <td style="text-align:center;"><?php echo $Absents[0]['Absent'];?></td>
                          <td style="text-align:center;"><?php echo $Leave[0]['Leavestd'];?></td>
                          <td style="text-align:center;"><?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>
      <table width="100%" style="font-size:18px;"  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>  
         <?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
}

 $m->delete("eduportal_old_exam_marks"); 

?>

</body>
</html>
