Add Conference Profiles.
This commit is contained in:
parent
9e568e56a8
commit
3684dacfcd
|
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = 'Conference Profiles';
|
||||
$apps[$x]['uuid'] = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9';
|
||||
$apps[$x]['category'] = '';
|
||||
$apps[$x]['subcategory'] = '';
|
||||
$apps[$x]['version'] = '';
|
||||
$apps[$x]['license'] = 'Mozilla Public License 1.1';
|
||||
$apps[$x]['url'] = 'http://www.fusionpbx.com';
|
||||
$apps[$x]['description']['en-us'] = '';
|
||||
|
||||
//permission details
|
||||
$y = 0;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_view';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_add';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_edit';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_delete';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_param_view';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_param_add';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_param_edit';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'user';
|
||||
$y++;
|
||||
$apps[$x]['permissions'][$y]['name'] = 'conference_profile_param_delete';
|
||||
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
|
||||
$y++;
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_conference_profiles';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'conference_profile_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the profile name.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_enabled';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Set the status of the profile.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_description';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
|
||||
|
||||
$y = 1; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_conference_profile_params';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'conference_profile_param_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'conference_profile_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_conference_profile';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'conference_profile_uuid';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_param_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the parameter name.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_param_value';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the value.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_param_enabled';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Set the status of the parameter.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_param_description';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.';
|
||||
$z++;
|
||||
?>
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
//Conference Profiles
|
||||
$text['title-conference_profiles']['en-us'] = 'Conference Profiles';
|
||||
$text['title-conference_profiles']['es-cl'] = '';
|
||||
$text['title-conference_profiles']['pt-pt'] = '';
|
||||
$text['title-conference_profiles']['fr-fr'] = '';
|
||||
|
||||
$text['title-conference_profile']['en-us'] = 'Conference Profile';
|
||||
$text['title-conference_profile']['es-cl'] = '';
|
||||
$text['title-conference_profile']['pt-pt'] = '';
|
||||
$text['title-conference_profile']['fr-fr'] = '';
|
||||
|
||||
$text['title_description-conference_profile']['en-us'] = 'A group of conference parameters saved together as a profile.';
|
||||
$text['title_description-conference_profile']['es-cl'] = '';
|
||||
$text['title_description-conference_profile']['pt-pt'] = '';
|
||||
$text['title_description-conference_profile']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_name']['en-us'] = 'Name';
|
||||
$text['label-profile_name']['es-cl'] = '';
|
||||
$text['label-profile_name']['pt-pt'] = '';
|
||||
$text['label-profile_name']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_name']['en-us'] = 'Enter the profile name.';
|
||||
$text['description-profile_name']['es-cl'] = '';
|
||||
$text['description-profile_name']['pt-pt'] = '';
|
||||
$text['description-profile_name']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_enabled']['en-us'] = 'Enabled';
|
||||
$text['label-profile_enabled']['es-cl'] = '';
|
||||
$text['label-profile_enabled']['pt-pt'] = '';
|
||||
$text['label-profile_enabled']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_enabled']['en-us'] = 'Set the status of the profile.';
|
||||
$text['description-profile_enabled']['es-cl'] = '';
|
||||
$text['description-profile_enabled']['pt-pt'] = '';
|
||||
$text['description-profile_enabled']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_description']['en-us'] = 'Description';
|
||||
$text['label-profile_description']['es-cl'] = '';
|
||||
$text['label-profile_description']['pt-pt'] = '';
|
||||
$text['label-profile_description']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_description']['en-us'] = 'Enter the description.';
|
||||
$text['description-profile_description']['es-cl'] = '';
|
||||
$text['description-profile_description']['pt-pt'] = '';
|
||||
$text['description-profile_description']['fr-fr'] = '';
|
||||
|
||||
//Profile Parameters
|
||||
$text['title-conference_profile_params']['en-us'] = 'Profile Parameters';
|
||||
$text['title-conference_profile_params']['es-cl'] = '';
|
||||
$text['title-conference_profile_params']['pt-pt'] = '';
|
||||
$text['title-conference_profile_params']['fr-fr'] = '';
|
||||
|
||||
$text['title-conference_profile_param']['en-us'] = 'Profile Parameter';
|
||||
$text['title-conference_profile_param']['es-cl'] = '';
|
||||
$text['title-conference_profile_param']['pt-pt'] = '';
|
||||
$text['title-conference_profile_param']['fr-fr'] = '';
|
||||
|
||||
$text['title_description-conference_profile_param']['en-us'] = 'Settings assigned to the conference profiles.';
|
||||
$text['title_description-conference_profile_param']['es-cl'] = '';
|
||||
$text['title_description-conference_profile_param']['pt-pt'] = '';
|
||||
$text['title_description-conference_profile_param']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_param_name']['en-us'] = 'Name';
|
||||
$text['label-profile_param_name']['es-cl'] = '';
|
||||
$text['label-profile_param_name']['pt-pt'] = '';
|
||||
$text['label-profile_param_name']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_param_name']['en-us'] = 'Enter the parameter name.';
|
||||
$text['description-profile_param_name']['es-cl'] = '';
|
||||
$text['description-profile_param_name']['pt-pt'] = '';
|
||||
$text['description-profile_param_name']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_param_value']['en-us'] = 'Value';
|
||||
$text['label-profile_param_value']['es-cl'] = '';
|
||||
$text['label-profile_param_value']['pt-pt'] = '';
|
||||
$text['label-profile_param_value']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_param_value']['en-us'] = 'Enter the value.';
|
||||
$text['description-profile_param_value']['es-cl'] = '';
|
||||
$text['description-profile_param_value']['pt-pt'] = '';
|
||||
$text['description-profile_param_value']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_param_enabled']['en-us'] = 'Enabled';
|
||||
$text['label-profile_param_enabled']['es-cl'] = '';
|
||||
$text['label-profile_param_enabled']['pt-pt'] = '';
|
||||
$text['label-profile_param_enabled']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_param_enabled']['en-us'] = 'Set the status of the parameter.';
|
||||
$text['description-profile_param_enabled']['es-cl'] = '';
|
||||
$text['description-profile_param_enabled']['pt-pt'] = '';
|
||||
$text['description-profile_param_enabled']['fr-fr'] = '';
|
||||
|
||||
$text['label-profile_param_description']['en-us'] = 'Description';
|
||||
$text['label-profile_param_description']['es-cl'] = '';
|
||||
$text['label-profile_param_description']['pt-pt'] = '';
|
||||
$text['label-profile_param_description']['fr-fr'] = '';
|
||||
|
||||
$text['description-profile_param_description']['en-us'] = 'Enter the description.';
|
||||
$text['description-profile_param_description']['es-cl'] = '';
|
||||
$text['description-profile_param_description']['pt-pt'] = '';
|
||||
$text['description-profile_param_description']['fr-fr'] = '';
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
$apps[$x]['menu'][0]['title']['en-us'] = 'Conference Profiles';
|
||||
$apps[$x]['menu'][0]['title']['es-cl'] = '';
|
||||
$apps[$x]['menu'][0]['title']['fr-fr'] = '';
|
||||
$apps[$x]['menu'][0]['title']['fr-ca'] = '';
|
||||
$apps[$x]['menu'][0]['title']['pl'] = '';
|
||||
$apps[$x]['menu'][0]['title']['sv-se'] = '';
|
||||
$apps[$x]['menu'][0]['title']['uk'] = '';
|
||||
$apps[$x]['menu'][0]['title']['de-at'] = '';
|
||||
$apps[$x]['menu'][0]['uuid'] = '6ebe7b9c-e964-4349-a002-288ea6ad08ca';
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
|
||||
$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
$apps[$x]['menu'][0]['path'] = '/app/conference_profiles/conference_profiles.php';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'admin';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'user';
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the id
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
|
||||
//delete the data
|
||||
if (strlen($id)>0) {
|
||||
//delete conference_profile
|
||||
$sql = "delete from v_conference_profiles ";
|
||||
$sql .= "where conference_profile_uuid = '$id' ";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
$_SESSION['message'] = $text['message-delete'];
|
||||
header('Location: conference_profiles.php');
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_add') || permission_exists('conference_profile_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$conference_profile_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
$profile_name = check_str($_POST["profile_name"]);
|
||||
$profile_enabled = check_str($_POST["profile_enabled"]);
|
||||
$profile_description = check_str($_POST["profile_description"]);
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$conference_profile_uuid = check_str($_POST["conference_profile_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
if (strlen($profile_name) == 0) { $msg .= $text['message-required']." ".$text['label-profile_name']."<br>\n"; }
|
||||
if (strlen($profile_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-profile_enabled']."<br>\n"; }
|
||||
//if (strlen($profile_description) == 0) { $msg .= $text['message-required']." ".$text['label-profile_description']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add" && permission_exists('conference_profile_add')) {
|
||||
$sql = "insert into v_conference_profiles ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "conference_profile_uuid, ";
|
||||
$sql .= "profile_name, ";
|
||||
$sql .= "profile_enabled, ";
|
||||
$sql .= "profile_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'$profile_name', ";
|
||||
$sql .= "'$profile_enabled', ";
|
||||
$sql .= "'$profile_description' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: conference_profiles.php");
|
||||
return;
|
||||
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update" && permission_exists('conference_profile_edit')) {
|
||||
$sql = "update v_conference_profiles set ";
|
||||
$sql .= "profile_name = '$profile_name', ";
|
||||
$sql .= "profile_enabled = '$profile_enabled', ";
|
||||
$sql .= "profile_description = '$profile_description' ";
|
||||
$sql .= "where conference_profile_uuid = '$conference_profile_uuid'";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: conference_profiles.php");
|
||||
return;
|
||||
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
|
||||
$conference_profile_uuid = check_str($_GET["id"]);
|
||||
$sql = "select * from v_conference_profiles ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and conference_profile_uuid = '$conference_profile_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$profile_name = $row["profile_name"];
|
||||
$profile_enabled = $row["profile_enabled"];
|
||||
$profile_description = $row["profile_description"];
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['title-conference_profile']."</b><br><br></td>\n";
|
||||
echo "<td width='70%' align='right' valign='top'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_profiles.php'\" value='".$text['button-back']."'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='profile_name' maxlength='255' value=\"$profile_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='profile_enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($profile_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($profile_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='profile_description' maxlength='255' value=\"$profile_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='conference_profile_uuid' value='$conference_profile_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "<br /><br />";
|
||||
|
||||
if ($action == "update") {
|
||||
require "conference_profile_params.php";
|
||||
}
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_param_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the id
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
$conference_profile_uuid = check_str($_GET["conference_profile_uuid"]);
|
||||
}
|
||||
|
||||
//delete the data
|
||||
if (strlen($id)>0) {
|
||||
//delete conference_profile_param
|
||||
$sql = "delete from v_conference_profile_params ";
|
||||
$sql .= "where conference_profile_param_uuid = '$id' ";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
$_SESSION['message'] = $text['message-delete'];
|
||||
header('Location: conference_profile_param_edit.php?id='.$conference_profile_uuid);
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_param_add') || permission_exists('conference_profile_param_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$conference_profile_param_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//set the parent uuid
|
||||
if (strlen($_GET["conference_profile_uuid"]) > 0) {
|
||||
$conference_profile_uuid = check_str($_GET["conference_profile_uuid"]);
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
$profile_param_name = check_str($_POST["profile_param_name"]);
|
||||
$profile_param_value = check_str($_POST["profile_param_value"]);
|
||||
$profile_param_enabled = check_str($_POST["profile_param_enabled"]);
|
||||
$profile_param_description = check_str($_POST["profile_param_description"]);
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
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"; }
|
||||
if (strlen($profile_param_value) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_value']."<br>\n"; }
|
||||
if (strlen($profile_param_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_enabled']."<br>\n"; }
|
||||
//if (strlen($profile_param_description) == 0) { $msg .= $text['message-required']." ".$text['label-profile_param_description']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//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;
|
||||
|
||||
} //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
|
||||
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
|
||||
$conference_profile_param_uuid = check_str($_GET["id"]);
|
||||
$sql = "select * from v_conference_profile_params ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and conference_profile_param_uuid = '$conference_profile_param_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$profile_param_name = $row["profile_param_name"];
|
||||
$profile_param_value = $row["profile_param_value"];
|
||||
$profile_param_enabled = $row["profile_param_enabled"];
|
||||
$profile_param_description = $row["profile_param_description"];
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<form name='frm' id='frm' method='post' action=''>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['title-conference_profile_param']."</b><br><br></td>\n";
|
||||
echo "<td width='70%' align='right' valign='top'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_profile_edit.php?id=$conference_profile_uuid'\" value='".$text['button-back']."'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_param_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='profile_param_name' maxlength='255' value=\"$profile_param_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_param_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_param_value']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='profile_param_value' maxlength='255' value=\"$profile_param_value\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_param_value']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_param_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='profile_param_enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($profile_param_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($profile_param_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_param_enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " ".$text['label-profile_param_description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='profile_param_description' maxlength='255' value=\"$profile_param_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-profile_param_description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='hidden' name='conference_profile_uuid' value='$conference_profile_uuid'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='conference_profile_param_uuid' value='$conference_profile_param_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "<br /><br />";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_param_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get variables used to control the order
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
|
||||
//add the search term
|
||||
$search = check_str($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_search = "and (";
|
||||
$sql_search .= "profile_param_name like '%".$search."%'";
|
||||
$sql_search .= "or profile_param_value like '%".$search."%'";
|
||||
$sql_search .= "or profile_param_enabled like '%".$search."%'";
|
||||
$sql_search .= "or profile_param_description like '%".$search."%'";
|
||||
$sql_search .= ")";
|
||||
}
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) as num_rows from v_conference_profile_params ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= $sql_search;
|
||||
$sql .= "and conference_profile_uuid = '$conference_profile_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
}
|
||||
else {
|
||||
$num_rows = '0';
|
||||
}
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_conference_profile_params ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= $sql_search;
|
||||
$sql .= "and conference_profile_uuid = '$conference_profile_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$sql .= "limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//alternate the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//show the content
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference_profile_params']."</b></td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td width='50%' style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".$search."'>\n";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " ".$text['title_description-conference_profile_param']."<br /><br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('profile_param_name', $text['label-profile_param_name'], $order_by, $order);
|
||||
echo th_order_by('profile_param_value', $text['label-profile_param_value'], $order_by, $order);
|
||||
echo th_order_by('profile_param_enabled', $text['label-profile_param_enabled'], $order_by, $order);
|
||||
echo th_order_by('profile_param_description', $text['label-profile_param_description'], $order_by, $order);
|
||||
echo "<td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_param_add')) {
|
||||
echo "<a href='conference_profile_param_edit.php?conference_profile_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if (is_array($result)) {
|
||||
foreach($result as $row) {
|
||||
if (permission_exists('conference_profile_param_edit')) {
|
||||
$tr_link = "href='conference_profile_param_edit.php?conference_profile_uuid=".$row['conference_profile_uuid']."&id=".$row['conference_profile_param_uuid']."'";
|
||||
}
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_param_name']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_param_value']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_param_enabled']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_param_description']." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_param_edit')) {
|
||||
echo "<a href='conference_profile_param_edit.php?conference_profile_uuid=".$row['conference_profile_uuid']."&id=".$row['conference_profile_param_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('conference_profile_param_delete')) {
|
||||
echo "<a href='conference_profile_param_delete.php?conference_profile_uuid=".$row['conference_profile_uuid']."&id=".$row['conference_profile_param_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='5' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_param_add')) {
|
||||
echo "<a href='conference_profile_param_edit.php?conference_profile_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
else {
|
||||
echo " ";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>";
|
||||
echo "<br /><br />";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
<?php
|
||||
|
||||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('conference_profile_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get variables used to control the order
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
|
||||
//add the search term
|
||||
$search = check_str($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$sql_search = "and (";
|
||||
$sql_search .= "profile_name like '%".$search."%'";
|
||||
$sql_search .= "or profile_enabled like '%".$search."%'";
|
||||
$sql_search .= "or profile_description like '%".$search."%'";
|
||||
$sql_search .= ")";
|
||||
}
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) as num_rows from v_conference_profiles ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= $sql_search;
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
}
|
||||
else {
|
||||
$num_rows = '0';
|
||||
}
|
||||
}
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_conference_profiles ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= $sql_search;
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$sql .= "limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//alternate the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//show the content
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference_profiles']."</b></td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td width='50%' style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".$search."'>\n";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " ".$text['title_description-conference_profile']."<br /><br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('profile_name', $text['label-profile_name'], $order_by, $order);
|
||||
echo th_order_by('profile_enabled', $text['label-profile_enabled'], $order_by, $order);
|
||||
echo th_order_by('profile_description', $text['label-profile_description'], $order_by, $order);
|
||||
echo "<td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_add')) {
|
||||
echo "<a href='conference_profile_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if (is_array($result)) {
|
||||
foreach($result as $row) {
|
||||
if (permission_exists('conference_profile_edit')) {
|
||||
$tr_link = "href='conference_profile_edit.php?id=".$row['conference_profile_uuid']."'";
|
||||
}
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_name']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_enabled']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile_description']." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_edit')) {
|
||||
echo "<a href='conference_profile_edit.php?id=".$row['conference_profile_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('conference_profile_delete')) {
|
||||
echo "<a href='conference_profile_delete.php?id=".$row['conference_profile_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('conference_profile_add')) {
|
||||
echo "<a href='conference_profile_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
else {
|
||||
echo " ";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>";
|
||||
echo "<br /><br />";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
umask(2);
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if (strpos($_ENV["OS"], "Win") !== false) {
|
||||
define("PATH_SEPARATOR", ";");
|
||||
} else {
|
||||
define("PATH_SEPARATOR", ":");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
|
||||
if(PHP_SAPI == 'cli'){
|
||||
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
|
||||
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
|
||||
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
|
||||
if (file_exists('/project_root.php')) {
|
||||
$path = '/';
|
||||
} else {
|
||||
$i = 1;
|
||||
$path = '';
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = $path;
|
||||
}else{
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
// try to detect if a project path is being used
|
||||
if (!defined('PROJECT_PATH')) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
|
||||
define('PROJECT_PATH', '/fusionpbx');
|
||||
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
|
||||
define('PROJECT_PATH', '');
|
||||
} else {
|
||||
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
|
||||
$i = 1;
|
||||
$path = $_SERVER["DOCUMENT_ROOT"];
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if(!file_exists($path. '/project_root.php')){
|
||||
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
|
||||
}
|
||||
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
|
||||
define('PROJECT_PATH', $project_path);
|
||||
}
|
||||
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue