diff options
Diffstat (limited to 'modules/rudi/views')
-rw-r--r-- | modules/rudi/views/view.awards.php | 22 | ||||
-rw-r--r-- | modules/rudi/views/view.current.php | 134 | ||||
-rw-r--r-- | modules/rudi/views/view.drills.php | 28 | ||||
-rw-r--r-- | modules/rudi/views/view.information.php | 20 | ||||
-rw-r--r-- | modules/rudi/views/view.platoon.php | 22 | ||||
-rw-r--r-- | modules/rudi/views/view.profile.php | 82 | ||||
-rw-r--r-- | modules/rudi/views/view.ranks.php | 18 | ||||
-rw-r--r-- | modules/rudi/views/view.roster.php | 23 | ||||
-rw-r--r-- | modules/rudi/views/view.unit.php | 22 |
9 files changed, 139 insertions, 232 deletions
diff --git a/modules/rudi/views/view.awards.php b/modules/rudi/views/view.awards.php index 6a60536..5039e56 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> @@ -6,9 +6,7 @@ <title>Awards and Medals</title> <style type="text/css"> -p {color: white; } -body {background-color: black; } -th.header { +/*th.header { width:175px; background:#333; } @@ -16,14 +14,14 @@ th.header { td.rudi { text-align: center; vertical-align: middle; -} +} */ </style> </head> <body> <?php $classes = $this->getAwardClasses(); ?> -<table align="center" style="width: 100%;"> +<table class="rudi" align="center" style="width: 100%;"> <?php $i = 0; @@ -33,9 +31,9 @@ td.rudi { echo "<tr>"; echo "<th colspan=\"3\">{$classes[$cl]->name}s</th>"; echo "</tr>"; - echo '<th scope="col" class="header" style="width:1px;">Image</th>'; - echo '<th scope="col" class="header" style="width:1px;">Award</th>'; - echo '<th scope="col" class="header" style="width:85%;">Description</th>'; + 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) { @@ -43,9 +41,9 @@ td.rudi { { echo " <tr> - <td align=\"center\" class=\"rudi\"><img src=\"{$medals_path}{$award->image}\" alt=\"{$award->image}\"/></td> - <td align=\"center\" class=\"rudi\">{$award->name} </td> - <td align=\"left\" class=\"rudi\" style=\"text-align:left;\">{$award->description} </td> + <td><img src=\"modules/rudi/images/medals/{$award->image}\" alt=\"{$award->image}\"/></td> + <td>{$award->name} </td> + <td style=\"text-align:left;\">{$award->description} </td> </tr>"; } diff --git a/modules/rudi/views/view.current.php b/modules/rudi/views/view.current.php deleted file mode 100644 index b0e1316..0000000 --- a/modules/rudi/views/view.current.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - $platoon_temp_count = 0; $squad_temp_count = 0; - -?> - -<html> -<head> - <title>Roster Current</title> - -<style type="text/css"> -p {color: white; } -body {background-color: black; } -th.header { - width:175px; - background:#333; -} - -td.rudi { - text-align: center; - vertical-align: middle; -} -</style> - -</head> -<body> - - <?php - /* - echo "<table align=\"center\">"; - - echo "<tr> - <th>Rank</th> - <th>Name</th> - <th>Weapon</th> - <th>Status</th> - </tr>"; - - $p = 1; - $s = 1; - $u = 1; - $members = $this->data; - while($u != count($members)) - { - while($p != $stats['platoon']) - { - echo "<tr> - <th>a platoon</th> - </tr>"; - - while($s != $stats['squad']) - { - if($members[$u]->squad_id) - echo "<tr> - <td>{$members[$u]->rank_short}</td> - <td>{$members[$u]->name}</td> - <td>{$members[$u]->weapon_name}</td> - <td>{$members[$u]->status}</td> - </tr>"; - - echo "<tr> - <th>a squad</th> - </tr>"; - - ++$s; - } - - ++$p; - } - - ++$u; - } - echo "</table>"; - */ - ?> - - <table align="center"> - - <?php for($platoon_count = 0; $platoon_count <= $stats['platoon']; ++$platoon_count): ?> - - <?php if($this->getMembersOfPlatoon($platoon_count) > 0): ?> - <?php if($platoon_count):?> - <tr> - <!-- Platoon table marker --> - <th class="header" colspan="5"><?php echo $platoon_count . ' Platoon'; ?></th></tr> - <?php endif; ?> - - <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 foreach($this->data as $member): ?> - <?php if($member->platoon_id == $platoon_count && $member->status_id < 2): ?> - <tr> - <!-- Rank --> - <td class="rudi"><img src="<?php echo "{$this->images_path}/ranks/small/{$member->rank_short}.png"; ?>" alt="<?php echo $member->rank_short; ?>" /></td> - <!-- Name --> - <td class="rudi"><a href="?load=rudi&profile=<?php echo $member->member_id ?>"><?php echo $member->last_name . ', ' . $member->first_name; ?></a></td> - <!-- Roles --> - <td class="rudi"> - <?php - decho(count($member->Roles) . ' roles attached to: ' . $member->last_name); - for($role = 0; $role < count($member->Roles); ++$role) - { - if($member->Roles[$role]->role_name) - { - decho($role . " = (" . $member->Roles[$role]->role_name . ")"); - echo $member->Roles[$role]->role_name; - echo ' '; - } - else - { - echo "Soldier"; - } - } - ?> - </td> - <!-- Weapon --> - <td class="rudi"><?php echo $member->weapon_manufacturer . ' ' . $member->weapon_model; ?></td> - <!-- Status --> - <td class="rudi"><?php echo $member->status; ?></td> - </tr> - <?php endif; ?> - - <?php endforeach; ?> - <?php endif; ?> - <?php endfor; ?> - - </table> -</body> -</html> diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php index 084be97..06fbe62 100644 --- a/modules/rudi/views/view.drills.php +++ b/modules/rudi/views/view.drills.php @@ -1,24 +1,3 @@ -<html> -<head> - <title>Drills</title> - -<style type="text/css"> -p {color: white; } -body {background-color: black; } -th.header { - width:175px; - background:#333; -} - -td.rudi { - text-align: center; - vertical-align: middle; -} -</style> - -</head> -<body> - <?php function Rating($val) @@ -45,7 +24,7 @@ OpenTable("Drills"); if(isset($_GET['id'])) { - + decho($this->drills); foreach($this->drills as $drill) { $name = $drill->last_name . ', ' . $drill->first_name; @@ -93,7 +72,4 @@ foreach($this->drills as $drill) } CloseTable(); -?> - -</body> -</html>
\ No newline at end of file +?>
\ No newline at end of file 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> </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 index 877fab0..7244b8d 100644 --- a/modules/rudi/views/view.profile.php +++ b/modules/rudi/views/view.profile.php @@ -1,50 +1,34 @@ <?php -define('BLOCK_RIGHT_DISABLE','block_right_disable'); +//define('BLOCK_RIGHT_DISABLE','block_right_disable'); $member =& $this->data[$_GET['profile']]; -$uniform_image = strtolower($member->first_name[0] . $member->last_name . ".png"); -$uniform_image[0] = strtoupper($uniform_image[0]); -$uniform_image[1] = strtoupper($uniform_image[1]); +$uniform_image = $member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png"; +decho($member); ?> - -<html> -<head> -<title>Profile page of, <?php echo $member->last_name ?></title> <style type="text/css"> -p {color: white; } -body {background-color: black; } -th.header { - width:100px; - background:#333; -} - -td { - vertical-align: middle; -} -#thin { - border:1px outset #333; -} </style> -</head> -<body> -<table width="100%" border="1" align="center" cellpadding="1" cellspacing="0"> + +<table class="rudi" width="100%" border="1" align="center" cellpadding="1" cellspacing="0"> <tr> - <th>Viewing Profile of: <?php echo $member->rank_long . " " . $member->first_name . " " . $member->last_name; ?></th> + <th class="header">Viewing Profile of: <?php echo $member->rank_long . " " . $member->first_name . " " . $member->last_name; ?></th> </tr> <tr> - <td><center><img src="<?php echo $this->images_path ?>/uniform/<?php echo $uniform_image; ?>" /> </center></td> + <td><center><img src="modules/rudi/images/uniform/<?php echo $uniform_image; ?>" /> </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="<?php echo $this->images_path ?>/ranks/large/<?php echo $member->rank_image ?>" /> </center></td> + <td><center><img src="modules/rudi/images/ranks/large/<?php echo $member->rank_image ?>" /> </center></td> </tr> <tr> - <td><center><img src="<?php echo $this->images_path ?>/flags/<?php echo $member->country_image?>" /> </center></td> + <td><center><img src="modules/rudi/images/flags/<?php echo $member->country_image?>" /> </center></td> </tr> </table> </td> @@ -52,9 +36,9 @@ td { <table width="100%" border="0" cellpadding="5"> <tr> <th class="header" scope="row">Location</th> - <td ><?php echo $this->evalData($member->location) ?> </td> + <td class="info"><?php echo $this->evalData($member->location) ?> </td> <th class="header">Superior</th> - <td><?php + <td class="info"><?php if(!is_null($member->superior_next->leader_id)) echo "<a href=\"?load=rudi&profile={$member->superior_next->leader_id}\">"; @@ -65,44 +49,44 @@ td { </tr> <tr> <th class="header" scope="row">Status</th> - <td><?php echo $this->evalData($member->status) ?> </td> + <td class="info"><?php echo $this->evalData($member->status) ?> </td> <th class="header">Position</th> - <td><?php echo $this->evalData($member->position) ?> </td> + <td class="info"><?php echo $this->evalData($member->position) ?> </td> </tr> <tr> <th class="header" scope="row">Unit</th> - <td><?php echo $this->evalData($member->unit_name) ?> </td> + <td class="info"><?php echo $this->evalData($member->unit_name) ?> </td> <th class="header">Weapon</th> - <td><?php echo $this->evalData($member->weapon_name) ?> </td> + <td class="info"><?php echo $this->evalData($member->weapon_name) ?> </td> </tr> <tr> <th class="header" scope="row">Platoon</th> - <td><?php echo $this->evalData($member->platoon_name) ?> </td> + <td class="info"><?php echo $this->evalData($member->platoon_name) ?> </td> <th class="header" scope="row">Enlisted</th> - <td><?php echo $this->evalData($member->enlist_date) ?> </td> + <td class="info"><?php echo $this->evalData($member->enlist_date) ?> </td> </tr> <tr> <th class="header" scope="row">Squad</th> - <td><?php echo $this->evalData($member->squad_name) ?> </td> + <td class="info"><?php echo $this->evalData($member->squad_name) ?> </td> <th class="header">Time In Service</th> <?php if($member->discharge_date): ?> - <td><?php echo $this->getDiffTime($member->enlist_date_st, $member->discharge_date)?> </td> + <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st, $member->discharge_date)?> </td> <?php else: ?> - <td><?php echo $this->getDiffTime($member->enlist_date_st)?></td> + <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st)?></td> <?php endif; ?> </tr> <tr> <th class="header">Team</th> - <td><?php echo $this->evalData($member->team_name) ?> </td> + <td class="info"><?php echo $this->evalData($member->team_name) ?> </td> <th class="header">Time In Grade</th> - <td><?php echo $this->getDiffTime($member->promo_date_st) ?> </td> + <td class="info"><?php echo $this->getDiffTime($member->promo_date_st) ?> </td> </tr> <tr> <?php if($member->discharge_date): ?> - <td colspan="2"></td> + <td class="info" colspan="2"></td> <th class="header" scope="row">Separated</th> - <td><?php echo $this->evalData($member->discharge_date) ?> </td> + <td class="info"><?php echo $this->evalData($member->discharge_date) ?> </td> <?php endif; ?> </tr> @@ -127,7 +111,7 @@ td { <th class="header" scope="col" colspan="3">Service Record</th> </tr> <tr> - <?php if(is_null($member->service_record)):?> + <?php decho($member->service_record); if($this->evalData($member->service_record)):?> <td>No service record available </td> <?php else:?> <?php foreach($member->service_record as $record): ?> @@ -147,14 +131,14 @@ td { <th class="header" scope="col" colspan="4">Award Record</th> </tr> <tr> - <?php if(is_null($member->award_record)):?> + <?php if($this->evalData($member->award_record)):?> <td>No award record available </td> <?php else:?> <?php foreach($member->award_record as $record): ?> <tr> <th class="header" width="25%"><?php echo $record->date_added?> </th> <td ><?php echo $this->evalData($record->award_name); ?> </td> - <td style="vertical-align:middle;"><center><img src="<?php echo $this->images_path; ?>/medals/<?php echo $record->image; ?>"/></center></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 ?> </td> </tr> <?php endforeach; ?> @@ -169,7 +153,7 @@ td { <th class="header" scope="col" colspan="3">Combat Record</th> </tr> <tr> - <?php if(is_null($member->combat_record)):?> + <?php if($this->evalData($member->combat_record)):?> <td>No combat record available </td> <?php else:?> <?php foreach($member->combat_record as $record): ?> @@ -183,6 +167,4 @@ td { </tr> </table></td> </tr> -</table> -</body> -</html>
\ No newline at end of file +</table>
\ No newline at end of file diff --git a/modules/rudi/views/view.ranks.php b/modules/rudi/views/view.ranks.php index 2bb1823..4792049 100644 --- a/modules/rudi/views/view.ranks.php +++ b/modules/rudi/views/view.ranks.php @@ -1,13 +1,11 @@ -<?php define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?> +<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?> <html> <head> <title>Awards and Medals</title> <style type="text/css"> -p {color: white; } -body {background-color: black; } -th.header { +/*th.header { width:175px; background:#333; } @@ -15,21 +13,21 @@ th.header { td.rudi { text-align: center; vertical-align: middle; -} +} */ </style> </head> <body> - <table align="center" style="width: 100%;"> + <table class="rudi" align="center" style="width: 100%;"> <tr> - <th scope="col" class="header">Image</th> - <th scope="col" class="header">Rank</th> + <th scope="col">Image</th> + <th scope="col">Rank</th> </tr> <?php foreach($this->ranks as $rank): ?> <tr> - <td align='center' class="rudi"><img src="<?php echo "{$this->images_path}/ranks/small/{$rank->image}"; ?>"></img> </td> - <td align='center' class="rudi"><?php echo $rank->longname; ?> </td> + <td><img src="<?php echo "modules/rudi/images/ranks/small/{$rank->image}"; ?>" /> </td> + <td><?php echo $rank->longname; ?> </td> </tr> <?php endforeach; ?> diff --git a/modules/rudi/views/view.roster.php b/modules/rudi/views/view.roster.php new file mode 100644 index 0000000..01da5ea --- /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']}</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> </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 |