aboutsummaryrefslogtreecommitdiff
path: root/admin/adjutant
diff options
context:
space:
mode:
authorEvan O'Connell <oconn.e@gmail.com>2013-08-18 18:29:07 -0400
committerEvan O'Connell <oconn.e@gmail.com>2013-08-18 18:29:07 -0400
commitf472c60b18469ff8a06963708174dea1bfc08015 (patch)
tree77c886ff7a2b38e4c4297935ad46e4b7c8f19e6c /admin/adjutant
parente7dab48469ac779d639fff7e221c7b5a23ded148 (diff)
downloadbayonetcms-f472c60b18469ff8a06963708174dea1bfc08015.tar.gz
Adds untracked changes
Diffstat (limited to 'admin/adjutant')
-rw-r--r--admin/adjutant/functions.php55
-rw-r--r--admin/adjutant/index.php13
2 files changed, 66 insertions, 2 deletions
diff --git a/admin/adjutant/functions.php b/admin/adjutant/functions.php
index 87bc4b4..b38400e 100644
--- a/admin/adjutant/functions.php
+++ b/admin/adjutant/functions.php
@@ -67,6 +67,59 @@
echo "<input type=\"submit\" name=\"processed\" value=\"Update Points\" /></form>";
}
+
+/****** NEW CODE ADDED LARRABEE 11-20-2012 ********/
+ function EditPoints2(){
+
+ global $db;
+
+ $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id < 4 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC");
+ $row = $db->Fetch($result);
+
+ if(isset($_POST['processed'])){
+ echo "Updating data... Please wait.";
+ foreach($row as $soldier){
+ $mID = $soldier['member_id'];
+ $missed = $_POST[$mID.'missed'];
+ $attended = $_POST[$mID.'attended'];
+ $points = $_POST[$mID.'points'];
+
+ if($missed !="" && $points != ""){
+ $db->Query("UPDATE `rudi_unit_members` SET `points` = $points, `drillcount` = $missed, `attendcount` = $attended WHERE `member_id` = $mID LIMIT 1");
+ }else{
+ ReportError("Error updating points for soldier id# '$mID'. Please contact administrator.");
+ }
+ }
+ PageRedirect(1,"?op=adjutant&edit=pointsnew");
+ return;
+ }
+?>
+ <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+ <table style="text-align:center;" width="100%" cellspacing="0">
+ <?php //OpenTable(); ?>
+ <tr><th>Rank</th><th>Soldier</th><th>Status</th><th>Points</th><th>Drills Missed</th><th>Drills Attended</th></tr>
+<?php
+ foreach($row as $soldier){
+ $memberID = $soldier['member_id'];
+ if($soldier['status_id'] != 1)
+ echo "<tr class=\"inactive\">";
+ else
+ echo "<tr>";
+ echo "<td>{$soldier['shortname']}</td>
+ <td>{$soldier['first_name']} {$soldier['last_name']}</td>
+ <td>".getStatus($soldier['status_id'])."</td>
+ <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['points']}\" name=\"{$memberID}points\" size=\"1\" maxlength=\"3\" />/100</td>
+ <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['drillcount']}\" name=\"{$memberID}missed\" size=\"1\" maxlength=\"1\" />/3</td>
+ <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['attendcount']}\" name=\"{$memberID}attended\" size=\"1\" maxlength=\"1\" />/3</td>";
+
+
+ echo "<input type=\"hidden\" value=\"{$memberID}\" name=\"{$memberID}id\" />\n";
+ }
+ CloseTable();
+ echo "<input type=\"submit\" name=\"processed\" value=\"Update Points\" /></form>";
+
+ }
+/****** END NEW CODE ADDED *******/
function EditLOAs($status_id = 1){
@@ -160,4 +213,4 @@ $num = 1;
return $row['name'];
}
- ?> \ No newline at end of file
+ ?>
diff --git a/admin/adjutant/index.php b/admin/adjutant/index.php
index 5149c28..d8491ac 100644
--- a/admin/adjutant/index.php
+++ b/admin/adjutant/index.php
@@ -19,8 +19,10 @@
?>
<link rel="stylesheet" type="text/css" href="adjutant/style.css" media="screen"/>
+ <script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script>
<div style="text-align:left;"><h2>- Adjutant Control Panel</h2></div>
<a href="?op=adjutant&edit=points">Edit Points</a>&nbsp;&nbsp;
+ <a href="?op=adjutant&edit=pointsnew">Edit Points *NEW*</a>&nbsp;&nbsp;
<a href="?op=adjutant&edit=loas">Edit LOAs</a>
<table class="panel" width="100%">
<tr><td style="text-align:center; vertical-align:top;">
@@ -39,6 +41,10 @@
echo "<h3>Edit Points</h3>";
EditPoints();
}
+ if($_GET['edit'] == "pointsnew"){
+ echo "<h3>Edit Points *NEW*</h3>";
+ EditPoints();
+ }
if($_GET['edit'] == "loas"){
echo "<h3>Edit LOAs</h3>";
if(isset($_GET['member'])){
@@ -53,6 +59,11 @@
}
}
}
+ else if(isset($_GET['drills'])){
+ if($_GET['drills'] == "new"){
+
+ }
+ }
?>
</td></tr>
- </table> \ No newline at end of file
+ </table>