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.php140
1 files changed, 68 insertions, 72 deletions
diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php
index bc80f83..5fcd18e 100644
--- a/modules/rudi/views/view.drills.php
+++ b/modules/rudi/views/view.drills.php
@@ -1,5 +1,10 @@
<?php
+function back()
+{
+ echo "<a href=\"?load=rudi&amp;show=drills\">Back</a>";
+}
+
function Rating($val)
{
define('EXCELLENT',100);
@@ -20,86 +25,77 @@ function Rating($val)
return "Bad Value";
}
-OpenTable("Drills");
+?>
+<?php if(isset($_GET['id'])): ?>
-if(isset($_GET['stats']))
-{
-
- return;
-}
+<table cellspacing="20" class="rudi" align="left" style="width: 100%;">
+<tr>
+ <th class="header">News</th>
+</tr>
-if(isset($_GET['id']))
-{
- 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 ? "Yes" : "No") . "</td>
- <td class=\"rudi\">{$drill->excusal_reason}</td>
-
- </tr>";
- }
- CloseTable();
- echo "<a href=\"?load=rudi&amp;show=drills\">Back</a>";
- decho('DATA FOR QUERY');
+<tr>
+ <td style="text-align:left;"><?php echo bbcode_format($drills->manifest->news); ?>&nbsp;</td>
+</tr>
+
+<tr>
+ <th class="header">Notes</th>
+</tr>
+
+<tr>
+ <td style="text-align:left;"><?php echo bbcode_format($drills->manifest->notes); ?>&nbsp;</td>
+</tr>
+</table>
+
+<br />
+
+<table class="rudi" align="center" style="width: 100%;">
+<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>
+<?php foreach($drills->manifest->members as $member): ?>
+<?php
+ $name = $member->last_name . ', ' . $member->first_name;
+ $pRating = Rating($member->performance);
+ $iRating = Rating($member->initiative);
+?>
+<tr>
+ <td class="rudi"><?php echo $name; ?>&nbsp;</td>
+ <td class="rudi"><?php echo $pRating; ?>&nbsp;</td>
+ <td class="rudi"><?php echo $iRating; ?>&nbsp;</td>
+ <td class="rudi"><?php echo ($member->excusal ? "Yes" : "No"); ?>&nbsp;</td>
+ <td class="rudi"><?php echo $member->excusal_reason; ?>&nbsp;</td>
+</tr>
+<?php endforeach; ?>
+</table>
+ <?php echo "<br/>"; back();
+ decho("DRILL DATA FOR ID({$_GET['id']}) QUERY");
decho($drills->manifest);
return;
-}
+ ?>
-echo "<tr>
-<th class=\"header\">&nbsp;</th>
-<th class=\"header\">Date</th>
-<!-- <th class=\"header\">News</th> -->
-<th class=\"header\">Notes</th>
-</tr>";
+<?php endif; ?>
-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>
- <td class=\"rudi\">{$drill->date}</td>
- <!-- <td class=\"rudi\">{$drill->news}</td> -->
- <td class=\"rudi\">{$drill->notes}</td>
- </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');
+<table class="rudi" align="center" style="width: 100%;">
+<tr>
+<th class="header">&nbsp;</th>
+<th class="header">Date</th>
+</tr>
-$drill = $drills->getAttendenceOf(2);
-$drill['stats'] = $drills->getMemberStatistics($drills->getAttendenceOf(2));
+<?php foreach($drills->manifest as $drill): ?>
+<tr>
+ <td class="rudi"><a href="?load=rudi&amp;show=drills&amp;id=<?php echo $drill->drill_id; ?>">View</a></td>
+ <td class="rudi"><?php echo $drill->date; ?> </td>
+</tr>
+<?php endforeach; ?>
+</table>
-$member = $drills->getMemberAttendenceOf(2,1);
-$member[] = $drills->getMemberStatistics($member);
-*/
+<?php
-decho('DATA FOR QUERY');
+decho('DATA FOR NO ID QUERY');
decho($drills->manifest);
-decho($drill);
-decho($member);
-CloseTable();
-?> \ No newline at end of file
+?>