\n";
}
$INC = array('js/popups.php');
print_header($INC,$HeadX);
$key = 0;
// List all unapproved events for the user
// Exclude "extension" events (used when an event goes past midnight)
function list_unapproved ( $user ) {
global $temp_fullname, $key, $login;
// echo "Listing events for $user
";
echo "
\n";
$sql = "SELECT webcal_entry.cal_id, webcal_entry.cal_name, " .
"webcal_entry.cal_description, " .
"webcal_entry.cal_priority, webcal_entry.cal_date, " .
"webcal_entry.cal_time, webcal_entry.cal_duration, " .
"webcal_entry_user.cal_status " .
"FROM webcal_entry, webcal_entry_user " .
"WHERE webcal_entry.cal_id = webcal_entry_user.cal_id " .
"AND ( webcal_entry.cal_ext_for_id IS NULL " .
"OR webcal_entry.cal_ext_for_id = 0 ) AND " .
"webcal_entry_user.cal_login = '$user' AND " .
"webcal_entry_user.cal_status = 'W' " .
"ORDER BY webcal_entry.cal_date";
$res = dbi_query ( $sql );
$count = 0;
$eventinfo = "";
if ( $res ) {
while ( $row = dbi_fetch_row ( $res ) ) {
$key++;
$id = $row[0];
$name = $row[1];
$description = $row[2];
$pri = $row[3];
$date = $row[4];
$time = $row[5];
$duration = $row[6];
$status = $row[7];
$divname = "eventinfo-$id-$key";
echo "- ";
$timestr = "";
if ( $time > 0 ) {
$timestr = display_time ( $time );
if ( $duration > 0 ) {
// calc end time
$h = (int) ( $time / 10000 );
$m = ( $time / 100 ) % 100;
$m += $duration;
$d = $duration;
while ( $m >= 60 ) {
$h++;
$m -= 60;
}
$end_time = sprintf ( "%02d%02d00", $h, $m );
$timestr .= " - " . display_time ( $end_time );
}
}
echo htmlspecialchars ( $name );
echo "";
echo " (" . date_to_str ($date) . ")\n";
echo ": " . translate("Approve/Confirm") . ", ";
echo "" . translate("Reject") . "";
$eventinfo .= build_event_popup ( $divname, $user, $description,
$timestr, $time );
$count++;
}
dbi_free_result ( $res );
}
echo "
\n";
if ( $count == 0 ) {
user_load_variables ( $user, "temp_" );
echo translate("No unapproved events for") . " " . $temp_fullname . ".";
} else {
echo $eventinfo;
}
}
?>
" . translate ( "Chicago Actions" ) . "
\n";
list_unapproved ( "__public__" );
}
?>