コード例 #1
0
{
    require_once $class_name . '.php';
}
$user = new User();
$page = new Webpage("Remove User Event", $user);
$C = new Connection();
$eID = $page->_GET_checkEventID($_GET['event'], $C, FALSE);
if (!isset($eID)) {
    exit(0);
}
$uID = $user->get_UserID();
if (isset($_GET['confirm'])) {
    // they have confirmed they wish to delete the event
    $q = "DELETE FROM userSchedule WHERE us_userID = {$uID} AND us_eventID = {$eID};";
    $C->query($q);
    $page->printError("Event removed successfully.");
    echo "<center>";
    $page->addURL("userSchedule.php", "Return to your custom schedule.");
    echo "<br /><br />";
    $page->addURL("index.php", "Return to event schedule.");
    echo "</center>";
} else {
    $q = "SELECT e_eventName FROM events WHERE e_eventID = {$eID}";
    $C->query($q);
    $row = $C->fetch_row();
    $eventName = $row[0];
    echo "<center>";
    echo "<h3>Do you really want to remove \"{$eventName}\" from your schedule?</h3>";
    $page->addURL("deleteUserEvent.php?event={$eID}&confirm=1", "Yes");
    echo "&nbsp; &nbsp; &nbsp;";
    $page->addURL("view.php?event={$eID}", "No");
コード例 #2
0
ファイル: add.php プロジェクト: kitsune/ConSchedule
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
#first login info
$user = new User();
$page = new Webpage("Add Event", $user);
$connection = new Connection();
#only admins can add events
if (!$user->is_Admin()) {
    $page->printError("Only Admins can create new events.");
    echo "<center>";
    $page->addURL("index.php", "Return to event schedule.");
    echo "</center>";
    exit(0);
}
if (isset($_GET['action']) && count($_POST) == 15) {
    //ok we'll add the entry here.
    $name = $connection->validate_string($_POST['name']);
    $name = trim($name);
    if (str_word_count($name) == 0) {
        $page->printError("Name cannot be blank.");
        echo "<center>";
        echo "Please go back and supply one.<br /><br />";
        $page->addURL("add.php", "Try again.");
        echo "<br /><br />";
コード例 #3
0
ファイル: delete.php プロジェクト: kitsune/ConSchedule
$user = new User();
$page = new Webpage("Delete Event", $user);
$connection = new Connection();
$eventID = $page->_GET_checkEventID($_GET['event'], $connection, FALSE);
if (!isset($eventID)) {
    exit(0);
}
if ($user->is_Admin()) {
    if (isset($_GET['confirm'])) {
        // they want to delete it so lets delete it
        $query = "DELETE FROM events WHERE e_eventID = {$eventID};";
        $connection->query($query);
        //also remove the event from user schedules
        $query = "DELETE FROM userSchedule WHERE us_eventID = {$eventID};";
        $connection->query($query);
        $page->printError("Event successfully deleted.");
        echo "<center>";
        $page->addURL("index.php", "Return to event schedule.");
        echo "</center>";
        exit(0);
    } else {
        $query = "SELECT e_eventName FROM events WHERE e_eventID = {$eventID}";
        $connection->query($query);
        $row = $connection->fetch_row();
        $eventName = $row[0];
        echo "<center>Do you really want to delete the event \"<strong>{$eventName}</strong>?\"<br />";
        $page->addURL("delete.php?event={$eventID}&confirm='Yes'", "Yes");
        echo "&nbsp;&nbsp;&nbsp;";
        $page->addURL("view.php?event={$eventID}", "No");
    }
} else {
コード例 #4
0
ファイル: index.php プロジェクト: harvimt/ConSchedule
        $endDate = date_create($conTimes[$conday]['end']);
    }
}
//fill in the start and end times with conTimes if not specified via url params
if (!isset($startDate) && !isset($endDate)) {
    $startDate = date_create($conTimes[0]['start']);
    $endDate = date_create($conTimes[$conDayCount - 1]['end']);
}
$schedule = NULL;
// events query
$q = "\nSELECT \n\te_eventID, e_eventName, r_roomName, e_dateStart, \n\te_dateEnd, e_eventName, e_eventDesc, e_color, e_panelist\nFROM \n\tevents, rooms\nWHERE \n\te_roomID = r_roomID\n\tAND\n\te_dateStart \n\t\tBETWEEN \n\t\t'" . $startDate->format("Y-m-d H:i:s") . "'\n\t\tAND\n\t\t'" . $endDate->format("Y-m-d H:i:s") . "'\nORDER BY\n\tr_roomID ASC\n;";
$C->query($q);
$eventCount = $C->result_size();
if ($eventCount < 1) {
    if (isset($_GET['date'])) {
        $page->printError("No events scheduled for " . $startDate->format("F d, Y"));
        echo "<center>";
        $page->addURL("index.php", "Return to non-filtered event schedule.");
        echo "</center>";
        exit(0);
    } else {
        $page->printError("No events scheduled.");
    }
    echo "<center>";
    if (!$user->is_Admin()) {
        echo "Please check back later. We'll be posting events soon =^.^=";
    } else {
        echo "Oi, you: ";
        $page->addURL("add.php", "add an event");
        echo "!";
    }
コード例 #5
0
ファイル: addUserEvent.php プロジェクト: kitsune/ConSchedule
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
$C = new Connection();
$user = new User();
$page = new Webpage("Add User Event", $user);
// make sure the visitor is a forum user
if (!$user->is_User()) {
    $page->printError("You must be a forum user to create your own schedule.");
    echo "<center>";
    $page->addURL("http://www.mewcon.com/forum/index.php", "Go to the forums to Register or Sign In.");
    echo "<br /><br />";
    $page->addURL("index.php", "Return to the event schedule.");
    echo "</center>";
    exit(0);
}
$reqEvent = $page->_GET_checkEventID($_GET['event'], $C);
if (!isset($reqEvent)) {
    exit(0);
}
$uID = $user->get_UserID();
$eID = $reqEvent->getEventID();
// check if we're processing from the conflict resolution form
if (isset($_POST['submit'])) {
コード例 #6
0
ファイル: edit.php プロジェクト: kitsune/ConSchedule
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
#first login info
$user = new User();
$page = new Webpage("Edit Event", $user);
$connection = new Connection();
// if the visitor isn't even a forum user, they shouldn't be using this page.
if (!$user->is_User()) {
    $page->printError("Hey, I don't know you! =O.O=");
    echo "<center>";
    echo "Please register or sign in to the ";
    $page->addURL("http://www.mewcon.com/forum/index.php", "forums");
    echo " if you fancy doing fun things with panels.<br />";
    $page->addURL("index.php", "Return to the event schedule.");
    echo "<br />";
    echo "</center>";
    exit(0);
}
$event = $page->_GET_checkEventID($_GET['event'], $connection);
if (!isset($event)) {
    exit(0);
}
$eventID = $event->getEventID();
// if there's no _POST data, why do anything?
コード例 #7
0
ファイル: userSchedule.php プロジェクト: kitsune/ConSchedule
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
$C = new Connection();
$user = new User();
$page = new Webpage("User Schedule", $user);
if (!$user->is_User()) {
    $page->printError("You must be a forum user to create your own schedule.");
    echo "<center>";
    $page->addURL("http://www.mewcon.com/forum/index.php", "Go to the forums to Register or Sign In.");
    echo "<br><br>";
    $page->addURL("index.php", "Return to the event schedule.");
    echo "</center>";
    exit(0);
}
// get the user's current event schedule
$uID = $user->get_UserID();
$q = "\nSELECT\n\te_eventID, e_eventName, r_roomName, e_dateStart, \n\te_dateEnd, e_eventDesc, e_panelist, e_color\nFROM\n\tevents, rooms, userSchedule\nWHERE\n\tus_userID = {$uID}\n\tAND\n\tus_eventID = e_eventID\n\tAND\n\te_roomID = r_roomID\nORDER BY\n\te_dateStart\n\tASC\n;";
$C->query($q);
if ($C->result_size() < 1) {
    $page->printError("Silly " . $user->get_Username() . ", you have no events scheduled. =^.^=");
    echo "<center>";
    $page->addURL("index.php", "Return to event schedule.");