ACIL FM
Dark
Refresh
Current DIR:
/home/fastexsh/public_html/exchange/commands
/
home
fastexsh
public_html
exchange
commands
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
add_new_card.php
5.4 MB
chmod
View
DL
Edit
Rename
Delete
affiliate.php
1.63 MB
chmod
View
DL
Edit
Rename
Delete
authentication.php
21.22 MB
chmod
View
DL
Edit
Rename
Delete
buy_voucher.php
16.43 MB
chmod
View
DL
Edit
Rename
Delete
charge_account.php
19.56 MB
chmod
View
DL
Edit
Rename
Delete
last_transactions.php
22.25 MB
chmod
View
DL
Edit
Rename
Delete
other_button.php
5.9 MB
chmod
View
DL
Edit
Rename
Delete
profile.php
2.96 MB
chmod
View
DL
Edit
Rename
Delete
sell_voucher.php
11.57 MB
chmod
View
DL
Edit
Rename
Delete
start_bot.php
7.73 MB
chmod
View
DL
Edit
Rename
Delete
withdraw.php
11.9 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/fastexsh/public_html/exchange/commands/buy_voucher.php
<?php if ($text == '🛒 خرید ووچر' || $text == '💳 خرید ووچر ( اتوماتیک )') { $buyVoucherStatus = getSettingsBot('buyVoucherStatus')->value_ ?: 0; if ($buyVoucherStatus == 0) { $offText = getSettingsBot('buyVoucherOffText')->value_ ?? "⚠️ *بخش خرید ووچر غیرفعال*\n\nمتأسفانه در حال حاضر امکان خرید ووچر وجود ندارد.\n\n💬 لطفاً با پشتیبانی تماس بگیرید."; $bot->sendMessage($from_id, $offText); die; } $response_text = "🛒 *خرید ووچر*\n\n"; $response_text .= "لطفاً نوع ووچر مورد نظر خود را انتخاب کنید:\n\n"; $response_text .= "💡 *نکته مهم:*\n"; $response_text .= "• دریافت ووچر به صورت کاملاً اتوماتیک و آنی انجام میشود\n"; $response_text .= "• پس از تایید خرید، کد ووچر بلافاصله برای شما ارسال میگردد\n"; $response_text .= "• تمامی تراکنشها امن و سریع میباشند"; $bot->sendMessage($from_id, $response_text, json_encode([ 'resize_keyboard' => true, 'keyboard' => [ [['text' => '🛒 خرید یو ووچر']], [['text' => '🔙 بازگشت به منوی اصلی']] ] ])); die; } if ($text == '🛒 خرید یو ووچر') { $buyVoucherStatus = getSettingsBot('buyVoucherStatus')->value_ ?: 0; if ($buyVoucherStatus == 0) { $offText = getSettingsBot('buyVoucherOffText')->value_ ?? "⚠️ *بخش خرید ووچر غیرفعال*\n\nمتأسفانه در حال حاضر امکان خرید ووچر وجود ندارد.\n\n💬 لطفاً با پشتیبانی تماس بگیرید."; $bot->sendMessage($from_id, $offText); die; } $loading_message = $bot->sendMessage($from_id, "⏳ *در حال دریافت قیمت لحظهای...*\n\n📡 لطفاً چند لحظه صبر کنید تا قیمت بهروز برای شما محاسبه شود."); $loading_message_id = $loading_message->result->message_id ?? null; $usdt_irt_price = getUsdtIrtPrice(); $uv_buy = getSettingsBot('uv_buy')->value_ ?? 0; if ($usdt_irt_price === null || $usdt_irt_price === false) { if ($loading_message_id) { $bot->editMessage($from_id, "❌ *خطا در دریافت قیمت*\n\n⚠️ متأسفانه در حال حاضر امکان دریافت قیمت لحظهای وجود ندارد.\n\n🔄 لطفاً چند دقیقه دیگر دوباره تلاش کنید.", $loading_message_id); } else { $bot->sendMessage($from_id, "❌ *خطا در دریافت قیمت*\n\n⚠️ متأسفانه در حال حاضر امکان دریافت قیمت لحظهای وجود ندارد.\n\n🔄 لطفاً چند دقیقه دیگر دوباره تلاش کنید."); } die; } $final_price = (int)$usdt_irt_price + (int)$uv_buy; $price_formatted = number_format($final_price); $usdt_price_formatted = number_format($usdt_irt_price); $price_text = "💰 *قیمت لحظهای خرید یو ووچر*\n\n"; $price_text .= "💰 *قیمت نهایی خرید*: `$price_formatted` تومان\n\n"; $price_text .= "💡 *لطفاً مبلغ مورد نظر خود را به تومان وارد کنید:*\n"; $price_text .= "مثال: 100000"; if ($loading_message_id) { $bot->editMessage($from_id, $price_text, $loading_message_id); $bot->sendMessage($from_id, "لطفاً مبلغ را وارد کنید:", $back_keyboard); } else { $bot->sendMessage($from_id, $price_text, $back_keyboard); } setStep($from_id, 'input-amount-uv'); die; } if ($text == '💎 خرید پرمیوم ووچر') { $bot->sendMessage($from_id, "🤝 این بخش به زودی فعال خواهد شد."); die; } if (strpos($currentUser->step, 'input-amount-') !== false) { $user_level = 'level_' . $currentUser->auth_level; $query = "SELECT * FROM `limits` WHERE `level` = ?"; $stmt = $db->prepare($query); $stmt->execute([$user_level]); $result = $stmt->fetch(); $min_buy_amount = $result->min_buy_amount ?? 0; $max_buy_amount = $result->max_buy_amount ?? 0; $query = "SELECT SUM(`amount`) AS `total_amount` FROM `sold_vouchers` WHERE `chat_id` = ? AND `status` = 'Confirm' AND DATE(`created_at`) = CURDATE()"; $stmt = $db->prepare($query); $stmt->execute([$from_id]); $result = $stmt->fetch(); $total_amount = $result->total_amount ?? 0; $min_amount_formatted = number_format($min_buy_amount); $max_amount_formatted = number_format($max_buy_amount); $total_amount_formatted = number_format($total_amount); $text_formatted = number_format($text); if ($total_amount == 0 && $text < $min_buy_amount) { $bot->sendMessage($from_id, "🫵 کاربر گرامی، حداقل مبلغ خرید روزانه در سطح شما $min_amount_formatted تومان است.\n\n🔰 برای افزایش سقف خرید لطفاً حساب کاربری خود را ارتقا دهید."); die; } if ($total_amount + $text > $max_buy_amount) { $bot->sendMessage($from_id, "🫵 کاربر گرامی، حداکثر مبلغ خرید روزانه در سطح شما **$max_amount_formatted تومان** میباشد.\n\n👀 شما امروز **$total_amount_formatted تومان** خرید کرده اید\n\n🔰 برای افزایش سقف خرید، لطفاً حساب کاربری خود را ارتقا دهید."); die; } $type = explode('-', $currentUser->step)[2]; $type_name = ($type == 'uv') ? 'یو ووچر' : 'پرمیوم ووچر'; if ($currentUser->balance < $text) { $bot->sendMessage($from_id, "⚠️ موجودی شما کافی نیست! \n\nبرای انجام این عملیات، لطفاً موجودی حساب خود را شارژ کنید."); die; } $amount_formatted = number_format($text); $usdt_irt_price = getUsdtIrtPrice(); $uv_buy = getSettingsBot('uv_buy')->value_ ?? 0; $final_price = (int)$usdt_irt_price + (int)$uv_buy; $voucher_amount = round(intval($text) / intval($final_price), 2); $confirm_text = "🔍 *تایید نهایی خرید*\n\n"; $confirm_text .= "💰 *مبلغ خرید:* `$amount_formatted` تومان\n"; $confirm_text .= "💎 *نوع ووچر:* $type_name\n"; $confirm_text .= "💵 *مقدار ووچر تقریبی:* `$voucher_amount` UUSD\n\n"; $confirm_text .= "⚠️ *توجه:*\n"; $confirm_text .= "• پس از تایید، مبلغ از موجودی حساب شما کسر میشود\n"; $confirm_text .= "• کد ووچر بلافاصله پس از تایید برای شما ارسال میگردد\n"; $confirm_text .= "• در صورت بروز مشکل، با پشتیبانی تماس بگیرید\n\n"; $confirm_text .= "❓ آیا از خرید مطمئن هستید؟"; $bot->sendMessage($from_id, $confirm_text, json_encode([ 'inline_keyboard' => [ [['text' => '✅ بله، تایید و خرید', 'callback_data' => 'order-confirm-uv']], [['text' => '❌ خیر، انصراف', 'callback_data' => 'cancel-buy']] ] ])); setStep($from_id, 'buy-' . $type . '-' . $text); die; } if (strpos($currentUser->step, 'buy-') !== false && $data == 'order-confirm-uv') { $type = explode('-', $currentUser->step); $toman = explode('-', $currentUser->step)[2]; $usdt_irt_price = getUsdtIrtPrice(); if ($usdt_irt_price === null || $usdt_irt_price === false || !is_numeric($usdt_irt_price)) { $bot->sendMessage($from_id, "⚠️ خطا در دریافت قیمت لحظهای تتر از وبسرویس. لطفا بعداً دوباره تلاش کنید."); die; } $uv_buy = getSettingsBot('uv_buy')->value_ ?? 0; $final_price = (int)$usdt_irt_price + (int)$uv_buy; switch ($type[1]) { case 'uv': $uv_buy = getSettingsBot('uv_buy')->value_ ?? 0; $amount = round(intval($toman) / intval($final_price), 1); break; case 'ps': $ps_buy = getSettingsBot('ps_buy')->value_ ?? 0; $amount = round(intval($toman) / intval($ps_buy), 1); break; } $type_name = ($type[1] == 'uv') ? 'یو ووچر' : 'پرمیوم ووچر'; if ($type[1] == 'uv') { $bot->editMessage($from_id, "⏳ *در حال پردازش درخواست خرید...*\n\n📡 لطفاً چند لحظه صبر کنید.\n\n🔄 در حال اتصال به سیستم ووچر و ایجاد تراکنش...", $message_id); $requestToUwallet = $uVoucher->createVoucher('UUSD', $amount); if ($requestToUwallet->message == 200) { $transActionId = $requestToUwallet->data->transactionId; $transActionStatus = $requestToUwallet->data->status; $transActionCode = $requestToUwallet->data->code; $transActionDate = jdate("Y/m/d - H:i:s", strtotime(date("Y/m/d H:i:s")), tr_num: 'en'); $amount_formatted = number_format($toman); $response_text = "✅ *خرید با موفقیت انجام شد*\n\n"; $response_text .= "🎫 *کد ووچر شما:*\n"; $response_text .= "`$transActionCode`\n\n"; $response_text .= "📊 *جزئیات تراکنش:*\n\n"; $response_text .= "💰 *مبلغ پرداختی:* `$amount_formatted` تومان\n"; $response_text .= "💎 *مقدار ووچر:* `$amount` UUSD\n"; $response_text .= "🆔 *شناسه تراکنش:* `$transActionId`\n"; $response_text .= "📅 *تاریخ و زمان:* $transActionDate\n"; $response_text .= "✅ *وضعیت:* " . (ucfirst($transActionStatus) == 'Confirm' ? 'تایید شده و تکمیل شد' : ucfirst($transActionStatus)) . "\n\n"; $response_text .= "💡 *نکات مهم:*\n"; $response_text .= "• کد ووچر شما در بالا آماده استفاده است\n"; $response_text .= "• شناسه تراکنش را برای پیگیری نگه دارید\n"; $response_text .= "• در صورت نیاز به کمک، با پشتیبانی تماس بگیرید"; $bot->editMessage($from_id, $response_text, $message_id); $query = "UPDATE `users` SET `balance` = `balance` - ? WHERE `chat_id` = ?"; $stmt = $db->prepare($query); $stmt->execute([$toman, $from_id]); do { $support_code = rand(10000, 50000); $query = "SELECT COUNT(*) FROM `sold_vouchers` WHERE `support_code` = ?"; $stmt = $db->prepare($query); $stmt->execute([$support_code]); $rowCount = $stmt->fetchColumn(); } while ($rowCount > 0); $query = "INSERT INTO `sold_vouchers` (`chat_id`, `amount`, `code`, `track_id`, `support_code`, `type`, `status`) VALUES (?, ?, ?, ?, ?, ?, ?)"; $stmt = $db->prepare($query); $stmt->execute([$from_id, $toman, $transActionCode, $transActionId, $support_code, 'uVoucher', $transActionStatus]); $channel = getSettingsBot('buy_voucher_channel')->value_ ?? 0; $full_name = $currentUser->full_name; $amount_formatted = number_format($toman); $log_text = "🛒 *خرید ووچر جدید*\n\n"; $log_text .= "👤 *اطلاعات کاربر:*\n"; $log_text .= "• شناسه: `$from_id`\n"; $log_text .= "• نام: $full_name\n\n"; $log_text .= "💰 *جزئیات خرید:*\n"; $log_text .= "• مبلغ: `$amount_formatted` تومان\n"; $log_text .= "• نوع: uVoucher\n"; $log_text .= "• مقدار: `$amount` UUSD\n"; $log_text .= "• کد رهگیری: `$support_code`\n"; $log_text .= "• شناسه تراکنش: `$transActionId`\n"; $log_text .= "• تاریخ: $transActionDate\n\n"; $log_text .= "✅ *وضعیت:* خرید با موفقیت انجام شد"; $bot->sendMessage($channel, $log_text); } else { $error_msg = "❌ *خطا در عملیات خرید*\n\n"; $error_msg .= "⚠️ متأسفانه در حال حاضر امکان خرید ووچر وجود ندارد.\n\n"; $error_msg .= "🔄 لطفاً چند دقیقه دیگر دوباره تلاش کنید.\n"; $error_msg .= "💬 در صورت تکرار مشکل، با پشتیبانی تماس بگیرید."; $bot->editMessage($from_id, $error_msg, $message_id); } } else if ($type[1] == 'ps') { $randomString = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 4); $randomString = preg_replace('/(.{8})(.{4})(.{4})(.{4})(.{12})/', '$1-$2-$3-$4-$5', $randomString); $bot->sendMessage($from_id, "*⏳ در حال ارسال درخواست برای خرید پرمیوم ووچر...*\n\n📲 لطفا اندکی صبر کنید تا درخواست شما پردازش شود."); $response = $psVoucher->createVouchers($amount, "USD", $randomString); if ($response->Status == 1) { $transActionCode = $response->Code; $transActionStatus = 'Confirm'; $transActionId = $response->TransactionID; $transActionDate = jdate("Y/m/d - H:i:s", strtotime($response->IssueDate), tr_num: 'en'); $response_text = "*🎉 تراکنش موفقیت آمیز بود*\n\n"; $response_text .= "*✅ کد ووچر شما: *\n" . "`" . $transActionCode . "`" . "\n\n"; $response_text .= "*🏷 شناسه تراکنش: *\n" . "`" . $transActionId . "`" . "\n\n"; $response_text .= "*📆 تاریخ تراکنش: *\n" . $transActionDate . "\n\n"; $response_text .= "*💡 وضعیت: *" . (ucfirst($transActionStatus) == 'Confirm' ? 'انجام شد ✅' : ucfirst($transActionStatus)) . "\n"; $bot->editMessage($from_id, $response_text, $message_id + 1); $query = "UPDATE `users` SET `balance` = `balance` - ? WHERE `chat_id` = ?"; $stmt = $db->prepare($query); $stmt->execute([$toman, $from_id]); do { $support_code = rand(10000, 50000); $query = "SELECT COUNT(*) FROM `sold_vouchers` WHERE `support_code` = ?"; $stmt = $db->prepare($query); $stmt->execute([$support_code]); $rowCount = $stmt->fetchColumn(); } while ($rowCount > 0); $query = "INSERT INTO `sold_vouchers` (`chat_id`, `amount`, `code`, `track_id`, `support_code`, `type`, `status`) VALUES (?, ?, ?, ?, ?, ?, ?)"; $stmt = $db->prepare($query); $stmt->execute([$from_id, $toman, $transActionCode, $transActionId, $support_code, 'psVoucher', $transActionStatus]); $channel = getSettingsBot('buy_voucher_channel')->value_ ?? 0; $full_name = $currentUser->full_name; $log_text = " 🛒 **خرید ووچر جدید** 🛒 👤 **شناسه کاربر**: $from_id 🔰 **نام و نام خانوادگی**: $full_name 💳 **شناسه رهگیری**: $support_code 💰 **مبلغ خرید**: $toman تومان 🏷️ **نوع ووچر**: psVoucher ⏳ **تاریخ خرید**: " . $transActionDate . " ✅ خرید ووچر با موفقیت توسط کاربر با شناسه $from_id انجام شد. "; $bot->sendMessage(-1002252661378, $log_text); } else { $bot->editMessage($from_id, '❌ خطا در عملیات خرید! لطفا دوباره تلاش کنید.', $message_id + 1); } } else { $bot->sendMessage($from_id, '❌ فقط خرید یو ووچر (UV) و پرمیوم ووچر (PS) در دسترس است.'); } $bot->sendMessage($from_id, '✅ به منوی اصلی بازگشتید', $main_keyboard); setStep($from_id, 'home'); die; }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply