From 82b8b75b2527617c0db8ccf265e30c86613550e0 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 20 Jan 2007 08:10:26 +0000 Subject: [PATCH] - Add location and contact info for each tour. Dump this in the CSV dump of the tours, but don't show it to the students at all. --- admin/reports_tours.php | 17 +++++++++++++---- db/db.code.version.txt | 2 +- db/db.update.36.sql | 5 +++++ tours.class.php | 4 +++- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 db/db.update.36.sql diff --git a/admin/reports_tours.php b/admin/reports_tours.php index 413fe62..3973fce 100644 --- a/admin/reports_tours.php +++ b/admin/reports_tours.php @@ -51,7 +51,9 @@ $table['header']=array( i18n("ID"), i18n("Description"), i18n("Capacity"), i18n("Minimum Grade"), - i18n("Maximum Grade")); + i18n("Maximum Grade"), + i18n("Contact"), + i18n("Location")); $q=mysql_query("SELECT * @@ -68,9 +70,13 @@ while($r=mysql_fetch_object($q)) // print_r($judge_subdivs); $n = str_replace("\r","", $r->name); - $n = str_replace("\n","", $n); + $n = str_replace("\n"," ", $n); $d = str_replace("\r","", $r->description); - $d = str_replace("\n","", $d); + $d = str_replace("\n"," ", $d); + $c = str_replace("\r","", $r->contact); + $c = str_replace("\n"," ", $c); + $l = str_replace("\r","", $r->location); + $l = str_replace("\n"," ", $l); $tmp=array( $r->id, @@ -78,7 +84,10 @@ while($r=mysql_fetch_object($q)) mysql_escape_string($d), $r->capacity, $r->grade_min, - $r->grade_max + $r->grade_max, + mysql_escape_string($c), + mysql_escape_string($l) + ); // print_r($tmp); $table['data'][]=$tmp; diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 8f92bfd..7facc89 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -35 +36 diff --git a/db/db.update.36.sql b/db/db.update.36.sql new file mode 100644 index 0000000..5504985 --- /dev/null +++ b/db/db.update.36.sql @@ -0,0 +1,5 @@ +-- Add 2 fields to tours +ALTER TABLE `tours` ADD `contact` TINYTEXT NOT NULL , +ADD `location` TINYTEXT NOT NULL ; + + diff --git a/tours.class.php b/tours.class.php index 5c0c579..ad3aacb 100644 --- a/tours.class.php +++ b/tours.class.php @@ -6,7 +6,9 @@ $tours_fields = array( 'name' => 'Tour Name', 'capacity' => 'Capacity', 'grade_min' => 'Minimum Grade', 'grade_max' => 'Maximum Grade', - 'year' => 'Year'); + 'year' => 'Year', + 'contact' => 'Contact', + 'location' => 'Location'); class tours {