diff options
author | arf20 <aruizfernandez05@gmail.com> | 2024-03-18 19:47:44 +0100 |
---|---|---|
committer | arf20 <aruizfernandez05@gmail.com> | 2024-03-18 19:47:44 +0100 |
commit | 0cb2a90f5422ca5c2f04ecf986a555c758afae61 (patch) | |
tree | cfd6b0ba24e1791991cd4c438fe7509caa7517bb | |
parent | 4c4b8df824dcd2fd3ac4b8d486181ec87a0f13cd (diff) | |
download | arfnet2-cstims-0cb2a90f5422ca5c2f04ecf986a555c758afae61.tar.gz arfnet2-cstims-0cb2a90f5422ca5c2f04ecf986a555c758afae61.zip |
Client sees orders, order status
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | client.php | 35 | ||||
-rw-r--r-- | dbinit.sql | 3 | ||||
-rw-r--r-- | manageorders.php | 17 | ||||
-rw-r--r-- | services.txt | 103 |
5 files changed, 152 insertions, 9 deletions
@@ -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 @@ -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; + } + } +} + ?> <!doctype html> @@ -34,7 +60,14 @@ require_once "config.php"; <div class="row"> <div class="col5"> <h3>Active services</h3> - <!-- TODO PHP list of services --> + <table> + <tr><th>service</th><th>instance</th><th>billing</th></tr> + <?php + foreach ($orders as $order) { + echo "<tr><td>".getservicebyid($order["service"])["name"]."</td><td>".$order["name"]."</td><td>".$order["billing"]."</tr>\n"; + } + ?> + </table> </div> <div class="col5"> <h3>Tickets</h3> @@ -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) { <?php if (isset($_GET["edit"])) { $order = getorderbyid($_GET["edit"]); + $client_options = $service_options = ""; + /*foreach ($clients as $client) + $client_options .= "<option value=\"".$client["id"]."\" ".($client["id"] == $order["client"] ? "selected" : "").">".$client["username"]."</option>"; + foreach ($services as $service) + $service_options .= "<option value=\"".$service["id"]."\" ".($service["id"] == $order["service"] ? "selected" : "").">".$service["name"]."</option>";*/ echo "<div class=\"editform\"><h3>Edit order ".$order["id"]."</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n" ."<label>Name</label><br><input type=\"text\" name=\"name\" value=\"".$order["name"]."\"><br>\n" ."<label>Billing</label><br><input type=\"text\" name=\"billing\" value=\"".$order["billing"]."\"><br>\n" + ."<label>Status</label><br><select name=\"status\"><option value=\"active\" ".($service["status"] == "active" ? "selected" : "").">active</option><option value=\"inactive\" ".($service["status"] == "inactive" ? "selected" : "").">inactive</option></select><br>\n" ."<label>Comments</label><br><textarea name=\"comments\" rows=\"10\" cols=\"80\">".$order["comments"]."</textarea><br>\n" ."<input type=\"hidden\" name=\"id\" value=\"".$order["id"]."\">" ."<br><input type=\"submit\" name=\"save\" value=\"Save\"><a href=\"".$_SERVER['SCRIPT_NAME']."\">cancel</a>" @@ -154,6 +161,7 @@ function getclientbyid($id) { ."<label>Name</label><br><input type=\"text\" name=\"name\"><br>\n" ."<label>Client</label><br><select name=\"client\">".$client_options."</select><br>\n" ."<label>Billing</label><br><input type=\"text\" name=\"billing\"><br>\n" + ."<label>Status</label><br><select name=\"status\"><option value=\"active\">active</option><option value=\"inactive\">inactive</option></select><br>\n" ."<label>Comments</label><br><textarea name=\"comments\" rows=\"10\" cols=\"80\"></textarea><br>\n" ."<br><input type=\"submit\" name=\"add\" value=\"Add\"><a href=\"".$_SERVER["SCRIPT_NAME"]."\">cancel</a>" ."</form></div>"; @@ -162,7 +170,7 @@ function getclientbyid($id) { <a href="?add">add</a> <table> - <tr><th>id</th><th>service</th><th>instance</th><th>client</th><th>billing</th><th>date</th><th>comments</th><th>action</th></tr> + <tr><th>id</th><th>service</th><th>instance</th><th>client</th><th>billing</th><th>date</th><th>status</th><th>comments</th><th>action</th></tr> <?php foreach ($orders as $order) { echo "<tr><td>".$order["id"]."</td>" @@ -171,6 +179,7 @@ function getclientbyid($id) { ."<td>".getclientbyid($order["client"])["username"]."</td>" ."<td>".$order["billing"]."</td>" ."<td>".$order["date"]."</td>" + ."<td>".$order["status"]."</td>" ."<td><pre>".$order["comments"]."</pre></td>" ."<td><a href=\"?del=".$order["id"]."\">del</a> <a href=\"?edit=".$order["id"]."\">edit</a></td></tr>\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 |