From 6d28ed7cd510621e571da1d5a20848d58d079f53 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 17 Jan 2010 03:02:16 +0000 Subject: Combat records appear to have a bug. For no reason it displays the unix epoch. More work on the drills. Mostly works-ish. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@462 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- modules/rudi/includes/common.class.php | 35 ++++----- modules/rudi/views/view.drills.php | 140 ++++++++++++++++----------------- modules/rudi/views/view.profile.php | 8 +- 3 files changed, 89 insertions(+), 94 deletions(-) (limited to 'modules') diff --git a/modules/rudi/includes/common.class.php b/modules/rudi/includes/common.class.php index ab8120e..2e64e48 100644 --- a/modules/rudi/includes/common.class.php +++ b/modules/rudi/includes/common.class.php @@ -113,20 +113,22 @@ class Rank class Drill { - public function __construct() - { - decho("Constructing " . get_class($this) . " -> " . $this); - } - - public function __destruct() - { - decho("Destructing " . get_class($this)); - } - - public function __toString() - { - return $this->date; - } + public $members; + public function __construct() + { + decho("Constructing " . get_class($this) . " -> " . $this); + //$this->members = array('Newly constructed'); + } + + public function __destruct() + { + decho("Destructing " . get_class($this)); + } + + public function __toString() + { + return $this->date; + } } class ServiceRecord @@ -203,10 +205,7 @@ class RUDI_Common global $config, $db; $this->images_path = $config['rudi']['images_path']; - //$this->db = new RUDI_SQL(); - //$this->link = $this->db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']); - $this->db = $db; - $this->db->Select_db('thirdid_oc'); + $this->db = $db; } public function __destruct() diff --git a/modules/rudi/views/view.drills.php b/modules/rudi/views/view.drills.php index bc80f83..5fcd18e 100644 --- a/modules/rudi/views/view.drills.php +++ b/modules/rudi/views/view.drills.php @@ -1,5 +1,10 @@ Back"; +} + function Rating($val) { define('EXCELLENT',100); @@ -20,86 +25,77 @@ function Rating($val) return "Bad Value"; } -OpenTable("Drills"); +?> + -if(isset($_GET['stats'])) -{ - - return; -} + + + + -if(isset($_GET['id'])) -{ - echo " - - - - - - - "; - foreach($drills->manifest['members'] as $drill) - { - $name = $drill->last_name . ', ' . $drill->first_name; - $pRating = Rating($drill->performance); - $iRating = Rating($drill->initiative); - - echo " - - - - - - - - "; - } - CloseTable(); - echo "Back"; - decho('DATA FOR QUERY'); + + + + + + + + + + + +
News
SoldierPerformance RatingInitiative RatingEarly ExcusalExcusal Reason
{$name}{$pRating}{$iRating} " . ($drill->excusal ? "Yes" : "No") . "{$drill->excusal_reason}
manifest->news); ?> 
Notes
manifest->notes); ?> 
+ +
+ + + + + + + + + +manifest->members as $member): ?> +last_name . ', ' . $member->first_name; + $pRating = Rating($member->performance); + $iRating = Rating($member->initiative); +?> + + + + + + + + +
SoldierPerformance RatingInitiative RatingEarly ExcusalExcusal Reason
   excusal ? "Yes" : "No"); ?> excusal_reason; ?> 
+ "; back(); + decho("DRILL DATA FOR ID({$_GET['id']}) QUERY"); decho($drills->manifest); return; -} + ?> -echo " -  -Date - -Notes -"; + -foreach($drills->manifest as $drill) -{ - echo " - drill_id}\">View - {$drill->date} - - {$drill->notes} - "; -} - -/* -decho('manifest'); -decho($drills->manifest); -decho('attendence of drill 2'); -decho($drills->getAttendenceOf(2)); -decho('member 1 attendence of drill 2'); -decho($drills->getMemberAttendenceOf(2,1)); -decho('member 1 attendence in general'); -decho($drills->getMemberAttendence(1)); -decho('statistics of member 1 in general'); + + + + + -$drill = $drills->getAttendenceOf(2); -$drill['stats'] = $drills->getMemberStatistics($drills->getAttendenceOf(2)); +manifest as $drill): ?> + + + + + +
 Date
Viewdate; ?>
-$member = $drills->getMemberAttendenceOf(2,1); -$member[] = $drills->getMemberStatistics($member); -*/ +manifest); -decho($drill); -decho($member); -CloseTable(); -?> \ No newline at end of file +?> diff --git a/modules/rudi/views/view.profile.php b/modules/rudi/views/view.profile.php index 1010985..6135ea4 100644 --- a/modules/rudi/views/view.profile.php +++ b/modules/rudi/views/view.profile.php @@ -116,13 +116,13 @@ define('BLOCK_RIGHT_DISABLE', true); Service Record - service_record); if($this->evalData($member->service_record)):?> + evalData($member->service_record)):?> No service record available  service_record as $record): ?> date_added)); ?>  - record_note; ?>  + record_note; ?>  @@ -141,7 +141,7 @@ define('BLOCK_RIGHT_DISABLE', true); award_record as $record): ?> - date_added; ?>  + date_added)); ?>  evalData($record->award_name); ?> 
record_note; ?>  @@ -163,7 +163,7 @@ define('BLOCK_RIGHT_DISABLE', true); combat_record as $record): ?> - date; ?>  + date_added)); ?>  name; ?>  status; ?>  -- cgit