diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index 00fc4a2686..f4c9eb9ee8 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -1,17 +1,102 @@ '); + +if($_POST['addapp']) { + if($_SESSION['userlevel'] == '10') { + include("includes/app-add.inc.php"); + } +} + +if($_POST['delapp']) { + if($_SESSION['userlevel'] == '10') { + include("includes/app-delete.inc.php"); + } +} + if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && strstr($file, ".inc.php")) { - $file = str_replace(".inc.php", "", $file); - $servicesform .= ""; + $file = str_replace(".inc.php", "", $file); + $applicationsform .= ""; } } closedir($handle); } -echo("$servicesform"); +$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`"); +while($device = mysql_fetch_array($query)) { + $devicesform .= ""; +} + +if($updated) { print_message("Applications Updated"); } + +if(mysql_result(mysql_query("SELECT COUNT(*) from `applications` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') { + $i = "1"; + $app_query = mysql_query("select * from applications WHERE device_id = '".$device['device_id']."' ORDER BY app_type"); + while($application = mysql_fetch_array($app_query)) { + $existform .= ""; + } + +} + +if($existform){ +echo('