diff --git a/web/index.php b/web/index.php index 3209322..d168df5 100644 --- a/web/index.php +++ b/web/index.php @@ -44,7 +44,15 @@ function serverdepropdown($server, $val, $what){ } echo "$enddiv"; } - +function formatbuttons($label, $val){ + echo "
$label
"; +} //read config file $configfile = new SplFileObject("/etc/nlvmi/nlvmi.conf"); while (!$configfile->eof()) { @@ -319,39 +327,14 @@ if (isset($_SESSION['username'])){ } } if (isset($_POST['serverbuttoni'])){ + serverdepropdown($_POST['serverbuttoni'], "no drive1", 'drive1'); + formatbuttons('format1', ''); + serverdepropdown($_POST['serverbuttoni'], "no drive2", 'drive2'); + formatbuttons('format2', ''); + serverdepropdown($_POST['serverbuttoni'], "no drive3", 'drive3'); + formatbuttons('format3', ''); serverdepropdown($_POST['serverbuttoni'], "no cdrom", 'cdrom'); exit; -//not nice, i know... Will do a function later... - } elseif (isset($_POST['serverbuttona'])){ - serverdepropdown($_POST['serverbuttona'], "no drive1", 'drive1'); - echo "
format1
"; - exit; - } elseif (isset($_POST['serverbuttonb'])){ - serverdepropdown($_POST['serverbuttonb'], "no drive2", 'drive2'); - echo "
format2
"; - exit; - } elseif (isset($_POST['serverbuttonc'])){ - serverdepropdown($_POST['serverbuttonc'], "no drive3", 'drive3'); - echo "
format3
"; - exit; } //ajax queries are all done, time for the header @@ -534,13 +517,7 @@ if (isset($_SESSION['username'])){ echo ""; // echo "$arrColnames[$col]
"; } elseif (preg_match('/format/', $arrColnames[$col])){ - echo "
$arrColnames[$col]
"; + formatbuttons($arrColnames[$col], $val); } elseif ($arrColnames[$col] == "autostart"){ $checked=""; if ($val=="1"){ @@ -548,7 +525,7 @@ if (isset($_SESSION['username'])){ } echo "
autostart
"; } elseif ($arrColnames[$col] == "cdrom"){ - echo "
"; + //echo "
"; serverdepropdown($server, $val, "cdrom"); echo "
"; } elseif (preg_match('/tapdev/', $arrColnames[$col])) { @@ -558,9 +535,10 @@ if (isset($_SESSION['username'])){ } elseif (preg_match('/brdev/', $arrColnames[$col])) { echo "
$arrColnames[$col]
"; } elseif (preg_match('/drive/', $arrColnames[$col])){ - echo "
"; + if ($arrColnames[$col]=="drive1"){ + echo "
"; + } serverdepropdown($server, $val, $arrColnames[$col]); - } elseif ($arrColnames[$col] == "server"){ echo "
$arrColnames[$col]