<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');?>
<?php   
     
     $branch=$_SESSION['branch'];
     $sql = "SELECT student_id,ref_no,first_name,last_name,cell_no,branch_id,class_id,candidate_roll_no,section_id,session_id,family_code,status FROM  edu_student_details  WHERE branch_id='$branch' and status='0'";

      if($_REQUEST['class_id']!=NULL){
      $sql .= " AND class_id ='" . $_REQUEST['class_id']. "' ";
      }

      if($_REQUEST['section']!=NULL){
      $sql .= " AND section_id ='" . $_REQUEST['section']. "' ";
     }

     if($_REQUEST['session']!=NULL){
      $sql .= " AND session_id ='" . $_REQUEST['session']. "' ";
     }

      if($_REQUEST['orderBy']=='alphabetic'){
      $sql .= "order by first_name asc";
    }

    if($_REQUEST['orderBy']=='RollNoWise'){
        $sql .= "ORDER BY CONVERT(SUBSTRING(candidate_roll_no,3),UNSIGNED) DESC";
      }

    if($_REQUEST['orderBy']=='AdmNoWise'){
        $sql .= "order by CAST(ref_no as UNSIGNED) asc";
      }

      //print_r($sql);
   $WorkAssignListings = $m->query($sql);



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

        $m->where("section_id", $_GET['section']);
        $section=$m->get("edu_adm_section_detail");
       // print_r($section);


       // getting branch details

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



     ?>

<!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">
<title>Print Award List</title>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<script type="text/javascript">
  //window.print();
</script>


<style> 

  .no_style{border:none;background-color:!important transparent;font-size:13px;}
  .alignment{padding-left:1%;text-align:left;}

  tr th {border-top:1px solid black;border-left:1px solid black;padding:0.5%;text-align:center;background-color:lightgray;font-size:14px;}
  tr td {border-bottom:1px solid black;border-left:1px solid black;padding:1.2%;text-align:center;}
  .section{width:28%; height:600px;float:left;border: 1px solid black;front-size:10px;padding:1%;margin-left:4%;}
  .name{font-size:14px;text-align:left;}
  .lname{font-size:13px;text-align:left;}

</style>

<style>

    body {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      background-color: #FAFAFA;
      font: 12pt "Tahoma";
      background: white;
  }
    * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
    }
    .page {
        width: 297mm;
        min-height:auto;        
        padding: 20mm;
        padding-top: 10mm;
        margin: 10mm auto;
        /*border: 1px #D3D3D3 solid;
        border-radius: 5px;
        background: white;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);*/
    }
    .subpage {
        width: 257mm;
        height:auto;
        
    }
    
    @page {
        
        margin: 0;
    }
    @media print {
        html, body {
            width:297mm;
            height:auto;        
        }
        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: blue;
        }
    }


  </style>

</head>
<body >

<div class="book">
  <div class="page">
      <div class="subpage">



        <p style="font-size: 18px;font-weight: bold;"><?php echo $branch[0]['Branch_Name'];?></p> 
        
        <hr style="border:2px solid black;">
        <div>
            <div style="width:48%;float: left;">List of Obtained Marks</div>
            <div style="width:48%;float: left;text-align: right;">TEST NAME: _________________</div>
            <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
            <div style="width:48%;float: right;text-align: right;margin-right: 37px;">TEST II NAME: _______________</div>
            <?php } ?>
        </div>
        <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
        <br>
        <?php } ?>
        <br>
        <hr style="border:2px solid black;">
        
        <div>
            <div style="width:33%;float: left;"><strong> Class: 
            <?php echo $class[0]['Class_Name']."-".$section[0]['section_name'];?></strong></div>
            <div style="width:33%;float: left;"><strong>Date:</strong></div>
            <div style="width:33%;float: left;"><strong>Max/Marks:</strong>
                <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
                    <strong style="margin-left:60px;">Max/Marks II:</strong><?php } ?></div>
        </div>

        <div style="margin-top: 38px;">
            <div style="width:33%;float: left;"><strong> Subject:</strong></div>
            <div style="width:33%;float: left;"><strong>Day:</strong></div>
            <div style="width:33%;float: left;"><strong>Pass.Marks:</strong>
                <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
             <strong style="margin-left:60px;">Pass.Marks II:</strong> <?php } ?></div>
        </div>


<br><br>



  <table width="100%" class="table" style="font-size:16px;"  cellspacing="0" >
  
  
  
  <thead>


    <tr>
      <th width="6%" class="border"><strong>S.No</strong></th>

      <?php if($_REQUEST['show']=='roll') { ?>
      
      <th width="12%" class="border alignment"><strong>Roll No</strong></th>
      
      <?php }else { ?>

        <th width="12%" class="border alignment"><strong>Adm No</strong></th>

      <?php } ?>

      <th width="30%" class="name"><strong> Name</strong></th>
      <th width="25%" class="border alignment"><strong>Father</strong></th>    
    


      <th width="15%" class="border"><strong>Obt Marks</strong></th>

      <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
        <th width="15%" class="border"><strong>Obt Marks II</strong></th>
      <?php } ?>

      <!-- <th width="15%" class="border"><strong>%</strong></th> -->

      <th width="15%" class="border"  style="border-right:1px solid black;"><strong>Signature</strong></th>

    </tr>
   

    </thead>
    <tbody>



   
 <?php 


  $second_array=array_slice($WorkAssignListings,$total_cols);
  

     $count=1;
      for($i=0;$i<count($WorkAssignListings);$i++)
      { 
        
  ?>     
    <tr>
      <td class="border center"><?php echo  $count; ?> </td>

      <?php if($_REQUEST['show']=='roll') { ?>
      
      <td class="name"><?php echo $WorkAssignListings[$i]['candidate_roll_no'];?>  </td>
      
      <?php }else { ?>

        <td class="name"><?php echo $WorkAssignListings[$i]['ref_no'];?>  </td>

      <?php } ?>

      <td class="name">

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

        <img style="border-radius:50%;height:30px;width:30px;" src="<?php echo DOMAIN.AgentDirectory;?>/students_pics/<?php echo $WorkAssignListings[$i]['image'];?>"  />
      <?php }else {?>

        <img style="border-radius:50%;height:30px;with:30px;" src="images/student.png" />

      <?php }?>&nbsp;&nbsp;<span style="margin-top:1px;"><?php echo  $WorkAssignListings[$i]['first_name']; ?></span></td>
       <td class="lname"><?php echo  $WorkAssignListings[$i]['last_name']; ?></td> 
    
      
      <td class="border center"></td>

      <?php if ($_REQUEST['show_no_of_test']=="2") { ?>
        <td class="border center"></td>
      <?php } ?>

      <!-- <td class="border center"></td> -->

      <td class="border center"  style="border-right:1px solid black;"></td>
    </tr>
   
<?php $count++; } ?>


    <tr>
        <td colspan="3">Average</td>
        <td></td>
        <td></td>
        <td style="border-right: 1px solid black;"></td>
    </tr>


 </tbody> 
        
    </table>
<br>

    <p style="font-size: 13px;font-weight: bold;" class="no_style">RESULT SUMMARY:</p>
    

    <div>
      <div   style="float: left; width: 25%;"><strong> Attempted:</strong></div>
      <div   style="float: left; width: 25%;"><strong> Passed:  </strong></div>
      <div   style="float: left; width: 25%;"><strong> Failed:  </strong></div>
      <div   style="float: left; width: 25%;"><strong> Percentage:  </strong></div>
   </div> 

    <br><br><br>
  <div>
   <p style="margin-left: 308px;font-weight: bold;"> Signature of Subject Teacher :    __________________________</p>
  </div>


<br>


        </div>    
    </div>      
   </div>


</body>
</html>
