示例#1
0
        header("LOCATION: index.php");
    }
    $event_id = $_GET['id'];
    #if event exists, retrive the info of event
    $entry = $ret[0];
    #validate if the user is the host of event
    #if not redirect the user to index.php
    if ($entry['host_id'] != $_SESSION['user_id']) {
        header("LOCATION: index.php");
    }
    #initializ the params
    $title = $entry['title'];
    $category = $entry['category'];
    $start_date = $entry['start_date'];
    $end_date = $entry['end_date'];
    $arr = unformatDate($entry['address']);
    $address1 = $arr[0];
    $city = $arr[1];
    $var = explode(' ', $arr[2]);
    $state = $var[1];
    $zipcode = $var[2];
    $country = $arr[3];
    $details = $entry['details'];
    $file_destination = $entry['photo_url'];
    $status = $entry['status'];
    //$_POST['event_id'] = $event_id;
}
#if submit process the form
#if submit with event_id, update the corresponding event.
if (isset($_POST['submit']) && isset($_POST['event_id'])) {
    //get all parameters
<?php

require_once dirname(__FILE__) . '/bagCheckIncludes.php';
session_start();
if (isset($_SESSION['bc_day'])) {
    $currentSelectedDay = $_SESSION['bc_day'];
} else {
    $currentSelectedDay = "NONE";
}
$newUnformattedSelectedDay = $_REQUEST['date'];
//$newUnformattedSelectedDay = $_POST['date'];
$newSelectedDay = unformatDate($newUnformattedSelectedDay);
if ($newSelectedDay != $currentSelectedDay) {
    loadBagCheckDay($newSelectedDay);
    $_SESSION['bc_day'] = $newSelectedDay;
}
header("Location: ./bagCheck.php");