diff --git a/web/header.php b/web/header.php
index 8a61474..8f3a065 100644
--- a/web/header.php
+++ b/web/header.php
@@ -6,8 +6,25 @@
-
+
diff --git a/web/index.php b/web/index.php
index 02aa333..ce75943 100644
--- a/web/index.php
+++ b/web/index.php
@@ -44,6 +44,20 @@ if ($config['DATABASETYPE']=="sqlite"){
exit;
}
}
+if ((isset($_POST['deletevm']))&&(isset($_POST['deletename']))){
+ $vmname = clean($_POST['deletename']);
+ $vmid = clean($_POST['deletevm']);
+ $sql="SELECT id FROM vms WHERE vmname='$vmname' AND id='$vmid'";
+ $res = $db_handle->query($sql);
+ while ($row = $res->fetchArray(SQLITE3_ASSOC)){
+ $sqld="DELETE FROM vms WHERE id='$vmid'";
+ if ($db_handle->query($sqld)){
+ echo "VM $vmname deleted!";
+ }
+ }
+}
+
+
include('header.php');
$mode="";
if (isset($_REQUEST['start'])){
@@ -195,7 +209,7 @@ if(isset($_REQUEST['mode'])){
}
if($mode!="newvm"){
- echo "
Create a new VM";
+ echo "
Create a new VM";
}
//getting vms from DB
$sql="SELECT * FROM vms";
@@ -207,7 +221,7 @@ while ($row = $res->fetchArray(SQLITE3_ASSOC)){
} else {
$button = "stop";
}
- echo "
";
+ echo "
";
}
echo "