aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarf20 <aruizfernandez05@gmail.com>2024-03-18 22:21:49 +0100
committerarf20 <aruizfernandez05@gmail.com>2024-03-18 22:21:49 +0100
commit1818a590244c1ae8390a6fb58d6e1f775b46d723 (patch)
treeb3a7f475e70a5d47c76f5aeac389034e7dc71c7f
parent0cb2a90f5422ca5c2f04ecf986a555c758afae61 (diff)
downloadarfnet2-cstims-1818a590244c1ae8390a6fb58d6e1f775b46d723.tar.gz
arfnet2-cstims-1818a590244c1ae8390a6fb58d6e1f775b46d723.zip
Order status, manageorders, order
-rw-r--r--manageorders.php4
-rw-r--r--manageservices.php4
-rw-r--r--manageusers.php4
-rw-r--r--order.php98
-rw-r--r--services.txt87
-rw-r--r--style.css8
6 files changed, 156 insertions, 49 deletions
diff --git a/manageorders.php b/manageorders.php
index 6f25959..596b351 100644
--- a/manageorders.php
+++ b/manageorders.php
@@ -140,7 +140,7 @@ function getclientbyid($id) {
$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"
+ echo "<div class=\"form\"><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"
@@ -156,7 +156,7 @@ function getclientbyid($id) {
$client_options .= "<option value=\"".$client["id"]."\">".$client["username"]."</option>";
foreach ($services as $service)
$service_options .= "<option value=\"".$service["id"]."\">".$service["name"]."</option>";
- echo "<div class=\"editform\"><h3>Add order</h3><form action=\"".$_SERVER["SCRIPT_NAME"]."\" method=\"post\">\n"
+ echo "<div class=\"form\"><h3>Add order</h3><form action=\"".$_SERVER["SCRIPT_NAME"]."\" method=\"post\">\n"
."<label>Service</label><br><select name=\"service\">".$service_options."</select><br>"
."<label>Name</label><br><input type=\"text\" name=\"name\"><br>\n"
."<label>Client</label><br><select name=\"client\">".$client_options."</select><br>\n"
diff --git a/manageservices.php b/manageservices.php
index f9531f1..f7fb3ae 100644
--- a/manageservices.php
+++ b/manageservices.php
@@ -100,7 +100,7 @@ function getservicebyid($id) {
<?php
if (isset($_GET["edit"])) {
$service = getservicebyid($_GET["edit"]);
- echo "<div class=\"editform\"><h3>Edit service ".$service["id"]."</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
+ echo "<div class=\"form\"><h3>Edit service ".$service["id"]."</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
."<label>Name</label><br><input type=\"text\" name=\"name\" value=\"".$service["name"]."\"><br>\n"
."<label>Type</label><br><select name=\"type\"><option value=\"free\" ".($service["type"] == "free" ? "selected" : "").">free</option><option value=\"standard\" ".($service["type"] == "standard" ? "selected" : "").">standard</option><option value=\"premium\" ".($service["type"] == "premium" ? "selected" : "").">premium</option></select><br>\n"
."<label>Billing</label><br><input type=\"text\" name=\"billing\" value=\"".$service["billing"]."\"><br>\n"
@@ -111,7 +111,7 @@ function getservicebyid($id) {
}
if (isset($_GET["add"])) {
- echo "<div class=\"editform\"><h3>Add service</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
+ echo "<div class=\"form\"><h3>Add service</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
."<label>Name</label><br><input type=\"text\" name=\"name\"><br>\n"
."<label>Type</label><br><select name=\"type\"><option value=\"free\">free</option><option value=\"standard\">standard</option><option value=\"premium\">premium</option></select><br>\n"
."<label>Billing</label><br><input type=\"text\" name=\"billing\"><br>\n"
diff --git a/manageusers.php b/manageusers.php
index f49c63e..0fb1f7d 100644
--- a/manageusers.php
+++ b/manageusers.php
@@ -103,7 +103,7 @@ function getuserbyid($id) {
<?php
if (isset($_GET["edit"])) {
$user = getuserbyid($_GET["edit"]);
- echo "<div class=\"editform\"><h3>Edit user ".$user["id"]."</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
+ echo "<div class=\"form\"><h3>Edit user ".$user["id"]."</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
."<label>Username</label><br><input type=\"text\" name=\"username\" value=\"".$user["username"]."\"><br>\n"
."<label>Email</label><br><input type=\"text\" name=\"email\" value=\"".$user["email"]."\"><br>\n"
."<label>Password (empty is unchanged)</label><br><input type=\"text\" name=\"password\"><br>\n"
@@ -115,7 +115,7 @@ function getuserbyid($id) {
}
if (isset($_GET["add"])) {
- echo "<div class=\"editform\"><h3>Add user</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
+ echo "<div class=\"form\"><h3>Add user</h3><form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\">\n"
."<label>Username</label><br><input type=\"text\" name=\"username\"><br>\n"
."<label>Email</label><br><input type=\"text\" name=\"email\"><br>\n"
."<label>Password</label><br><input type=\"text\" name=\"password\"><br>\n"
diff --git a/order.php b/order.php
new file mode 100644
index 0000000..1dd8555
--- /dev/null
+++ b/order.php
@@ -0,0 +1,98 @@
+<?php
+
+session_start();
+
+if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
+ header("location: /login.php");
+ exit;
+}
+
+$clientid = $_SESSION["id"];
+$username = $_SESSION["username"];
+$type = $_SESSION["type"];
+
+require_once "config.php";
+
+// 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>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <link rel="stylesheet" type="text/css" href="/style.css">
+ <title>ARFNET CSTIMS</title>
+ </head>
+ <body>
+ <header><a href="https://arf20.com/">
+ <img src="arfnet_logo.png" width="64"><span class="title"><strong>ARFNET</strong></span>
+ </a></header>
+ <hr>
+ <main>
+ <div class="row">
+ <div class="col8">
+ <h2>ARFNET Client Service Ticket and Invoice Management System</h2>
+ <h3><?php echo strtoupper($type[0]).substr($type, 1); ?> panel</h3>
+ <div class="form">
+ <h3>Order a new service</h3>
+ <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
+ <div class="border">
+ <label><b>Service</b></label><br>
+
+ <label>Premium</dev><br>
+ <?php
+ foreach ($services as $service) {
+ if ($service["type"] != "premium") continue;
+ echo "<input type=\"radio\" name=\"service\" value=\"".$service["id"]."\">"
+ ."<label>".$service["name"]."</label><br>\n";
+ }
+ ?>
+
+
+ <label>Standard</dev><br>
+ <?php
+ foreach ($services as $service) {
+ if ($service["type"] != "standard") continue;
+ echo "<input type=\"radio\" name=\"service\" value=\"".$service["id"]."\">"
+ ."<label>".$service["name"]."</label><br>\n";
+ }
+ ?>
+
+ <label>Free</dev><br>
+ <?php
+ foreach ($services as $service) {
+ if ($service["type"] != "free") continue;
+ echo "<input type=\"radio\" name=\"service\" value=\"".$service["id"]."\">"
+ ."<label>".$service["name"]."</label><br>\n";
+ }
+ ?>
+
+ </div>
+ <br><input type="submit" value="Place order">
+ </form>
+ </div>
+ </div>
+ <div class="col2">
+ <h3>Logged as <?php echo $username; ?></h3>
+ <h3><a href="/logout.php">Logout</h2>
+ <h3><a href="/client.php">Back to dashboard</h2>
+ </div>
+ </div>
+ </main>
+ </body>
+</html>
diff --git a/services.txt b/services.txt
index 9241441..f9b5f3e 100644
--- a/services.txt
+++ b/services.txt
@@ -9,94 +9,97 @@ Services:
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
+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
+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
+nginx vhost in main web VM
+PHP and MySQL
+IPv4 and v6
-webhost
+bothost
Price: 0.75€/mo
Desc:
- Telegram, discord, matrix, IRC, whatever
+Telegram, discord, matrix, IRC, whatever
gamehost
Price: 1-10€/mo
Desc:
- Minecraft, csgo, whatever
- Price may vary by game's weight and load
+Minecraft, csgo, whatever
+Price may vary by game's weight and load
+Shared IPv4
proxy
Price: 0.5€/mo
Desc:
- Reverse proxies a site
- Main nginx vhost proxy
- IPv4 and v6
+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
+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
+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
+Desc:
+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
+Ddesc:
+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://webmail.arf20.com
voip
Price: 2€/mo
Desc:
- CURRENTLY DOWN!
- SIP VoIP access to ARFNET and SDF networks
+CURRENTLY UNAVAILABLE!
+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
+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
+Nextcloud account up to 10GB storage
+https://nextcloud.arf20.com
matrix
diff --git a/style.css b/style.css
index 769ac9b..be0edd3 100644
--- a/style.css
+++ b/style.css
@@ -55,12 +55,18 @@ body {
margin-top: 200px;
}
-.editform {
+.form {
width: fit-content;
padding: 20px;
border-style: double;
}
+.border {
+ width: fit-content;
+ padding: 20px;
+ border: 1px solid black;
+}
+
table, th, td {
border: 1px solid black;
}