<?php
if(isset($_POST['batch_no'])){
    require_once('../../assets/config/config.php');
    $obj=new Database();
    $id=$_POST['batch_no'];
    $id="batch_no='".$id."'";
    $obj->select('students_course','*',null,$id,null,null);
    $result=$obj->getResult();
    $paid=$obj->Amount_Count('txn_details',$id,'credit');
    $fee=$obj->Amount_Count('txn_details',$id,'debit');
    if(($paid!='')||($fee!='')){
            $result[0]['p_fee'] = $paid;
            $result[0]['pp_fee'] = $fee-$paid;}
        header('Content-type:application/json');
        echo json_encode($result);
}
?>