<?php
$bal=0;
$s=mysql_query("select * from airtime_customer where customer_id = '$session_id' ");
$cdata=mysql_fetch_array($s);

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



?>