Update conference_profile_param_edit.php

Add a few more comments end a little more indentation.
This commit is contained in:
FusionPBX
2016-07-16 23:57:03 -06:00
committed by GitHub
parent bb8cacd0da
commit 7ba66fd7b4
@@ -40,82 +40,84 @@
$profile_param_description = check_str($_POST["profile_param_description"]); $profile_param_description = check_str($_POST["profile_param_description"]);
} }
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //process the http post if it exists
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") { //get the uuid
$conference_profile_param_uuid = check_str($_POST["conference_profile_param_uuid"]); if ($action == "update") {
} $conference_profile_param_uuid = check_str($_POST["conference_profile_param_uuid"]);
}
//check for all required data
if (strlen($profile_param_name) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_name']."<br>\n"; } //check for all required data
if (strlen($profile_param_value) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_value']."<br>\n"; } $msg = '';
if (strlen($profile_param_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_enabled']."<br>\n"; } if (strlen($profile_param_name) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_name']."<br>\n"; }
//if (strlen($profile_param_description) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_description']."<br>\n"; } if (strlen($profile_param_value) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_value']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($profile_param_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_enabled']."<br>\n"; }
require_once "resources/header.php"; //if (strlen($profile_param_description) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_description']."<br>\n"; }
require_once "resources/persist_form_var.php"; if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n"; require_once "resources/header.php";
echo "<table><tr><td>\n"; require_once "resources/persist_form_var.php";
echo $msg."<br />"; echo "<div align='center'>\n";
echo "</td></tr></table>\n"; echo "<table><tr><td>\n";
persistformvar($_POST); echo $msg."<br />";
echo "</div>\n"; echo "</td></tr></table>\n";
require_once "resources/footer.php"; persistformvar($_POST);
return; echo "</div>\n";
} require_once "resources/footer.php";
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('conference_profile_param_add')) {
$sql = "insert into v_conference_profile_params ";
$sql .= "(";
//$sql .= "domain_uuid, ";
$sql .= "conference_profile_param_uuid, ";
$sql .= "conference_profile_uuid, ";
$sql .= "profile_param_name, ";
$sql .= "profile_param_value, ";
$sql .= "profile_param_enabled, ";
$sql .= "profile_param_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
//$sql .= "'$domain_uuid', ";
$sql .= "'".uuid()."', ";
$sql .= "'$conference_profile_uuid', ";
$sql .= "'$profile_param_name', ";
$sql .= "'$profile_param_value', ";
$sql .= "'$profile_param_enabled', ";
$sql .= "'$profile_param_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION["message"] = $text['message-add'];
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid);
return; return;
}
} //if ($action == "add")
//add or update the database
if ($action == "update" && permission_exists('conference_profile_param_edit')) { if ($_POST["persistformvar"] != "true") {
$sql = "update v_conference_profile_params set "; if ($action == "add" && permission_exists('conference_profile_param_add')) {
$sql .= "conference_profile_uuid = '$conference_profile_uuid', "; $sql = "insert into v_conference_profile_params ";
$sql .= "profile_param_name = '$profile_param_name', "; $sql .= "(";
$sql .= "profile_param_value = '$profile_param_value', "; //$sql .= "domain_uuid, ";
$sql .= "profile_param_enabled = '$profile_param_enabled', "; $sql .= "conference_profile_param_uuid, ";
$sql .= "profile_param_description = '$profile_param_description' "; $sql .= "conference_profile_uuid, ";
$sql .= "where conference_profile_param_uuid = '$conference_profile_param_uuid'"; $sql .= "profile_param_name, ";
//$sql .= "and domain_uuid = '$domain_uuid' "; $sql .= "profile_param_value, ";
$db->exec(check_sql($sql)); $sql .= "profile_param_enabled, ";
unset($sql); $sql .= "profile_param_description ";
$sql .= ")";
$_SESSION["message"] = $text['message-update']; $sql .= "values ";
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid); $sql .= "(";
return; //$sql .= "'$domain_uuid', ";
$sql .= "'".uuid()."', ";
} //if ($action == "update") $sql .= "'$conference_profile_uuid', ";
} //if ($_POST["persistformvar"] != "true") $sql .= "'$profile_param_name', ";
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) $sql .= "'$profile_param_value', ";
$sql .= "'$profile_param_enabled', ";
$sql .= "'$profile_param_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION["message"] = $text['message-add'];
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid);
return;
} //if ($action == "add")
if ($action == "update" && permission_exists('conference_profile_param_edit')) {
$sql = "update v_conference_profile_params set ";
$sql .= "conference_profile_uuid = '$conference_profile_uuid', ";
$sql .= "profile_param_name = '$profile_param_name', ";
$sql .= "profile_param_value = '$profile_param_value', ";
$sql .= "profile_param_enabled = '$profile_param_enabled', ";
$sql .= "profile_param_description = '$profile_param_description' ";
$sql .= "where conference_profile_param_uuid = '$conference_profile_param_uuid'";
//$sql .= "and domain_uuid = '$domain_uuid' ";
$db->exec(check_sql($sql));
unset($sql);
$_SESSION["message"] = $text['message-update'];
header('Location: conference_profile_edit.php?id='.$conference_profile_uuid);
return;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form //pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {