echo calculateCurrentPeriodPercent($area, $netID); echo "</td><td>"; echo calculateTotalPercent($netID); echo "</td>"; ?> </tr> </table> </div> <div class='floatRight'> <h2>Training Stats for all Team Leaders (Trained : Timely) </h2> <table> <tr> <th>% Last Period</th><th>% This month</th><th>% This Semester</th><th>% Total</th> </tr><tr> <?php echo "<td>"; echo calculateLastPeriodPercentAllTeams($area); echo "</td><td>"; echo calculateCurrentMonthPercentAllTeams($area); echo "</td><td>"; echo calculateCurrentPeriodPercentAllTeams($area); echo "</td><td>"; echo calculateTotalPercentAllTeams($area); echo "</td>"; ?> </tr> </table> </div> <?php require '../includes/includeAtEnd.php';
function printTeamingStats($area) { global $db; try { $areaQuery = $db->prepare("SELECT * FROM teams WHERE area =:area ORDER BY name"); $areaQuery->execute(array(':area' => $area)); } catch (PDOException $e) { exit("error in query"); } while ($cur = $areaQuery->fetch(PDO::FETCH_ASSOC)) { echo "<tr><td>"; echo nameByNetId($cur['lead']); echo "</td><td>"; echo calculateLastPeriodPercent($cur['lead']); echo "</td><td>"; echo calculateCurrentMonthPercent($cur['lead']); echo "</td><td>"; echo calculateCurrentPeriodPercent($area, $cur['lead']); echo "</td><td>"; echo calculateTotalPercent($cur['lead']); echo "</td></tr>"; } echo "<tr><th>"; echo "OVERALL TOTALS"; echo "</th><th>"; echo calculateLastPeriodPercentAllTeams($area); echo "</th><th>"; echo calculateCurrentMonthPercentAllTeams($area); echo "</th><th>"; echo calculateCurrentPeriodPercentAllTeams($area); echo "</th><th>"; echo calculateTotalPercentAllTeams($area); echo "</th>"; }