diff options
author | arf20 <aruizfernandez05@gmail.com> | 2024-03-20 16:04:19 +0100 |
---|---|---|
committer | arf20 <aruizfernandez05@gmail.com> | 2024-03-20 16:04:19 +0100 |
commit | 68858da5d6166be880f1301f49807a2e52357288 (patch) | |
tree | 2c77908058983f23c0e04b47d524a7cfd829a26e | |
parent | 342ddb4141290b257ec9532b47506f1a26516515 (diff) | |
download | arfnet2-cstims-68858da5d6166be880f1301f49807a2e52357288.tar.gz arfnet2-cstims-68858da5d6166be880f1301f49807a2e52357288.zip |
Add 'setting up' order status
-rw-r--r-- | client.php | 8 | ||||
-rw-r--r-- | dbinit.sql | 2 | ||||
-rw-r--r-- | manageorders.php | 2 | ||||
-rw-r--r-- | order.php | 2 |
4 files changed, 7 insertions, 7 deletions
@@ -14,7 +14,7 @@ $type = $_SESSION["type"]; require_once "config.php"; // Get orders -$sql = "SELECT id, service, name, billing, comments FROM orders WHERE client = ?"; +$sql = "SELECT id, service, name, billing, comments, status FROM orders WHERE client = ?"; $stmt = mysqli_prepare($link, $sql); mysqli_stmt_bind_param($stmt, "s", $param_client); $param_client = $clientid; @@ -59,12 +59,12 @@ function getservicebyid($id) { <h3><?php echo strtoupper($type[0]).substr($type, 1); ?> panel</h3> <div class="row"> <div class="col5"> - <h3>Active services</h3> + <h3>Orders</h3> <table> - <tr><th>service</th><th>instance</th><th>billing</th><th>comments</th></tr> + <tr><th>service</th><th>instance</th><th>billing</th><th>comments</th><th>status</th></tr> <?php foreach ($orders as $order) { - echo "<tr><td>".getservicebyid($order["service"])["name"]."</td><td>".$order["name"]."</td><td>".$order["billing"]."</td><td><pre>".$order["comments"]."</pre></td></tr>\n"; + echo "<tr><td>".getservicebyid($order["service"])["name"]."</td><td>".$order["name"]."</td><td>".$order["billing"]."</td><td><pre>".$order["comments"]."</pre></td><td>".$order["status"]."</tr>\n"; } ?> </table> @@ -28,7 +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 , + `status` ENUM('setting up','active','inactive') NOT NULL , `comments` TEXT NOT NULL , PRIMARY KEY (`id`) ); diff --git a/manageorders.php b/manageorders.php index 9452509..49c2e63 100644 --- a/manageorders.php +++ b/manageorders.php @@ -143,7 +143,7 @@ function getclientbyid($id) { 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" + ."<label>Status</label><br><select name=\"status\"><option value=\"setting up\" ".($service["status"] == "setting up" ? "selected" : "").">setting up</option><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>" @@ -168,7 +168,7 @@ function genoption($id, $name) { <input type=text name="name"><br> <div id="commentcontainer"> <br><label>Comments (describe use case and requirements)</label><br> - <textarea id="commentbox" rows="10" cols="80" onchange="updatecomment()"></textarea><br> + <textarea id="commentbox" rows="10" cols="80" onchange="update()"></textarea><br> </div> <input type="hidden" name="billing" id="billing"> <input type="hidden" name="comments" id="comments"> |