function copy_day($new_date, $original_date) { $insert = "INSERT INTO schedule (date, day, start_time, end_time, host, note, deleted) (SELECT \"" . $new_date . "\", day, start_time, end_time, host, note, deleted FROM schedule WHERE date = \"" . $original_date . "\")"; $result = mysql_query($insert); if (!$result) { echo $insert . "<br>"; die('Error Inserting into Database.'); } echo "<div class=\"center\"><h1>Success!</h1>\n <span class=\"success\">The full day has been copied.</span></div>\n <hr width=75%>"; display_day($new_date); }
function display() { global $vars, $day, $month, $year; if (isset($vars['id'])) { return display_id($vars['id']); } if (isset($vars['day'])) { return display_day($day, $month, $year); } if (isset($vars['month'])) { return display_month($month, $year); } if (isset($vars['year'])) { soft_error('year view not yet implemented'); } return display_month($month, $year); }
if ($current_day == $day) { $ppf = ' tec-present'; } elseif ($current_day > $day) { $ppf = ' tec-past'; } elseif ($current_day < $day) { $ppf = ' tec-future'; } } elseif ($current_month > $month && $current_year == $year || $current_year > $year) { $ppf = ' tec-past'; } elseif ($current_month < $month && $current_year == $year || $current_year < $year) { $ppf = ' tec-future'; } else { $ppf = false; } echo "<td class='tec-thismonth" . $ppf . "'>" . display_day_title($day, $monthView) . "\n"; echo display_day($day, $monthView); echo "</td>"; } // skip next month while ($day + $offset <= $rows * 7) { echo "<td class='tec-othermonth'></td>"; $day++; } ?> </tr> </tbody> </table> <?php /** * Each day in the calendar grid view will only display posts_per_page events. * If the day has more events than will be displayed, we show all of the events
require "functions/schedule_fns.php"; $action = $_POST['action']; $date = $_GET['date']; if (!$_SESSION["logged_in"]) { loginPrompt($_POST[username], $_POST[remember_me], $_SESSION["error"]); } else { /*----- CONTENT ------*/ ?> <div class="row"> <div class="tweleve columns content full-width"> <h1>Copy Full Day</h1> <?php if (!$date) { echo '<div class="top-spacer_20 center error">Error - missing date value</div>'; } elseif (!$action) { display_day($date); echo "<p>"; copy_schedule($date); } else { $new_date = $_POST['new_date']; if (!$new_date) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { copy_day($new_date, $date); } } ?> <div class="top-spacer_20"> <a href="schedule_view_all.php">View all Schedules</a> <p> <a href="cp.php">Control Panel</a>