Example #1
0
 *
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/consoleoption.php";
include_once "../../../classes/event.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$objMember = new Member($mysqli);
$eventObj = new Event($mysqli);
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage My Events");
$consoleObj->select($cID);
if ($member->authorizeLogin($_SESSION['btPassword']) && $eventObj->select($_POST['eID'])) {
    $memberInfo = $member->get_info();
    $eventInfo = $eventObj->get_info_filtered();
    if ($eventInfo['member_id'] == $memberInfo['member_id']) {
        if ($_POST['confirmDelete'] == 1) {
            $eventObj->delete();
        } else {
            echo "\n\t\t\t\n\t\t\t\t<div id='confirmDeleteMessage' style='display: none'>\n\t\t\t\t\n\t\t\t\t\t<p class='main' align='center'>Are you sure you want to delete the event, <b>" . $eventInfo['title'] . "</b>?</p>\n\t\t\t\t\n\t\t\t\t</div>\t\t\t\n\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#confirmDeleteMessage').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Delete Event',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/events/include/deleteevent.php', { confirmDelete: 1, eID: '" . $eventInfo['event_id'] . "' }, function(data) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twindow.location = '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t\n\t\t\t";
        }
    }
}
Example #2
0
    $arrCheckVisibility = array(0, 1, 2);
    if (!in_array($_POST['visibility'], $arrCheckVisibility)) {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid visibility setting.<br>";
        $countErrors++;
    }
    if ($_POST['allowmessages'] != 0) {
        $allowMessages = 1;
    } else {
        $allowMessages = 0;
    }
    if ($countErrors == 0) {
        $eventObj = new Event($mysqli);
        $arrColumns = array("member_id", "title", "description", "location", "startdate", "publicprivate", "visibility", "messages", "invitepermission", "timezone");
        $arrValues = array($memberInfo['member_id'], $_POST['eventtitle'], $_POST['eventdetails'], $_POST['eventlocation'], $setStartTime, $inviteType, $_POST['visibility'], $allowMessages, $openInvites, $_POST['timezone']);
        if ($eventObj->addNew($arrColumns, $arrValues)) {
            echo "\n\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully added the event, <b>" . $eventObj->get_info_filtered("title") . "!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Add Event', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.<br>";
        }
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $houroptions = "<option value='0'>12</option>";
    for ($i = 1; $i <= 11; $i++) {
        $houroptions .= "<option value='" . $i . "'>" . $i . "</option>";
    }