<?php include('parent/callMe.php');?>

<?php include('Sessioncheck.php');?>

<?php



$m->where("class_id", $_REQUEST['class_id']);

$classStanderdFee=$m->get("eduportal_class_fee_details");



$branch=$brid;

$branchIDs=$_SESSION['branch'];

if($_REQUEST['class_id']!=NULL){



  $sql = "SELECT * FROM  edu_student_details  WHERE branch_id='$branchIDs' and status='0'";



  if($_REQUEST['class_id']!=NULL){

      $sql .= " AND class_id ='" . $_REQUEST['class_id']. "' ";

      }



      

     if($_REQUEST['section']=="All"){

    

    } else {

     $sql .= " AND section_id = '" .$_REQUEST['section']. "' ";



    }






     if($_REQUEST['orderBy']=='RollNoWise'){

        $sql .= "order by candidate_roll_no asc";

      }



    if($_REQUEST['orderBy']=='Admascending'){

        $sql .= "order by CAST(ref_no as unsigned)  asc";

      }



    if($_REQUEST['orderBy']=='Alphabatically'){

        $sql .= "order by first_name  asc";

      }

//echo $sql;

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



}



$m->where("class_id", $_REQUEST['class_id']);

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

$class=$m->get("edu_class_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">

<!-- Favicons-->

<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />

<title>Print Update Fee</title>

<!-- Favicons-->

<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />



<script type="text/javascript">

  //window.print();

</script>

<style> 

  

.section{width:32%; height:auto;float:left;border-right: 2px solid black;border-right-style:dotted;padding-right:1%;margin-left:1%;}

tr th {background-color:gray;text-align:center;font-size:18px;border:1px solid black;padding: 0.5;}

tr td {border-bottom:1px solid black;border-left:1px solid black;padding:1.1%;}



  

@media print {

    #Header, #Footer { display: none !important; }

}

@media screen

   {

      p.bodyText {font-family:verdana, arial, sans-serif;}

   }



   @media print

   {

      p.bodyText {font-family:georgia, times, serif;}

   }

   @media screen, print

   {

      p.bodyText {font-size:10pt}

   }

   @media print {

  a[href]:after {

    content: none !important;

  }

}





  body {

    width: 100%;

    height: 100%;

    margin: 0;

    padding: 0;

    background-color: #FAFAFA;

    font-weight:bold;

    font-size:15px;

    /*font: 12pt "Tahoma";*/

}

* {

    box-sizing: border-box;

    -moz-box-sizing: border-box;

}

.page {

    width: 297mm;

    min-height:190mm;        

    padding-left:5mm;

    padding-top:5mm;

    padding-bottom:35mm;

    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: 280mm;

    height:170mm;

    

}



@page {

    size: A4;

    margin: 0;

}

@media print {

    html, body {

        width:297mm;

        height:190mm;        

    }

    .page {

        margin: 0;

        border: initial;

        border-radius: initial;

        width: initial;

        min-height: initial;

        box-shadow: initial;

        background: initial;

        page-break-after: blue;

    }

}





  </style>



</head>

<script>

  window.print();

</script>

<body>

  <div style="margin: 1.5%;">

<h3 style="text-align: center;"> Sudent Update Fee</h3>

<h3> Class:- <?php echo $class[0]['Class_Name']; ?></h3>

<table data-page-length='100' class="table table-striped table-bordered" style="width:100%">

          

          <thead>

            <tr>

                <th width="3%">S.No</th>

                <th width="12%">Student Name</th>

                <th width="12%">Father Name</th>

                <th width="8%">Roll#</th>

                <th width="7%">Adm#</th>

                <th width="7%" style="text-align:center;"> Class </th>

                <th width="7%" style="text-align:center;"> Prev.Balance </th>

                <th width="7%" style="text-align:center;"> Transport </th>

                <th width="7%" style="text-align:center;"> 

                  <?php if ($brid[0]['misc_title']!=NULL){echo $brid[0]['misc_title'];}else {echo 'Miscellaneous';} ?> </th>

                <th width="7%" style="text-align:center;"> Monthly Fee </th>

                <th width="7%" style="text-align:center;"> Discount </th>

                <th width="15%">Disc.Reason</th>

                    





                

  

            </tr>

        </thead>

        <tbody>

   

     

     <?php $count=1;



      foreach($WorkAssignListings as $WorkAssignListVal)

      { 

        

          $m->where("student_id", $WorkAssignListVal['student_id']);

          $m->where("year", $_REQUEST['year']);

          $m->where("class_id", $_REQUEST['class_id']);

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

      

          $fees=$m->get("eduportal_student_fee_structure");

        

          //print_r($fees);

         $show_fee=0;

         $misc_fee=0;



        if(count($fees)>0){

         

         $show_fee=$fees[0]['std_tution_fee'];

         $misc_fee=$fees[0]['std_misc_fee'];

        }else {



         $m->where("class_id", $WorkAssignListVal['class_id']);

         $fees1=$m->get("eduportal_class_fee_details");



         $show_fee=$fees1[0]['tution_fee'];

         $misc_fee=$fees1[0]['misc_fee'];





        }







       

       $id=$WorkAssignListVal['student_id'];  



    

    $totalOutstandingBal+=$fees[0]['std_outstanding_blc'];

    $totalTransportFee+=$fees[0]['std_transport_fee'];

    $totalMiscFee+=$misc_fee;

    $totalFee+=$show_fee;

    $totalDiscount+=$classStanderdFee[0]['tution_fee']-$show_fee;



      ?>



    <tr>

              <td style="text-align:center;"> <?php echo $count; $count+=1;?> </td>

              <td>



                 <input name="students[]" id="students[]" type="hidden" value="<?php echo $WorkAssignListVal['student_id'];?>">

                 <?php echo $WorkAssignListVal['first_name'];?>



               </td>


               <td> <?php echo $WorkAssignListVal['last_name'];?> </td>
              

              <td> <?php echo $WorkAssignListVal['candidate_roll_no'];?> </td>



              <td> <?php echo $WorkAssignListVal['ref_no'];?> </td>



              <td style="text-align:center;"> <?php echo getClassName($m,$_GET['class_id']);?> - <?php echo getSectionName($m,$WorkAssignListVal['section_id']);?> </td>



              <td> <?php echo $fees[0]['std_outstanding_blc'];?></td>



              <td><?php echo $fees[0]['std_transport_fee'];?></td>

              <td><?php echo $misc_fee;?></td>

              <td><?php echo $show_fee;?>  </td>

              <td><?php echo $classStanderdFee[0]['tution_fee']-$show_fee;?>  </td>

              <td><?php echo $fees[0]['discount_reason'];?></td>



             

          </tr>











              <?php

      } ?>



      <tr style="background-color: gray;text-align: center;">

        <td colspan="5">Total</td>

        <td><?php echo $totalOutstandingBal;?></td>

        <td><?php echo $totalTransportFee;?></td>

        <td><?php echo $totalMiscFee;?></td>

        <td><?php echo $totalFee;?></td>

        <td><?php echo $totalDiscount;?></td>

        <td></td>

      </tr>







           

            

           

        </tbody>

        

    </table>

</div>

</body>

</html>