•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,336 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,234 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 518 | Replies: 0 | Solved
![]() |
•
•
Join Date: Oct 2006
Posts: 76
Reputation:
Rep Power: 2
Solved Threads: 0
Hi
The goal is to allow the user the ability to compare daily schedules of
between 1 to 7 users.
The number of columns/user schedule and column headers
are dynamically created base on user selection.
Each user schedule is set up in columns with the user name
at the top of the column and appointments in the columns.
For a static number of columns in a loop I would use the approach
below to display client names for columns.
I am having problems creating dynmic unique column array names for
client_name.
[php]
[php]
The goal is to allow the user the ability to compare daily schedules of
between 1 to 7 users.
The number of columns/user schedule and column headers
are dynamically created base on user selection.
Each user schedule is set up in columns with the user name
at the top of the column and appointments in the columns.
For a static number of columns in a loop I would use the approach
below to display client names for columns.
I am having problems creating dynmic unique column array names for
client_name.
[php]
//static columns
for()
{
echo"<tr>
<td>$client_name1</td>
<td>$client_name2</td>
<td>$client_name3</td>
<td>$client_name4</td>
<td>$client_name5</td>
<td>$client_name6</td>
</tr>";
}
[/php][php]
<?
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]![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access advice broadband business classification code combo crime cult of the dead cow daniweb data data protection data transfer database drive dropdownlist encryption europe forensic forensics gadget google government hacking hard hardware help hitachi hp industrial espionage information internet linux mobile module net news payment services privacy protection reuse search security spot storage terabyte tutorials and more tv web wikipedia
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
- How will I Capture this Dynamic Data (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: Cutting amount of work and loading time?
- Next Thread: Can i load my page before displaying it ??


Linear Mode