Update conference room list, edit and delete files.

This commit is contained in:
Mark Crane 2012-10-04 23:04:39 +00:00
parent 8d7b149594
commit 243d67572a
3 changed files with 57 additions and 57 deletions

View File

@ -2,7 +2,7 @@
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conference_session_delete')) {
if (permission_exists('conference_room_delete')) {
//access granted
}
else {
@ -17,10 +17,10 @@ if (count($_GET)>0) {
if (strlen($id)>0) {
//get the meeting_uuid
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$conference_session_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_sessions ";
$conference_room_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_room_uuid = '$conference_room_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
@ -31,9 +31,9 @@ if (strlen($id)>0) {
}
//delete the conference session
$sql = "delete from v_conference_sessions ";
$sql = "delete from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$id' ";
$sql .= "and conference_room_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
@ -65,7 +65,7 @@ if (strlen($id)>0) {
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_sessions.php\">\n";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_rooms.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo "</div>\n";

View File

@ -2,7 +2,7 @@
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conference_session_add') || permission_exists('conference_session_edit')) {
if (permission_exists('conference_room_add') || permission_exists('conference_room_edit')) {
//access granted
}
else {
@ -13,7 +13,7 @@ else {
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$conference_session_uuid = check_str($_REQUEST["id"]);
$conference_room_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
@ -21,7 +21,7 @@ else {
//get http post variables and set them to php variables
if (count($_POST)>0) {
$conference_uuid = check_str($_POST["conference_uuid"]);
$conference_center_uuid = check_str($_POST["conference_center_uuid"]);
$member_pin = check_str($_POST["member_pin"]);
$member_type = check_str($_POST["member_type"]);
$user_uuid = check_str($_POST["user_uuid"]);
@ -40,11 +40,11 @@ else {
}
//delete the user from the v_extension_users
if ($_GET["a"] == "delete" && permission_exists('conference_session_add') && permission_exists('conference_session_edit')) {
if ($_GET["a"] == "delete" && permission_exists('conference_room_add') && permission_exists('conference_room_edit')) {
if (strlen($_REQUEST["meeting_user_uuid"]) > 0) {
//set the variables
$meeting_user_uuid = check_str($_REQUEST["meeting_user_uuid"]);
$conference_session_uuid = check_str($_REQUEST["conference_session_uuid"]);
$conference_room_uuid = check_str($_REQUEST["conference_room_uuid"]);
//delete the extension from the ring_group
$sql = "delete from v_meeting_users ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
@ -55,7 +55,7 @@ else {
if (strlen($_REQUEST["meeting_pin_uuid"]) > 0) {
//set the variables
$meeting_pin_uuid = check_str($_REQUEST["meeting_pin_uuid"]);
$conference_session_uuid = check_str($_REQUEST["conference_session_uuid"]);
$conference_room_uuid = check_str($_REQUEST["conference_room_uuid"]);
//delete the extension from the ring_group
$sql = "delete from v_meeting_pins ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
@ -65,7 +65,7 @@ else {
}
//redirect the browser
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_session_edit.php?id=$conference_session_uuid\">\n";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_room_edit.php?id=$conference_room_uuid\">\n";
echo "<div align='center'>Delete Complete</div>";
require_once "includes/footer.php";
return;
@ -75,11 +75,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$conference_session_uuid = check_str($_POST["conference_session_uuid"]);
$conference_room_uuid = check_str($_POST["conference_room_uuid"]);
}
//check for all required data
//if (strlen($conference_uuid) == 0) { $msg .= "Please provide: Conference UUID<br>\n"; }
//if (strlen($conference_center_uuid) == 0) { $msg .= "Please provide: Conference UUID<br>\n"; }
//if (strlen($max_members) == 0) { $msg .= "Please provide: Max Members<br>\n"; }
//if (strlen($wait_mod) == 0) { $msg .= "Please provide: Wait for the Moderator<br>\n"; }
if (strlen($announce) == 0) { $msg .= "Please provide: Announce<br>\n"; }
@ -105,7 +105,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('conference_session_add')) {
if ($action == "add" && permission_exists('conference_room_add')) {
//add a meeting
$meeting_uuid = uuid();
$sql = "insert into v_meetings ";
@ -130,12 +130,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
//add a conference session
$conference_session_uuid = uuid();
$sql = "insert into v_conference_sessions ";
$conference_room_uuid = uuid();
$sql = "insert into v_conference_rooms ";
$sql .= "(";
$sql .= "domain_uuid, ";
$sql .= "conference_session_uuid, ";
$sql .= "conference_uuid, ";
$sql .= "conference_room_uuid, ";
$sql .= "conference_center_uuid, ";
$sql .= "meeting_uuid, ";
$sql .= "max_members, ";
$sql .= "wait_mod, ";
@ -150,8 +150,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "values ";
$sql .= "(";
$sql .= "'$domain_uuid', ";
$sql .= "'$conference_session_uuid', ";
$sql .= "'$conference_uuid', ";
$sql .= "'$conference_room_uuid', ";
$sql .= "'$conference_center_uuid', ";
$sql .= "'$meeting_uuid', ";
$sql .= "'$max_members', ";
$sql .= "'$wait_mod', ";
@ -168,13 +168,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
} //if ($action == "add")
if ($action == "update" && permission_exists('conference_session_edit')) {
if ($action == "update" && permission_exists('conference_room_edit')) {
//get the meeting_uuid
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$conference_session_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_sessions ";
$conference_room_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_room_uuid = '$conference_room_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
@ -194,8 +194,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql);
//update conferences sessions
$sql = "update v_conference_sessions set ";
$sql .= "conference_uuid = '$conference_uuid', ";
$sql = "update v_conference_rooms set ";
$sql .= "conference_center_uuid = '$conference_center_uuid', ";
//$sql .= "meeting_uuid = '$meeting_uuid', ";
$sql .= "max_members = '$max_members', ";
$sql .= "wait_mod = '$wait_mod', ";
@ -205,7 +205,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$sql .= "enabled = '$enabled', ";
$sql .= "description = '$description' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_room_uuid = '$conference_room_uuid' ";
//echo $sql; //exit;
$db->exec(check_sql($sql));
unset($sql);
@ -260,7 +260,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//redirect the user
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_session_edit.php?id=$conference_session_uuid\">\n";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_room_edit.php?id=$conference_room_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo "</div>\n";
@ -272,15 +272,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$conference_session_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_sessions ";
$conference_room_uuid = check_str($_GET["id"]);
$sql = "select * from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_room_uuid = '$conference_room_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
foreach ($result as &$row) {
$conference_uuid = $row["conference_uuid"];
$conference_center_uuid = $row["conference_center_uuid"];
$meeting_uuid = $row["meeting_uuid"];
$max_members = $row["max_members"];
$wait_mod = $row["wait_mod"];
@ -323,7 +323,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if (strlen($meeting_uuid) > 0) {
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='/app/conferences_active/conference_interactive.php?c=".$meeting_uuid."'\" value='View'>\n";
}
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='conference_sessions.php'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='conference_rooms.php'\" value='Back'>\n";
echo "</td>\n";
echo "</tr>\n";
@ -332,7 +332,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Conference Name:\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='conference_uuid'>\n";
echo " <select class='formfld' name='conference_center_uuid'>\n";
$sql = "select * from v_conferences ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "order by conference_name asc ";
@ -341,11 +341,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$x = 0;
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as &$row) {
if ($conference_uuid == $row["conference_uuid"]) {
echo " <option value='".$row["conference_uuid"]."' selected='selected'>".$row["conference_name"]."</option>\n";
if ($conference_center_uuid == $row["conference_center_uuid"]) {
echo " <option value='".$row["conference_center_uuid"]."' selected='selected'>".$row["conference_name"]."</option>\n";
}
else {
echo " <option value='".$row["conference_uuid"]."'>".$row["conference_name"]."</option>\n";
echo " <option value='".$row["conference_center_uuid"]."'>".$row["conference_name"]."</option>\n";
}
$x++;
}
@ -374,7 +374,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <tr>\n";
echo " <td class='vtable'>".$field['username']."</td>\n";
echo " <td style='width : 25px;' align='right'>\n";
echo " <a href='conference_session_edit.php?meeting_user_uuid=".$field['meeting_user_uuid']."&conference_session_uuid=".$conference_session_uuid."&a=delete' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='conference_room_edit.php?meeting_user_uuid=".$field['meeting_user_uuid']."&conference_room_uuid=".$conference_room_uuid."&a=delete' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo " </tr>\n";
}
@ -420,7 +420,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <td class='vtable'>".$field['member_pin']."</td>\n";
echo " <td class='vtable'>".$field['member_type']."</td>\n";
echo " <td style='width : 25px;' align='right'>\n";
echo " <a href='conference_session_edit.php?meeting_pin_uuid=".$field['meeting_pin_uuid']."&conference_session_uuid=".$conference_session_uuid."&a=delete' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='conference_room_edit.php?meeting_pin_uuid=".$field['meeting_pin_uuid']."&conference_room_uuid=".$conference_room_uuid."&a=delete' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo " </tr>\n";
}
@ -559,7 +559,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
/*
if ($action == "update" && permission_exists('conference_session_edit')) {
if ($action == "update" && permission_exists('conference_room_edit')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Created:\n";
@ -627,7 +627,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
if ($action == "update") {
echo " <input type='hidden' name='conference_session_uuid' value='$conference_session_uuid'>\n";
echo " <input type='hidden' name='conference_room_uuid' value='$conference_room_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n";

View File

@ -2,7 +2,7 @@
require_once "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conference_session_view')) {
if (permission_exists('conference_room_view')) {
//access granted
}
else {
@ -31,7 +31,7 @@ require_once "includes/paging.php";
echo "</table>\n";
//prepare to page the results
$sql = "select count(*) as num_rows from v_conference_sessions ";
$sql = "select count(*) as num_rows from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
@ -55,7 +55,7 @@ require_once "includes/paging.php";
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_conference_sessions ";
$sql = "select * from v_conference_rooms ";
$sql .= "where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$sql .= "limit $rows_per_page offset $offset ";
@ -72,7 +72,7 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
//echo th_order_by('conference_uuid', 'Conference UUID', $order_by, $order);
//echo th_order_by('conference_center_uuid', 'Conference UUID', $order_by, $order);
//echo th_order_by('meeting_uuid', 'Meeting UUID', $order_by, $order);
echo th_order_by('max_members', 'Max Members', $order_by, $order);
echo th_order_by('wait_mod', 'Wait for Moderator', $order_by, $order);
@ -84,8 +84,8 @@ require_once "includes/paging.php";
echo th_order_by('enabled', 'Enabled', $order_by, $order);
echo th_order_by('description', 'Description', $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('conference_session_add')) {
echo " <a href='conference_session_edit.php' alt='add'>$v_link_label_add</a>\n";
if (permission_exists('conference_room_add')) {
echo " <a href='conference_room_edit.php' alt='add'>$v_link_label_add</a>\n";
}
else {
echo " &nbsp;\n";
@ -96,7 +96,7 @@ require_once "includes/paging.php";
if ($result_count > 0) {
foreach($result as $row) {
echo "<tr >\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['conference_uuid']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['conference_center_uuid']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['meeting_uuid']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['max_members']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['wait_mod']."&nbsp;</td>\n";
@ -108,11 +108,11 @@ require_once "includes/paging.php";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['enabled']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg' width='30%'>".$row['description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('conference_session_edit')) {
echo " <a href='conference_session_edit.php?id=".$row['conference_session_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
if (permission_exists('conference_room_edit')) {
echo " <a href='conference_room_edit.php?id=".$row['conference_room_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
}
if (permission_exists('conference_session_delete')) {
echo " <a href='conference_session_delete.php?id=".$row['conference_session_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
if (permission_exists('conference_room_delete')) {
echo " <a href='conference_room_delete.php?id=".$row['conference_room_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@ -128,8 +128,8 @@ require_once "includes/paging.php";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('conference_session_add')) {
echo " <a href='conference_session_edit.php' alt='add'>$v_link_label_add</a>\n";
if (permission_exists('conference_room_add')) {
echo " <a href='conference_room_edit.php' alt='add'>$v_link_label_add</a>\n";
}
else {
echo " &nbsp;\n";