aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/views/view.drills.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rudi/views/view.drills.php')
-rw-r--r--modules/rudi/views/view.drills.php86
1 files changed, 58 insertions, 28 deletions
diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php
index 06fbe62..bc80f83 100644
--- a/modules/rudi/views/view.drills.php
+++ b/modules/rudi/views/view.drills.php
@@ -2,11 +2,11 @@
function Rating($val)
{
- define(EXCELLENT,100);
- define(GOOD, 75);
- define(FAIR, 50);
- define(POOR, 25);
- define(TERRIBLE, 0);
+ define('EXCELLENT',100);
+ define('GOOD', 75);
+ define('FAIR', 50);
+ define('POOR', 25);
+ define('TERRIBLE', 0);
if($val == EXCELLENT)
return "Excellent";
@@ -22,35 +22,42 @@ function Rating($val)
OpenTable("Drills");
+if(isset($_GET['stats']))
+{
+
+ return;
+}
+
if(isset($_GET['id']))
{
- decho($this->drills);
- 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>
+ <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>";
+ foreach($drills->manifest['members'] as $drill)
+ {
+ $name = $drill->last_name . ', ' . $drill->first_name;
+ $pRating = Rating($drill->performance);
+ $iRating = Rating($drill->initiative);
- 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>
+ echo "
+ <tr>
+ <td class=\"rudi\">{$name}</td>
+ <td class=\"rudi\">{$pRating}</td>
+ <td class=\"rudi\">{$iRating}</td>
+ <td class=\"rudi\"> " . ($drill->excusal ? "Yes" : "No") . "</td>
+ <td class=\"rudi\">{$drill->excusal_reason}</td>
- </tr>";
+ </tr>";
}
CloseTable();
echo "<a href=\"?load=rudi&amp;show=drills\">Back</a>";
+ decho('DATA FOR QUERY');
+ decho($drills->manifest);
return;
}
@@ -61,7 +68,7 @@ echo "<tr>
<th class=\"header\">Notes</th>
</tr>";
-foreach($this->drills as $drill)
+foreach($drills->manifest as $drill)
{
echo "<tr>
<td class=\"rudi\"><a href=\"?load=rudi&amp;show=drills&amp;id={$drill->drill_id}\">View</a></td>
@@ -71,5 +78,28 @@ foreach($this->drills as $drill)
</tr>";
}
+/*
+decho('manifest');
+decho($drills->manifest);
+decho('attendence of drill 2');
+decho($drills->getAttendenceOf(2));
+decho('member 1 attendence of drill 2');
+decho($drills->getMemberAttendenceOf(2,1));
+decho('member 1 attendence in general');
+decho($drills->getMemberAttendence(1));
+decho('statistics of member 1 in general');
+
+$drill = $drills->getAttendenceOf(2);
+$drill['stats'] = $drills->getMemberStatistics($drills->getAttendenceOf(2));
+
+$member = $drills->getMemberAttendenceOf(2,1);
+$member[] = $drills->getMemberStatistics($member);
+*/
+
+
+decho('DATA FOR QUERY');
+decho($drills->manifest);
+decho($drill);
+decho($member);
CloseTable();
?> \ No newline at end of file