403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.48
Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64
User : win 10 ( 0)
PHP Version : 8.2.12
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  D:/xampp/htdocs-coblaa/BM_game/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : D:/xampp/htdocs-coblaa/BM_game/autopagek.php
<?php 
include('db.php');
session_start();
$status = $_GET['status'];
//////////////////////////////////////////////////////////
$curr_day = date("d");
$curr_month = date("m");
$curr_year = date("Y");
$curr_hour = date("H");
///////////////////////////////////////////////////////////////   
?>
<span style="display:none;">
<span style="display:none;" ><?php $g_reward = 50; $cb_exchange_px=0.1; ?></span>
<span id="cb_ugx_px" style="display:none;" ><?php echo $cb_exchange_px; ?></span>
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
$exchange_rate=0.2;
$game1RWD = 10;
/*echo"$user_ip";
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/

if(isset($_SESSION['my_id']))
{
$my_id = $_SESSION['my_id'];		
}

?> 
</span>
<?php

/////////////index/////////////////////////////////////////////////////// 
if($status =="save_ad_view_task")
{
	$user_id = $_GET['my_id'];

	$get_user_beta_performer = "select * from performancetb where my_id='$user_id' ";
	$run_get_user_beta_performer= mysqli_query($con,$get_user_beta_performer);
	$check_get_user_beta_performer = mysqli_num_rows($run_get_user_beta_performer);
	if($check_get_user_beta_performer <1){
		
	$insert_user_performance ="insert into performancetb (my_id,ad_view,cur_country,cur_city,ipuser,cur_date,cur_time)
    values('$user_id','1','$country','$city','$user_ip',CURDATE(),CURTIME() )";
    $run_insert_user_performance = mysqli_query($con,$insert_user_performance); 
		
	}else{
	
    while($row_get_user_beta_performer= mysqli_fetch_array($run_get_user_beta_performer))
	{
    
   $update_user_performance ="UPDATE performancetb SET ad_view='1',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$my_id' ";
   $run_update_user_product = mysqli_query($con,$update_user_performance);
 }
	}
}
if($status =="chcek_member")
{
	$user_id = $_GET['my_id'];
		
	$get_user_check = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_user_check= mysqli_query($con,$get_user_check);
	$chcek_get_user = mysqli_num_rows($run_get_user_check);
	if($chcek_get_user > 0){}else{ ?>
<div id="shell_welcome_div"  class="shell_welcome_div" >
<div class="sub_shell_welcome_span" >
<p style="width:100%;text-align:center;font-weight:bold;font-size:1.3em;color:orange;">BMG</p>
We're excited to roll out the <strong>BMG</strong> that's short for <br/><strong>Business Mind Game!</strong><br/>

This isn't just about fun; it's a chance to sharpen your strategic thinking and earn points that can be redeemed for real value.<br/>

Dive in, explore the challenges, and start accumulating those valuable points. It's time to put your business savvy to the test and see how much you can earn!
<p style="width:100%;text-alignk:center;"><strong>Great news!</strong><br/> We've just credited your account with <strong>500 points</strong> to kickstart your experience in the <strong>BM Game</strong>.</p>

These points are ready for you to use in the game. Dive in and start building your business empire!

<div class="button_cover" onClick="join_bmgame_now();" ><button class="start_bmgame_btn" >Continue</button></div>
</div>
</div>
<?php
	}
	
	
			
	
}
/////////////index/////////////////////////////////////////////////////// 
if($status =="join_bmgame_now")
{
	$user_id = $_GET['my_id'];
	$kickstart_pts =500;
	$get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$main_ptspy = $row_get_main_pointsup['bmg_main_point'];
	
	if($kickstart_pts > $main_ptspy ){ ?> 
<div id="shell_welcome_div2"  class="shell_welcome_div" >
<div class="sub_shell_welcome_span" >
<p style="width:100%;text-align:center;font-weight:bold;font-size:1.3em;color:orange;">Sorry you can not join right now</p>

<div class="button_cover" ><a href="login"><button class="start_bmgame_btn" >Continue</button></a></div>
</div>
</div>

	<?php }else{
	
	$insert_bk_point_user="insert into bm_point_bank (my_id,point_amount,ipuser,cur_country,cur_city,cur_date,cur_time) 
	values('$user_id','$kickstart_pts','$user_ip','$country','$city',CURDATE(),CURTIME())";
	$run_insert_bk_point_user = mysqli_query($con,$insert_bk_point_user);
if($run_insert_bk_point_user){
	$cur_main_pts = $main_ptspy - $kickstart_pts;
 $update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$cur_main_pts' ";
 $run_update_main_pts = mysqli_query($con,$update_main_pts);	
	} 
	}
	}
}
/////////////index/////////////////////////////////////////////////////// 
if($status =="chcek_gift")
{
	$user_id = $_GET['my_id'];
	$get_user_gift = "select * from performancetb where my_id='$user_id' AND gift_view='1' ";
	$run_get_user_gift= mysqli_query($con,$get_user_gift);
	$check_get_user_gift = mysqli_num_rows($run_get_user_gift);
	if($check_get_user_gift >0){ ?>
	<div id="shell_gift_div" class="shell_gift_div" >

<div id="sub_gift_div" class="sub_gift_div" >
<span class="gift_title" >Amazing gift!</span>
<span class="gift_body" style="line-height:90px;" >FREE</span>
<span class="gift_body" style="line-height:30px;" >GIFT</span>
<span class="gift_body" ><button id="gift_btn" onClick="get_gift_points(250);" class="gift_btn" >Claim</button></span>
<button onClick="close_gift_shell();" class="close_gift_btn" >x</button>
</div>

<div id="gift_disp_div" class="gift_disp_div" >
<span class="gift_title" style="background:#5e16d4;color:#fff;" >Coblaa</span>
<span class="gift_body" style="height:120px;line-height:120px;" >Gifts you</span>
<span class="gift_body" style="line-height:30px;color:#16a739;" >250</span>
<span class="gift_body" style="font-size:1em;ine-heightk:30px;colork:#16a739;" >Points</span>
<button onClick="get_back_homepage();" class="close_gift_btn" style="border:5px solid blue;color:blue;margin-top:10px;"  >ok</button>
</div>

</div>

<?php	}
	
}	
/////////////index/////////////////////////////////////////////////////// /////////////////////////////////
if($status =="disp_user_point")
{
	$user_id = $_GET['my_id'];
	
	$get_user_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_user_point= mysqli_query($con,$get_user_point);
    while($row_get_user_point= mysqli_fetch_array($run_get_user_point))
	{
	 $user_point_amt = $row_get_user_point['point_amount'];
     echo $user_point_amt; 
    }

	 $get_user_beta_performer = "select * from performancetb where my_id='$user_id' ";
	$run_get_user_beta_performer= mysqli_query($con,$get_user_beta_performer);
	$check_get_user_beta_performer = mysqli_num_rows($run_get_user_beta_performer);
	if($check_get_user_beta_performer <1){
		
	$insert_user_performance ="insert into performancetb (my_id,check_in,check_in_target_hour,cur_country,cur_city,ipuser,cur_date,cur_time)
    values('$user_id','1','$curr_hour','$country','$city','$user_ip',CURDATE(),CURTIME() )";
    $run_insert_user_performance = mysqli_query($con,$insert_user_performance); 
		
	}else{
	
	
    while($row_get_user_beta_performer= mysqli_fetch_array($run_get_user_beta_performer))
	{
	$check_in_target_hour = $row_get_user_beta_performer['check_in_target_hour'];
	if($check_in_target_hour == $curr_hour){}else{
    
   $update_user_performance ="UPDATE performancetb SET check_in='1',check_in_target_hour='$curr_hour',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$my_id' ";
   $run_update_user_product = mysqli_query($con,$update_user_performance);
	}
 }
	}
/////////////////////////////////////sale off proudcts///////////////////////////////game_playchancetb/////////////////////////////////////////////////////


	$get_user_beta_performer = "select * from performancetb where my_id='$user_id' ";
	$run_get_user_beta_performer= mysqli_query($con,$get_user_beta_performer);
    while($row_get_user_beta_performer= mysqli_fetch_array($run_get_user_beta_performer))
	{
	$check_in = $row_get_user_beta_performer['check_in'];
	$ad_view = $row_get_user_beta_performer['ad_view'];
	//$id_userBeta_performer = $row_get_user_beta_performer['my_id'];
	if($check_in >0){

	
	 $update_user_performance2 ="UPDATE performancetb SET check_in='0',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$user_id' ";
     $run_update_user_product = mysqli_query($con,$update_user_performance2);
		
		}elseif($ad_view >0){
	
	
	 $update_user_performance3 ="UPDATE performancetb SET ad_view='0',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$user_id' ";
     $run_update_user_product = mysqli_query($con,$update_user_performance3);	
		}
if($check_in >0 OR $ad_view >0){
	
	$get_user_product = "select * from bmg_partner_producttb where partner_id='$user_id' LIMIT 1 ";
	$run_get_user_product= mysqli_query($con,$get_user_product);
    while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
	{
	 $bmg_partner_producttb_id = $row_get_user_product['id'];
	 $bmg_partner_user_id = $row_get_user_product['partner_id'];
	 $product_id = $row_get_user_product['product_id'];
	  $product_selling_price = $row_get_user_product['product_price'];

 $delete_user_product ="DELETE FROM bmg_partner_producttb WHERE id='$bmg_partner_producttb_id' ";
 $run_delete_user_product = mysqli_query($con,$delete_user_product);  
 
 if($run_delete_user_product){

 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];	 
	 

 $insert_trans_sale="insert into bm_transactiontb (my_id,product_id,product_name,selling_price,description,cur_country,cur_city,ipuser,bmg_partner_producttb_id,cur_date,cur_time) 
 values('$user_id','$product_id','$product_name','$product_selling_price','Sale','$country','$city','$user_ip','$bmg_partner_producttb_id',CURDATE(),CURTIME()) ";
 $run_insert_trans_sale = mysqli_query($con,$insert_trans_sale);
 if($run_insert_trans_sale){
	 
	 $get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$main_ptspy = $row_get_main_pointsup['bmg_main_point'];
	
	$cur_main_pts = $main_ptspy-$product_selling_price; 
	$update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$cur_main_pts' ";
    $run_update_main_pts = mysqli_query($con,$update_main_pts);
	if($run_update_main_pts){

 	$get_point = "select * from bm_point_bank where my_id='$bmg_partner_user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];

  $new_point_amt = $total_point+$product_selling_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$bmg_partner_user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
	}
	}
 }
 }
 }
 }
	}   	
}
}
}
////////bm_dashboard//////////////////////////////////////////////////////
if($status =="disp_user_info")
{
	$user_id = $_GET['my_id'];
 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	  $get_user = "select * from cb_userstb where my_id='$user_id' ";
	
	$run_get_user = mysqli_query($con,$get_user);
	$check_user = mysqli_num_rows($run_get_user);	
    while($row_get_user = mysqli_fetch_array($run_get_user))
	{
		$usrname = $row_get_user['lname'];
		echo $usrname;
	
	}
	
	
}
}
////////index//////////////////////////////////////////////////////
if($status =="disp_user_referral")
{
	$user_id = $_GET['my_id'];
 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	
		$get_refer_code ="select * from cb_main_referraltb where user_ref_no='$user_id' ";
		$run_refer_code = mysqli_query($con,$get_refer_code);
		while($row_refer_code = mysqli_fetch_array($run_refer_code))
		{
			$refer_code = $row_refer_code['referral_code'];
			echo"Ref: $refer_code";
		}
	
}
}
include('db.php');
////////index//////////////////////////////////////////////////////
if($status =="disp_total_referral_points")
{
  $user_id = $_GET['my_id'];
  $get_trans_history ="select SUM(points_amt)  from withdraw_transtb where user_id='$user_id' AND referred_id!='' ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $refer_sum_points_amt = $row_get_trans_history['SUM(points_amt)'];
   echo $refer_sum_points_amt;
  }
}
/////////////bm_dashboard///////////////////////////////////////////////////////

if($status =="disp_point_transaction")
{
	$user_id = $_GET['my_id'];
	$get_sum_point = "select SUM(selling_price) from bm_transactiontb where my_id='$user_id' AND description='Sale' AND cur_date=CURDATE() ";
	$run_get_sum_point= mysqli_query($con,$get_sum_point);
    while($row_get_sum_point= mysqli_fetch_array($run_get_sum_point))
	{
	 $point_sum = $row_get_sum_point['SUM(selling_price)'];
     echo $point_sum; 
    }	
	
	
}

/////sales///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_sales_list")
{ 

 /*$main_search = $_GET['main_search'];
	if($main_search !==""){
	$get_sales ="select * from salestb WHERE product_name LIKE '%$main_search%' ORDER BY id DESC";// OR id LIKE '%$main_search%' OR product_color LIKE '%$main_search%' OR product_brand LIKE '%$main_search%' OR product_category LIKE '%$main_search%' ";	
	}else{
	$get_sales ="select * from salestb ORDER BY id DESC";	
	}*/
$my_id = $_GET['my_id'];
 $get_sales ="select * from bm_transactiontb where my_id='$my_id' ORDER BY id DESC; ";
 $run_get_sales = mysqli_query($con,$get_sales);
 while($row_get_sales = mysqli_fetch_array($run_get_sales))
 {
	$trans_id = $row_get_sales['id']; 
	$product_id = $row_get_sales['product_id'];
	$cur_date = $row_get_sales['cur_date']; 
	$product_refno = $row_get_sales['product_id']; 
	$product_name = $row_get_sales['product_name']; 
	$description = $row_get_sales['description']; 
	$purchasing_price= $row_get_sales['purchasing_price']; 
	$selling_price= $row_get_sales['selling_price']; 
	//$total_paid = $row_get_sales['total_paid'];
if($description=='Purchase'){
?>
<a href="bm_transaction?trans_id=<?php echo $trans_id ?>" ><div class="sale_output_div" style="color:red;" > 

<!--span class="sub_output_sale"><?php echo $product_refno ?></span-->
<span class="trans_icon_span"><img src="main_icon/out_arrow.png" class="trans_icon" /></span>
<span class="sub_output_sale2" style="color:red;"><?php echo $product_name ?></span>

<span class="sub_output_sale3"><?php echo $purchasing_price ?></span>
<span class="sub_output_sale3"><?php echo $cur_date ?></span>

</div></a>
 <?php  }else if($description=='Sale'){ ?>
 
<a href="bm_transaction?sale_tran_id=<?php echo $trans_id ?>" ><div class="sale_output_div" style="color:green;"> 

<!--span class="sub_output_sale"><?php echo $product_refno ?></span-->
<span class="trans_icon_span"><img src="main_icon/in_arrow.png" class="trans_icon" /></span>
<span class="sub_output_sale2" style="color:green;"><?php echo $product_name ?></span>

<span class="sub_output_sale3"><?php echo $selling_price ?></span>
<span class="sub_output_sale3"><?php echo $cur_date ?></span>

</div></a>
<?php	
 }
 }

}
///purchase///////////////////////////////////////////////////////////////////////////////////cb_userstb////////////////////////////////////
if($status =="disp_wholesale_products")
{ ?>
<div id="main_content_div" class="main_content_div" >
<?php
$purchase_load_count = $_GET['purchase_load_count'];
 $get_wholesale_produ ="select * from bmg_producttb ORDER BY RAND() LIMIT $purchase_load_count";
 $run_get_wholesale_produ = mysqli_query($con,$get_wholesale_produ);
 while($row_get_wholesale_produ = mysqli_fetch_array($run_get_wholesale_produ))
 {
	$product_name = $row_get_wholesale_produ['product_name']; 
	$product_img = $row_get_wholesale_produ['product_img'];
	$product_points = $row_get_wholesale_produ['product_price'];
	$product_id = $row_get_wholesale_produ['id'];
	
?>

<div id="single_ad_div" class="single_ad_div" >
<span class="product_img_span"><img src="product_img/<?php echo $product_img; ?>" class="product_img" /></span>
<span class="product_name" ><?php echo $product_name; ?></span>
<span class="partner_level" >Lv-1</span>
<span class="product_price" >CB <?php echo $product_points; ?></span>
<button id="<?php echo $product_id; ?>" onClick="start_purchase(this.id);" class="product_buy_btn" >Buy</button>
</div>

<?php	 } ?>
</div>

<?php

}

//////purchase/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="start_purchase_check")
{
$product_id = $_GET['product_id'];
 $get_wholesale_produ ="select * from bmg_producttb where id ='$product_id'";
 $run_get_wholesale_produ = mysqli_query($con,$get_wholesale_produ);
 while($row_get_wholesale_produ = mysqli_fetch_array($run_get_wholesale_produ))
 {
	$product_img = $row_get_wholesale_produ['product_img'];
	$product_points = $row_get_wholesale_produ['product_price'];
	$product_points = $row_get_wholesale_produ['product_price'];
	
 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_price_limit = $row_get_product_info['product_price_limit'];	
 
	
?>
<div id="confirm_purchase_div" class="confirm_purchase_div" >
<div class="sub_confirm_purchase_div" > 
<span id="confirm_purchase_title" class="confirm_purchase_title" >You will be charged <?php echo $product_points; ?> points for one</span>
<img src="product_img/<?php echo $product_img; ?>" class="confirm_purch_product_img" />
<span class="confirm_purchase_tips" >Product Max Sell Points is <?php echo $product_price_limit; ?></span>
<input type="number" id="set_selling_price_input" placeholder="Set Selling Price" class="set_selling_price_input" />
<button onClick="cancel_confirm_purchase();" class="cancel_confirm_purch_btn" >Cancel</button>
<button id="<?php echo $product_id; ?>" onClick="save_purchased_product(this.id);" class="yes_confirm_purch_btn" >Confirm</button>
<input id="product_purching_price" value="<?php echo $product_points; ?>" class="help_input" />
<input id="prod_price_limit" value="<?php echo $product_price_limit; ?>" class="help_input" />

</div>
</div>
<?php
 }
 }

}

if($status =="save_purchased_product")
{
$user_id = $_GET['my_id'];
$product_id = $_GET['purchase_product_id'];
$product_purching_price = $_GET['product_purching_price'];
$selling_price_input = $_GET['selling_price_input'];
$prod_price_limit = $_GET['prod_price_limit'];

if($selling_price_input >$prod_price_limit){ ?>  

 <div id="confirm_purchase_tip_div" class="confirm_purchase_tip_div" >
<div id="sub_confirm_purchase_div" class="sub_confirm_purchase_tip_div" > 
<span id="confirm_purchase_title" class="confirm_purchase_tip_title" style="color:red;" >You set the selling points above the limit</span>
<button id="cancel_confirm_purch_btn" onClick="close_confirm_purchase_tip_div();" style="background:red;" class="close_confirm_purchase_tip_btn" >OK</button>
</div>
</div>

 <?php }else{

	$get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
     
    if($product_purching_price > $total_point ){ ?>
 <div id="confirm_purchase_tip_div" class="confirm_purchase_tip_div" >
<div id="sub_confirm_purchase_div" class="sub_confirm_purchase_tip_div" > 
<span id="confirm_purchase_title" class="confirm_purchase_tip_title" style="color:red;" >Insufficient points balance</span>
<button id="cancel_confirm_purch_btn" onClick="close_confirm_purchase_tip_div();" style="background:red;" class="close_confirm_purchase_tip_btn" >OK</button>
</div>
</div>

	<?php }else{
		
 $point_charge = $total_point-$product_purching_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$point_charge' WHERE my_id='$user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
 if($run_update_user_points){	
 
 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];

 $insert_trans_purchase="insert into bm_transactiontb (my_id,product_id,product_name,purchasing_price,description,cur_country,cur_city,ipuser,cur_date,cur_time) 
 values('$user_id','$product_id','$product_name','$product_purching_price','Purchase','$country','$city','$user_ip',CURDATE(),CURTIME()) ";
 $run_insert_trans_purchase = mysqli_query($con,$insert_trans_purchase);
 
 	$get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$main_ptspy = $row_get_main_pointsup['bmg_main_point'];
	
	$cur_main_pts = $main_ptspy+$product_purching_price; 
	$update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$cur_main_pts' ";
    $run_update_main_pts = mysqli_query($con,$update_main_pts);
	}
 
$insert_purch_product ="insert into bmg_partner_producttb(partner_id,product_id,purchasing_price,product_price,purchase_date,purchase_time,cur_country,cur_city,ipuser) 
values('$user_id','$product_id','$product_purching_price','$selling_price_input',CURDATE(),CURTIME(),'$country','$city','$user_ip')";
 $run_insert_purch_product = mysqli_query($con,$insert_purch_product);
 if($run_insert_purch_product){ ?>
<div id="confirm_purchase_tip_div" class="confirm_purchase_tip_div" >
<div id="sub_confirm_purchase_div" class="sub_confirm_purchase_tip_div" > 
<span id="confirm_purchase_title" class="confirm_purchase_tip_title" style="color:green;" >Product Purchased Successfuly</span>
<button id="cancel_confirm_purch_btn" onClick="close_confirm_purchase_tip_div();" style="background:green;" class="close_confirm_purchase_tip_btn" >OK</button>
</div>
</div>
 <?php }else{ ?>
 <div id="confirm_purchase_tip_div" class="confirm_purchase_tip_div" >
<div id="sub_confirm_purchase_div" class="sub_confirm_purchase_tip_div" > 
<span id="confirm_purchase_title" class="confirm_purchase_tip_title" style="color:red;" >Product Purchased Successfuly</span>
<button id="cancel_confirm_purch_btn" onClick="close_confirm_purchase_tip_div();" style="background:red;" class="close_confirm_purchase_tip_btn" >OK</button>
</div>
</div>
 <?php } } } } }
}
}
/////////////purchase////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_total_point")
{
	$user_id = $_GET['my_id'];
	$get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
     echo $total_point; 
    }		
}

////adm_studio///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_perfomance_winer")
{
	//$user_id = $_GET['my_id'];
	$get_perform_winer = "select MAX(tota_points) from performancetb";
	$run_get_perform_winer= mysqli_query($con,$get_perform_winer);
    while($row_get_perform_winer= mysqli_fetch_array($run_get_perform_winer))
	{
    $max_point = $row_get_perform_winer['MAX(tota_points)'];
	if($max_point >5){
echo"@@ $max_point @@";
	$get_user_beta_performer = "select * from performancetb where tota_points='$max_point' ";
	$run_get_user_beta_performer= mysqli_query($con,$get_user_beta_performer);
    while($row_get_user_beta_performer= mysqli_fetch_array($run_get_user_beta_performer))
	{
	
	$id_userBeta_performer = $row_get_user_beta_performer['my_id'];
echo"mm $id_userBeta_performer mm";
	
		$get_user_product = "select * from bmg_partner_producttb where partner_id='$id_userBeta_performer' LIMIT 1 ";
	$run_get_user_product= mysqli_query($con,$get_user_product);
    while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
	{
	 $bmg_partner_producttb_id = $row_get_user_product['id'];
	 $bmg_partner_user_id = $row_get_user_product['partner_id'];
	 $product_id = $row_get_user_product['product_id'];
	  $product_selling_price = $row_get_user_product['product_price'];
	echo"*- $bmg_partner_producttb_id *";
 echo $bmg_partner_user_id;
 

 $delete_user_product ="DELETE FROM bmg_partner_producttb WHERE id='$bmg_partner_producttb_id' ";
 $run_delete_user_product = mysqli_query($con,$delete_user_product);  
 
 if($run_delete_user_product){

 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];	 
	 

 $insert_trans_sale="insert into bm_transactiontb (my_id,product_id,product_name,product_price_points,description,cur_country,cur_city,ipuser,bmg_partner_producttb_id,cur_date,cur_time) 
 values('$id_userBeta_performer','$product_id','$product_name','$product_selling_price','Sale','$country','$city','$user_ip','$bmg_partner_producttb_id',CURDATE(),CURTIME()) ";
 $run_insert_trans_sale = mysqli_query($con,$insert_trans_sale);
 if($run_insert_trans_sale){

 	$get_point = "select * from bm_point_bank where my_id='$bmg_partner_user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];

  $new_point_amt = $total_point+$product_selling_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$bmg_partner_user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
 echo"##";  echo $bmg_partner_user_id;
 echo"8";
	}
 }
 }
 }

 $update_user_performance ="UPDATE performancetb SET ad_view = '0',reward_ad_view='0',set_price='0',check_in='0',tota_points='0',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$id_userBeta_performer' ";
 $run_update_user_product = mysqli_query($con,$update_user_performance);
	 
	}   }	
}
}
}

////////bm_market////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_user_products")
{ ?>
<div class="main_content_div" >
<?php
    $user_id = $_GET['my_id'];
	$get_user_product = "select * from bmg_partner_producttb where partner_id='$user_id' ";
	$run_get_user_product= mysqli_query($con,$get_user_product);
	$check_user_product = mysqli_num_rows($run_get_user_product);
	
	if($check_user_product <1){ ?> 
	<div class="user_no_product_tip" >You do not have products to sell, Go to Wholesale page to buy some products</div>
	<a href="purchase" class="wholesale_btn">Wholesale</a>
	<?php }else{
    while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
	{
	 $product_id = $row_get_user_product['product_id'];
	 $product_price = $row_get_user_product['product_price'];
     $refno_id = $row_get_user_product['id'];
   $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];
	 $product_img = $row_get_product_info['product_img'];
  
	 ?>
<div class="single_ad_div" >
<img src="main_icon/more_option.png" id="<?php echo $refno_id; ?>" onClick="show_more_option_area(this.id);" class="more_option_btn" />
<div id="more_option_div<?php echo $refno_id; ?>" class="more_option_div" >
<button id="<?php echo $refno_id; ?>" onClick="show_price_edit_area(this.id);" class="more_action_btn" >Edit Price</button>
<button id="<?php echo $refno_id; ?>"  class="more_action_btn" onClick="delete_user_main_product(this.id)" >Delete</button>
<button id="<?php echo $refno_id; ?>" onClick="close_more_option_area(this.id);" class="close_more_option_btn" >x</button>
</div>
<span class="product_img_span">
<img src="product_img/<?php echo $product_img; ?> " class="product_img" />
</span>
<span class="product_name" ><?php echo $product_name; ?></span>
<span class="product_price" >CB <?php echo $product_price; ?></span>
<button class="product_buy_btn" >Sell</button>

</div>



	<?php } } ?>
</div>

<?php	
}
}
///bm_market///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="update_product_price")
{ 
 $user_id = $_GET['my_id'];
 $refno_id = $_GET['refno_id'];
 $price_edit_input = $_GET['price_edit_input'];
 $update_user_product_price ="UPDATE bmg_partner_producttb SET product_price='$price_edit_input' WHERE partner_id='$user_id' AND id='$refno_id' ";
 $run_update_user_product_price = mysqli_query($con,$update_user_product_price);
 
}

///bm_market///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="delete_user_main_product")
{ 
 $user_id = $_GET['my_id'];
 $refno_id = $_GET['refno_id'];
 
$get_user_product = "select * from bmg_partner_producttb where partner_id='$user_id' AND id='$refno_id' ";
$run_get_user_product= mysqli_query($con,$get_user_product);
while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
{
  $purchasing_price = $row_get_user_product['purchasing_price'];
 
 
  	$get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];

  $new_point_amt = $total_point+$purchasing_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
 if($run_update_user_points){

 $delete_user_product ="DELETE FROM bmg_partner_producttb WHERE partner_id='$user_id' AND id='$refno_id' ";
 $run_delete_user_product = mysqli_query($con,$delete_user_product);
 }
}
}
}

//////bm_transaction//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_purch_no")
{ 
 $user_id = $_GET['my_id'];
 $trans_id = $_GET['trans_id'];
 $get_sales ="select * from bm_transactiontb where id='$trans_id' AND my_id='$user_id'";
 $run_get_sales = mysqli_query($con,$get_sales);
 while($row_get_sales = mysqli_fetch_array($run_get_sales))
 {
	$sale_id = $row_get_sales['id']; 
	$cur_date = $row_get_sales['cur_date']; 
	$product_refno = $row_get_sales['product_id']; 
	$product_name = $row_get_sales['product_name']; 
	$description = $row_get_sales['description']; 
	$purchase_price= $row_get_sales['purchasing_price'];
	
	$get_product_info ="select * from bmg_producttb where id ='$product_refno'";
    $run_get_product_info = mysqli_query($con,$get_product_info);
    while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	$product_img = $row_get_product_info['product_img'];	
?>
<div class="single_trans_detail_div" >
<span class="detail_product_img_span" ><img src="product_img/<?php echo $product_img; ?>" class="product_img" /></span>
<span class="detail_product_name" ><?php echo $product_name; ?></span>
<span class="detail_product_price" ><?php echo $purchase_price; ?> Points</span>
<span class="detail_product_name" ><?php echo $description; ?></span>
<span class="detail_product_price" >Tran no.<?php echo $sale_id; ?></span>
<span class="detail_product_name" >Product no. <?php echo $product_refno; ?></span>
</div>
<?php
 }
 }
}
//////bm_transaction//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_trans_deatail_sale")
{ 
 $user_id = $_GET['my_id'];
 $sale_tran_id = $_GET['sale_tran_id'];
 $get_sales ="select * from bm_transactiontb where id='$sale_tran_id' AND my_id='$user_id'";
 $run_get_sales = mysqli_query($con,$get_sales);
 while($row_get_sales = mysqli_fetch_array($run_get_sales))
 {
	$sale_id = $row_get_sales['id']; 
	$cur_date = $row_get_sales['cur_date']; 
	$product_refno = $row_get_sales['product_id']; 
	$product_name = $row_get_sales['product_name']; 
	$description = $row_get_sales['description']; 
	$selling_price= $row_get_sales['selling_price'];
	
	$get_product_info ="select * from bmg_producttb where id ='$product_refno'";
    $run_get_product_info = mysqli_query($con,$get_product_info);
    while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	$product_img = $row_get_product_info['product_img'];	
?>
<div class="single_trans_detail_div" >
<span class="detail_product_img_span" ><img src="product_img/<?php echo $product_img; ?>" class="product_img" /></span>
<span class="detail_product_name" ><?php echo $product_name; ?></span>
<span class="detail_product_price" ><?php echo $selling_price; ?> Points</span>
<span class="detail_product_name" ><?php echo $description; ?></span>
<span class="detail_product_price" >Tran no.<?php echo $sale_id; ?></span>
<span class="detail_product_name" >Product no. <?php echo $product_refno; ?></span>
</div>
<?php
 }
 }
}











/////////////earn///////////////////////////////////////////////////////  

if($status =="disp_pro_usr")
{
	
 $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	  $get_user = "select * from cb_userstb where my_id='$my_id' ";
	
	$run_get_user = mysqli_query($con,$get_user);
	$check_user = mysqli_num_rows($run_get_user);	
    while($row_get_user = mysqli_fetch_array($run_get_user))
	{
		$usrname = $row_get_user['lname'];
		echo $usrname;
	
	}
	
	
}
}
////earn//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_user_point_gm1")
{
	$user_id = $_GET['my_id'];
	
	$get_user_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_user_point= mysqli_query($con,$get_user_point);
    while($row_get_user_point= mysqli_fetch_array($run_get_user_point))
	{
	 $user_point_amt = $row_get_user_point['point_amount'];
     echo $user_point_amt; 
    }
}
//////earn/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="disp_game")
{
  //$incoming_search = $_GET['incoming_search'];
  $get_game ="select * from gametb order by rand() limit 1";
  $run_get_game = mysqli_query($con,$get_game);
  while($row_get_game = mysqli_fetch_array($run_get_game))
  {
	$cur_g_id = $row_get_game['id'];
	$g_icon1 = $row_get_game['g_icon1'];
	$g_icon2 = $row_get_game['g_icon2'];
	$g_icon3 = $row_get_game['g_icon3'];
	$g_icon4 = $row_get_game['g_icon4'];
	$g_icon_correct = $row_get_game['g_corredt_icon'];
	
	?>
	
<div class="game_div" >

<input id="cur_game_id" class="help_game_valve" value="<?php echo $cur_g_id ?>" />
<input id="cur_reward" class="help_game_valve" value="" />
<span  class="sub_game_top" >
<span id="corrent_g_icon" class="sub_game_top_span" ><img src="main_icon/<?php echo $g_icon_correct ?>" class="game_icon_img_top"  ></span>
<span id="game_icon_img_top" class="help_game_valve" ><?php echo $g_icon_correct ?></span><span id="gm_timer" class="second_acc" >5</span>
</span>

<span class="game_tip" >Select the image that matches the one above</span>

<span id="sub_game_bottom" class="sub_game_bottom" >

<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon1 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon1 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value1" class="help_game_valve" >441</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon2 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon2 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value2" class="help_game_valve" >442</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon3 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon3 ?>" class="game_icon_img_bottom"  >
<span idk="game_icon_img_bottom_value3" class="help_game_valve" >443</span>
</span>
<span onClick="compare_valvegame(this.id);" id="<?php echo $g_icon4 ?>" class="sub_game_bottom_span" >
<img src="main_icon/<?php echo $g_icon4 ?>" class="game_icon_img_bottom"  >
<span id="game_icon_img_bottom_value4" class="help_game_valve" >444</span>
</span>

</span>

</div>
<button id="try_agin_btn" onClick="disp_game()" class="game_claim_btn" >Try Again</button>	
	<?php
	
	
	
  }
}
//earn/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="gameplay_chanes_count")
{
  $my_id = $_GET['my_id'];
  $get_gplay_chance ="select * from game_playchancetb where user_id='$my_id'";
  $run_get_gplay_chance= mysqli_query($con,$get_gplay_chance);
  $check_run_get_gplay_chance = mysqli_num_rows($run_get_gplay_chance);
  if($check_run_get_gplay_chance <1){
	  $insert_user_gp_chance ="insert into game_playchancetb (user_id,chances_count,cur_day,cur_month,cur_year,cur_time)
	  values('$my_id','0','$curr_day','$curr_month','$curr_year',CURTIME())";
	  $run_insert_user_gp_chance = mysqli_query($con,$insert_user_gp_chance);
  }
  while($row_get_gplay_chance = mysqli_fetch_array($run_get_gplay_chance))
  {
   $chances_count = $row_get_gplay_chance['chances_count'];
   $curr_day = $row_get_gplay_chance['cur_day'];
   $curr_month = $row_get_gplay_chance['cur_month'];
   $curr_year = $row_get_gplay_chance['cur_year'];
   $chane_count_date = $curr_day.'-'.$curr_month.'-'.$curr_year
   ?>
  <span id="game_chance_date"><?php echo $chane_count_date; ?></span> 
  <span id="game_chance"><?php echo $chances_count; ?></span> 
   <?php
  }
}
//earn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_greward_game")
{
  $my_id = $_GET['my_id'];
  $cur_game_chance = $_GET['cur_game_chance'];
  $cur_reward = $_GET['cur_reward'];
  if($cur_reward =='K'){ $final_greward = $game1RWD;
  
  
  	$get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$amt_maincoin = $row_get_main_pointsup['bmg_main_point'];
	

  

   $new_coinamount = $amt_maincoin - $final_greward;
   
   if($amt_maincoin < $game1RWD){ ?> <span style="color:red;"><?php echo"Coin still  minting come back later";?></span> <?php }else{
   
  // if($final_greward > $new_coinamount){echo"nyoo";}else{
	  
	$update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$new_coinamount' ";
    $run_update_main_pts = mysqli_query($con,$update_main_pts);
   
if($run_update_main_pts){
  
 /* $get_game_acc ="select * from gamebanktb where user_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	$my_acc = $row_get_game_acc['accountNo'];
	$acc_amount = $row_get_game_acc['acc_amount'];
	
	$final_reward_coin = $acc_amount + $final_greward;*/
	
  // $update_gbank ="UPDATE gamebanktb SET acc_amount='$final_reward_coin' where user_id='$my_id' ";disp_user_point
  // $run_update_gbank = mysqli_query($con,$update_gbank);
   
   //if($run_update_gbank){
	   
  // $ugx_amt =$final_greward *$cb_exchange_px;
  
   	$get_point = "select * from bm_point_bank where my_id='$my_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
	 $phone_number = $row_get_point['accountNo'];
  
  $insert_at_withdraw="insert into withdraw_transtb (user_id,toAccount,points_amt,exchange_price,description,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$phone_number','$game1RWD','$exchange_rate','Game1 reward','Success','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_at_withdraw = mysqli_query($con,$insert_at_withdraw);
  if($run_insert_at_withdraw){
	  
	  
	  $new_point_amt = $total_point+$game1RWD; 
		 
	 $update_gbank ="UPDATE bm_point_bank SET point_amount='$new_point_amt' where my_id='$my_id' ";
     $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){
  
	  
    $update_game_life ="UPDATE game_playchancetb SET chances_count='$cur_game_chance',cur_day='$curr_day',cur_month='$curr_month',cur_year='$curr_year',cur_time=CURTIME() where user_id='$my_id' ";
   $run_update_game_life = mysqli_query($con,$update_game_life);
  ?> <span style="color:green;"><?php echo"Your reward has been added ";?></span> <?php 
  //}
  }
  }
}
}
}
}
}
}

///earn_control/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_pend_trans")
{
  $my_id = $_GET['my_id'];
  
  $get_trans_history ="select * from withdraw_transtb where trans_status='Pending' ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $trans_ref = $row_get_trans_history['id'];
   $toAccount = $row_get_trans_history['toAccount'];
   $receivingName = $row_get_trans_history['receivingName'];
   $description = $row_get_trans_history['description'];
   $trans_status = $row_get_trans_history['trans_status'];
   $amt_maincoin = $row_get_trans_history['points_amt'];
   $amt_ugx = $row_get_trans_history['amount_ugx'];
   $cur_day = $row_get_trans_history['cur_day'];
   $cur_month = $row_get_trans_history['cur_month'];
   $cur_year = $row_get_trans_history['cur_year'];
   $cur_time = $row_get_trans_history['cur_time'];
   
   if($trans_status=='Pending'){
  ?>
  
<span id="<?php echo $trans_ref ?>" ondblClick="show_trans_confirm_div(this.id);" class="trans_history_output_span" style="backgroundk:#f990ec;" >
<span class="transaction_output" style="width:15%;background:#f990ec;"><?php echo $toAccount ?></span>
<span class="transaction_output" style="width:15%;background:#f990ec;"><?php echo $receivingName ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $description ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $amt_maincoin ?>.000</span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $amt_ugx ?> </span>
<span class="transaction_output" style="width:15%;color:#930646;background:#f990ec;"><?php echo $trans_status ?></span>
<span class="transaction_output" style="width:20%;background:#f990ec;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
<input id="mobile_noto" value="<?php echo $toAccount ?>" style="display:none;" >
</span>
  
  <?php
   }
  } 
}
///earn_control/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_trans_confirm")
{
  $my_id = $_GET['my_id'];
  $confirm_network_ref = $_GET['confirm_network_ref'];
  $pending_trans_ref_no = $_GET['pending_trans_ref_no'];
  
   $get_trans_pend="select * from withdraw_transtb where id='$pending_trans_ref_no' ";
   $run_get_trans_pend= mysqli_query($con,$get_trans_pend);
   while($row_get_trans_pend= mysqli_fetch_array($run_get_trans_pend))
   {
   $amt_maincoin = $row_get_trans_pend['points_amt']; 
   
   
   $get_game_acc ="select * from bm_point_bank where my_id='$my_id'";
  $run_get_game_acc = mysqli_query($con,$get_game_acc);
  while($row_get_game_acc = mysqli_fetch_array($run_get_game_acc))
  {
	$my_acc = $row_get_game_acc['accountNo'];


   
   
	   
	   $update_game_transtb = "UPDATE withdraw_transtb SET toAccount='$my_acc',trans_status='Success',trans_code='$confirm_network_ref' where id='$pending_trans_ref_no' ";
	   $run_update_game_transtb = mysqli_query($con,$update_game_transtb);
	   if($run_update_game_transtb){
		   
		   

  $get_sale_point ="select * from bmg_pointsuplytb";
  $run_get_sale_point = mysqli_query($con,$get_sale_point);
  while($row_get_sale_point = mysqli_fetch_array($run_get_sale_point))
  {
   $alredy_sold_pts = $row_get_sale_point['points_sold_back'];
   
   $final_points_sold_back = $alredy_sold_pts + $amt_maincoin;
		   
   $update_sold_points="UPDATE bmg_pointsuplytb SET points_sold_back='$final_points_sold_back'";
   $run_update_sold_points= mysqli_query($con,$update_sold_points);

if($run_update_sold_points){echo"Transaction was successful";}else{echo"Something went wrong astb";}   
		   
		   
  }  
		   
     
 }else{echo"Something went wrong lst";}
	   
  }
}

}



///bm_widthdraw////////////////////////////////////////////////////////////////////////////////////insert_withdraw_amt//////////////////////////////////////

if($status =="airtime_topup")
{
	$my_id = $_GET['my_id'];
	$points_amt = $_GET['at_amt'];
	
	
	
 	$get_point = "select * from bm_point_bank where my_id='$my_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
	 $accountNo = $row_get_point['accountNo'];
	 	 if($accountNo==""){ ?> 

<span id="topup_erorr" class="failed_erorr" style='color:#2275d8;' >Add Your Phone Number </span> 
<input id="add_phone_no" class="failed_erorr" placeholder="755000000" maxlength='9' />
	 <button onClick="add_phone_no();" class="shell_ok_btn" style='background:#2275d8;' >Add</button>
	 <button onClick="close_confirm_shell();" class="shell_ok_btn" >OK</button> 
	 
	 <?php }else{
	 
	 if($points_amt > $total_point){ ?>

	 <span id="topup_erorr" class="failed_erorr" >You do not have engouh points </span> 
	 <button onClick="close_confirm_shell();" class="shell_ok_btn" >OK</button> 
	
	 
	 <?php }else{ ?>
	 
	<span id="topup_erorr" class="failed_erorr" style="color:#f07d09;" >You will be charged <?php echo $points_amt; ?> points  </span> 
	 <button onClick="close_confirm_shell();" class="confirm_btn" >No</button> 
 <button id="<?php echo $points_amt; ?>" onClick="confirm_airtime_topup(this.id);" class="confirm_btn" style="background:green;" >Yes</button> 	 
	 
	 <?php
		 
		
		/*$new_point_amt = $total_point-$points_amt; 
		$amount_ugx = $points_amt*$exchange_price;
		 
	 $update_gbank ="UPDATE bm_point_bank SET point_amount='$new_point_amt' where my_id='$my_id' ";
     $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){
		  
  $insert_at_withdraw="insert into withdraw_transtb (user_id,toAccount,points_amt,exchange_price,amount_ugx,description,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$phone_number','$points_amt','$exchange_price','$amount_ugx','Airtime Topup','Pending','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_at_withdraw = mysqli_query($con,$insert_at_withdraw);
  if($run_insert_at_withdraw){	echo $phone_number; }else{echo"Something went wrong";} 
		  

	 }*/
	}
	 }
}
}

////bm_widthdraw///////////////////////////////////////////////////////////////////////////////////insert_withdraw_amt//////////////////////////////////////

if($status =="confirm_airtime_topup")
{
	$my_id = $_GET['my_id'];
	$points_amt = $_GET['points_towidthdraw'];
	$exchange_price = $_GET['exchange_rate'];

 	$get_point = "select * from bm_point_bank where my_id='$my_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
	 $phone_number = $row_get_point['accountNo'];
	 
	 if($points_amt > $total_point){ ?>

	 <span id="topup_erorr" class="failed_erorr" >You do not have engouh points </span> 
	 <button onClick="close_confirm_shell();" class="shell_ok_btn" >OK</button> 
	
	 
	 <?php }else{ ?>
	 
	<span id="help_erorr" class="failed_erorr" style="color:#f07d09;" >You will be charged <?php echo $points_amt; ?> points  </span> 
	 <button id="help_erorr2" onClick="close_confirm_shell();" class="confirm_btn" >No</button> 
 <button id="help_erorr3" id="<?php echo $points_amt; ?>" onClick="confirm_airtime_topup(this.id);" class="confirm_btn" style="background:green;" >Yes</button> 	 
	 
	 <?php
		 
		
		$new_point_amt = $total_point-$points_amt; 
		$amount_ugx = $points_amt*$exchange_price;
		 
	 $update_gbank ="UPDATE bm_point_bank SET point_amount='$new_point_amt' where my_id='$my_id' ";
     $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){
		  
  $insert_at_withdraw="insert into withdraw_transtb (user_id,toAccount,points_amt,exchange_price,amount_ugx,description,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$phone_number','$points_amt','$exchange_price','$amount_ugx','Airtime Topup','Pending','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_at_withdraw = mysqli_query($con,$insert_at_withdraw);
  if($run_insert_at_withdraw){ ?>


  <span id="topup_erorr" class="failed_erorr" style="color:#f07d09;" >Transaction was successful, confirmation with in 24 hours</span> 
 <button onClick="close_confirm_shell();" class="shell_ok_btn" >OK</button> 

 <?php  }else{echo"Something went wrong";} 
		  

	 }
	}

}
}

////bm_widthdraw/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if($status =="add_phone_no")
{
	$my_id = $_GET['my_id'];
	$phoneNo = $_GET['phoneNo'];
		 $update_gbank ="UPDATE bm_point_bank SET accountNo='$phoneNo' where my_id='$my_id' ";
     $run_update_gbank = mysqli_query($con,$update_gbank);
      if($run_update_gbank){ ?> 
	    <span id="topup_erorr" class="failed_erorr" style="color:#f07d09;" >Phone number added successfully</span> 
 <button onClick="close_confirm_shell();" class="shell_ok_btn" >OK</button> 
	  <?php }else{echo"Something went wrong";} 




}

////earn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_trans_bm_withdraw")
{
  $my_id = $_GET['my_id'];
  
  $get_trans_history ="select * from withdraw_transtb where user_id='$my_id' ORDER BY id DESC ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $toAccount = $row_get_trans_history['toAccount'];
   $description = $row_get_trans_history['description'];
   $trans_status = $row_get_trans_history['trans_status'];
   $points_amt = $row_get_trans_history['points_amt'];
   $amount_ugx = $row_get_trans_history['amount_ugx'];
   $transCharge = $row_get_trans_history['transCharge'];
   $cur_day = $row_get_trans_history['cur_day'];
   $cur_month = $row_get_trans_history['cur_month'];
   $cur_year = $row_get_trans_history['cur_year'];
   $cur_time = $row_get_trans_history['cur_time'];
   
   if($trans_status=='Pending'){
  ?>
  
<span class="trans_history_output_span" style="backgroundk:#f990ec;" >
<span class="transaction_output" style="width:15%;background:#f990ec;"><?php echo $toAccount ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $description ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $points_amt ?></span>
<span class="transaction_output" style="width:15%;color:#930646;background:#f990ec;"><?php echo $trans_status ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $amount_ugx ?></span>
<span class="transaction_output" style="background:#f990ec;"><?php echo $transCharge ?></span>
<span class="transaction_output" style="width:20%;background:#f990ec;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
</span>
  
  <?php
   }else{   ?>   

<span class="trans_history_output_span" >
<span class="transaction_output" style="width:15%;"><?php echo $toAccount ?></span>
<span class="transaction_output"><?php echo $description ?></span>
<span class="transaction_output"><?php echo $points_amt ?></span>
<span class="transaction_output" style="width:15%;color:green;"><?php echo $trans_status ?></span>
<span class="transaction_output"><?php echo $amount_ugx ?> </span>
<span class="transaction_output"><?php echo $transCharge ?></span>
<span class="transaction_output" style="width:20%;"><?php echo"$cur_day-$cur_month-$cur_year / $cur_time"; ?></span>
</span>
   <?php }
  } 
}




////kvt_adpage///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="sale_boost_tym")
{
  $my_id = $_GET['my_id'];
  $get_user_sale_bost = "select * from sale_boosttb where my_id='$my_id'";
  $run_get_user_sale_bost = mysqli_query($con,$get_user_sale_bost);
  $check_user_sale_bost = mysqli_num_rows($run_get_user_sale_bost);
  if($check_user_sale_bost <1){
	 
	  $insert_user_sale_boost ="insert into sale_boosttb (my_id,sale_date,sale_time,cur_country,cur_city,ipuser) values('$my_id',CURDATE(),CURTIME(),'$country','$city','$user_ip' )";
	  $run_insert_user_sale_boost = mysqli_query($con,$insert_user_sale_boost);
  }else{  
	 $update_user_sale_bost="UPDATE sale_boosttb SET sale_date=CURDATE(),sale_time=CURTIME(),cur_country='$country',cur_city='$city',ipuser='$user_ip' where my_id='$my_id' ";
     $run_update_user_sale_bost = mysqli_query($con,$update_user_sale_bost);
  }
///////////////////////////////////////////////////////////// 

	
	$get_user_product = "select * from bmg_partner_producttb where partner_id='$my_id' LIMIT 1 ";
	$run_get_user_product= mysqli_query($con,$get_user_product);
    while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
	{
	 $bmg_partner_producttb_id = $row_get_user_product['id'];
	 $bmg_partner_user_id = $row_get_user_product['partner_id'];
	 $product_id = $row_get_user_product['product_id'];
	  $product_selling_price = $row_get_user_product['product_price'];

 $delete_user_product ="DELETE FROM bmg_partner_producttb WHERE id='$bmg_partner_producttb_id' ";
 $run_delete_user_product = mysqli_query($con,$delete_user_product);  
 
 if($run_delete_user_product){

 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];	 
	 

 $insert_trans_sale="insert into bm_transactiontb (my_id,product_id,product_name,selling_price,description,cur_country,cur_city,ipuser,bmg_partner_producttb_id,cur_date,cur_time) 
 values('$my_id','$product_id','$product_name','$product_selling_price','Sale','$country','$city','$user_ip','$bmg_partner_producttb_id',CURDATE(),CURTIME()) ";
 $run_insert_trans_sale = mysqli_query($con,$insert_trans_sale);
 if($run_insert_trans_sale){
	 
	 $get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$main_ptspy = $row_get_main_pointsup['bmg_main_point'];
	
	$cur_main_pts = $main_ptspy-$product_selling_price; 
	$update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$cur_main_pts' ";
    $run_update_main_pts = mysqli_query($con,$update_main_pts);
	if($run_update_main_pts){

 	$get_point = "select * from bm_point_bank where my_id='$bmg_partner_user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];

  $new_point_amt = $total_point+$product_selling_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$bmg_partner_user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
	}
	}
 }
 }

 }
 }
 }
////sale for the referer//////////////////////////

  $get_trans_history ="select * from withdraw_transtb where referred_id='$my_id' ";
  $run_get_trans_history = mysqli_query($con,$get_trans_history);
  $check_referer = mysqli_num_rows($run_get_trans_history);
  if($check_referer >0){
  while($row_get_trans_history = mysqli_fetch_array($run_get_trans_history))
  {
   $who_refered_id = $row_get_trans_history['user_id'];
   
   	$get_user_product = "select * from bmg_partner_producttb where partner_id='$who_refered_id' LIMIT 1 ";
	$run_get_user_product= mysqli_query($con,$get_user_product);
    while($row_get_user_product= mysqli_fetch_array($run_get_user_product))
	{
	 $bmg_partner_producttb_id = $row_get_user_product['id'];
	 $bmg_partner_user_id = $row_get_user_product['partner_id'];
	 $product_id = $row_get_user_product['product_id'];
	  $product_selling_price = $row_get_user_product['product_price'];

 $delete_user_product ="DELETE FROM bmg_partner_producttb WHERE id='$bmg_partner_producttb_id' ";
 $run_delete_user_product = mysqli_query($con,$delete_user_product);  
 
 if($run_delete_user_product){

 $get_product_info ="select * from bmg_producttb where id ='$product_id'";
 $run_get_product_info = mysqli_query($con,$get_product_info);
 while($row_get_product_info = mysqli_fetch_array($run_get_product_info)){
	 $product_name = $row_get_product_info['product_name'];	 
	 

 $insert_trans_sale="insert into bm_transactiontb (my_id,product_id,product_name,selling_price,description,cur_country,cur_city,ipuser,bmg_partner_producttb_id,cur_date,cur_time) 
 values('$who_refered_id','$product_id','$product_name','$product_selling_price','Sale','$country','$city','$user_ip','$bmg_partner_producttb_id',CURDATE(),CURTIME()) ";
 $run_insert_trans_sale = mysqli_query($con,$insert_trans_sale);
 if($run_insert_trans_sale){
	 
	 $get_main_pointsup = "select * from bmg_pointsuplytb";
	$run_get_main_pointsup = mysqli_query($con,$get_main_pointsup);
	while($row_get_main_pointsup = mysqli_fetch_array($run_get_main_pointsup)){
	$main_ptspy = $row_get_main_pointsup['bmg_main_point'];
	
	$cur_main_pts = $main_ptspy-$product_selling_price; 
	$update_main_pts ="UPDATE bmg_pointsuplytb SET bmg_main_point = '$cur_main_pts' ";
    $run_update_main_pts = mysqli_query($con,$update_main_pts);
	if($run_update_main_pts){

 	$get_point = "select * from bm_point_bank where my_id='$who_refered_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];

  $new_point_amt = $total_point+$product_selling_price; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$who_refered_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);
	}
	}
 }
 }

 }
 }
 }
  }
  }

//////////////////////////////////////////////////////////////



	

}

////bm_member///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_bm_memeber_list")
{
	 $get_point = "select * from bm_point_bank ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $my_id = $row_get_point['my_id'];
	 $point_amount = $row_get_point['point_amount'];
	 $cur_date = $row_get_point['cur_date'];
	 
	  $con = mysqli_connect('localhost','root','2019khalaf','cranebule_userdb');
 if(! $con){echo"You have not connected to the database.";}
 else{
	  $get_user = "select * from cb_userstb where my_id='$my_id' ";
	
	$run_get_user = mysqli_query($con,$get_user);
	$check_user = mysqli_num_rows($run_get_user);	
    while($row_get_user = mysqli_fetch_array($run_get_user))
	{
		$usrname = $row_get_user['lname'];

	
	//}
	
	
//}
	 
	 
	 ?>
<div class="sale_output_div">
<span class="sub_output_sale2"><?php echo $usrname; ?></span>
<span class="sub_output_sale3"><?php echo $point_amount; ?></span>
<span class="sub_output_sale3"><?php echo $cur_date; ?></span>
</div>	 
	 
	 <?php
} }
	}
}


////bm_widthraw///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="disp_available_cur_point")
{
		$user_id = $_GET['my_id'];
	 $get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $point_amount = $row_get_point['point_amount'];
	 echo $point_amount ;
	 ?>
	 <input id="cur_avb_coin" value="<?php echo $point_amount ?> " class="help_input" />
	 <?php
	 
	}
}


////insert_bm_withdraw_amt///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="insert_bm_withdraw_amt")
{
	$user_id = $_GET['my_id'];
	$withdrawal_amt_coin = $_GET['withdrawal_amt_coin'];
	$recev_acc = $_GET['recev_acc'];
	$recev_acc_name = $_GET['recev_acc_name'];
	$exchange_rate = $_GET['exchange_rate'];
	
	
		 $get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $point_amount = $row_get_point['point_amount'];
	 
	 if($point_amount < $withdrawal_amt_coin){echo"You do not have engouh points";}else{

	 $final_wiz_amt = $point_amount-$withdrawal_amt_coin;
	 $amount_ugx = $withdrawal_amt_coin * $exchange_rate;
	 	
  $update_user_points ="UPDATE bm_point_bank SET point_amount = '$final_wiz_amt' WHERE my_id='$user_id' ";
  $run_update_user_points = mysqli_query($con,$update_user_points);
  if($run_update_user_points){
	  
  $insert_at_withdraw="insert into withdraw_transtb (user_id,toAccount,receivingName,points_amt,exchange_price,amount_ugx,description,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
  values('$my_id','$recev_acc','$recev_acc_name','$withdrawal_amt_coin','$exchange_rate','$amount_ugx','M Money','Pending','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
  $run_insert_at_withdraw = mysqli_query($con,$insert_at_withdraw);
  if($run_insert_at_withdraw){ echo"Transaction was successful, confirmation with in 24 hours";}
  }

	
	
	 }
	}
}

////index///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if($status =="get_gift_points")
{
	$user_id = $_GET['my_id'];
	$gift_points = $_GET['gift_points'];
	
	$user_id = $_GET['my_id'];
	$get_user_gift = "select * from performancetb where my_id='$user_id' AND gift_view='1' ";
	$run_get_user_gift= mysqli_query($con,$get_user_gift);
	$check_get_user_gift = mysqli_num_rows($run_get_user_gift);
	if($check_get_user_gift >0){
		
	$get_point = "select * from bm_point_bank where my_id='$user_id' ";
	$run_get_point= mysqli_query($con,$get_point);
    while($row_get_point= mysqli_fetch_array($run_get_point))
	{
	 $total_point = $row_get_point['point_amount'];
	 $accountNo = $row_get_point['accountNo'];
	 
	 $update_user_performance2 ="UPDATE performancetb SET gift_view='0',cur_country='$country',cur_city='$city',ipuser='$user_ip',cur_date=CURDATE(),cur_time=CURTIME() WHERE my_id='$user_id' ";
     $run_update_user_product = mysqli_query($con,$update_user_performance2);
	 if($run_update_user_product){
    $amount_ugx = $gift_points * $exchange_rate;
	
	$insert_gift_points="insert into withdraw_transtb (user_id,toAccount,points_amt,exchange_price,amount_ugx,description,trans_status,cur_country,cur_city,ipuser,cur_day,cur_month,cur_year,cur_time)
    values('$user_id','$accountNo','$gift_points','$exchange_rate','$amount_ugx','Coblaa Gift','Success','$country','$city','$user_ip','$curr_day','$curr_month','$curr_year',CURTIME() )";
    $run_insert_gift_points = mysqli_query($con,$insert_gift_points);
 if($run_insert_gift_points){
  $new_point_amt = $total_point+$gift_points; 	
 $update_user_points ="UPDATE bm_point_bank SET point_amount = '$new_point_amt' WHERE my_id='$user_id' ";
 $run_update_user_points = mysqli_query($con,$update_user_points);	
 if($run_update_user_points){ ?> <input id="gift_insert_done" value="1" class="help_input" /> <?php }
		
 }	
	}
	
}

	}


}








?>  



Youez - 2016 - github.com/yon3zu
LinuXploit