function free_time($email) { // Globals global $PDO; $events = get_all_events($email); usort($events, 'time_cmp'); $start = time(); $end = strtotime('+7 days'); $free = array(); $prev = $start; foreach ($events as $event) { if ($prev < $event['start']) { $free[] = array('start' => $prev, 'start_friendly' => date('Y-m-d H:i:s', $prev), 'end' => $event['start'], 'end_friendly' => date('Y-m-d H:i:s', $event['start'])); } $prev = $event['end']; } if ($prev < $end) { $free[] = array('start' => $prev, 'start_friendly' => date('Y-m-d H:i:s', $prev), 'end' => $end, 'end_friendly' => date('Y-m-d H:i:s', $end)); } return $free; }
$topbar['rightnav'][0]['url'] = $_SERVER['PHP_SELF']. "?groupid=" . $groupdetails['group_id'] . "&mode=edit"; */ print_topbar($topbar); print_body_start(); if ($listevents && array_key_exists(5, $permissions)) { if ($message) { print_pagetitle($message); } // only show add event if owner if (array_key_exists(0, $permissions)) { $purl = "http://" . $_SERVER['HTTP_HOST'] . DIR . "event.php?groupid=" . $groupdetails['group_id']; $formarray['action'] = $purl; $formarray['rows'][1]['items'] = "|mode|hidden|add"; $formarray['rows'][2]['items'] = "|groupid|hidden|" . $groupdetails['group_id']; $formarray['rows'][3]['items'] = "||submit|Add event"; echo create_form_html($formarray); unset($formarray); } // Upcoming event /* $event[$row['event_id']]['event_id'] = $row['event_id']; $event[$row['event_id']]['event_name'] = $row['event_name']; $event[$row['event_id']]['description'] = $row['event_description']; $event[$row['event_id']]['organizer'] = $row['organizer_id']; $event[$row['event_id']]['date'] = date("j M Y", $row['date']); $event[$row['event_id']]['expense_type'] = $row['expense_type_id']; */ $events = get_all_events($groupdetails['group_id']); if ($events) { print_all_events_html($events); } } print_footer($user, 2);
function list_events_action($uid) { // needed to set the tab active $extras_active = true; $events_active = true; if (user_is_admin($uid)) { // dealing with event add form if (isset($_POST['description']) && isset($_POST['title'])) { $event_added = get_event_by_id($_POST['id']); // event exists if ($event_added) { update_event($_POST['id'], $_POST['title'], $_POST['description'], $_POST['date'], $_POST['max'], $_POST['registrationfee']); } else { add_event($_POST['title'], $_POST['description'], $_POST['date'], $_POST['max'], $_POST['registrationfee']); } } // get all the events $events = get_all_events(); $uids = get_all_uids(); require 'templates/events.php'; } else { require 'templates/login.php'; } }
<?php require 'lib/database.php'; require 'lib/misc.php'; require 'lib/authentication.php'; redirect_if_not_logged_in("login.php"); $categories = get_all_categories(); $events = get_all_events(); ?> <!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"> <title>Edge CMS</title> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top">
function event_list() { $event_set = get_all_events(); $output = ""; while ($event = mysql_fetch_array($event_set)) { $output .= "<tr id=\"{$event['hash']}\">\n\t\t\t\t<td><input type=\"checkbox\"></td>"; $output .= "<td>" . $event['event_name'] . "</td>"; $output .= "<td>" . $event['description'] . "</td>"; $output .= "<td>" . $event['date'] . "</td>"; $output .= "<td>" . $event['time'] . "</td>"; $output .= "<td>" . $event['venue'] . "</td>"; } return $output; }
else $uname = ""; $gmembers[$members[$i]['user_id']] = $members[$i]['realname'] . $uname;*/ $gmembers[$members[$i]['user_id']] = format_name($user, $members[$i]['username'], $members[$i]['realname']); } if (isset($_POST['expense_owner'])) { $selected = $_POST['expense_owner']; } else { $selected = $details['ownerid']; } $formarray['rows'][0]['type'] = "select"; $formarray['rows'][0]['label'] = "Expense by: "; $formarray['rows'][0]['name'] = "expense_owner"; $formarray['rows'][0]['selected'] = $selected; $formarray['rows'][0]['value'] = $gmembers; } if (!($event = get_all_events($groupid, true))) { $formarray['rows'][1]['type'] = "select"; $formarray['rows'][1]['label'] = "Current event:"; $formarray['rows'][1]['name'] = "event_id"; $formarray['rows'][1]['selected'] = $_POST['event_id']; $formarray['rows'][1]['value'] = array(0 => "No event found"); } else { // event found ksort($event); $event[0] = "No event"; // reverse array while maintaining actual keys // http://nl.php.net/manual/en/function.array-reverse.php end($event); do { $part1 = key($event); $part2 = current($event);
<h1>Question Form <span>Please fill all the texts in the fields.</span> </h1> <label> <span>Question Name :</span> <input id="name" type="text" name="name" placeholder="Event Name" /> </label> <label> <span>Code Name :</span> <input id="code" type="text" name="code" placeholder="Code Name" /> </label> <label> <span>Event :</span> <select name="event" id="event"> <?php $event_set = get_all_events(date("Y")); while ($event = mysql_fetch_array($event_set)) { echo "<option value=\"{$event['id']}\">{$event['name']}</option>"; } ?> </select> </label> <label> <span>Content :</span> <textarea id="content" name="content" placeholder="<?php echo "<p>Your description here</p>"; echo "<p>Rules & Regulation</p>"; echo "<ul>"; echo "<li>your rules here</li>"; echo "</ul>"; echo "<p>Prizes</p>";
while ($event = mysql_fetch_array($up_event_set)) { echo "<li>"; echo "<a href=\"event.php?eve=" . urlencode($event['id']) . "\"><span>{$event['name']}</span></a></li>"; } } echo "</ul></div>"; ?> </li> <?php $year_set = get_all_years(); while ($year = mysql_fetch_array($year_set)) { echo "<li><a href=\"#\" class=\"parent\"><span>"; echo "{$year['name']}"; echo "</span></a>"; echo "<div><ul>"; $event_set = get_all_events($year['year_id']); if (isset($_SESSION['staff_id'])) { while ($event = mysql_fetch_array($event_set)) { echo "<li>"; echo "<a href=\"change_details.php?eve=" . urlencode($event['id']) . "\"><span>{$event['name']}</span></a></li>"; } } else { while ($event = mysql_fetch_array($event_set)) { echo "<li>"; echo "<a href=\"event.php?eve=" . urlencode($event['id']) . "\"><span>{$event['name']}</span></a></li>"; } } echo "</ul></div>"; } echo "</li>"; ?>
function updateEventAchievements() { $a = 1; $events = get_all_events($this->groupid); $a = 1; $sql = " SELECT users_expenses.user_id, event_id, COUNT(event_id) AS expense_count FROM `users_expenses`, expenses WHERE users_expenses.expense_id = expenses.expense_id AND users_expenses.expense_id IN (SELECT expense_id FROM expenses WHERE event_id > 0 AND group_id=1) GROUP BY user_id, event_id"; if (!($result = mysql_query($sql))) { return false; } else { $maxevents = 0; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $this->members[$row['user_id']]['events'][$row['event_id']] = array('eventid' => $row['event_id'], 'expense_count' => $row['expense_count']); $this->members[$row['user_id']]['eventcount'] += 1; $maxevents = $this->members[$row['user_id']]['eventcount'] > $maxevents ? $this->members[$row['user_id']]['eventcount'] : $maxevents; } } $mostevents = array(); foreach ($this->members as $member) { if ($member['eventcount'] == $maxevents) { $mostevents[] = array('memberid' => $member['user_id'], 'value' => $maxevents); } } $this->achievements['participated_most_events'] = array('key' => 'participated_most_events', 'value' => $mostevents); $a = 1; }