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.php81
-rw-r--r--modules/rudi/views/view.drills.php122
-rw-r--r--modules/rudi/views/view.information.php20
-rw-r--r--modules/rudi/views/view.platoon.php22
-rw-r--r--modules/rudi/views/view.profile.php175
-rw-r--r--modules/rudi/views/view.ranks.php37
-rw-r--r--modules/rudi/views/view.roster.php23
-rw-r--r--modules/rudi/views/view.unit.php22
8 files changed, 502 insertions, 0 deletions
diff --git a/modules/rudi/views/view.awards.php b/modules/rudi/views/view.awards.php
new file mode 100644
index 0000000..5039e56
--- /dev/null
+++ b/modules/rudi/views/view.awards.php
@@ -0,0 +1,81 @@
+<?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 $classes = $this->getAwardClasses(); ?>
+<table class="rudi" align="center" style="width: 100%;">
+
+ <?php
+ $i = 0;
+ $cl = 0;
+ while($cl != count($classes))
+ {
+ echo "<tr>";
+ echo "<th colspan=\"3\">{$classes[$cl]->name}s</th>";
+ echo "</tr>";
+ echo '<th scope="col">Image</th>';
+ echo '<th scope="col" width=\"100px\">Award</th>';
+ echo '<th scope="col">Description</th>';
+
+ foreach($this->awards as $award)
+ {
+ if($classes[$cl]->class_id == $award->class_id)
+ {
+ echo "
+ <tr>
+ <td><img src=\"modules/rudi/images/medals/{$award->image}\" alt=\"{$award->image}\"/></td>
+ <td>{$award->name}&nbsp;</td>
+ <td style=\"text-align:left;\">{$award->description}&nbsp;</td>
+ </tr>";
+ }
+
+ }
+
+ ++$cl;
+ }
+ ?>
+
+</table>
+
+<!-- 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
diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php
new file mode 100644
index 0000000..aa4b30a
--- /dev/null
+++ b/modules/rudi/views/view.drills.php
@@ -0,0 +1,122 @@
+<?php
+
+function back()
+{
+ echo "<a href=\"?load=rudi&amp;show=drills\">Back</a>";
+}
+
+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";
+}
+
+//$this->getMemberAttendance();
+
+OpenContent();
+?>
+<div class="contentHeading">Drills</div>
+<div class="content">
+
+<?php if(isset($_GET['id'])): ?>
+<table cellspacing="20" class="rudi" align="left" style="width: 100%;">
+<tr>
+ <th class="header">News</th>
+</tr>
+
+<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">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 $this->evalData($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;
+ ?>
+
+<?php endif; ?>
+
+<table class="rudi" align="center" style="width: 100%;">
+<tr>
+<th class="header">&nbsp;</th>
+<th class="header">Date</th>
+</tr>
+
+<?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>
+
+</div>
+<?php
+CloseContent();
+OpenContent();
+?>
+<?php if(isset($_GET['stats']) && $_GET['stats'] == 'true'): ?>
+<div class="contentHeading">Statistics</div>
+<div class="content">
+<?php
+//decho($drills->getMemberAttendanceFull());
+require_once 'view.drills.statistics.php';
+?>
+</div>
+</div>
+
+<?php endif; ?>
+
+<?php
+CloseContent();
+decho('DATA FOR NO ID QUERY');
+decho($drills->manifest);
+?>
diff --git a/modules/rudi/views/view.information.php b/modules/rudi/views/view.information.php
new file mode 100644
index 0000000..a62ba8a
--- /dev/null
+++ b/modules/rudi/views/view.information.php
@@ -0,0 +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;
+}
+?> \ No newline at end of file
diff --git a/modules/rudi/views/view.platoon.php b/modules/rudi/views/view.platoon.php
new file mode 100644
index 0000000..dbbb455
--- /dev/null
+++ b/modules/rudi/views/view.platoon.php
@@ -0,0 +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 decho($data); ?> \ No newline at end of file
diff --git a/modules/rudi/views/view.profile.php b/modules/rudi/views/view.profile.php
new file mode 100644
index 0000000..6135ea4
--- /dev/null
+++ b/modules/rudi/views/view.profile.php
@@ -0,0 +1,175 @@
+<?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";
+decho($member);
+define('BLOCK_RIGHT_DISABLE', true);
+?>
+<style type="text/css">
+
+
+</style>
+
+<table class="rudi" width="100%" border="1" align="center" cellpadding="1" cellspacing="0">
+ <tr>
+ <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>
+ </tr>
+ <tr>
+ <td><table width="100%" border="0" cellpadding="1">
+ <tr>
+ <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>
+ </tr>
+ <tr>
+ <td><center><img src="modules/rudi/images/ranks/large/<?php echo $member->rank_image; ?>" />&nbsp;</center></td>
+ </tr>
+ <tr>
+ <td><center><img src="modules/rudi/images/flags/<?php echo $member->country_image; ?>" />&nbsp;</center></td>
+ </tr>
+ </table>
+ </td>
+ <td width="100%">
+ <table width="100%" border="0" cellpadding="5">
+ <tr>
+ <th class="header" scope="row">Location</th>
+ <td class="info"><?php echo $this->evalData($member->location); ?>&nbsp;</td>
+ <th class="header">Superior</th>
+ <td class="info"><?php
+ if(!is_null($member->superior_next->leader_id))
+ echo "<a href=\"?load=rudi&profile={$member->superior_next->leader_id}\">";
+
+ echo $this->evalData($member->superior_next->name);
+ echo "</a>&nbsp;";
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <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>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Unit</th>
+ <td class="info"><?php echo $this->evalData($member->unit_name); ?>&nbsp;</td>
+ <th class="header">Weapon</th>
+ <td class="info"><?php echo $this->evalData($member->weapon_name); ?>&nbsp;</td>
+ </tr>
+ <tr>
+ <th class="header" scope="row">Platoon</th>
+ <td class="info"><?php echo $this->evalData($member->platoon_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>
+ <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>
+ <?php else: ?>
+ <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st); ?></td>
+ <?php endif; ?>
+
+ </tr>
+ <tr>
+ <th class="header">Team</th>
+ <td class="info"><?php echo $this->evalData($member->team_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>
+ <?php else: ?>
+ <td class="info"><?php echo $this->getDiffTime($member->promo_date_st); ?></td>
+ <?php endif; ?>
+ </tr>
+ <tr>
+ <?php if($member->discharge_date): ?>
+ <td class="info" colspan="2"></td>
+ <th class="header" scope="row">Separated</th>
+ <td class="info"><?php echo $this->evalData($member->discharge_date); ?>&nbsp;</td>
+ <?php endif; ?>
+ </tr>
+
+ </table></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col">Biography</th>
+ </tr>
+ <tr >
+ <td style="text-align:left;"><?php echo $member->bio; ?>&nbsp;</td>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="3">Service Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->service_record)):?>
+ <td>No service record available&nbsp;</td>
+ <?php else:?>
+ <?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>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="4">Award Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->award_record)):?>
+ <td>No award record available&nbsp;</td>
+ <?php else:?>
+ <?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="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>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table>
+
+ &nbsp;
+
+ <table width="100%" border="0" cellpadding="1" id="thin">
+ <tr>
+ <th class="header" scope="col" colspan="3">Combat Record</th>
+ </tr>
+ <tr>
+ <?php if($this->evalData($member->combat_record)):?>
+ <td>No combat record available&nbsp;</td>
+ <?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>
+ <td><a href="<?php echo $record->website; ?>"><?php echo $record->name; ?></a>&nbsp;</td>
+ <td><?php echo $record->status; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </tr>
+ </table></td>
+ </tr>
+</table> \ No newline at end of file
diff --git a/modules/rudi/views/view.ranks.php b/modules/rudi/views/view.ranks.php
new file mode 100644
index 0000000..4792049
--- /dev/null
+++ b/modules/rudi/views/view.ranks.php
@@ -0,0 +1,37 @@
+<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+
+<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>
+
+ <table class="rudi" align="center" style="width: 100%;">
+ <tr>
+ <th scope="col">Image</th>
+ <th scope="col">Rank</th>
+ </tr>
+ <?php foreach($this->ranks as $rank): ?>
+ <tr>
+ <td><img src="<?php echo "modules/rudi/images/ranks/small/{$rank->image}"; ?>" />&nbsp;</td>
+ <td><?php echo $rank->longname; ?>&nbsp;</td>
+ </tr>
+ <?php endforeach; ?>
+
+ </table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/modules/rudi/views/view.roster.php b/modules/rudi/views/view.roster.php
new file mode 100644
index 0000000..c0ee92d
--- /dev/null
+++ b/modules/rudi/views/view.roster.php
@@ -0,0 +1,23 @@
+<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>
+
diff --git a/modules/rudi/views/view.unit.php b/modules/rudi/views/view.unit.php
new file mode 100644
index 0000000..fcc66ac
--- /dev/null
+++ b/modules/rudi/views/view.unit.php
@@ -0,0 +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 decho($data); ?> \ No newline at end of file