// // CHECK USER CREDENTIALS // // metadata for this Web page $title = "Calendar"; require("header.inc"); // // GET PARISH ACCOUNT // $server = explode(".", $_SERVER['SERVER_NAME']); // // GET SYSTEM VARIABLES // require("/usr/home/jpthomas/public_html/isidore/account/" . $server[0] . "/variables.inc"); // // SET TIME ZONE // date_default_timezone_set('US/Eastern'); // // SET VARIABLES // // show past events? 0 for no, 1 for yes $showPastEvents = 0; // // FUNCTIONS // // get date of first occurrence of "dayWeek" in this month function getFirstDate($dayWeek) { global $year, $monthNo; for ($n = 1; $n <= 7; $n++) { // get this day's number $dayNumber = date("w", mktime(0, 0, 0, $monthNo, $n, $year)); // if it matches "dayWeek", save this date as "firstDate" and stop the cycle if ($dayNumber == $dayWeek) { return $n; } } } // // BEGIN BODY // echo "
\n"; // // PRINT MONTHLY VIEW // if (empty($_REQUEST) || isset($_REQUEST['fbclid']) || isset($_POST['cancel']) || isset($_REQUEST['monthNo']) || isset($print_calendar)) { // // GET CALENDAR DATA // // get current year if one not provided if (!isset($_REQUEST['year'])) { $year = date("Y"); } // save user-supplied data under a simpler variable name else { $year = $_REQUEST['year']; } // get current month number (1-12) if one not provided if (!isset($_REQUEST['monthNo'])) { $monthNo = date("n"); } // save user-supplied month under a simpler variable name else { $monthNo = $_REQUEST['monthNo']; } // do not show past events if ($showPastEvents == 0 && ($year < date("Y") || ($year == date("Y") && $monthNo < date("n")))) { die("You cannot see past events."); } // get month name $monthName = date("F", mktime(0, 0, 0, $monthNo, 1, $year)); // get number of days in this month $daysInMonth = date("t", mktime(0, 0, 0, $monthNo, 1, $year)); // // PRINT NAVIGATION LINKS // echo "
\n"; // calculate previous month $prevMonth = $monthNo - 1; // if previous month number is 0, reset to 12 and decrement year if ($prevMonth == 0) { $prevMonth = 12; $prevYear = $year - 1; } // otherwise, keep same year else { $prevYear = $year; } // calculate next month $nextMonth = $monthNo + 1; // if next month number is 13, reset to 1 and increment year if ($nextMonth == 13) { $nextMonth = 1; $nextYear = $year + 1; } // otherwise, keep same year else { $nextYear = $year; } // print links for previous and next months if ($showPastEvents == 0 && $year == date("Y") && $monthNo == date("n")) { echo "

« | » $monthName $year

\n"; } else { echo "

« | » $monthName $year

\n"; } // get buildings $get_buildings = mysqli_query($link, "select * from building order by name"); $building = $get_buildings->fetch_all(MYSQLI_ASSOC); if (count($building) > 0) { $get_building_colors = mysqli_query($link, "select building_id, color from building"); $building_colors = $get_building_colors->fetch_all(MYSQLI_ASSOC); for ($b = 0; $b < count($building_colors); $b++) { $colors[$building_colors[$b]['building_id']] = $building_colors[$b]['color']; } echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "

Building

\n"; echo "
    \n"; for ($i = 0; $i < count($building); $i++) { if (in_array($building[$i]['building_id'], $_POST['building']) || !isset($_POST['building'])) { echo "\t
  • " . $building[$i]['name'] . "
  • \n"; } else { echo "\t
  • " . $building[$i]['name'] . "
  • \n"; } } echo "
\n"; } // if only one building is selected, then print room list if (count($_POST['building']) == 1) { // get rooms $get_rooms = mysqli_query($link, "select * from room where building_id = " . $_POST['building'][0] . " order by name"); $room = $get_rooms->fetch_all(MYSQLI_ASSOC); if (count($room) > 0) { $use_room_colors = 1; $get_room_colors = mysqli_query($link, "select room_id, color from room where building_id = " . $_POST['building'][0]); $room_colors = $get_room_colors->fetch_all(MYSQLI_ASSOC); unset($colors); for ($r = 0; $r < count($room_colors); $r++) { $colors[$room_colors[$r]['room_id']] = $room_colors[$r]['color']; } echo "

Room

\n"; echo "
    \n"; for ($i = 0; $i < count($room); $i++) { if (in_array($room[$i]['room_id'], $_POST['room']) || !isset($_POST['room'])) { echo "\t
  • " . $room[$i]['name'] . "
  • \n"; } else { echo "\t
  • " . $room[$i]['name'] . "
  • \n"; } } echo "
\n"; } } // get event types $get_event_types = mysqli_query($link, "select event_type_id, name from event_type order by name"); $event_type = $get_event_types->fetch_all(MYSQLI_ASSOC); if (count($event_type) > 0) { echo "

Event Type

\n"; echo "
    \n"; for ($i = 0; $i < count($event_type); $i++) { if (in_array($event_type[$i]['event_type_id'], $_POST['event_type']) || !isset($_POST['event_type'])) { echo "\t
  • " . $event_type[$i]['name'] . "
  • \n"; } else { echo "\t
  • " . $event_type[$i]['name'] . "
  • \n"; } } echo "
\n"; echo "
\n"; } echo "
\n"; echo "
\n"; if (isset($_POST['building'])) { $building_query = " and ("; for ($i = 0; $i < count($_POST['building']); $i++) { $building_query .= "building_id = " . $_POST['building'][$i]; if ($i != (count($_POST['building']) - 1)) { $building_query .= " or "; } } $building_query .= ")"; } if (isset($_POST['room'])) { $room_query = " and ("; for ($i = 0; $i < count($_POST['room']); $i++) { $room_query .= "room_id = " . $_POST['room'][$i]; if ($i != (count($_POST['room']) - 1)) { $room_query .= " or "; } } $room_query .= ")"; } if (isset($_POST['event_type'])) { $event_type_query = " and ("; for ($i = 0; $i < count($_POST['event_type']); $i++) { $event_type_query .= "event_type_id = " . $_POST['event_type'][$i]; if ($i != (count($_POST['event_type']) - 1)) { $event_type_query .= " or "; } } $event_type_query .= ")"; } // get events occurring this month $current_data = mysqli_query($link, "select event_id, date, building_id, room_id, title, time_format(time_begins, '%l:%i %p') as formatted_time, canceled from calendar where month(date) = $monthNo and year(date) = $year $event_type_query $building_query $room_query and public = 'Y' order by date, time_begins"); $events = $current_data->fetch_all(MYSQLI_ASSOC); // get number of events $noEvents = count($events); // print calendar table head echo "\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; // get today's date $today = date("Y-m-d"); // print a table cell for each day of this month for ($i = 1; $i <= $daysInMonth; $i++) { // get day name $day = date("D", mktime(0, 0, 0, $monthNo, $i, $year)); // if first day of this month is not Sun if ($i == 1 && $day != "Sun") { // start a new week echo "\n"; // get weekday number (0-6) $dayOfWeek = date("w", mktime(0, 0, 0, $monthNo, $i, $year)); // print empty table cells until first day of this month is reached for ($n = 0; $n < $dayOfWeek; $n++) { echo "\t\n"; } } // if today is Sun, start a new week if ($day == "Sun") { echo "\n"; } // format month number if ($monthNo < 10 && strlen($monthNo) < 2) { $monthNumber = "0" . $monthNo; } else { $monthNumber = $monthNo; } // format day number if ($i < 10) { $dayNo = "0" . $i; } else { $dayNo = $i; } $dateToCheck = $year . "-" . $monthNumber . "-" . $dayNo; $keys = array_keys(array_column($events, 'date'), $dateToCheck); if (count($keys) > 0) { if ($dateToCheck == $today) { echo "\t\n"; } // otherwise, print an empty table cell else { if ($dateToCheck == $today) { echo "\t\n"; } else { echo "\t\n"; } } // if today is Sat, end this week if ($day == "Sat") { echo "\n"; } // if the last day of the month is not Sat if ($i == $daysInMonth && $day != "Sat") { // get weekday number (0-6) $dayOfWeek = date("w", mktime(0, 0, 0, $monthNo, $i, $year)); // print empty table cells until Sat is reached for ($n = 6; $n > $dayOfWeek; $n--) { echo "\t\n"; } // end this week echo "\n"; } } // finish printing table echo "
SundayMondayTuesdayWednesdayThursdayFridaySaturday
\n"; } elseif ($dateToCheck < $today) { echo "\t\n"; } else { echo "\t\n"; } echo "$i
\n"; for ($n = 0; $n < count($keys); $n++) { if ($events[$keys[$n]]['canceled'] == "N") { $css_event_class = "class=\"event_link\""; } else { $css_event_class = "class=\"event_canceled_link\""; } if ($use_room_colors) { echo " " . $events[$keys[$n]]['formatted_time'] . ": " . $events[$keys[$n]]['title'] . "
\n"; } else { echo " " . $events[$keys[$n]]['formatted_time'] . ": " . $events[$keys[$n]]['title'] . "
\n"; } } echo "\t
$i$i
\n"; echo "
\n"; } // // PRINT DAILY VIEW // if (isset($_GET['view']) && isset($_GET['date'])) { echo "
\n"; echo "
\n"; // get project details $get_projects = mysqli_query($link, "select event_id, title, date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, calendar.building_id, building.name as building_name, room.name as room_name from calendar inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where date = '" . $_REQUEST['date'] . "' and public = 'Y' order by time_begins"); $project = $get_projects->fetch_all(MYSQLI_ASSOC); $date = new DateTime($_REQUEST['date']); $today = $date->format('D, M j'); $date_parts = explode("-", $_REQUEST['date']); $date->modify('-1 day'); $previousDate = $date->format('Y-m-d'); $date->modify('+2 days'); $nextDate = $date->format('Y-m-d'); echo "

[ Monthly View ]

\n"; echo "

«" . " | » " . $today . "

\n"; if (count($project) == 0) { echo "

There are no events today.

\n"; } else { echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; $get_bldg_colors = mysqli_query($link, "select name, color from building"); $bldg_colors = $get_bldg_colors->fetch_all(MYSQLI_ASSOC); for ($i = 0; $i < count($bldg_colors); $i++) { $color[$bldg_colors[$i]['name']] = $bldg_colors[$i]['color']; } // print each building name for ($i = 0; $i < count($project); $i++) { echo "\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; } echo "
Start TimeEnd TimeTitleBuildingRoom
" . $project[$i]['formatted_time_begins'] . "" . $project[$i]['formatted_time_ends'] . "" . $project[$i]['title'] . "" . $project[$i]['building_name'] . "" . $project[$i]['room_name'] . "
\n"; } echo "
\n"; } // // MAIL EVENT INFORMATION // if (isset($_POST['mail_event_info'])) { $get_event = mysqli_query($link, "select *, date, file, submitted_at, submitted_by, event_type_id, calendar.title, description, user.username, date_format(date, '%Y%m%d') as date_url, date_format(date, '%W, %M %e, %Y') as formatted_date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, user.username as username, user.name as user_name, calendar.building_id, building.name as building_name, calendar.room_id, room.name as room_name from calendar inner join user on calendar.submitted_by = user.user_id inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where event_id = " . $_REQUEST['event_id'] . " and public = 'Y'"); $event = mysqli_fetch_array($get_event, MYSQLI_ASSOC); // mail success message to couple $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $get_general_contact = mysqli_query($link, "select name, email from user inner join settings on settings.contact_general = user.user_id where sacrament = 'M'"); $general_contact = mysqli_fetch_array($get_general_contact, MYSQLI_ASSOC); $from = $general_contact['email']; // create email headers $headers .= 'From: '.$from."\r\n". 'Reply-To: '.$from."\r\n" . 'X-Mailer: PHP/' . phpversion(); // compose a simple HTML email message $message = "\n\n"; $message .= "

" . $event['title'] . "

\n"; // create email subject if ($_POST['name'] != "") { $message .= "

" . $_POST['name'] . " requested that you receive information about this event"; if ($_POST['message'] != "") { $message .= ":

\n"; $message .= "

" . $_POST['message'] . "

\n"; } else { $message .= ".

\n"; } } $message .= "

" . $event['formatted_date'] . "

\n"; $message .= "

" . $event['formatted_time_begins'] . " - " . $event['formatted_time_ends'] . "

\n"; $message .= "\n"; $message .= "\n"; $message .= "\t\n"; $message .= "\t\n"; $message .= "\n"; $message .= "\n"; $message .= "\t\n"; $message .= "\t\n"; $message .= "\n"; if ($event['event_type_id'] == 6) { $get_funeral = mysqli_query($link, "select funeral_id, decedent_name from funeral where event_id = " . $_REQUEST['event_id'] . " and canceled = 'N'"); $funeral = $get_funeral->fetch_assoc(); $message .= "\n"; $message .= "\t\n"; $message .= "\n"; $message .= "\n"; $message .= "\t\n"; $message .= "\t\n"; $message .= "\n"; } $message .= "
Building" . $event['building_name'] . "
Room" . $event['room_name'] . "
Funeral Information
Decedent" . $funeral['decedent_name'] . "
\n"; $message .= "

Christ the King Church • 200 Windsor Avenue, Haddonfield, NJ 08033 • 856-429-1600

\n"; $message .= "\n"; $to = $_POST['recipient_email']; // create email subject if ($_POST['name'] == "") { $subject = "Check out " . $event['title'] . " at " . $parish_name; } else { $subject = $_POST['recipient_name'] . ", check out " . $event['title'] . " at " . $parish_name; } echo "
\n"; echo "
\n"; if (mail($to, $subject, $message, $headers)) { echo "

[ Return to Event Page ]

\n"; echo "

We emailed $to with information about this event.

\n"; $event_id = $_POST['event_id']; // increment "mail" counter column $increment_views_counter = mysqli_query($link, "update calendar set mail = mail + 1 where event_id = " .$_REQUEST['event_id']); } else { echo "

[ Return to Event Page ]

\n"; echo "

There was an error emailing $to.

\n"; } echo "
\n"; } // // ADD EVENT FEEDBACK // if (isset($_POST['post_review'])) { echo "
\n"; echo "
\n"; $content = mysqli_real_escape_string($link, $_POST['content']); $add_review = mysqli_query($link, "insert into review_general (event_id, submitted_at, name, email, content, convenient_time, good_location, preparedness, good_pace, good_use_of_time, will_attend_again, benefits_prayer, benefits_relationship_with_christ) values(" . $_POST['event_id'] . ", now(), '" . $_POST['name'] . "', '" . $_POST['email'] . "', '" . $content . "', '" . $_POST['convenient_time'] . "', '" . $_POST['good_location'] . "', '" . $_POST['preparedness'] . "', '" . $_POST['good_pace'] . "', '" . $_POST['good_use_of_time'] . "', '" . $_POST['will_attend_again'] . "', '" . $_POST['benefits_prayer'] . "', '" . $_POST['benefits_relationship_with_christ'] . "')"); if (!isset($_POST['anonymous']) && ($_POST['name'] == "" || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))) { echo "

Sorry, we do not allow anonymous feedback. You must provide your name and email address. We will respond to your email in a timely fashion.

\n"; } else { if ($add_review) { echo "

[ Return to Event Page ]

\n"; echo "

Your feedback has been posted.

\n"; $event_id = $_POST['event_id']; } else { echo "

[ Return to Event Page ]

\n"; echo "

There was an error posting your feedback.

\n"; } } echo "
\n"; } // // LIST DETAILS FOR A SINGLE EVENT // if (isset($_GET['view']) && (isset($_REQUEST['event_id']) || isset($event_id))) { echo "
\n"; require("left.inc"); echo "
\n"; echo "
\n"; // get project details $get_event = mysqli_query($link, "select date, file, submitted_at, submitted_by, event_type_id, calendar.title, description, canceled, date_format(canceled_at, '%l:%i %p on %W, %M %e') as formatted_canceled_date, user.username, date_format(date, '%Y%m%d') as date_url, date_format(date, '%W, %M %e, %Y') as formatted_date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, time_format(convert_tz(time_begins, 'US/Eastern','UTC'), '%H%i00') as time_begins_url, time_format(convert_tz(time_ends, 'US/Eastern','UTC'), '%H%i00') as time_ends_url, user.username as username, user.name as user_name, calendar.building_id, building.name as building_name, calendar.room_id, room.name as room_name, unix_timestamp(concat(date, ' ', time_begins)) as unix_timestamp from calendar inner join user on calendar.submitted_by = user.user_id inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where event_id = " . $_REQUEST['event_id'] . " and public = 'Y'"); if ($get_event->num_rows == 0) { echo "

Error

\n"; echo "

There is no such event.

\n"; } else { $event = $get_event->fetch_assoc(); // increment "views" counter column $increment_views_counter = mysqli_query($link, "update calendar set views = views + 1 where event_id = " . $_REQUEST['event_id']); $date_parts = explode("-", $event['date']); $title_url = urlencode($event['title']); $dates = $event['date_url'] . "T" . $event['time_begins_url'] . "Z%2F" . $event['date_url'] . "T" . $event['time_ends_url'] . "Z"; echo "
\n"; echo "

Calendar

\n"; echo "\"Monthly\n"; echo "

Event Details

\n"; // include "remind me" link if (time() < $event['unix_timestamp']) { echo "\"Mail\n"; if ($event['event_type_id'] == 3) { echo "\"Register\"\n"; } else { echo "\"Remind\n"; } } // include "leave feedback" link else { echo "\"Leave\n"; } echo "
\n"; echo "

" . $event['title'] . "

\n"; if ($event['canceled'] == "Y") { echo "

This event was canceled at " . $event['formatted_canceled_date'] . "

\n"; } echo "

" . $event['formatted_date'] . "

\n"; echo "

" . $event['formatted_time_begins'] . " - " . $event['formatted_time_ends'] . "

\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; if (substr(strrchr($event['file'], '.'),1) == "pdf") { echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; } if ($event['event_type_id'] == 6) { $get_funeral = mysqli_query($link, "select funeral_id, decedent_name from funeral where event_id = " . $_REQUEST['event_id'] . " and canceled = 'N'"); $funeral = $get_funeral->fetch_assoc(); echo "\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; } echo "
Building" . $event['building_name'] . "
Room" . $event['room_name'] . "
Flyer (PDF)View
Funeral Information
Decedent" . $funeral['decedent_name'] . "
\n"; if ($event['description'] != "") { echo "

Description

\n"; echo "

" . $event['description'] . "

\n"; } if (substr(strrchr($event['file'], '.'),1) == "png" || substr(strrchr($event['file'], '.'),1) == "jpg") { echo "

\n"; } $get_event_labels = mysqli_query($link, "select label.label_id, name from event_label inner join label on event_label.label_id = label.label_id where event_id = " . $_REQUEST['event_id'] . " order by name"); $label = $get_event_labels->fetch_all(MYSQLI_ASSOC); if (count($label) > 0) { for ($i = 0; $i < count($label); $i++) { echo "

" . $label[$i]['name'] . "

\n"; } } if (time() > $event['unix_timestamp']) { echo "

We value feedback. Please share with us about this event!

\n"; } echo "

\n"; } echo "
\n"; } // // PRINT MAIL EVENT INFORMATION FORM // if (isset($_REQUEST['mail'])) { $get_event = mysqli_query($link, "select event_type_id, calendar.title, date_format(date, '%W, %M %e, %Y') as formatted_date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, building.name as building_name, room.name as room_name from calendar inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where event_id = " . $_REQUEST['event_id'] . " and public = 'Y'"); $event = $get_event->fetch_assoc(); echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "

Mail Event Information

\n"; echo "

You can email information about the event " . $event['title'] . " on " . $event['formatted_date'] . " at " . $event['formatted_time_begins'] . " using the form below.

\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "
Your name
The recipient's name, if you wish
The recipient's email address
\n"; echo "

You can include a message for the recipient below:

\n"; echo "\n"; echo "

\n"; echo "
\n"; echo "
\n"; } // // PRINT EVENT FEEDBACK FORM // if (isset($_REQUEST['feedback'])) { $get_event = mysqli_query($link, "select event_type_id, calendar.title, date_format(date, '%W, %M %e, %Y') as formatted_date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, building.name as building_name, room.name as room_name from calendar inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where event_id = " . $_REQUEST['event_id'] . " and public = 'Y'"); $event = $get_event->fetch_assoc(); echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "
\n"; echo "

Event Feedback

\n"; echo "

You are providing feedback for the event " . $event['title'] . " on " . $event['formatted_date'] . " from " . $event['formatted_time_begins'] . " to " . $event['formatted_time_ends'] . ".

\n"; echo "

Please share your name and email address so we can respond to your feedback:

\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "
Your name
Your email address
\n"; echo "\n"; $review_table = "\n"; $review_table .= "\n"; $review_table .= "\t\n"; $review_table .= "\t\n"; $review_table .= "\t\n"; $review_table .= "\t\n"; $review_table .= "\t\n"; $review_table .= "\n"; $review_table .= "\n"; echo "

Please respond to the following statements:

\n"; echo "
\n"; echo "

The event was held at a convenient time.

\n"; echo $review_table; echo "\t
\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "
Strongly DisagreeDisagreeNeither Agree or DisagreeAgreeStrongly Agree
\n"; echo "
\n"; echo "
\n"; echo "

The location was clean and comfortable.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

The organizer(s) were well prepared.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

The event proceeded at a good pace.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

The event was a good use of my time.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

I will likely attend similar events in the future.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

The event will benefit my prayer life.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

The event will improve my relationship with Christ.

\n"; echo $review_table; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "
\n"; echo "

You can leave additional feedback below:

\n"; echo "\n"; echo "

\n"; echo "\n"; echo "
\n"; } // // PRINT EVENT REGISTRATION FORM // if (isset($_REQUEST['registration'])) { $get_event = mysqli_query($link, "select event_type_id, calendar.title, date_format(date, '%W, %M %e, %Y') as formatted_date, time_format(time_begins, '%l:%i %p') as formatted_time_begins, time_format(time_ends, '%l:%i %p') as formatted_time_ends, building.name as building_name, room.name as room_name from calendar inner join building on calendar.building_id = building.building_id inner join room on calendar.room_id = room.room_id where event_id = " . $_REQUEST['event_id'] . " and public = 'Y'"); $event = $get_event->fetch_assoc(); echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "
\n"; echo "

Event Reminder

\n"; echo "

You can receive a 1-day reminder for the event " . $event['title'] . " on " . $event['formatted_date'] . " from " . $event['formatted_time_begins'] . " to " . $event['formatted_time_ends'] . ".

\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "\n"; echo "\t\n"; echo "\t\n"; echo "\n"; echo "
Your name, unless you wish to remain anonymous
Your email address
\n"; echo "

\n"; echo "
\n"; echo "
\n"; } // // REGISTER USER FOR EVENT // if (isset($_POST['post_registration'])) { echo "
\n"; echo "
\n"; $add_registration = mysqli_query($link, "insert into event_registration (event_id, name, email, registered) values(" . $_POST['event_id'] . ", '" . $_POST['name'] . "', '" . $_POST['email'] . "', now())"); if ($add_registration) { echo "

[ Return to Event Page ]

\n"; echo "

You will receive a one-day reminder.

\n"; } else { echo "

[ Return to Event Page ]

\n"; echo "

There was an error setting up your reminder.

\n"; } echo "
\n"; } // // PRINT FOOTER // echo "
\n"; echo "

Trending

\n"; echo "\n"; $get_most_viewed_events = mysqli_query($link, "select title, date_format(date, '%b %e, \'%y') as formatted_date, event_id from calendar where date >= curdate() and public = 'Y' order by views desc limit 5"); $most_viewed_events = $get_most_viewed_events->fetch_all(MYSQLI_ASSOC); for ($i = 0; $i < count($most_viewed_events); $i++) { echo "\n"; echo "\t\n"; echo "\t\n"; echo "\t\n"; echo "\n"; } echo "
" . ($i + 1) . "" . $most_viewed_events[$i]['title'] . "" . $most_viewed_events[$i]['formatted_date'] . "
\n"; echo "
\n"; echo "\n"; // include footer file require("admin/footer.inc"); ?>