fetch_all(MYSQLI_ASSOC); // POST actions if ($_SERVER["REQUEST_METHOD"] == "POST") { // add entry $sql = "INSERT INTO orders (service, name, client, billing, comments) VALUES (?, ?, ?, ?, ?)"; $stmt = mysqli_prepare($link, $sql); mysqli_stmt_bind_param($stmt, "sssss", $param_service, $param_name, $param_client, $param_billing, $param_comments); $param_service = $_POST["service"]; $param_name = $_POST["name"]; $param_client = $clientid; $param_billing = $_POST["billing"]; $param_comments = $_POST["comments"]; if (!mysqli_stmt_execute($stmt) || (mysqli_stmt_affected_rows($stmt) != 1)) { echo "SQL error."; } else { // send admin mail // Get admin mails $sql = "SELECT email FROM users WHERE type = 'admin'"; $stmt = mysqli_prepare($link, $sql); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $admins = $result->fetch_all(MYSQLI_ASSOC); foreach ($admins as $admin) { $mailer->addAddress($admin["email"]); } $mailer->Subject = "New service order request"; $mailer->Body = "Admins,\n\nUser $username requested service ".getservicebyid($_POST["service"])["name"]."\n\n" ."Instance name: ".$_POST["name"]."\n" ."Calculated billing: ".$_POST["billing"]."\n" ."Comments:\n" .$_POST["comments"] ."\n\n--\nARFNET Client, Service, Ticket and Invoice Management System\nhttps://arf20.com"; if (!$mailer->send()) { echo 'Mailer Error [ask arf20]: ' . $mailer->ErrorInfo; } else header("location: ".$_SERVER['SCRIPT_NAME']); } } function getservicebyid($id) { global $services; foreach ($services as $service) { if ($service["id"] == $id) { return $service; } } } function genoption($id, $name) { return "" ."
\n"; } ?> ARFNET CSTIMS
ARFNET

ARFNET Client Service Ticket and Invoice Management System

panel

Order a new service