Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiMGF2 authored Aug 18, 2023
1 parent edfc72a commit 4f409cf
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,15 +1218,10 @@ function StatusPayment($paymentid){
$stmt->bind_param("ss", $step, $from_id);
$stmt->execute();
}
elseif ($user['step'] == "payment" && $datain == "confirmandgetservice" || $datain == "confirmandgetserviceDiscount"){
$info_product = mysqli_fetch_assoc(mysqli_query($connect, "SELECT * FROM product WHERE name_product = '{$user['Processing_value_one']}' AND (Location = '$Processing_value' or Location = '/all') LIMIT 1"));
elseif ($user['step'] == "payment" && $datain == "confirmandgetservice"){
$info_product = mysqli_fetch_assoc(mysqli_query($connect, "SELECT * FROM product WHERE code_product = '{$user['Processing_value_one']}' AND (Location = '$Processing_value' or Location = '/all') LIMIT 1"));
if (empty($info_product['price_product']) || empty($info_product['price_product'])) return;
if($datain == "confirmandgetserviceDiscount"){
$priceproduct = $user['Processing_value_four'];
}
else{
$priceproduct = $info_product['price_product'];
}
if ($priceproduct > $user['Balance']) {
$Balance_prim = $info_product['price_product'] - $user['Balance'];
$stmt = $connect->prepare("UPDATE user SET Processing_value = ? WHERE id = ?");
Expand Down Expand Up @@ -1354,12 +1349,7 @@ function StatusPayment($paymentid){
sendmessage($from_id, $textcreatuser, $Shoppinginfo, 'HTML');
sendmessage($from_id, $textbotlang['users']['selectoption'], $keyboard, 'HTML');
}
if($datain == "confirmandgetserviceDiscount"){
$priceproduct = $user['Processing_value_four'];
}
else{
$priceproduct = $info_product['price_product'];
}
$stmt = $connect->prepare("UPDATE user SET Balance = ? WHERE id = ?");
$Balance_prim = $user['Balance'] - $priceproduct;
$stmt->bind_param("ss", $Balance_prim, $from_id);
Expand Down

0 comments on commit 4f409cf

Please sign in to comment.