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

<?php


$month_id= date("m");
$date= date("Y-m-d");
$bid=$_SESSION['branch'];
$sessID=$_SESSION['current_session'];

$qr="select std.student_id, std.cell_no, fee.challan_id, fee.tutionfee, fee.transportfee, fee.balance, fee.misc_fee from eduportal_monthly_challan as fee,edu_student_details as std where fee.month_id='$month_id' AND fee.paid_status='0' AND std.student_id=fee.student_id AND std.status='0' AND  fee.branch_id='$bid' AND fee.session_id='$sessID' group by std.cell_no";
// echo $qr; 


$secondLevel = $m->query($qr);

$numbers="";

foreach($secondLevel as $numb){


	 $others_fee=0+getFeeAllOtherFee($numb['student_id'],$numb['challan_id'],$m);

     
        $totalAmount= $numb['tutionfee']+$numb['transportfee']+$numb['balance']+$numb['misc_fee']+$others_fee;

        if ($numb['balance'] < 0) {
        	continue;
        }
              
          if($totalAmount==0 ||  $totalAmount=="0"){
          
            continue;
          } 

	if($numb['cell_no']!=NULL && is_numeric($numb['cell_no'])  && strlen($numb['cell_no'])==11){
	
		$numbers.=$numb['cell_no'].",";
	}
	
}
	


	$temp=array_unique(explode(",", $numbers));


	$numbers=implode(",",$temp);

	echo rtrim($numbers, ",");
	
  ?>
