function display_person_rows($projects) { $mondays = setup_mondays(); foreach ($projects as $key => $project) { ?> <tr id="project-<?php echo $project['project_id']; ?> " staffy:project_id="<?php echo $project_id['project_id']; ?> "> <?php foreach ($mondays as $key => $monday) { ?> <td class="project-<?php echo $project['project_id']; ?> <?php echo week_class($monday); ?> " id="cell-<?php echo $project['project_id']; ?> -<?php echo $monday; ?> " staffy:project_id="<?php echo $project['project_id']; ?> " staffy:date="<?php echo $monday; ?> "> <?php if (strtotime(date('Y-m-d')) > strtotime($mondays[$key + 1])) { ?> <!-- this is a past week --> <span class="actual-hours">32</span> <span class="estimated-hours">28</span> <?php } else { ?> <!-- this is a present or future week --> <span class="estimated-hours">28</span> <?php } ?> </td> <?php } ?> </tr> <?php } ?> <!-- summary row --> <tr id="project-<?php echo $project['project_id']; ?> " staffy:project_id="<?php echo $project_id['project_id']; ?> "> <?php foreach ($mondays as $key => $monday) { ?> <td class="project-<?php echo $project['project_id']; ?> <?php echo week_class($monday); ?> summary" id="cell-<?php echo $project['project_id']; ?> -<?php echo $monday; ?> " staffy:project_id="<?php echo $project['project_id']; ?> " staffy:date="<?php echo $monday; ?> "> <strong>84</strong> </td> <?php } ?> </tr> <?php }
<?php define('NUM_WEEKS', 52); define('START_DATE', '2010-08-01'); $people = array(array('person_id' => '1', 'person_name' => 'R Marianski', 'person_long_name' => 'Robert Marianski', 'person_role' => 'dev'), array('person_id' => '2', 'person_name' => 'J Maki', 'person_long_name' => 'Jeff Maki', 'person_role' => 'pm'), array('person_id' => '3', 'person_name' => 'A Cochran', 'person_long_name' => 'Andy Cochran', 'person_role' => 'dzn'), array('person_id' => '4', 'person_name' => 'C Patterson', 'person_long_name' => 'Chris Patterson', 'person_role' => 'dzn'), array('person_id' => '5', 'person_name' => 'D Turner', 'person_long_name' => 'David Turner', 'person_role' => 'dev'), array('person_id' => '6', 'person_name' => 'Designer', 'person_long_name' => 'Designer', 'person_role' => 'dzn'), array('person_id' => '7', 'person_name' => 'Developer', 'person_long_name' => 'Developer', 'person_role' => 'dev')); $projects = array(array('project_id' => '1', 'project_name' => 'DOT Portals'), array('project_id' => '2', 'project_name' => 'MTA Bus CIS'), array('project_id' => '1', 'project_name' => 'Sound Transit')); $mondays = setup_mondays();
function display_projects_table($projects) { $mondays = setup_mondays(); foreach ($projects as $key => $project) { ?> <tr id="project-<?php echo $project['project_id']; ?> " tb:project_id="<?php echo $project['project_id']; ?> " class="<?php echo $project['component_class']; ?> " tb:component="<?php echo $project['component_full']; ?> "> <td class="project-name"> <?php //echo $project['project_name']; ?> <?php //the_project_link($project); ?> <a class="<?php echo $project['priority']; ?> " href="http://thenest.topplabs.org/ticket/<?php echo $project['project_id']; ?> "><?php echo $project['project_name']; ?> </a> </td> <?php foreach ($mondays as $key => $monday) { ?> <td class="project-<?php echo $project['project_id']; ?> <?php echo week_class($monday); ?> " id="cell-<?php echo $project['project_id']; ?> -<?php echo $monday; ?> " tb:project_id="<?php echo $project['project_id']; ?> " tb:date="<?php echo $monday; ?> "> <?php echo display_people($project['project_id'], $monday); ?> <div class="batch-dialog" style="display:none"> <a href="#" class="copy">cp</a> <a href="#" class="move">mv</a> <a href="#" class="delete">rm</a> <a href="#" class="cancel">x</a> </div> </td> <?php } ?> <th style="width: 40px"> </th> </tr> <?php } }