From 0cb2a90f5422ca5c2f04ecf986a555c758afae61 Mon Sep 17 00:00:00 2001 From: arf20 Date: Mon, 18 Mar 2024 19:47:44 +0100 Subject: Client sees orders, order status --- README.md | 3 -- client.php | 35 ++++++++++++++++++- dbinit.sql | 3 +- manageorders.php | 17 ++++++--- services.txt | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 services.txt diff --git a/README.md b/README.md index c9e1106..200f7a4 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,6 @@ User types: Client: order services and open tickets Service types: premium, standard, free -Services: - VPS, VPN, webhost, bot host, game host, proxy, mirror, subdomain, storage, - nextcloud, jellyfin, email, matrix, xmpp, voip Report problems with CST or such as password changes to admin@arf20.com diff --git a/client.php b/client.php index 615aac3..5d33ba2 100644 --- a/client.php +++ b/client.php @@ -7,11 +7,37 @@ if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ exit; } +$clientid = $_SESSION["id"]; $username = $_SESSION["username"]; $type = $_SESSION["type"]; require_once "config.php"; +// Get orders +$sql = "SELECT id, service, name, billing FROM orders WHERE client = ?"; +$stmt = mysqli_prepare($link, $sql); +mysqli_stmt_bind_param($stmt, "s", $param_client); +$param_client = $clientid; +mysqli_stmt_execute($stmt); +$result = mysqli_stmt_get_result($stmt); +$orders = $result->fetch_all(MYSQLI_ASSOC); + +// Get services +$sql = "SELECT id, name, type, billing FROM services"; +$stmt = mysqli_prepare($link, $sql); +mysqli_stmt_execute($stmt); +$result = mysqli_stmt_get_result($stmt); +$services = $result->fetch_all(MYSQLI_ASSOC); + +function getservicebyid($id) { + global $services; + foreach ($services as $service) { + if ($service["id"] == $id) { + return $service; + } + } +} + ?> @@ -34,7 +60,14 @@ require_once "config.php";

Active services

- + + + \n"; + } + ?> +
serviceinstancebilling
".getservicebyid($order["service"])["name"]."".$order["name"]."".$order["billing"]."

Tickets

diff --git a/dbinit.sql b/dbinit.sql index 7f7dec9..506729a 100644 --- a/dbinit.sql +++ b/dbinit.sql @@ -6,9 +6,9 @@ CREATE TABLE `arfnet2`.`users` ( `password` VARCHAR(255) NOT NULL , `email` VARCHAR(127) NOT NULL , `verifycode` VARCHAR(31) NOT NULL , - `status` ENUM('verified','unverified') NOT NULL DEFAULT 'unverified' , `type` ENUM('client','helpdesk','accountant','admin') NOT NULL , `regdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + `status` ENUM('verified','unverified') NOT NULL DEFAULT 'unverified' , PRIMARY KEY (`id`) ); @@ -28,6 +28,7 @@ CREATE TABLE `arfnet2`.`orders` ( `client` INT NOT NULL , `billing` VARCHAR(255) NOT NULL , `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + `status` ENUM('active','inactive') NOT NULL , `comments` TEXT NOT NULL , PRIMARY KEY (`id`) ); diff --git a/manageorders.php b/manageorders.php index c91a5b7..6f25959 100644 --- a/manageorders.php +++ b/manageorders.php @@ -31,7 +31,7 @@ $result = mysqli_stmt_get_result($stmt); $services = $result->fetch_all(MYSQLI_ASSOC); // Get orders -$sql = "SELECT id, service, name, client, date, billing, comments FROM orders"; +$sql = "SELECT id, service, name, client, date, billing, status, comments FROM orders"; $stmt = mysqli_prepare($link, $sql); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); @@ -69,11 +69,12 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // edit entry if (isset($_POST["save"])) { - $sql = "UPDATE orders SET name = ?, billing = ?, comments = ? WHERE id = ?"; + $sql = "UPDATE orders SET name = ?, billing = ?, status = ?, comments = ? WHERE id = ?"; $stmt = mysqli_prepare($link, $sql); - mysqli_stmt_bind_param($stmt, "ssss", $param_name, $param_billing, $param_comments, $param_id); + mysqli_stmt_bind_param($stmt, "sssss", $param_name, $param_billing, $param_status, $param_comments, $param_id); $param_name = $_POST["name"]; $param_billing = $_POST["billing"]; + $param_status = $_POST["status"]; $param_comments = $_POST["comments"]; $param_id = $_POST["id"]; @@ -134,9 +135,15 @@ function getclientbyid($id) { ".$client["username"].""; + foreach ($services as $service) + $service_options .= "";*/ echo "

Edit order ".$order["id"]."

\n" ."

\n" ."

\n" + ."

\n" ."

\n" ."" ."
cancel" @@ -154,6 +161,7 @@ function getclientbyid($id) { ."

\n" ."

\n" ."

\n" + ."

\n" ."

\n" ."
cancel" ."
"; @@ -162,7 +170,7 @@ function getclientbyid($id) { add - + " @@ -171,6 +179,7 @@ function getclientbyid($id) { ."" ."" ."" + ."" ."" ."\n"; } diff --git a/services.txt b/services.txt new file mode 100644 index 0000000..9241441 --- /dev/null +++ b/services.txt @@ -0,0 +1,103 @@ +Services: + Free: + matrix, xmpp + Standard: + email, voip, jellyfin, nextcloud + Premium + VPS, VPN, webhost, bot host, game host, proxy, mirror, storage, subname + +VPS +Price: 1*vCPU + 0.50*GBRAM + 0.05*GBSSD € +Desc: + KVM shared VM in our Proxmox node + Price may vary by specifications + Entitled to + - a few ports (>1024) in shared public v4 address + - whole IPv6 address via HE.net + Up to + - 8GB RAM + - 4vCPUs + - 30GB SSD, optional HDD + - debian12 or custom provided ISO + Bandwidth is shared + +VPN +Price: 5€/mo +Desc: + Wireguard connection to ARFNET network, shared public IPv4 + Isolated VPN network + Optional HE IPv6 + +webhost +Price: 1€/mo +Desc: + nginx vhost in main web VM + PHP and MySQL + IPv4 and v6 + +webhost +Price: 0.75€/mo +Desc: + Telegram, discord, matrix, IRC, whatever + +gamehost +Price: 1-10€/mo +Desc: + Minecraft, csgo, whatever + Price may vary by game's weight and load + +proxy +Price: 0.5€/mo +Desc: + Reverse proxies a site + Main nginx vhost proxy + IPv4 and v6 + +mirror +Price: 1 + 0.005*GB^2 +Desc: + Mirror files on https://ftp.arf20.com + Stored on RAID HDD vault + +storage +Price: 1 + 0.005*GB^2 +Desc: + Up/download files via FTP, SFTP or rsync + Stored on RAID HDD vault + +subname +Price: 0.5€/mo or 6€/y + Subname in arf20.com + DNS provided by our nameservers + + +email +Price: 1€/mo + Email account in @arf20.com + IMAP/SMTP mail.arf20.com (postfix/dovecot) + No SPAM filter + 100MB max storage + Accesible via any IMAP/SMTP client and https://jellyfin.arf20.com + +voip +Price: 2€/mo +Desc: + CURRENTLY DOWN! + SIP VoIP access to ARFNET and SDF networks + +jellyfin +Price: 2€/mo +Desc: + Unlimited jellyfin account with access to all ARFNET media + No transcoding + https://jellyfin.arf20.com + +nextcloud +Price: 5€/mo +Desc: + Nextcloud account up to 10GB storage + https://nextcloud.arf20.com + +matrix + +xmpp -- cgit v1.2.3
idserviceinstanceclientbillingdatecommentsaction
idserviceinstanceclientbillingdatestatuscommentsaction
".$order["id"]."".getclientbyid($order["client"])["username"]."".$order["billing"]."".$order["date"]."".$order["status"]."
".$order["comments"]."
del edit