aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/views/view.roster.php
diff options
context:
space:
mode:
author3rd Infantry Division <thirdid@3rd-infantry-division.org>2011-04-18 16:29:05 -0400
committer3rd Infantry Division <thirdid@3rd-infantry-division.org>2011-04-18 16:29:05 -0400
commitea0080efe5a38a470d4f745ca589e923efc35e5c (patch)
treec6604647d51c0e81168e7dbaba9f73385edc02ee /modules/rudi/views/view.roster.php
parentfa1cde8684c1a481dd251398d1c2faa27d147a43 (diff)
parent0077cb99704fe863cf731fc5cab792af2ede96c2 (diff)
downloadbayonetcms-ea0080efe5a38a470d4f745ca589e923efc35e5c.tar.gz
Merge branch 'master' of ssh://3rd-infantry-division.org/~/git/bayonet
Diffstat (limited to 'modules/rudi/views/view.roster.php')
-rw-r--r--modules/rudi/views/view.roster.php82
1 files changed, 59 insertions, 23 deletions
diff --git a/modules/rudi/views/view.roster.php b/modules/rudi/views/view.roster.php
index c0ee92d..6d7d14f 100644
--- a/modules/rudi/views/view.roster.php
+++ b/modules/rudi/views/view.roster.php
@@ -1,23 +1,59 @@
-<table width="100%" class="rudi">
-<?php
- $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0");
- $row = $this->db->fetch($result);
- foreach($row as $unit){
- echo "<tr><th colspan=\"5\">{$unit['name']} : {$unit['callsign']}</th></tr>";
-?>
- <tr>
- <!-- Table header -->
- <th class="header">Rank</th>
- <th class="header">Name</th>
- <th class="header">Role</th>
- <th class="header">Weapon</th>
- <th class="header">Status</th>
- </tr>
-<?php
- $this->printRoster($unit['unit_id'], $unit['leader_id']);
- $this->displayUnitsRec($unit['unit_id']);
- }
-
-?>
-</table>
-
+<div style="text-align: center">
+<?php
+
+ echo LinkInternal('Active Roster','?load=rudi');
+ echo '&nbsp;&nbsp;&nbsp;'.LinkInternal('Past Member Roster','?load=rudi&select=past').'<br /><br />';
+
+?>
+</div>
+<center>
+<table width="100%" cellspacing="1" cellpadding="0" class="rudiroster">
+<?php
+
+ if(isset($_GET['select']) && $_GET['select'] == "past"){
+
+?>
+ <tr><th colspan="5">Past Members Roster</th></tr>
+ <tr>
+ <!-- Table header -->
+ <th class="header" width="90px">Rank</th>
+ <th class="header" width="280px">Name</th>
+ <th class="header" width="174px">Role</th>
+ <th class="header" width="160px">Time in Service</th>
+ <th class="header" width="140px">Status</th>
+ </tr>
+<?php
+ $this->printPastRoster();
+
+ }else {
+
+ $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0");
+ $row = $this->db->fetch($result);
+ foreach($row as $unit){
+ $unit_id = $unit['unit_id'];
+ decho("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '$unit_id' AND `date_discharged` IS NULL LIMIT 1");
+ $num = 0;
+ $check = $this->db->Query("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '$unit_id' AND `date_discharged` IS NULL LIMIT 1");
+ $num = $this->db->Rows($check);
+ if($num >= 1){
+ echo "<tr><th colspan=\"5\">{$unit['name']} : {$unit['callsign']}</th></tr>";
+?>
+ <tr>
+ <!-- Table header -->
+ <th class="header" width="90px">Rank</th>
+ <th class="header" width="300px">Name</th>
+ <th class="header" width="214px">Role</th>
+ <th class="header" width="120px">Weapon</th>
+ <th class="header" width="120px">Status</th>
+ </tr>
+<?php
+ $this->printRoster($unit['unit_id'], $unit['leader_id']);
+ $this->displayUnitsRec($unit['unit_id']);
+ }
+ }
+ $this->printReserves();
+ }
+
+?>
+</table>
+</center>