diff options
| author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-29 15:46:26 -0500 |
|---|---|---|
| committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-29 15:46:26 -0500 |
| commit | 4bc1e32a79c0928a079113c51f9cf9fcaf525a63 (patch) | |
| tree | 00312c30100c6947859324c39d80b7fcafaf92f1 /modules/rudi/views/view.drills.php | |
| parent | ad6ba256efd1a65fb1bb3951ae6b17b1593205b7 (diff) | |
| download | bayonetcms-4bc1e32a79c0928a079113c51f9cf9fcaf525a63.tar.gz | |
(OC) I cut down the calendar queries to just one which seems to work out a lot better.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@409 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/rudi/views/view.drills.php')
| -rw-r--r-- | modules/rudi/views/view.drills.php | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php new file mode 100644 index 0000000..084be97 --- /dev/null +++ b/modules/rudi/views/view.drills.php @@ -0,0 +1,99 @@ +<html> +<head> + <title>Drills</title> + +<style type="text/css"> +p {color: white; } +body {background-color: black; } +th.header { + width:175px; + background:#333; +} + +td.rudi { + text-align: center; + vertical-align: middle; +} +</style> + +</head> +<body> + +<?php + +function Rating($val) +{ + define(EXCELLENT,100); + define(GOOD, 75); + define(FAIR, 50); + define(POOR, 25); + define(TERRIBLE, 0); + + if($val == EXCELLENT) + return "Excellent"; + elseif($val < EXCELLENT && $val >= GOOD) + return "Good"; + elseif($val < GOOD && $val >= POOR) + return "Poor"; + elseif($val < POOR && $val >= TERRIBLE) + return "Terrible"; + else + return "Bad Value"; +} + +OpenTable("Drills"); + +if(isset($_GET['id'])) +{ + + foreach($this->drills as $drill) + { + $name = $drill->last_name . ', ' . $drill->first_name; + $pRating = Rating($drill->performance); + $iRating = Rating($drill->initiative); + + echo "<tr> + <th class=\"header\">Soldier</th> + <th class=\"header\">Performance Rating</th> + <th class=\"header\">Initiative Rating</th> + <th class=\"header\">Early Excusal</th> + <th class=\"header\">Excusal Reason</th> + + </tr>"; + + echo "<tr> + <td class=\"rudi\">{$name}</td> + <td class=\"rudi\">{$pRating}</td> + <td class=\"rudi\">{$iRating}</td> + <td class=\"rudi\">{$drill->excusal}</td> + <td class=\"rudi\">{$drill->excusal_reason}</td> + + </tr>"; + } + CloseTable(); + echo "<a href=\"?load=rudi&show=drills\">Back</a>"; + return; +} + +echo "<tr> +<th class=\"header\"> </th> +<th class=\"header\">Date</th> +<!-- <th class=\"header\">News</th> --> +<th class=\"header\">Notes</th> +</tr>"; + +foreach($this->drills as $drill) +{ + echo "<tr> + <td class=\"rudi\"><a href=\"?load=rudi&show=drills&id={$drill->drill_id}\">View</a></td> + <td class=\"rudi\">{$drill->date}</td> + <!-- <td class=\"rudi\">{$drill->news}</td> --> + <td class=\"rudi\">{$drill->notes}</td> + </tr>"; +} + +CloseTable(); +?> + +</body> +</html>
\ No newline at end of file |
