diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index fe9247b3f1..b068f8685c 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2008-2016 All Rights Reserved. + Copyright (C) 2019 All Rights Reserved. Contributor(s): Mark J Crane @@ -26,9 +26,9 @@ //includes require_once "root.php"; require_once "resources/require.php"; - require_once "resources/check_auth.php"; //check permissions + require_once "resources/check_auth.php"; if (permission_exists('device_profile_add') || permission_exists('device_profile_edit')) { //access granted } @@ -42,52 +42,38 @@ $text = $language->get(); //action add or update - if (is_uuid($_REQUEST["id"])) { + if (isset($_REQUEST["id"])) { $action = "update"; $device_profile_uuid = $_REQUEST["id"]; + $id = $_REQUEST["id"]; } else { $action = "add"; } //get http post variables and set them to php variables - if (count($_POST) > 0) { - //echo ""; exit; + if (is_array($_POST)) { + $device_profile_uuid = $_POST["device_profile_uuid"]; $device_profile_name = $_POST["device_profile_name"]; + $device_profile_keys = $_POST["device_profile_keys"]; + $device_profile_settings = $_POST["device_profile_settings"]; $device_profile_enabled = $_POST["device_profile_enabled"]; $device_profile_description = $_POST["device_profile_description"]; - $device_key_category = $_POST["device_key_category"]; - $device_key_id = $_POST["device_key_id"]; - $device_key_type = $_POST["device_key_type"]; - $device_key_line = $_POST["device_key_line"]; - $device_key_value = $_POST["device_key_value"]; - $device_key_extension = $_POST["device_key_extension"]; - $device_key_label = $_POST["device_key_label"]; - $device_key_icon = $_POST["device_key_icon"]; - - //$device_setting_category = $_POST["device_setting_category"]; - $device_setting_subcategory = $_POST["device_setting_subcategory"]; - //$device_setting_name = $_POST["device_setting_name"]; - $device_setting_value = $_POST["device_setting_value"]; - $device_setting_enabled = $_POST["device_setting_enabled"]; - $device_setting_description = $_POST["device_setting_description"]; - - //allow the domain_uuid to be changed only with the device_profile_domain permission - if (permission_exists('device_profile_domain')) { - $domain_uuid = $_POST["domain_uuid"]; - } - else { - $_POST["domain_uuid"] = $_SESSION['domain_uuid']; - } } -//add or update the database +//process the user data and save it to the database if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { + //check for all required data $msg = ''; - if (strlen($device_profile_name) == 0) { $msg .= $text['message-required'].$text['label-profile_name']."
\n"; } - if (strlen($msg) > 0) { + if (strlen($device_profile_name) == 0) { $msg .= $text['message-required']." ".$text['label-device_profile_name']."
\n"; } + //if (strlen($device_profile_keys) == 0) { $msg .= $text['message-required']." ".$text['label-device_profile_keys']."
\n"; } + //if (strlen($device_profile_settings) == 0) { $msg .= $text['message-required']." ".$text['label-device_profile_settings']."
\n"; } + //if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."
\n"; } + if (strlen($device_profile_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-device_profile_enabled']."
\n"; } + //if (strlen($device_profile_description) == 0) { $msg .= $text['message-required']." ".$text['label-device_profile_description']."
\n"; } + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "resources/header.php"; require_once "resources/persist_form_var.php"; echo "
\n"; @@ -100,639 +86,2559 @@ return; } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //set the domain_uuid + $_POST["domain_uuid"] = $_SESSION["domain_uuid"]; - //add the device_profile_uuid - if (strlen($_POST["device_profile_uuid"]) == 0) { - $device_profile_uuid = uuid(); - } + //add the device_profile_uuid + if (strlen($_POST["device_profile_uuid"]) == 0) { + $device_profile_uuid = uuid(); + } - //prepare the array - $array['device_profiles'][0]["device_profile_uuid"] = $device_profile_uuid; - $array['device_profiles'][0]["device_profile_name"] = $device_profile_name; - $array['device_profiles'][0]["domain_uuid"] = $domain_uuid; - $array['device_profiles'][0]["device_profile_enabled"] = $device_profile_enabled; - $array['device_profiles'][0]["device_profile_description"] = $device_profile_description; - $y = 0; - foreach ($device_profile_keys as $row) { - if (strlen($row['profile_key_category']) > 0) { - $array['device_profiles'][0]['device_profile_keys'][$y]["device_profile_key_uuid"] = $row["device_profile_key_uuid"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_category"] = $row["profile_key_category"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_id"] = $row["profile_key_id"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_vendor"] = $row["profile_key_vendor"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_type"] = $row["profile_key_type"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_line"] = $row["profile_key_line"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_value"] = $row["profile_key_value"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_extension"] = $row["profile_key_extension"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_protected"] = $row["profile_key_protected"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_label"] = $row["profile_key_label"]; - $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_icon"] = $row["profile_key_icon"]; - $y++; - } - } - $y = 0; - foreach ($device_profile_settings as $row) { - if (strlen($row['profile_setting_name']) > 0) { - $array['device_profiles'][0]['device_profile_settings'][$y]["device_profile_setting_uuid"] = $row["device_profile_setting_uuid"]; - $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_name"] = $row["profile_setting_name"]; - $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_value"] = $row["profile_setting_value"]; - $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_enabled"] = $row["profile_setting_enabled"]; - $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_description"] = $row["profile_setting_description"]; - $y++; - } - } + //prepare the array + $array['device_profiles'][0]["device_profile_uuid"] = $device_profile_uuid; + $array['device_profiles'][0]["device_profile_name"] = $device_profile_name; + $array['device_profiles'][0]["domain_uuid"] = $domain_uuid; + $array['device_profiles'][0]["device_profile_enabled"] = $device_profile_enabled; + $array['device_profiles'][0]["device_profile_description"] = $device_profile_description; + $y = 0; + foreach ($device_profile_keys as $row) { + if (strlen($row['profile_key_category']) > 0) { + $array['device_profiles'][0]['device_profile_keys'][$y]["device_profile_key_uuid"] = $row["device_profile_key_uuid"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_category"] = $row["profile_key_category"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_id"] = $row["profile_key_id"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_vendor"] = $row["profile_key_vendor"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_type"] = $row["profile_key_type"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_line"] = $row["profile_key_line"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_value"] = $row["profile_key_value"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_extension"] = $row["profile_key_extension"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_protected"] = $row["profile_key_protected"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_label"] = $row["profile_key_label"]; + $array['device_profiles'][0]['device_profile_keys'][$y]["profile_key_icon"] = $row["profile_key_icon"]; + $y++; + } + } + $y = 0; + foreach ($device_profile_settings as $row) { + if (strlen($row['profile_setting_name']) > 0) { + $array['device_profiles'][0]['device_profile_settings'][$y]["device_profile_setting_uuid"] = $row["device_profile_setting_uuid"]; + $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_name"] = $row["profile_setting_name"]; + $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_value"] = $row["profile_setting_value"]; + $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_enabled"] = $row["profile_setting_enabled"]; + $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_description"] = $row["profile_setting_description"]; + $y++; + } + } - //save the profile - $database = new database; - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; - $database->save($array); - $response = $database->message; - unset($array); + //save to the data + $database = new database; + $database->app_name = 'Device Profiles'; + $database->app_uuid = 'bb2531c3-97e6-428f-9a19-cbac1b96f5b7'; + $database->save($array); - //write the provision files - if (strlen($_SESSION['provision']['path']['text']) > 0) { - $prov = new provision; - $prov->domain_uuid = $domain_uuid; - $response = $prov->write(); - } - - //set the message - if (!isset($_SESSION['message'])) { - if ($save) { - if ($action == "add") { - //save the message to a session variable - message::add($text['message-add']); - } - if ($action == "update") { - //save the message to a session variable - message::add($text['message-update']); - - } - //redirect the browser - header("Location: device_profile_edit.php?id=".$device_profile_uuid); - exit; - } - } - - } //if ($_POST["persistformvar"] != "true") - } //(count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) + //redirect the user + if (isset($action)) { + if ($action == "add") { + $_SESSION["message"] = $text['message-add']; + } + if ($action == "update") { + $_SESSION["message"] = $text['message-update']; + } + header('Location: device_profile_edit.php?id='.$device_profile_uuid); + return; + } + } //(is_array($_POST) && strlen($_POST["persistformvar"]) == 0) //pre-populate the form - if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { + if (is_array($_GET) && $_POST["persistformvar"] != "true") { + $device_profile_uuid = $_GET["id"]; $sql = "select * from v_device_profiles "; $sql .= "where device_profile_uuid = :device_profile_uuid "; + //$sql .= "and domain_uuid = :domain_uuid "; + //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['device_profile_uuid'] = $device_profile_uuid; $database = new database; - $row = $database->select($sql, $parameters, 'row'); - if (is_array($row) && @sizeof($row) != 0) { + $result = $database->execute($sql, $parameters, 'all'); + foreach ($result as &$row) { $device_profile_name = $row["device_profile_name"]; - $device_profile_domain_uuid = $row["domain_uuid"]; + $device_profile_keys = $row["device_profile_keys"]; + $device_profile_settings = $row["device_profile_settings"]; $device_profile_enabled = $row["device_profile_enabled"]; $device_profile_description = $row["device_profile_description"]; } - unset($sql, $parameters, $row); + unset ($sql, $parameters); } -//set the sub array index - $x = "999"; - -//get device keys - $sql = "select * from v_device_keys "; - $sql .= "where device_profile_uuid = :device_profile_uuid "; - $sql .= "order by "; - $sql .= "device_key_vendor asc, "; - $sql .= "case device_key_category "; - $sql .= "when 'line' then 1 "; - $sql .= "when 'memory' then 2 "; - $sql .= "when 'programmable' then 3 "; - $sql .= "when 'expansion' then 4 "; - $sql .= "when 'expansion-1' then 5 "; - $sql .= "when 'expansion-2' then 6 "; - $sql .= "else 100 end, "; - $sql .= $db_type == "mysql" ? "device_key_id asc " : "cast(device_key_id as numeric) asc "; - $parameters['device_profile_uuid'] = $device_profile_uuid; - $database = new database; - $device_keys = $database->select($sql, $parameters, 'all'); - unset($sql, $parameters); - - $device_keys[$x]['device_key_category'] = ''; - $device_keys[$x]['device_key_id'] = ''; - $device_keys[$x]['device_key_type'] = ''; - $device_keys[$x]['device_key_line'] = ''; - $device_keys[$x]['device_key_value'] = ''; - $device_keys[$x]['device_key_extension'] = ''; - $device_keys[$x]['device_key_protected'] = ''; - $device_keys[$x]['device_key_label'] = ''; - $device_keys[$x]['device_key_icon'] = ''; - -//get the vendors - $sql = "select * "; - $sql .= "from v_device_vendors as v "; - $sql .= "where enabled = 'true' "; - $sql .= "order by name asc "; - $database = new database; - $vendors = $database->select($sql, null, 'all'); - unset($sql); - -//get the vendor functions - $sql = "select v.name as vendor_name, f.name, f.value "; - $sql .= "from v_device_vendors as v, v_device_vendor_functions as f "; - $sql .= "where v.device_vendor_uuid = f.device_vendor_uuid "; - $sql .= "and v.enabled = 'true' "; - $sql .= "and f.enabled = 'true' "; - $sql .= "order by v.name asc, f.name asc "; - $database = new database; - $vendor_functions = $database->select($sql, null, 'all'); - unset($sql); - -//get the vendor count - $vendor_count = 0; - foreach($device_keys as $row) { - if ($previous_vendor != $row['device_key_vendor']) { - $previous_vendor = $row['device_key_vendor']; - $vendor_count++; - } +//get the child data + if (strlen($device_profile_uuid) > 0) { + $sql = "select * from v_device_profile_keys "; + $sql .= "where device_profile_uuid = :device_profile_uuid "; + //$sql .= "and domain_uuid = '".$domain_uuid."' "; + $sql .= "order by profile_key_id asc"; + //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $parameters['device_profile_uuid'] = $device_profile_uuid; + $database = new database; + $device_profile_keys = $database->execute($sql, $parameters, 'all'); + unset ($sql, $parameters); } -//get device settings - $sql = "select * from v_device_settings "; - $sql .= "where device_profile_uuid = :device_profile_uuid "; - $sql .= "order by device_setting_subcategory asc "; - $parameters['device_profile_uuid'] = $device_profile_uuid; - $database = new database; - $device_settings = $database->select($sql, $parameters, 'all'); - unset($sql, $parameters); +//add the $device_profile_key_uuid + if (strlen($device_profile_key_uuid) == 0) { + $device_profile_key_uuid = uuid(); + } - $device_settings[$x]['device_setting_name'] = ''; - $device_settings[$x]['device_setting_value'] = ''; - $device_settings[$x]['enabled'] = ''; - $device_settings[$x]['device_setting_description'] = ''; +//add an empty row + $x = count($device_profile_keys); + $device_profile_keys[$x]['domain_uuid'] = $_SESSION['domain_uuid']; + $device_profile_keys[$x]['device_profile_uuid'] = $device_profile_uuid; + $device_profile_keys[$x]['device_profile_key_uuid'] = uuid(); + $device_profile_keys[$x]['profile_key_category'] = ''; + $device_profile_keys[$x]['profile_key_id'] = ''; + $device_profile_keys[$x]['profile_key_vendor'] = ''; + $device_profile_keys[$x]['profile_key_type'] = ''; + $device_profile_keys[$x]['profile_key_line'] = ''; + $device_profile_keys[$x]['profile_key_value'] = ''; + $device_profile_keys[$x]['profile_key_extension'] = ''; + $device_profile_keys[$x]['profile_key_protected'] = ''; + $device_profile_keys[$x]['profile_key_label'] = ''; + $device_profile_keys[$x]['profile_key_icon'] = ''; + +//get the child data + if (strlen($device_profile_uuid) > 0) { + $sql = "select * from v_device_profile_settings "; + $sql .= "where device_profile_uuid = :device_profile_uuid "; + //$sql .= "and domain_uuid = '".$domain_uuid."' "; + $sql .= "order by profile_setting_name asc"; + //$parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $parameters['device_profile_uuid'] = $device_profile_uuid; + $database = new database; + $device_profile_settings = $database->execute($sql, $parameters, 'all'); + unset ($sql, $parameters); + } + +//add the $device_profile_setting_uuid + if (strlen($device_profile_setting_uuid) == 0) { + $device_profile_setting_uuid = uuid(); + } + +//add an empty row + $x = count($device_profile_settings); + $device_profile_settings[$x]['domain_uuid'] = $_SESSION['domain_uuid']; + $device_profile_settings[$x]['device_profile_uuid'] = $device_profile_uuid; + $device_profile_settings[$x]['device_profile_setting_uuid'] = uuid(); + $device_profile_settings[$x]['profile_setting_name'] = ''; + $device_profile_settings[$x]['profile_setting_value'] = ''; + $device_profile_settings[$x]['profile_setting_enabled'] = ''; + $device_profile_settings[$x]['profile_setting_description'] = ''; //show the header require_once "resources/header.php"; - $document['title'] = $text['title-profile']; -//javascript to change select to input and back again - ?> - -\n"; + echo "
\n"; echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - - echo " "; - echo " "; - echo " "; - echo " "; - -//device settings - echo " "; - echo " "; - echo " \n"; - echo " \n"; - - if (permission_exists('device_profile_domain')) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "\n"; - echo " \n"; + echo "
"; - echo " ".$text['header-profile'].""; - echo "

"; - echo " ".$text['description-profile']; - echo "

"; - echo "
".$text['title-device_profile']."

\n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " "; + echo " "; + echo " "; + echo "
\n"; + echo " ".$text['description-device_profiles']."

\n"; echo "
\n"; - echo " ".$text['label-profile_name']."\n"; + echo " ".$text['label-device_profile_name']."\n"; echo "\n"; - echo " \n"; + echo "\n"; + echo " \n"; echo "
\n"; - echo $text['description-profile_name']."\n"; - echo "
".$text['label-keys'].""; - echo " \n"; - if ($vendor_count == 0) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('device_key_extension')) { - echo " \n"; - } - if (permission_exists('device_key_protected')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - } - - $x = 0; - foreach($device_keys as $row) { - - //set the device vendor - $device_vendor = $row['device_key_vendor']; - - //get the device key vendor from the key type - foreach ($vendor_functions as $function) { - if ($row['device_key_vendor'] == $function['vendor_name'] && $row['device_key_type'] == $function['value']) { - $device_key_vendor = $function['vendor_name']; - } - } - - //set the column names - if ($previous_device_key_vendor != $row['device_key_vendor']) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - if (permission_exists('device_key_extension')) { - echo " \n"; - } - if (permission_exists('device_key_protected')) { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - } - //determine whether to hide the element - if (!is_uuid($device_key_uuid)) { - $element['hidden'] = false; - $element['visibility'] = "visibility:visible;"; - } - else { - $element['hidden'] = true; - $element['visibility'] = "visibility:hidden;"; - } - //add the primary key uuid - if (is_uuid($row['device_key_uuid'])) { - echo " \n"; - } - else { - echo " \n"; - } - //show all the rows in the array - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo "\n"; - - echo "\n"; - - if (permission_exists('device_key_extension')) { - echo "\n"; - } - - if (permission_exists('device_key_protected')) { - echo " \n"; - } - - echo "\n"; - - echo "\n"; - - echo "\n"; - echo " \n"; - //set the previous vendor - $previous_device_key_vendor = $row['device_key_vendor']; - //increment the array key - $x++; - } - echo "
".$text['label-device_key_category']."".$text['label-device_key_id']."".$text['label-device_vendor']."".$text['label-device_key_type']."".$text['label-device_key_line']."".$text['label-device_key_value']."".$text['label-device_key_extension']."".$text['label-device_key_protected']."".$text['label-device_key_label']." ".$text['label-device_key_icon']." 
".$text['label-device_key_category']."".$text['label-device_key_id']."".$text['label-device_vendor']."".$text['label-device_key_type']."".$text['label-device_key_line']."".$text['label-device_key_value']."".$text['label-device_key_extension']."".$text['label-device_key_protected']."".$text['label-device_key_label']."".$text['label-device_key_icon']." 
\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - if (is_uuid($row['device_key_uuid'])) { - if (permission_exists('device_key_delete')) { - echo " $v_link_label_delete\n"; - } - } - echo "
\n"; - if (strlen($text['description-keys']) > 0) { - echo "
".$text['description-keys']."\n"; - } - echo "
".$text['label-settings'].""; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - - $x = 0; - foreach($device_settings as $row) { - //determine whether to hide the element - if (!is_uuid($device_setting_uuid)) { - $element['hidden'] = false; - $element['visibility'] = "visibility:visible;"; - } - else { - $element['hidden'] = true; - $element['visibility'] = "visibility:hidden;"; - } - //add the primary key uuid - if (is_uuid($row['device_setting_uuid'])) { - echo " \n"; - } - - //show alls rows in the array - echo "\n"; - echo "\n"; - - echo "\n"; - - echo "\n"; - - echo "\n"; - - if (strlen($text['description-settings']) > 0) { - echo "
".$text['description-settings']."\n"; - } - echo " "; - - echo " \n"; - echo " \n"; - $x++; - } - /* - echo "
".$text['label-device_setting_name']."".$text['label-device_setting_value']."".$text['label-enabled']."".$text['label-device_setting_description']." 
\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo " \n"; - echo "\n"; - if (is_uuid($row['device_setting_uuid'])) { - echo " $v_link_label_delete\n"; - } - echo "
\n"; - echo " \n"; - */ - echo "
\n"; - echo "
\n"; - echo " ".$text['label-profile_domain']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo " ".$text['label-profile_enabled']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-profile_enabled']."\n"; + echo $text['description-device_profile_name']."\n"; echo "
\n"; - echo " ".$text['label-profile_description']."\n"; + echo " ".$text['label-device_profile_keys']."\n"; echo "\n"; - echo " \n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + $x = 0; + foreach($device_profile_keys as $row) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + $x++; + } + echo "
".$text['label-device_key_category']."".$text['label-device_key_id']."".$text['label-device_key_vendor']."".$text['label-device_key_type']."".$text['label-device_key_line']."".$text['label-device_key_value']."".$text['label-device_key_extension']."".$text['label-device_key_protected']."".$text['label-device_key_label']."".$text['label-device_key_icon']."
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; echo "
\n"; - echo $text['description-profile_description']."\n"; + echo $text['description-profile_key_icon']."\n"; echo "
\n"; - if ($action == "update") { - echo " \n"; + echo "\n"; + echo " ".$text['label-device_profile_settings']."\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + $x = 0; + foreach($device_profile_settings as $row) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + $x++; } - echo "
"; - echo " \n"; - echo " \n"; - echo ""; - echo "
".$text['label-device_setting_name']."".$text['label-device_setting_value']."".$text['label-device_setting_enabled']."".$text['label-device_setting_description']."
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
"; - echo "

"; - echo ""; + echo "
\n"; + echo "
\n"; + echo $text['description-profile_setting_description']."\n"; + echo "\n"; + echo "\n"; -//show the footer + echo "\n"; + echo "\n"; + echo " ".$text['label-domain_uuid']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-domain_uuid']."\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-device_profile_enabled']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_profile_enabled']."\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-device_profile_description']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_profile_description']."\n"; + echo "\n"; + echo "\n"; + + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " "; + echo ""; + echo ""; + echo "

"; + +//include the footer require_once "resources/footer.php"; ?>