aboutsummaryrefslogtreecommitdiff
path: root/modules/rudi/admin/includes
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-29 15:46:26 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-29 15:46:26 -0500
commit4bc1e32a79c0928a079113c51f9cf9fcaf525a63 (patch)
tree00312c30100c6947859324c39d80b7fcafaf92f1 /modules/rudi/admin/includes
parentad6ba256efd1a65fb1bb3951ae6b17b1593205b7 (diff)
downloadbayonetcms-4bc1e32a79c0928a079113c51f9cf9fcaf525a63.tar.gz
(OC) I cut down the calendar queries to just one which seems to work out a lot better.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@409 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/rudi/admin/includes')
-rw-r--r--modules/rudi/admin/includes/admin.class.php121
1 files changed, 121 insertions, 0 deletions
diff --git a/modules/rudi/admin/includes/admin.class.php b/modules/rudi/admin/includes/admin.class.php
new file mode 100644
index 0000000..fee79c9
--- /dev/null
+++ b/modules/rudi/admin/includes/admin.class.php
@@ -0,0 +1,121 @@
+<?php
+/*
+class Rank
+{
+ public function __toString()
+ {
+ return $this->longname;
+ }
+}
+
+class Award
+{
+ public function __toString()
+ {
+ return $this->name;
+ }
+}
+*/
+
+class AdminCommon extends RUDI_Common
+{
+ public function __construct()
+ {
+ parent::__construct();
+ $this->Update();
+ }
+
+ public function getRanks()
+ {
+ $result = $this->db->Query("SELECT * FROM rudi_ranks");
+ while(($row = $this->db->FetchObject($result,'Rank'))!=false)
+ {
+ $ranks[] = $row;
+ }
+
+ return $ranks;
+ }
+
+ public function getAwards()
+ {
+ $result = $this->db->Query("SELECT * FROM rudi_awards");
+ while(($row = $this->db->FetchObject($result,'Award'))!=false)
+ {
+ $awards[] = $row;
+ }
+
+ return $awards;
+ }
+}
+
+class AdminAdd
+{
+ protected $db, $link, $id;
+ public $data;
+
+ public function __construct()
+ {
+ if(is_null($id))
+ {
+ decho("No ID");
+ return;
+ }
+ $this->id = $id;
+
+ $this->db = new RUDI_SQL();
+ $this->link = $this->db->Connect('localhost','hunkeler','proball');
+ $this->db->Select_db('rudi');
+
+ //$result = $this->db->Query("INSERT INTO rudi_unit_members VALUES()");
+ //$name = $this->db->FetchArray($result);
+
+ echo "Current soldier selected: '{$name['last_name']}, {$name['first_name']}'";
+ }
+
+ public function __set($var, $val)
+ {
+ //echo "UPDATE rudi_unit_members SET $var = '$val';";
+ //mysql_query("UPDATE rudi_unit_members SET $var = '$val';");
+ $this->id = addslashes($this->id);
+ $this->db->Query("UPDATE rudi_unit_members SET $var = '$val' WHERE member_id = '{$this->id}';");
+ }
+}
+
+class AdminModify
+{
+ protected $db, $link, $id;
+ public $data;
+
+ public function __construct($id)
+ {
+ if(is_null($id))
+ {
+ decho("No ID");
+ return;
+ }
+ else
+ {
+ decho(get_class($this) . "received: $id" );
+ }
+ $this->id = $id;
+
+ $this->db = new RUDI_SQL();
+ $this->link = $this->db->Connect('localhost','hunkeler','proball');
+ $this->db->Select_db('rudi');
+
+ $result = $this->db->Query("SELECT last_name, first_name FROM rudi_unit_members WHERE member_id = '$id'");
+ $name = $this->db->FetchArray($result);
+
+ echo "Current soldier selected: '{$name['last_name']}, {$name['first_name']}'";
+ }
+
+ public function __set($var, $val)
+ {
+ //echo "UPDATE rudi_unit_members SET $var = '$val';";
+ //mysql_query("UPDATE rudi_unit_members SET $var = '$val';");
+ $this->id = addslashes($this->id);
+ $this->db->Query("UPDATE rudi_unit_members SET $var = '$val' WHERE member_id = '{$this->id}';");
+ }
+}
+
+?> \ No newline at end of file