function entry() { echo "<div class=\"section\">\n"; echo "<h2>쇼앤텔 일정</h2>\n"; $snts = get_schedule(); echo "<ul>\n"; foreach ($snts as $key => $snt) { $t = time_of_when($snt["when"]); echo "<li>" . date('Y-m-d H:i', $t) . " @ " . $snt["where"] . "\n"; echo "<ul>\n"; $date = date('Y-m-d', $t); foreach ($snt["who"] as $id) { echo "<li><a href=\"reg_comment?id={$id}&date={$date}\">" . get_member_name($id) . "</a> "; $filename = gen_talk_data_filename($t, $id); if (file_exists($filename)) { $talk_data = get_talk_data($t, $id); $commenters = $talk_data["commenters"]; if (count($commenters) !== 0) { $commenters = array_map(function ($commenter) { return get_member_name($commenter); }, $commenters); echo "(" . implode(", ", $commenters) . ")"; } } echo "</li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; echo "</div>\n"; }
function entry() { echo "<div class=\"section\">\n"; echo "<h2>쇼앤텔 일정</h2>\n"; $snts = get_schedule(); echo "<ul>\n"; foreach ($snts as $key => $snt) { $t = time_of_when($snt["when"]); echo "<li>" . date('Y-m-d H:i', $t) . " @ " . $snt["where"] . "\n"; echo "<ul>\n"; $date = date('Y-m-d', $t); foreach ($snt["who"] as $id) { echo "<li><a href=\"reg_abstract?id={$id}&date={$date}\">" . get_member_name($id) . "</a></li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; echo "</div>\n"; }
function validate_time($submited_time, $id, $time_field) { $schedule = get_schedule($id); if ($submited_time == "") { return $schedule[$time_field]; } else { return $submited_time; } }
<?php /* * @author Emmanuel John * * @return json The schedule for the week or the day if a day param is passed * */ require_once "../domain/model.php"; $day = $_GET["day"]; if (!is_numeric($day) || $day < 0 || 6 < $day) { header("HTTP/1.1 400 Bad Request"); exit("Day of week is empty or invalid."); } $schedule = get_schedule($day); header("Content-Type: application/json"); echo json_encode($schedule);
exit(1); } } } echo "</li>\n"; } echo "</ul>\n"; ?> </div> <div class="section"> <h2>쇼앤텔 일정</h2> <?php $snts = get_schedule(); echo "<ul>\n"; foreach ($snts as $key => $snt) { echo "<li>" . date('Y-m-d H:i', time_of_when($snt["when"])) . " @ " . $snt["where"] . "<br>\n"; echo "의장: " . get_member_name($snt["chair"]) . "\n"; echo "<ul>\n"; foreach ($snt["who"] as $id) { echo "<li>" . get_member_name($id) . "</li>\n"; } echo "</ul>\n"; echo "</li>\n"; } echo "</ul>\n"; ?> </div>
the_content(); ?> <?php } // end of the loop. ?> <ul id="day-sort" class="sorting"> <li id="day-1" class="current">Wednesday</li> <li id="day-2">Thursday</li> <li id="day-3">Friday</li> </ul> <ul id="session-sort" class="sorting"> <li id="session-1" class="current">Session 1</li> <li id="session-2">Session 2</li> <li id="session-3">Session 3</li> </ul> <?php get_schedule(); ?> </div> </section> <?php get_footer(); ?> <script> // schedule sorting and everything </script>
$host = $_POST['host']; $date = $_POST['date']; $start_time_submit = $_POST['start_time_submit']; $end_time_submit = $_POST['end_time_submit']; $start_time = $_POST['end_time']; $end_time = $_POST['end_time']; $note = $_POST['note']; $start_time = validate_time($start_time_submit, $id, "start_time"); $end_time = validate_time($end_time_submit, $id, "end_time"); if (!$host || !$date || !$start_time || !$end_time) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_schedule($id, $host, $date, $start_time, $end_time, $note); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_schedule(get_schedule($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="schedule_view_all.php">View all Schedules</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";
/** * replace custom merge tags in field content * @param string $field_content * @param array $field * @param string $value * @param int $lead_id * @param int $form_id * @return string */ function entry_schedule_field_content($field_content, $field, $value, $lead_id, $form_id) { if (strpos($field_content, '{entry_schedule}') !== false) { $lead = GFAPI::get_entry($lead_id); $schedule = get_schedule($lead); $field_content = str_replace('{entry_schedule}', $schedule, $field_content); } return $field_content; }
function select_snt() { $snts = get_schedule(); foreach ($snts as $key => $snt) { echo "{$key}) " . date('Y-m-d H:i', time_of_when($snt["when"])) . "\n"; } echo "\n"; echo "Select a S&T (x to exit): "; $input_str = my_fgets(); echo "\n"; if ($input_str === "x") { echo "Exit\n"; exit(0); } else { if (my_key_exists($input_str, $snts)) { $snt = $snts[(int) $input_str]; echo "The S&T on " . date('Y-m-d H:i', time_of_when($snt["when"])) . " is selected.\n\n"; return $snt; } else { echo "Your input is invalid.\n"; exit(1); } } }
dataTable.addColumn({ type: 'date', id: 'Start' }); dataTable.addColumn({ type: 'date', id: 'End' }); dataTable.addRows([ <?php $unavailable = array(); $numRows = 0; $blankexists = false; foreach ($users as $u) { $name = ""; if ($u["account"] != 0) { $a = get_account_info($u["account"]); $name = $a["first_name"] . " " . $a["last_name"]; } else { $name = $u["name"]; } $sched = get_schedule($u["id"], $event["id"]); foreach ($sched as $s) { $exists = true; echo "['" . $name . "', null, ' " . date("n/j/Y g:i A", strtotime($s["range_start"])) . "-" . date("n/j/Y g:i A", strtotime($s["range_end"])) . " ', new Date(" . (strtotime($s["range_start"]) * 1000 + 1000 * 3600 * 7) . "), new Date(" . (strtotime($s["range_end"]) * 1000 + 1000 * 3600 * 7) . ")],"; } if (count($sched) == 0) { $blankexists = true; echo "['" . $name . "', null, 'None', new Date(" . (strtotime($event["range_start"]) * 1000 + 1000 * 3600 * 7) . "), new Date(" . (strtotime($event["range_start"]) * 1000 + 1000 * 3600 * 7) . ")],"; } } ?> ]); var chartHeight = dataTable.getNumberOfRows() * 15 + 40; var options = {
<?php require_once "./connect.php"; echo json_encode(get_schedule($link)); function get_schedule($link) { $days = array('Monday' => 'Понедельник', 'Tuesday' => 'Вторник', 'Wednesday' => 'Среда', 'Thursday' => 'Четверг', 'Friday' => 'Пятница', 'Saturday' => 'Суббота', 'Sunday' => 'Воскресенье'); $answer = ""; $query = "SELECT * FROM trip, route WHERE trip.id_route = route.id_route AND trip.date >= DATE_FORMAT(CURDATE(), '%Y-%m-%d') ORDER BY trip.date ASC LIMIT 14"; if (!($result = mysqli_query($link, $query))) { $answer .= 'Error: ' . mysqli_error($link); } else { while ($row = mysqli_fetch_assoc($result)) { $date = strtotime($row["date"]); $date1 = strftime("%d.%m.%Y", $date); $date2 = strftime("%A", $date); $date = $date1 . " " . $days[$date2]; $answer .= "<tr><td align='left'>" . $date . "</td>\n <td>" . $row["name"] . "</td>\n <td>" . $row["freeplace"] . "</td>\n <td>" . $row["price"] . "</td>\n <td>\n <input type='button' form='form_" . $row["id_trip"] . "' onclick='goReserver(" . $row["id_trip"] . ")' value='Забронировать'></td></tr></form>"; } } return $answer; }