<?php
$bal=0;
$s=mysqli_query($con,"select * from airtime_customer where customer_id = '$session_id' ");
$cdata=mysqli_fetch_array($s);

if($cdata['user_type'] == "Admin"){
	$account_for=$cdata['company'];
	
	$s2=mysqli_query($con,"select * from airtime_admin_credits where customer_id='$session_id' and account_for='$account_for' ");
	$adcr=mysqli_fetch_array($s2);
	$bal=$adcr['current_amount'];
	
}else{
//	$s3=mysql_query("select * from airtime_user_credits where customer_id='$session_id'  ");

	$s3 = mysqli_query($con,"select * from airtime_sending_credentials where customer_id = '$session_id'  ");
	$get_name = mysqli_fetch_array($s3);
	$account_id = $get_name['API_Account'];
	
	$s5 = mysqli_query($con,"select * from currency_credits where shopid = '$account_id' ");
	$usrcr = mysqli_fetch_array($s5);
	$bal = $usrcr['amount'];
}



?>