<?php 
$ins = mysqli_query($conn,"SELECT * FROM users WHERE email='$user' ");
$data = mysqli_fetch_array($ins);

$level = $data['level'];

$query_rec = mysqli_query($conn,"SELECT * FROM sme_data");
$sme = mysqli_fetch_array($query_rec);	


$query_rec1 = mysqli_query($conn,"SELECT * FROM sme_data_agent");
$smeA2 = mysqli_fetch_array($query_rec1);


$query_rec2 = mysqli_query($conn,"SELECT * FROM sme_data_regular");
$smeR = mysqli_fetch_array($query_rec2);



$Reseller  = 'paid';
$Agent  = 'agent';
$free  = 'free';






		
if($level == $Reseller ){
		
$mtnA = $sme['mtnA'];
$mtnB = $sme['mtnB'];
$mtnC = $sme['mtnC'];
$mtnD = $sme['mtnD'];
$mtnE = $sme['mtnE'];
$mtnF = $sme['mtnF'];
//$mtnG = $sme['mtnG'];

		
$airtelA = $sme['airtelA'];
$airtelB = $sme['airtelB']; 
$airtelC = $sme['airtelC'];
$airtelD = $sme['airtelD'];
$airtelE = $sme['airtelE'];
$airtelF = $sme['airtelF'];
$airtelG = $sme['airtelG'];
$airtelH = $sme['airtelH'];
$airtelI = $sme['airtelI'];
$airtelJ = $sme['airtelJ'];
$airtelK = $sme['airtelK'];


$gloA = $sme['gloA'];
$gloB = $sme['gloB'];
$gloC = $sme['gloC'];
$gloD = $sme['gloD'];
$gloE = $sme['gloE'];
$gloF = $sme['gloF'];
$gloG = $sme['gloG'];
$gloH = $sme['gloH'];
$gloI = $sme['gloI'];

$etisalatA = $sme['etisalatA'];
$etisalatB = $sme['etisalatB'];
$etisalatC = $sme['etisalatC'];
$etisalatD = $sme['etisalatD'];
$etisalatE = $sme['etisalatE'];
$etisalatF = $sme['etisalatF'];
$etisalatG = $sme['etisalatG'];
$etisalatH = $sme['etisalatH'];
$etisalatI = $sme['etisalatI'];
$etisalatJ = $sme['etisalatJ'];
$etisalatK = $sme['etisalatK'];

}elseif($level == $Agent){
			
		
$smeA = $smeA2['mtnA'];
$smeB = $smeA2['mtnB'];
$smeC = $smeA2['mtnC'];
$smeD = $smeA2['mtnD'];
$smeE = $smeA2['mtnE'];
$smeF = $smeA2['mtnF'];

$mtnA = $smeA2['mtnA'];
$mtnB = $smeA2['mtnB'];
$mtnC = $smeA2['mtnC'];
$mtnD = $smeA2['mtnD'];
$mtnE = $smeA2['mtnE'];
$mtnF = $smeA2['mtnF'];
$mtnG = $smeA2['mtnG'];

$smecA = $smeA2['mtncA'];
$smecB = $smeA2['mtncB'];
$smecC = $smeA2['mtncC'];
$smecD = $smeA2['mtncD'];
$smecE = $smeA2['mtncE'];
$smecF = $smeA2['mtncF'];

$airtelA = $smeA2['airtelA'];
$airtelB = $smeA2['airtelB']; 
$airtelC = $smeA2['airtelC'];
$airtelD = $smeA2['airtelD'];
$airtelE = $smeA2['airtelE'];
$airtelF = $smeA2['airtelF'];
$airtelG = $smeA2['airtelG'];
$airtelH = $smeA2['airtelH'];
$airtelI = $smeA2['airtelI'];
$airtelJ = $smeA2['airtelJ'];
$airtelK = $smeA2['airtelK'];

$gloA = $smeA2['gloA'];
$gloB = $smeA2['gloB'];
$gloC = $smeA2['gloC'];
$gloD = $smeA2['gloD'];
$gloE = $smeA2['gloE'];
$gloF = $smeA2['gloF'];
$gloG = $smeA2['gloG'];
$gloH = $smeA2['gloH'];
$gloI = $smeA2['gloI'];

$etisalatA = $smeA2['etisalatA'];
$etisalatB = $smeA2['etisalatB'];
$etisalatC = $smeA2['etisalatC'];
$etisalatD = $smeA2['etisalatD'];
$etisalatE = $smeA2['etisalatE'];
$etisalatF = $smeA2['etisalatF'];
$etisalatG = $smeA2['etisalatG'];
$etisalatH = $smeA2['etisalatH'];
$etisalatI = $smeA2['etisalatI'];
$etisalatJ = $smeA2['etisalatJ'];
$etisalatK = $smeA2['etisalatK'];

}elseif($level == $free){	
					
				
		
$smeA = $smeR['mtnA'];
$smeB = $smeR['mtnB'];
$smeC = $smeR['mtnC'];
$smeD = $smeR['mtnD'];
$smeE = $smeR['mtnE'];
$smeF = $smeR['mtnF'];

$mtnA = $smeR['mtnA'];
$mtnB = $smeR['mtnB'];
$mtnC = $smeR['mtnC'];
$mtnD = $smeR['mtnD'];
$mtnE = $smeR['mtnE'];
$mtnF = $smeR['mtnF'];
$mtnG = $smeR['mtnG'];

$smecA = $smeR['mtncA'];
$smecB = $smeR['mtncB'];
$smecC = $smeR['mtncC'];
$smecD = $smeR['mtncD'];
$smecE = $smeR['mtncE'];
$smecF = $smeR['mtncF'];

$airtelA = $smeR['airtelA'];
$airtelB = $smeR['airtelB']; 
$airtelC = $smeR['airtelC'];
$airtelD = $smeR['airtelD'];
$airtelE = $smeR['airtelE'];
$airtelF = $smeR['airtelF'];
$airtelG = $smeR['airtelG'];
$airtelH = $smeR['airtelH'];
$airtelI = $smeR['airtelI'];
$airtelJ = $smeR['airtelJ'];
$airtelK = $smeR['airtelK'];

$gloA = $smeR['gloA'];
$gloB = $smeR['gloB'];
$gloC = $smeR['gloC'];
$gloD = $smeR['gloD'];
$gloE = $smeR['gloE'];
$gloF = $smeR['gloF'];
$gloG = $smeR['gloG'];
$gloH = $smeR['gloH'];
$gloI = $smeR['gloI'];

$etisalatA = $smeR['etisalatA'];
$etisalatB = $smeR['etisalatB'];
$etisalatC = $smeR['etisalatC'];
$etisalatD = $smeR['etisalatD'];
$etisalatE = $smeR['etisalatE'];
$etisalatF = $smeR['etisalatF'];
$etisalatG = $smeR['etisalatG'];
$etisalatH = $smeR['etisalatH'];
$etisalatI = $smeR['etisalatI'];
$etisalatJ = $smeR['etisalatJ'];
$etisalatK = $smeR['etisalatK'];

                                         
                                                
}else{
                                                
$smeA = $smeR['mtnA'];
$smeB = $smeR['mtnB'];
$smeC = $smeR['mtnC'];
$smeD = $smeR['mtnD'];
$smeE = $smeR['mtnE'];
$smeF = $smeR['mtnF'];

$mtnA = $smeR['mtnA'];
$mtnB = $smeR['mtnB'];
$mtnC = $smeR['mtnC'];
$mtnD = $smeR['mtnD'];
$mtnE = $smeR['mtnE'];
$mtnF = $smeR['mtnF'];
$mtnG = $smeR['mtnG'];

$smecA = $smeR['mtncA'];
$smecB = $smeR['mtncB'];
$smecC = $smeR['mtncC'];
$smecD = $smeR['mtncD'];
$smecE = $smeR['mtncE'];
$smecF = $smeR['mtncF'];

$airtelA = $smeR['airtelA'];
$airtelB = $smeR['airtelB']; 
$airtelC = $smeR['airtelC'];
$airtelD = $smeR['airtelD'];
$airtelE = $smeR['airtelE'];
$airtelF = $smeR['airtelF'];
$airtelG = $smeR['airtelG'];
$airtelH = $smeR['airtelH'];
$airtelI = $smeR['airtelI'];
$airtelJ = $smeR['airtelJ'];
$airtelK = $smeR['airtelK'];

$gloA = $smeR['gloA'];
$gloB = $smeR['gloB'];
$gloC = $smeR['gloC'];
$gloD = $smeR['gloD'];
$gloE = $smeR['gloE'];
$gloF = $smeR['gloF'];
$gloG = $smeR['gloG'];
$gloH = $smeR['gloH'];
$gloI = $smeR['gloI'];

$etisalatA = $smeR['etisalatA'];
$etisalatB = $smeR['etisalatB'];
$etisalatC = $smeR['etisalatC'];
$etisalatD = $smeR['etisalatD'];
$etisalatE = $smeR['etisalatE'];
$etisalatF = $smeR['etisalatF'];
$etisalatG = $smeR['etisalatG'];
$etisalatH = $smeR['etisalatH'];
$etisalatI = $smeR['etisalatI'];
$etisalatJ = $smeR['etisalatJ'];
$etisalatK = $smeR['etisalatK'];

} 


$serviceID = $network;
$Dataplan = $plan;	



if($serviceID == '01' && $Dataplan == '500'  ){
		
		$amount = $mtnA;
		
		$valu = "MTN 500MB ";




}elseif($serviceID == '01' && $Dataplan == '1000'  ){
		
		$amount = $mtnB;
		
		$valu = "MTN 1GB ";

		
		
			
}elseif($serviceID == '01' && $Dataplan == '2000' ){
				
    		$amount = $mtnC;
    		
    		$valu = "MTN 2GB ";


			
				}elseif($serviceID == '01' && $Dataplan == '3000' ){
					
				$amount = $mtnD;
				
				$valu = "MTN 3GB ";


				
					}elseif($serviceID == '01' && $Dataplan == '5000' ){
						
						$amount = $mtnE;
						
						$valu = "MTN 5GB ";


						
}elseif($serviceID == '01' && $Dataplan == '10000'){	
										
			        
$amount = $mtnF;
$valu = "MTN 10GB ";


}elseif($serviceID == '01' && $Dataplan == '20000' ){
						
$amount = $mtnG;
$valu = "MTN 20GB ";
						
						
						
					// airtel Data	
						
						}elseif($serviceID == '04' && $Dataplan == '100' ){
							
						$amount = $airtelA;	
						
						$valu = "Airtel 100MB ";




}elseif($serviceID == '04' && $Dataplan == '300' ){
							
						$amount = $airtelB;	
						
						$valu = "Airtel 300MB ";



							
							}elseif($serviceID == '04' && $Dataplan == '500' ){
								
							$amount = $airtelA;	
							
							$valu = "Airtel 500MB ";


			}elseif($serviceID == '04' && $Dataplan == '1000'){
								
							$amount = $airtelB;	
							
							$valu = "Airtel 1GB ";


								
							}elseif($serviceID == '04' && $Dataplan == '2000'){
								
							$amount = $airtelC;	
							
							$valu = "Airtel 2GB ";


								
							}elseif($serviceID == '04' && $Dataplan == '3000'){
								
							$amount = $airtelD;	
							
							$valu = "Airtel 3GB ";


								

								
							}elseif($serviceID == '04' && $Dataplan == '5000'){
								
							$amount = $airtelE;	
							
							$valu = "Airtel 5GB ";
				
							
							}elseif($serviceID == '04' && $Dataplan == '10000'){
								
							$amount = $airtelF;	
							
							$valu = "Airtel 10GB ";



}elseif($serviceID == '04' && $Dataplan == '15000'){
								
							$amount = $airtelG;	
							
							$valu = "Airtel 15GB ";



}elseif($serviceID == '04' && $Dataplan == '20000'){
								
							$amount = $airtelH;	
							
							$valu = "Airtel 20GB ";

            

						
							
							
						//glo data	
						
						
						}elseif($serviceID == '02' && $Dataplan == '200'){
								
							

$amount = $gloA;						
							
$valu = "Glo 200MB";





}elseif($serviceID == '02' && $Dataplan == '500'){
								
							

$amount = $gloB;				
$valu = "Glo 500MB";




}elseif($serviceID == '02' && $Dataplan == '1000'){
								
							

$amount = $gloC;
							
							
$valu = "Glo 1GB";





}elseif($serviceID == '02' && $Dataplan == '2000'){
								
							

$amount = $gloD;
							
							
$valu = "Glo 2GB";





}elseif($serviceID == '02' && $Dataplan == '3000'){
								
							

$amount = $gloE;
							
							
$valu = "Glo 3GB";






}elseif($serviceID == '02' && $Dataplan == '4000'){
								
							

$amount = $gloF;
							
							
$valu = "Glo 4GB";





}elseif($serviceID == '02' && $Dataplan == '5000'){
								
							

$amount = $gloG;
							
							
$valu = "Glo 5GB";





}elseif($serviceID == '02' && $Dataplan == '10000'){
								
							

$amount = $gloH;
							
							
$valu = "Glo 10GB";

		
							
								
							
							
							
							//etisalat data
							
							}elseif($serviceID == '03' && $Dataplan == '250'){ 
								
							$amount = $etisalatA;
							
							$valu = "9Mobile 250 MB ";


								
							}elseif($serviceID == '03' && $Dataplan == '500'){
								
							$amount = $etisalatB;
							
							$valu = "9Mobile 500MB ";

								
							}elseif($serviceID == '03' && $Dataplan == '1000'){
								
							$amount = $etisalatC;
							
							$valu = "9Mobile 1GB ";
							


								
							}elseif($serviceID == '03' && $Dataplan == '1500'){
								
							$amount = $etisalatD;
							
							$valu = "9Mobile 1.5GB ";
							
				
							}elseif($serviceID == '03' && $Dataplan == '2000'){
								
							$amount = $etisalatE;
							
							$valu = "9Mobile 2GB ";
							

								
							}elseif($serviceID == '03' && $Dataplan == '3000'){
								
							$amount = $etisalatF;
							
							$valu = "9Mobile 3GB ";
							


                            }elseif($serviceID == '03' && $Dataplan == '4000'){
								
							$amount = $etisalatG;	
							
							$valu = "9Mobile 4GB ";
		
							
							}elseif($serviceID == '03' && $Dataplan == '4500'){
								
							$amount = $etisalatH;	
							
							$valu = "9Mobile 4.5GB ";

								
							}elseif($serviceID == '03' && $Dataplan == '5000'){
								
							$amount = $etisalatI;
							
							$valu = "9Mobile 5GB ";
							

								
							}elseif($serviceID == '03' && $Dataplan == '10000'){
								
							$amount = $etisalatJ;	
							
							$valu = "9Mobile 10GB ";
							


}elseif($serviceID == '03' && $Dataplan == '20000'){
								
							$amount = $etisalatK;	
							
							$valu = "9Mobile 20GB ";
							

                                                
							
							
$amount = $Dataplan; }	

							
									 ?>