/*
##########################################################
## calendar.inc #
## maintains calendar functions for various things #
## #
## #
##########################################################
## (c) 2003 ArosNet, Inc. Programmed by Devin Atencio #
##########################################################
*/
function display_events($month,$date,$year) {
global $db, $dbhost,$dbuser,$dbpass, $dbbase;
// $dbd = mysql_connect($dbhost,$dbuser,$dbpass);
$start_search_date = $year.$month.$date."000000";
$date_e = $date +1;
$e_search_date = $year.add_zero($month).add_zero($date_e)."000000";
$search_query = "select * from calendar_events where";
$search_query .= " startdate > '$start_search_date'";
$search_query .= " and startdate < '$e_search_date'";
mysql_select_db($dbbase,$db);
$search_result = mysql_query($search_query,$db);
$num_rows = @mysql_num_rows($search_result);
if ($num_rows > 0) {
print "";
}
while ($data = mysql_fetch_array($search_result)) {
print $data[title]."
";
}
if ($num_rows > 0) {
print "";
}
// mysql_close($dbd);
}
function prnt_timeoff_calendar($user,$month,$year,$header) {
// Set Current Month if none specified
if (!$month) $month = (int)date("m");
if (!$year) $year = (int)date("Y");
// Calculate the previous month.
$last_month = $month - 1;
$last_year = $year;
if (!checkdate($last_month, 1, $last_year)) {
$last_month += 12;
$last_year --;
}
// Get day of week of 1st of month
$firstday = date("w",mktime(0,0,0,$month,1,$year));
// Find out what the previous month is
$prev_info = date("m/Y",mktime(0,0,0,$month-1, 1, $year));
$exp_prev_info = explode("/",$prev_info);
$prev_month = $exp_prev_info[0];
$prev_year = $exp_prev_info[1];
// Find out what the next month is
$next_info = date("m/Y",mktime(0,0,0,$month+1, 1, $year));
$exp_next_info = explode("/",$next_info);
$next_month = $exp_next_info[0];
$next_year = $exp_next_info[1];
?>