File: /home/awaldron/www/archive/demo/event_view.php
<?php
session_start();
echo "<html>\n";
echo "<head>\n";
echo "<title>".CMP_NAME_INF." : View Calendar Event</title>\n";
echo "</head>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\">\n";
echo "<body style=\"margin:15px;font-size:12px;\">\n";
include("_functions.php");
dbconnect();
$sql = "SELECT * FROM tbl_calendar_dates WHERE cal_date=".$_GET["d"]." AND calendar_id=".$_GET["cid"]." ORDER BY cal_date ASC";
$result = mysql_query($sql);
$d = date_tstounix($_GET["d"]."000000");
echo "<P><b id=\"red\">".date("F j, Y",$d).":</b><P><ul>";
for ($i=0; $i < mysql_num_rows($result); $i++) {
$row = mysql_fetch_array($result);
if ($row["cal_linkto"] != "0") echo "<li><a href=\"#\" onClick=\"window.opener.location.href='".$row["cal_linkto"]."';window.close();\">".$row["cal_title"]."</a>\n";
else echo "<li>".$row["cal_title"]."\n";
if ($row[username] == $_SESSION[auth_user]) echo " (<a href=\"/event_edit.php?cal_id=".$row[cal_id]."\">edit</a>)";
} echo "</ul>\n";
$bdays = "";
$bsql = "SELECT fname,lname,username FROM tbl_employees WHERE emp_type_id<4 AND is_employee=1 AND acct_confirmed=1 AND birthday='".substr($_GET["d"],4,4)."'";
$bres = mysql_query($bsql);
if (mysql_num_rows($bres) > 0) {
for ($i=0; $i < mysql_num_rows($bres); $i++) {
$bday = mysql_fetch_array($bres);
$bdays .= "<li><a href=\"#\" onClick=\"window.opener.location.href='/profile.php?u=".$bday["username"]."';window.close();\">".$bday["fname"]." ".$bday["lname"]."</a>\n";
}
}
if (strlen($bdays) > 0) {
echo "<P><b id=\"red\">Today's Birthdays:</b>";
echo "<P><ul>".$bdays."</ul>\n";
}
echo "<br><br><a href=\"/event_add.php?d=".$_GET["d"]."&cid=".$_GET["cid"]."\" style=\"font-size:10px\">Add event to ".date("m/d",$d)." >></a>\n";
?>
</body>
</html>