<?php require_once 'dbc/data.php'; $data = new NewEvent(); $thumbnals = $data->returnAllEvent(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <!-- Bootstrap core CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <!-- Custom styles for this template --> <link rel="stylesheet" href="css/eventlist.css"> <title>Browse Events</title> </head> <body> <div class="container"> <div class="row"> <div class="page-header"> <h1>Event</h1> </div>
<?php /** * Created by PhpStorm. * User: SXH * Date: 12/5/15 * Time: 5:52 PM */ session_start(); $_SESSION['user_id'] = 1; require_once "dbc/data.php"; $data = new NewEvent(); if (isset($_POST['submit'])) { //get all parameters $post_id = $_SESSION['user_id']; $title = $_POST['title']; $category = $_POST['category']; $start_date = $_POST['startdate']; $end_date = $_POST['enddate']; $details = $_POST['details']; $time = date("Y-m-d"); $address1 = $_POST['address1']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $country = $_POST['country']; $zipcode = $_POST['zipcode']; $address = trim($address1 . $address2 . $city . $state . $country); //format the date $start_date = new DateTime($start_date); $start_date = date_format($start_date, 'Y-m-d'); $end_date = new DateTime($start_date);