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

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

<?php



 $month;

 

  if($_GET["month"]!=NULL ){



      $month= $_GET["month"];

    }

    else{

      $month= date("m");

    }

   


   $year;



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



      $year=$_REQUEST['year'];

      

    }else {

      

      $year=date("Y");

    }







       $branch=$_SESSION['branch'];

       

       $classes = $m->query("select * from edu_class_config where branch_id=".$branch." order by class_id asc limit 1");

       // print_r($classes);

       





     /* code for advance Search*/





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



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



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

      $sql;

    } else {

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



    }



  if($_REQUEST['section']!=''){

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

 }





 // echo $sql;



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

} else {

 

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



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

}



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

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

  $class_standerd_fee=$class_fee[0]['tution_fee'];*/

        $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 Discount Report</title>

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

<script type="text/javascript">

 // window.print();

</script>

<style type="text/css">







.center{text-align:center;}

.alignment{padding-left:1%;text-align:left;}



tr th {border:1px solid black;text-align:center;background-color:lightgray;font-size:14px;}

tr td {border-bottom:1px solid black;border-left:1px solid black;font-size:14px;padding:3px;}

  



@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;

  }

}

</style>

</head>

<body>







<div style="text-align:center;font-size:25px;font-weight:bold;margin:0 auto;"><?php echo $branch[0]['Branch_Name'];?> </div> 

<p style="text-align:center;font-size:18px;">Student Discount Report List</p>



<div style="text-align:center;font-size:14px;"><b><?php echo $_GET['studnetlist'];?></b> </div>



<hr style="width:100%;">



<div style="width:50%;float:left;">  <b> Class Name:</b> <?php echo getClassName($m,$_REQUEST['class_id']);?> </div>



<!-- <div style="width:50%; float:right; "> <b> Total Strength:</b> <?php echo count($WorkAssignListings);?> </div> -->





<br>





  <table width="100%" class="table"  cellspacing="0" >

  

    

  <thead>

    <tr>

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

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

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

                <th width="10%">Class Name</th>

                <th width="10%"> Month </th>

                <th width="10%"> Standared Fee </th>

                <th width="10%"> Discount </th>



     

    </tr>

   

    </thead>

       <tbody>

    

<?php 



$count=1;

foreach($WorkAssignListings as $WorkAssignListVal)

{ 


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

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

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

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

        $challanFee=$m->get("eduportal_monthly_challan");



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

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

        $class_standerd_fee=$class_fee[0]['tution_fee'];



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

        $section=$m->get("edu_adm_section_detail");



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

        $session=$m->get("edu_session_config");



        if ($challanFee[0]['disc_amount']==0) {

            

            continue;

        }



        $totalDiscAmount+=$challanFee[0]['disc_amount'];

?>

    <tr>

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



          <td style="padding: 2px;" ><?php echo $WorkAssignListVal['first_name'];?></td>

                

          <td style="padding: 2px; "> <?php echo $WorkAssignListVal['last_name'];?> </td>



          <td style="text-align:center; padding: 2px;">

                   <?php echo getClassName($m,$WorkAssignListVal['class_id']);?>

                   ( <?php echo getSectionName($m,$WorkAssignListVal['section_id']);?>)

          </td>



          <td style="text-align:center; padding: 2px;"> <?php echo getMonthName($m,$month);?></td>

          <td style="text-align:center; padding: 2px;">

                   <?php echo $class_standerd_fee;?>

          </td>

                  

          <td style="text-align:center; padding: 2px;"><?php echo $challanFee[0]['disc_amount'];?> </td> 



      

    </tr>

   

<?php  

    }

?>



<tr>

    <td colspan="6" style="background: lightgray;text-align: center;">Total Discount</td>

    <td style="background: lightgray;text-align: center;"> <?php echo $totalDiscAmount;?></td>



</tr>



      </tbody>



  </table>

<script src="js/ajax_functions.js"></script>

</body>

</html>

