From f472c60b18469ff8a06963708174dea1bfc08015 Mon Sep 17 00:00:00 2001 From: Evan O'Connell Date: Sun, 18 Aug 2013 18:29:07 -0400 Subject: Adds untracked changes --- admin/adjutant/functions.php | 55 +++++++++++++++++++++++++++++++++++++++++++- admin/adjutant/index.php | 13 ++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) (limited to 'admin/adjutant') 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 ""; } + +/****** 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; + } +?> +
+ + + +"; + else + echo ""; + echo " + + + + + "; + + + echo "\n"; + } + CloseTable(); + echo ""; + + } +/****** 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 @@ ?> +

- Adjutant Control Panel

Edit Points   + Edit Points *NEW*   Edit LOAs
RankSoldierStatusPointsDrills MissedDrills Attended
{$soldier['shortname']}{$soldier['first_name']} {$soldier['last_name']}".getStatus($soldier['status_id'])."/100/3/3
-
@@ -39,6 +41,10 @@ echo "

Edit Points

"; EditPoints(); } + if($_GET['edit'] == "pointsnew"){ + echo "

Edit Points *NEW*

"; + EditPoints(); + } if($_GET['edit'] == "loas"){ echo "

Edit LOAs

"; if(isset($_GET['member'])){ @@ -53,6 +59,11 @@ } } } + else if(isset($_GET['drills'])){ + if($_GET['drills'] == "new"){ + + } + } ?>
\ No newline at end of file + -- cgit