aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rudi/views')
-rw-r--r--modules/rudi/views/view.awards.php2
-rw-r--r--modules/rudi/views/view.information.php38
-rw-r--r--modules/rudi/views/view.platoon.php42
-rw-r--r--modules/rudi/views/view.points.php35
-rw-r--r--modules/rudi/views/view.profile.php64
-rw-r--r--modules/rudi/views/view.roster.php82
-rw-r--r--modules/rudi/views/view.unit.php42
-rw-r--r--modules/rudi/views/view.weapons.php70
8 files changed, 269 insertions, 106 deletions
diff --git a/modules/rudi/views/view.awards.php b/modules/rudi/views/view.awards.php
index 5039e56..0a17005 100644
--- a/modules/rudi/views/view.awards.php
+++ b/modules/rudi/views/view.awards.php
@@ -1,4 +1,4 @@
-<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+<?php define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
<?php $medals_path = $this->images_path . "/medals/"; ?>
<html>
diff --git a/modules/rudi/views/view.information.php b/modules/rudi/views/view.information.php
index a62ba8a..d017564 100644
--- a/modules/rudi/views/view.information.php
+++ b/modules/rudi/views/view.information.php
@@ -1,20 +1,20 @@
-<?php
-$unit_id = $_GET['unit_id'];
-$platoon_id = $_GET['platoon_id'];
-switch($_GET['info'])
-{
- case 'unit':
- if(isset($unit_id))
- include_once 'view.unit.php';
- break;
-
- case 'platoon':
- if(isset($unit_id, $platoon_id))
- include_once 'view.platoon.php';
- break;
-
- default:
- ReportError('Invalid info entry');
- return;
-}
+<?php
+$unit_id = $_GET['unit_id'];
+$platoon_id = $_GET['platoon_id'];
+switch($_GET['info'])
+{
+ case 'unit':
+ if(isset($unit_id))
+ include_once 'view.unit.php';
+ break;
+
+ case 'platoon':
+ if(isset($unit_id, $platoon_id))
+ include_once 'view.platoon.php';
+ break;
+
+ default:
+ ReportError('Invalid info entry');
+ return;
+}
?> \ No newline at end of file
diff --git a/modules/rudi/views/view.platoon.php b/modules/rudi/views/view.platoon.php
index dbbb455..4ee60dc 100644
--- a/modules/rudi/views/view.platoon.php
+++ b/modules/rudi/views/view.platoon.php
@@ -1,22 +1,22 @@
-<?php $data = $info->Platoon($unit_id, $platoon_id); ?>
-
-<table align="center">
- <tr>
- <th>&nbsp;</th>
- <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
- </tr>
- <tr>
- <th width="25%">Platoon</th>
- <td><?php echo $data->name; ?></td>
- </tr>
- <tr>
- <th>Creed</th>
- <td><?php echo $data->creed; ?></td>
- </tr>
- <tr>
- <th valign="top">Biography</th>
- <td><?php echo $data->bio; ?></td>
- </tr>
-</table>
-
+<?php $data = $info->Platoon($unit_id, $platoon_id); ?>
+
+<table align="center">
+ <tr>
+ <th>&nbsp;</th>
+ <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
+ </tr>
+ <tr>
+ <th width="25%">Platoon</th>
+ <td><?php echo $data->name; ?></td>
+ </tr>
+ <tr>
+ <th>Creed</th>
+ <td><?php echo $data->creed; ?></td>
+ </tr>
+ <tr>
+ <th valign="top">Biography</th>
+ <td><?php echo $data->bio; ?></td>
+ </tr>
+</table>
+
<?php decho($data); ?> \ No newline at end of file
diff --git a/modules/rudi/views/view.points.php b/modules/rudi/views/view.points.php
new file mode 100644
index 0000000..bf6c2b6
--- /dev/null
+++ b/modules/rudi/views/view.points.php
@@ -0,0 +1,35 @@
+<h3>Points Ticker:</h3>
+<table width="100%" class="rudi" cellspacing="0">
+
+ <tr>
+ <!-- Table header -->
+ <th class="header">Rank</th>
+ <th class="header">Name</th>
+ <th class="header">Points</th>
+ <th class="header">Missed Count</th>
+ <th class="header">Attended Count</th>
+ </tr>
+<?php
+ $num = 0;
+ foreach($this->data as $member){
+ if($member->status_id < 4){
+ if($num %2 == 0){
+ echo '<tr style="background-color:#D4D4D4; height:30px;">';
+ }else{
+ echo '<tr style="height:30px;">';
+ }
+?>
+ <td><?php echo $member->rank_short; ?></td>
+ <td><?php echo $member->first_name." ".$member->last_name; ?></td>
+ <td><?php echo $member->points; ?></td>
+ <td><?php echo $member->drillcount; ?></td>
+ <td><?php echo $member->attendcount; ?></td>
+ </tr>
+
+<?php
+ $num++;
+ }
+ }
+
+?>
+</table> \ No newline at end of file
diff --git a/modules/rudi/views/view.profile.php b/modules/rudi/views/view.profile.php
index 6135ea4..97adead 100644
--- a/modules/rudi/views/view.profile.php
+++ b/modules/rudi/views/view.profile.php
@@ -1,10 +1,14 @@
<?php
//define('BLOCK_RIGHT_DISABLE','block_right_disable');
$member =& $this->data[$_GET['profile']];
-$uniform_image = $member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png";
+$uniform_image = "modules/rudi/images/uniform/".$member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png";
decho($member);
define('BLOCK_RIGHT_DISABLE', true);
+
+$arrUnits = $this->getUnitArr($_GET['profile']);
+decho($arrUnits);
?>
+
<style type="text/css">
@@ -15,7 +19,13 @@ define('BLOCK_RIGHT_DISABLE', true);
<th class="header">Viewing Profile of: <?php echo $member->rank_long . " " . $member->first_name . " " . $member->last_name; ?></th>
</tr>
<tr>
- <td><center><img src="modules/rudi/images/uniform/<?php echo $uniform_image; ?>" />&nbsp;</center></td>
+ <td><center>
+<?php
+ if(file_exists($uniform_image)){
+ echo '<img src="'.$uniform_image.'" />';
+ }
+?>
+ &nbsp;</center></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="1">
@@ -23,11 +33,18 @@ define('BLOCK_RIGHT_DISABLE', true);
<td width="20%">
<table width="100%" border="0" cellpadding="5" align="center" style="border: 0px;">
<tr>
- <td><center><?php echo $member->primary_mos; ?></center></td>
+ <td><center><span style="font-weight: bold; font-size: 16px; font-family: arial;"><?php echo $member->primary_mos; ?></span></center></td>
</tr>
<tr>
- <td><center><img src="modules/rudi/images/ranks/large/<?php echo $member->rank_image; ?>" />&nbsp;</center></td>
- </tr>
+ <td><center>
+ <?php
+ if(file_exists("modules/rudi/images/ranks/large/{$member->rank_image}")){
+ echo "<img src=\"modules/rudi/images/ranks/large/{$member->rank_image}\" alt=\"{$member->rank_short}\" />";
+ }else{
+ echo $member->rank_short;
+ }
+ ?>
+ </center></td></tr>
<tr>
<td><center><img src="modules/rudi/images/flags/<?php echo $member->country_image; ?>" />&nbsp;</center></td>
</tr>
@@ -38,12 +55,12 @@ define('BLOCK_RIGHT_DISABLE', true);
<tr>
<th class="header" scope="row">Location</th>
<td class="info"><?php echo $this->evalData($member->location); ?>&nbsp;</td>
- <th class="header">Superior</th>
+ <th class="header">Reports To</th>
<td class="info"><?php
- if(!is_null($member->superior_next->leader_id))
- echo "<a href=\"?load=rudi&profile={$member->superior_next->leader_id}\">";
+ if(!is_null($member->superior->leader_id))
+ echo "<a href=\"?load=rudi&profile={$member->superior->leader_id}\">";
- echo $this->evalData($member->superior_next->name);
+ echo $this->evalData($member->superior->name);
echo "</a>&nbsp;";
?>
</td>
@@ -52,23 +69,27 @@ define('BLOCK_RIGHT_DISABLE', true);
<th class="header" scope="row">Status</th>
<td class="info"><?php echo $this->evalData($member->status); ?>&nbsp;</td>
<th class="header">Position</th>
- <td class="info"><?php echo $this->evalData($member->position); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($member->role_name); ?>&nbsp;</td>
</tr>
<tr>
<th class="header" scope="row">Unit</th>
- <td class="info"><?php echo $this->evalData($member->unit_name); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($arrUnits[0]['name']); ?>&nbsp;</td>
<th class="header">Weapon</th>
- <td class="info"><?php echo $this->evalData($member->weapon_name); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($member->weapon_model); ?>&nbsp;
+ <?php if($member->weapon2_model != NULL)
+ echo "/&nbsp;&nbsp;".$member->weapon2_model;
+ ?>
+ </td>
</tr>
<tr>
<th class="header" scope="row">Platoon</th>
- <td class="info"><?php echo $this->evalData($member->platoon_name); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($arrUnits[1]['name']); ?>&nbsp;</td>
<th class="header" scope="row">Enlisted</th>
<td class="info"><?php echo $this->evalData($member->enlist_date); ?>&nbsp;</td>
</tr>
<tr>
<th class="header" scope="row">Squad</th>
- <td class="info"><?php echo $this->evalData($member->squad_name); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($arrUnits[2]['name']); ?>&nbsp;</td>
<th class="header">Time In Service</th>
<?php if($member->discharge_date): ?>
<td class="info"><?php echo $this->getDiffTime($member->enlist_date_st, $member->discharge_date); ?>&nbsp;</td>
@@ -79,7 +100,7 @@ define('BLOCK_RIGHT_DISABLE', true);
</tr>
<tr>
<th class="header">Team</th>
- <td class="info"><?php echo $this->evalData($member->team_name); ?>&nbsp;</td>
+ <td class="info"><?php echo $this->evalData($arrUnits[3]['name']); ?>&nbsp;</td>
<th class="header">Time In Grade</th>
<?php if($member->discharge_date): ?>
<td class="info"><?php echo $this->getDiffTime($member->promo_date_st, $member->discharge_date); ?>&nbsp;</td>
@@ -122,7 +143,7 @@ define('BLOCK_RIGHT_DISABLE', true);
<?php foreach($member->service_record as $record): ?>
<tr>
<th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
- <td><?php echo $record->record_note; ?>&nbsp;</td>
+ <td style="text-align:left; padding-left: 10px;"><?php echo $record->record_note; ?>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
@@ -142,9 +163,9 @@ define('BLOCK_RIGHT_DISABLE', true);
<?php foreach($member->award_record as $record): ?>
<tr>
<th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
- <td ><?php echo $this->evalData($record->award_name); ?>&nbsp;</td>
+ <td style="text-align:left; padding-left: 10px;" ><?php echo $this->evalData($record->award_name); ?>&nbsp;</td>
<td style="vertical-align:middle;"><center><img src="modules/rudi/images/medals/<?php echo $record->image; ?>"/></center></td>
- <td width="40%"><?php echo $record->record_note; ?>&nbsp;</td>
+ <td width="40%" style="text-align:left; padding-left: 10px;"><?php echo $record->record_note; ?>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
@@ -155,7 +176,7 @@ define('BLOCK_RIGHT_DISABLE', true);
<table width="100%" border="0" cellpadding="1" id="thin">
<tr>
- <th class="header" scope="col" colspan="3">Combat Record</th>
+ <th class="header" scope="col" colspan="4">Combat Record</th>
</tr>
<tr>
<?php if($this->evalData($member->combat_record)):?>
@@ -163,9 +184,10 @@ define('BLOCK_RIGHT_DISABLE', true);
<?php else:?>
<?php foreach($member->combat_record as $record): ?>
<tr>
- <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?>&nbsp;</th>
+ <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date)); ?>&nbsp;</th>
<td><a href="<?php echo $record->website; ?>"><?php echo $record->name; ?></a>&nbsp;</td>
- <td><?php echo $record->status; ?>&nbsp;</td>
+ <td><?php echo $record->title; ?>&nbsp;</td>
+ <td><?php echo $record->status . ' '. $record->home_score . '-' . $record->visit_score; ?>&nbsp;</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
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>
diff --git a/modules/rudi/views/view.unit.php b/modules/rudi/views/view.unit.php
index fcc66ac..4e85e29 100644
--- a/modules/rudi/views/view.unit.php
+++ b/modules/rudi/views/view.unit.php
@@ -1,22 +1,22 @@
-<?php $data = $info->Unit($unit_id); ?>
-
-<table align="center">
- <tr>
- <th>&nbsp;</th>
- <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
- </tr>
- <tr>
- <th width="25%">Unit</th>
- <td><?php echo $data->name; ?></td>
- </tr>
- <tr>
- <th>Creed</th>
- <td><?php echo $data->creed; ?></td>
- </tr>
- <tr>
- <th valign="top">Biography</th>
- <td><?php echo $data->bio; ?></td>
- </tr>
-</table>
-
+<?php $data = $info->Unit($unit_id); ?>
+
+<table align="center">
+ <tr>
+ <th>&nbsp;</th>
+ <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
+ </tr>
+ <tr>
+ <th width="25%">Unit</th>
+ <td><?php echo $data->name; ?></td>
+ </tr>
+ <tr>
+ <th>Creed</th>
+ <td><?php echo $data->creed; ?></td>
+ </tr>
+ <tr>
+ <th valign="top">Biography</th>
+ <td><?php echo $data->bio; ?></td>
+ </tr>
+</table>
+
<?php decho($data); ?> \ No newline at end of file
diff --git a/modules/rudi/views/view.weapons.php b/modules/rudi/views/view.weapons.php
new file mode 100644
index 0000000..2cb033c
--- /dev/null
+++ b/modules/rudi/views/view.weapons.php
@@ -0,0 +1,70 @@
+<?php define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+<?php $medals_path = $this->images_path . "/medals/"; ?>
+
+<html>
+<head>
+ <title>Awards and Medals</title>
+
+<style type="text/css">
+/*th.header {
+ width:175px;
+ background:#333;
+}
+
+td.rudi {
+ text-align: center;
+ vertical-align: middle;
+} */
+</style>
+
+</head>
+<body>
+
+<?php $weapons = $this->getWeapons("ORDER BY role ASC, caliber ASC, model ASC"); ?>
+<center>
+<table class="rudiroster" cellspacing="1" cellpadding="0" align="center">
+<tr><th width="250px">Model</th><th width="250px">Caliber</th><th width="250px">Role</th></tr>
+ <?php
+ $num=0;
+ $role = "Assault";
+ foreach($weapons as $weapon){
+ if($role != $weapon['role']){
+ echo '<tr class="null" style="height:3px;"></tr>';
+ }
+ if($num%2==0)
+ echo '<tr class="high">';
+ else
+ echo "<tr>";
+ echo "<td>".$weapon['model']."</td><td>".$weapon['caliber']."</td><td>".$weapon['role']."</td></tr>";
+ $role = $weapon['role'];
+ $num++;
+ }
+
+ ?>
+
+</table>
+</center>
+<!-- grr wtf
+ <table align="center" style="width: 100%;">
+ <tr>
+ <th scope="col" class="header" style="width:1px;">Image</th>
+ <th scope="col" class="header" style="width:1px;">Award</th>
+ <th scope="col" class="header">Description</th>
+ </tr>
+
+
+ <?php //foreach($this->awards as $award): ?>
+
+ <tr>
+ <td align='center' class="rudi"><img src="/rudi/images/medals/<?php //echo $award->image; ?>"></img>&nbsp;</td>
+ <td align='center' class="rudi"><?php //echo $award->name; ?>&nbsp;</td>
+ <td align='left'><?php //echo wordwrap($award->description,80,"<br/>"); ?>&nbsp;</td>
+ </tr>
+
+ <?php //endforeach; ?>
+
+
+ </table>
+-->
+</body>
+</html> \ No newline at end of file