<?
function calendar_event_list_play($users, $date, $db_host, $db_user, $db_password)
{
//database connnection goes here
/**-------------selected database contents stored in arrays---------**/
$group_seg[] = $row;//get user availability
$events[] = $row;//appointments for users
$provider[] = $row;//users names for column header
$width = 23;//dymanic column width calculation base on number of user schedules selected
/**--------------header with user names--------------**/
echo"<table>
<tr>";
//appointmant time header
echo"<td width='$time_slot%'>Time</td>";
//user name column header
for($num = 0; $num < count($provider); $num++)
{
$last_name = $provider[$num][last_name];//get provider last name for title
echo"<td width='$width%'><a href ='../calendar_form.php>$provider_name</a></td>";
}
echo "</tr>
</table>";
echo "<table width='100%'>\n";
//Loop over to display appointment time 15 min time slots
for($time = $start_time; $time <= $end_time; $time += $add_time)
{
//format 24 hour time interval for passing via url
$interval_24hr = date("H:i:s", $time);
/**-----------------------event time listing ------------------------**/
echo "<tr>";
//Output the time interval label
echo"<td width='8%' height='15'>
<div id='cal-number' style =''>
<ul>
<li>".date("h:i A", $time)."</li>
</ul>
</div>
</td>";
//number of columns
for($i = 0; $i < count($provider); $i++)
{
//loop to display appointments for column
foreach ($events as $event)
{
//Event falls into this hour
if($interval_24hr == $event['event_time'])
{
$client_name = substr($event['last_name'],0,14);
}
else
{
$client_name = "";
}
}//end foreach
//number of user columns dynamic with appointments displayed
echo"<td $width%'><a href ='../calendar_event_manage_form.php>$client_name</a></td>";
}
echo "</tr>";
}
echo "</table>";
}//end function
?>
[/php]