Update the contact tables
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 14 Jul 2014 18:55:33 +0000 (14:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 14 Jul 2014 18:55:33 +0000 (14:55 -0400)
Bringing in their old tables.

Toolkit/Contacts/Database/alterTables.sql [new file with mode: 0644]
Toolkit/Contacts/Database/application.sql
Toolkit/Contacts/Database/data/contact.sql
Toolkit/Contacts/Database/data/contact_inq.sql
Toolkit/Contacts/Database/data/golfing_preference.sql
Toolkit/Contacts/Database/loadData.sql [new file with mode: 0644]
Toolkit/Contacts/Database/moveDate.sql [new file with mode: 0644]
Toolkit/Contacts/config.ini
admin/Contact/contact_setup.inc
admin/Contact/index.phtml

diff --git a/Toolkit/Contacts/Database/alterTables.sql b/Toolkit/Contacts/Database/alterTables.sql
new file mode 100644 (file)
index 0000000..c47bd45
--- /dev/null
@@ -0,0 +1,15 @@
+ALTER TABLE contacts.contact ADD arrival DATE;
+ALTER TABLE contacts.contact ADD departure DATE;
+ALTER TABLE contacts.contact ADD golfers INTEGER;
+ALTER TABLE contacts.contact ADD nongolfers INTEGER;
+ALTER TABLE contacts.contact ADD lodging TEXT;
+ALTER TABLE contacts.contact ADD couples INTEGER;
+ALTER TABLE contacts.contact ADD singles INTEGER;
+ALTER TABLE contacts.contact ADD bathrooms INTEGER;
+ALTER TABLE contacts.contact ADD rooms INTEGER;
+ALTER TABLE contacts.contact ADD beds INTEGER;
+ALTER TABLE contacts.contact ADD twinok BOOLEAN;
+ALTER TABLE contacts.contact ADD sleepersofaok BOOLEAN;
+ALTER TABLE contacts.contact ADD alt_phone TEXT;
+ALTER TABLE contacts.contact ADD pquote_create_date DATE;
+ALTER TABLE contacts.contact ADD pquote BOOLEAN;
index f219edd..245b5c8 100644 (file)
@@ -4,11 +4,12 @@ GRANT ALL ON SCHEMA contacts TO nobody;
 --
 -- Tables
 --
-\i ./tables/contact.sql
-\i ./tables/contact_inq.sql
-\i ./tables/inq_group.sql
-\i ./tables/query_db.sql
-\i ./tables/news_response.sql
+\i ./newTables/contact.sql
+\i ./newTables/contact_inq.sql
+\i ./newTables/query_db.sql
+\i ./newTables/news_response.sql
+\i ./newTables/golfing_preference.sql
+\i ./newTables/dining_preference.sql
 
 --
 -- Procedures
index 6758436..34847a6 100644 (file)
@@ -15,7 +15,7 @@ SET search_path = public, pg_catalog;
 -- Name: contact_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --
 
-SELECT pg_catalog.setval('contact_id_seq', 4016, true);
+SELECT pg_catalog.setval('contact_id_seq', 4019, true);
 
 
 --
@@ -3965,6 +3965,7 @@ INSERT INTO contact (id, create_date, fname, lname, company, address, address2,
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (1718, '2010-04-16', 'Sue', 'Jenkins', NULL, '2207 Candlestick Ln', NULL, 'Midland', 'MI', '48642', NULL, '898592517', NULL, 'sbj915226@charter.net', NULL, NULL, NULL, true, '2014-06-06', '2014-06-08', 8, 0, 'Hamlet Village Condominiums', 0, 8, 4, 2, 8, true, true, '', 'I have sent this request for 2 night 3 rds but can you also send it for 3 nights and 3 rounds
 and would like to know replay rate for each course', 'Returning guest', 8, '2014-01-30 13:20:41.806195', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (3964, '2014-03-17', 'Dave', 'Wagenhauser', NULL, '', NULL, '', '', '', NULL, '', NULL, 'gobluefan2323@yahoo.com', NULL, NULL, NULL, true, '2014-07-25', '2014-07-27', 14, 0, 'Hamlet Village Condominiums', 0, 14, 1, 2, 14, true, true, '', '', 'Returning guest', 14, '2014-03-17 11:15:11.137716', true);
+INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4019, '2014-07-13', 'Ken', 'Mcclusky', NULL, '', NULL, '', 'MI', '', NULL, '', NULL, 'kenmcclusky2000@yahoo.com', NULL, NULL, NULL, true, '2014-07-13', '2014-07-14', 2, 0, 'Trout Creek Condominiums', 1, 0, 1, 1, 1, true, true, '', '', 'Internet Search', 2, '2014-07-13 19:35:06.026889', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (2429, '2012-02-27', 'Howard', 'Davis', NULL, '429 Umberland Dr', NULL, 'Howell', 'MI', '48843', NULL, '517-404-0719', NULL, 'howarddavis@ferrellgas.com', NULL, NULL, NULL, true, '2014-06-16', '2014-06-19', 8, 0, 'Trout Creek Condominiums', 0, 8, 2, 4, 8, true, true, '', '', 'Golf Show - Novi', 8, '2014-02-14 19:55:11.427957', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (3945, '2014-02-12', 'Jacob', 'Sponsler', NULL, '', NULL, '', 'MI', '', NULL, '', NULL, 'Jacob.sponsler@gmail.com', NULL, NULL, NULL, true, '2014-08-02', '2014-08-04', 8, 0, 'Trout Creek Condominiums', 0, 8, 1, 4, 8, true, true, '', 'Order of golf courses not important just want to play all four. Only real concern with lodging is eight beds.', 'Internet Search', 8, '2014-02-12 13:25:17.710018', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (2641, '2012-12-24', 'michael', 'Roman', NULL, '36655 Thomas Dr.', NULL, 'Sterling Heights', 'MI', '48312', NULL, '5865492254', NULL, 'roman1148@gmail.com', NULL, NULL, NULL, true, '2014-07-27', '2014-07-30', 12, 0, 'Trout Creek Condominiums', 0, 12, 6, 6, 12, true, true, '5865492254', 'Instead of dinner we would like breakfast on Mon.Tues.Wed.
@@ -4039,10 +4040,12 @@ INSERT INTO contact (id, create_date, fname, lname, company, address, address2,
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4009, '2014-07-05', 'Dallas', 'Fisher', NULL, '1458 Iva', NULL, 'Burton', 'MI', '48509', NULL, '8108139533', NULL, 'cwbd@comcast.net', NULL, NULL, NULL, true, '2014-09-05', '2014-09-07', 8, 0, 'Hamlet Village Condominiums', 0, 8, 1, 4, 8, true, true, '8108139555', '', 'Internet Search', 8, '2014-07-05 11:37:40.85513', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4013, '2014-07-09', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, 0, 0, NULL, 0, 0, 1, 1, 1, false, false, NULL, NULL, NULL, NULL, NULL, false);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4012, '2014-07-08', 'Dale', 'Lehman', NULL, '8300 Fairmount Dr #I101', NULL, 'Denver', 'CO', '80247', NULL, '3038544499', NULL, 'bud.lehman@hotmail.com', NULL, NULL, NULL, true, '2014-05-24', '2014-05-28', 5, 0, 'Hamlet Village Condominiums', 0, 5, 2, 3, 5, true, true, '3038544499', '', 'Internet Search', 5, '2014-07-08 07:49:16.528333', true);
-INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4011, '2014-07-07', 'Mike', 'Ruppe', NULL, '', NULL, '', 'ON', '', NULL, '', NULL, 'mike.ruppe@tiger-coatings.com', NULL, NULL, NULL, true, '2014-09-04', '2014-09-07', 4, 0, 'Hamlet Village Condominiums', 0, 4, 1, 2, 4, true, true, '', '', 'Internet Search', 4, '2014-07-07 15:51:56.740491', true);
+INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4017, '2014-07-12', 'Marcia', 'Rumsey', NULL, '', NULL, '', '', '', NULL, '', NULL, 'Marcia@gmail.com', NULL, NULL, NULL, true, '2014-08-29', '2014-09-01', 2, 0, 'Trout Creek Condominiums', 1, 0, 1, 1, 1, true, true, '', '', 'Internet Search', 2, '2014-07-12 19:13:53.47405', true);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4014, '2014-07-09', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'euaoeu', NULL, NULL, NULL, true, NULL, NULL, 0, 0, NULL, 0, 0, 1, 1, 1, false, false, NULL, NULL, NULL, NULL, NULL, false);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4015, '2014-07-10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Trina1Mac@gmail.com', NULL, NULL, NULL, true, NULL, NULL, 0, 0, NULL, 0, 0, 1, 1, 1, false, false, NULL, NULL, NULL, NULL, NULL, false);
 INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4016, '2014-07-10', 'CARL', 'HAGENBAUGH', NULL, '1020 ESSEX CIRCLE', NULL, 'KALAMAZOO', 'MI', '49008', NULL, '', NULL, 'bighat2004@yahoo.com', NULL, NULL, NULL, true, '2014-09-21', '2014-09-23', 4, 0, 'Hamlet Village Condominiums', 0, 4, 2, 1, 4, true, true, '', '', 'Golf Course', 4, '2014-07-10 12:41:12.599077', true);
+INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4018, '2014-07-13', 'Jim', 'Clark', NULL, '314 Hadley St.', NULL, 'Holly', 'MI', '48442', NULL, '2486344683', NULL, 'Jmclark473@comcast.net', NULL, NULL, NULL, true, '2014-07-30', '2014-08-02', 2, 0, 'Trout Creek Condominiums', 1, 0, 1, 1, 1, true, true, '', '', 'Internet Search', 2, '2014-07-13 08:54:49.880585', true);
+INSERT INTO contact (id, create_date, fname, lname, company, address, address2, city, state, zip, country, phone, fax, email, user_agent, remote_addr, interest, mail_ok, arrival, departure, golfers, nongolfers, lodging, couples, singles, bathrooms, rooms, beds, twinok, sleepersofaok, alt_phone, comments, discover, partysize, pquote_create_date, pquote) VALUES (4011, '2014-07-07', 'Mike', 'RUPPE', NULL, '', NULL, '', '', '', NULL, '', NULL, 'mike.ruppe@tiger-coatings.com', NULL, NULL, NULL, true, '2014-09-25', '2014-09-28', 4, 0, 'Hamlet Village Condominiums', 0, 4, 4, 2, 4, true, true, '', '', 'Internet Search', 4, '2014-07-11 22:02:25.701505', true);
 
 
 --
index d43106a..2e186dc 100644 (file)
@@ -9,7 +9,7 @@ SET check_function_bodies = false;
 SET client_min_messages = warning;
 SET escape_string_warning = off;
 
-SET search_path = public, pg_catalog;
+SET search_path = contacts, pg_catalog;
 
 --
 -- Name: contact_inq_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
index 53c78b7..06ec0b6 100644 (file)
@@ -15,7 +15,7 @@ SET search_path = public, pg_catalog;
 -- Name: golfing_preference_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --
 
-SELECT pg_catalog.setval('golfing_preference_id_seq', 9429, true);
+SELECT pg_catalog.setval('golfing_preference_id_seq', 9439, true);
 
 
 --
@@ -8266,6 +8266,7 @@ INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course)
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9298, 3989, '2015-05-23', 16, '08:00 am', 'Dunmaglas');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9299, 3989, '2015-05-23', 16, '02:30 pm', 'Belvedere Golf Club');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9300, 3989, '2015-05-24', 16, '08:30 am', 'Little Traverse Bay');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9430, 4017, '2014-08-29', 2, 'Any Time', 'Belvedere Golf Club');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9318, 3993, '2014-07-30', 2, 'Any Time', 'Belvedere Golf Club');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9319, 3993, '2014-07-31', 2, 'Any Time', 'Belvedere Golf Club');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9320, 3993, '2014-08-01', 2, 'Any Time', 'Belvedere Golf Club');
@@ -8388,6 +8389,15 @@ INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course)
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9427, 4016, '2014-09-21', 4, 'Any Time', 'Belvedere Golf Club');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9428, 4016, '2014-09-22', 4, '11:30 am', 'Little Traverse Bay');
 INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9429, 4016, '2014-09-23', 4, '11:30 am', 'Black Lake');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9431, 4017, '2014-08-30', 2, 'Any Time', 'Dunmaglas');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9432, 4017, '2014-08-31', 2, 'Any Time', 'Black Lake');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9433, 4017, '2014-09-01', 2, 'Any Time', 'Little Traverse Bay');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9434, 4018, '2014-07-30', 2, '11:00 am', 'Dunmaglas');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9435, 4018, '2014-07-31', 2, '07:30 am', 'Little Traverse Bay');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9436, 4018, '2014-07-31', 2, '01:30 pm', 'Belvedere Golf Club');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9437, 4018, '2014-08-01', 2, '08:30 am', 'Black Lake');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9438, 4019, '2014-07-13', 2, '11:00 am', 'Dunmaglas');
+INSERT INTO golfing_preference (id, contact_id, date, golfers, teetime, course) VALUES (9439, 4019, '2014-07-14', 2, '11:00 am', 'Little Traverse Bay');
 
 
 --
diff --git a/Toolkit/Contacts/Database/loadData.sql b/Toolkit/Contacts/Database/loadData.sql
new file mode 100644 (file)
index 0000000..bfac75d
--- /dev/null
@@ -0,0 +1,17 @@
+
+--
+-- Tables
+--
+DELETE FROM contact;
+DELETE FROM contact_inq;
+DELETE FROM query_db;
+DELETE FROM news_response;
+DELETE FROM golfing_preference;
+DELETE FROM dining_preference;
+
+\i ./data/contact.sql
+\i ./data/contact_inq.sql
+\i ./data/query_db.sql
+\i ./data/news_response.sql
+\i ./data/golfing_preference.sql
+\i ./data/dining_preference.sql
diff --git a/Toolkit/Contacts/Database/moveDate.sql b/Toolkit/Contacts/Database/moveDate.sql
new file mode 100644 (file)
index 0000000..8e8380f
--- /dev/null
@@ -0,0 +1,37 @@
+--
+-- Transfer the table data for the contact public schema tables
+-- to the new ones in contacts schema
+--
+
+DELETE FROM contacts.contact_inq;
+INSERT INTO contacts.contact_inq (SELECT * FROM public.contact_inq);
+DROP TABLE public.contact_inq;
+
+DELETE FROM contacts.news_response;
+INSERT INTO contacts.news_response
+(subject,response,last_update)
+SELECT subject,response,last_update FROM public.news_response;
+DROP TABLE public.news_response;
+
+DELETE FROM contacts.query_db;
+INSERT INTO contacts.query_db (SELECT * FROM public.query_db);
+DROP TABLE public.query_db;
+
+ALTER TABLE public.golfing_preference DROP CONSTRAINT "golfing_preference_contact_id_fkey";
+ALTER TABLE public.dining_preference DROP CONSTRAINT "dining_preference_contact_id_fkey";
+DELETE FROM contacts.contact;
+INSERT INTO contacts.contact
+( id,create_date,fname,lname,company,address,address2,city,state,zip,
+    country,phone,fax,email,user_agent,remote_addr,interest,mail_ok,discover,comments,
+    arrival,departure,golfers,nongolfers,lodging,couples,singles,bathrooms,rooms,beds,
+    twinok,sleepersofaok,alt_phone,pquote_create_date,pquote)
+ SELECT id,create_date,fname,lname,company,address,address2,city,state,zip,
+    country,phone,fax,email,user_agent,remote_addr,interest,mail_ok,discover,comments,
+    arrival,departure,golfers,nongolfers,lodging,couples,singles,bathrooms,rooms,beds,
+    twinok,sleepersofaok,alt_phone,pquote_create_date,pquote
+    FROM public.contact;
+DROP TABLE public.contact;
+
+ALTER TABLE public.dining_preference SET SCHEMA contacts;
+ALTER TABLE public.golfing_preference SET SCHEMA contacts;
+
index c77d0d2..9f64955 100644 (file)
@@ -10,5 +10,5 @@ sequence = "contact_id_seq"
 [contact_types]
 1 = "Web Contact"
 2 = "E-News"
-3 = "Travel Planner"
-4 = "Visitor Guide"
+;3 = "Travel Planner"
+;4 = "Visitor Guide"
index 29f7502..39ad2a8 100755 (executable)
@@ -2,11 +2,11 @@
 
 /**
 * contact_setup.phtml
-* 
-* Config setting for the admin contact application 
-* 
+*
+* Config setting for the admin contact application
+*
 * PHP versions 4 and 5
-* 
+*
 * @category  Toolkit
 * @package   Contacts
 * @author    Steve Sutton <steve@gaslightmedia.com>
 * @link      <>
 */
 extract($_REQUEST);
-// The Contact Type array is now is one location and is used by the 
+// The Contact Type array is now is one location and is used by the
 // Toolkit_Contacts_Admin_EditContact class
 $conf = new Config;
 $contactRoot =& $conf->parseConfig(
-       BASE . 'Toolkit/Contacts/config.ini',
-       'IniFile'
+    BASE . 'Toolkit/Contacts/config.ini',
+    'IniFile'
 );
 if (!defined("ENTRIES_PER_PAGE")) {
 
@@ -67,7 +67,7 @@ $DB = new GLM_DB();
 if (!defined("HTML_EMAIL")) {
 
     /**
-    * HTML_EMAIL = ON or OFF 
+    * HTML_EMAIL = ON or OFF
     */
     define("HTML_EMAIL", "ON");
 }
@@ -83,18 +83,18 @@ if (!defined("NEWSLETTER")) {
     /**
     * NEWSLETTER 1 or true will allow newsletters
     */
-    define("NEWSLETTER", 1); //bool- does the contact database mail out a newsletter? 
+    define("NEWSLETTER", 1); //bool- does the contact database mail out a newsletter?
 }
 
 if (!function_exists("template_read")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
-    * 
+    *
     * @return string  Return description (if any) ...
     */
     function template_read($template)
@@ -116,12 +116,12 @@ if (!function_exists("template_read")) {
 * insert an array into another array after position.
 * You can specify an associative array key or index key
 * to dictact the positioning of the new array
-* 
+*
 * @param array   &$array       array to be used
 * @param unknown $position     position to add array
 * @param unknown $insert_array array to be inserted
-* 
-* @return void   
+*
+* @return void
 */
 function array_insert(&$array, $position, $insert_array)
 {
@@ -144,12 +144,12 @@ if (!function_exists("explode_template")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
     * @param unknown $data     Parameter description (if any) ...
-    * 
+    *
     * @return unknown Return description (if any) ...
     */
     function explode_template($template, $data)
@@ -167,12 +167,12 @@ if (!function_exists("template_replacement")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
     * @param array   $fieldarr Parameter description (if any) ...
-    * 
+    *
     * @return unknown Return description (if any) ...
     */
     function template_replacement($template, $fieldarr)
@@ -191,12 +191,12 @@ if (!function_exists("add_image")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param string $image Parameter description (if any) ...
     * @param string $align Parameter description (if any) ...
-    * 
+    *
     * @return string Return description (if any) ...
     */
     function add_image($image, $align)
@@ -217,36 +217,38 @@ $nav      = array(
     "Saved Reports"          => "list_query.phtml",
 );
 // }}}
+$discover = array('' => "Don't Care");
 $navWidth = 7;
 $query    = "select * from contact_inq order by pos;";
 $cData    = $DB->db_auto_get_data($query);
 if (is_array($cData)) {
     foreach ($cData as $key => $value) {
         $int_array[$value['id']] = $value['header'];
+        $discover[$value['header']] = $value['header'];
     }
 }
-$contactTypesSetup = 
+$contactTypesSetup =
     $contactRoot->getItem('section', 'contact_types')
-       ->toArray();
+    ->toArray();
 $cType = $contactTypesSetup['contact_types'];
 // {{{ search_where($name, $search_where)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name         Parameter description (if any) ...
 * @param string $search_where Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_where($name, $search_where)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="1" '.( ( !isset( $search_type ) || $search_type == "0" ) ? 'selected' : '' ).'>Anywhere 
-        <option value="2" '.( ( $search_where == '1' ) ? 'selected' : '' ).'>Begining 
+        <option value="1" '.( ( !isset( $search_type ) || $search_type == "0" ) ? 'selected' : '' ).'>Anywhere
+        <option value="2" '.( ( $search_where == '1' ) ? 'selected' : '' ).'>Begining
         <option value="3" '.( ( $search_where == '2' ) ? 'selected' : '' ).'>Ending
     </select>';
     return $out;
@@ -256,19 +258,19 @@ function search_where($name, $search_where)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name        Parameter description (if any) ...
 * @param string $search_type Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_type($name, $search_type)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="2" '.( ( !isset( $search_type ) || $search_type == '2' ) ? 'selected' : '' ).'>And 
+        <option value="2" '.( ( !isset( $search_type ) || $search_type == '2' ) ? 'selected' : '' ).'>And
         <option value="3" '.( ( $search_type == '3' ) ? 'selected' : '' ).'>Or
         <option value="4" '.( ( $search_type == '4' ) ? 'selected' : '' ).'>Not
     </select>';
@@ -279,19 +281,19 @@ function search_type($name, $search_type)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name        Parameter description (if any) ...
 * @param string $search_type Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_bool($name, $search_type)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="n" '.( !isset( $search_type ) ? 'selected' : '' ).'>Don\'t Care 
+        <option value="n" '.( !isset( $search_type ) ? 'selected' : '' ).'>Don\'t Care
         <option value="1" '.( ( $search_type == '1' ) ? 'selected' : '' ).'>Yes
         <option value="0" '.( ( $search_type == '0' ) ? 'selected' : '' ).'>No
     </select>';
@@ -302,11 +304,11 @@ function search_bool($name, $search_type)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param unknown $field Parameter description (if any) ...
-* 
+*
 * @return boolean Return description (if any) ...
 */
 function interest($field)
@@ -445,15 +447,34 @@ if (TABLE == 'customer') {
     $DB_fields[] = array("name" => "address",       "title" => "Address",       "type" => "text");
     $DB_fields[] = array("name" => "address2",      "title" => "Address 2",     "type" => "text");
 }
+$lodging = array(
+    '' => "Don't Care",
+    'Trout Creek Condominiums' => 'Trout Creek Condominiumns',
+    'Hamlet Village Condominiums' => 'Hamlet Village Condominiums'
+);
 $DB_fields[] = array("name" => "city",          "title" => "City",          "type" => "text");
 $DB_fields[] = array("name" => "state",         "title" => "State",         "type" => "state");
 $DB_fields[] = array("name" => "zip",           "title" => "Zip",           "type" => "text");
 $DB_fields[] = array("name" => "phone",         "title" => "Phone",         "type" => "text");
+$DB_fields[] = array( 'name' => "alt_phone",       'title' => "Alternate Phone",   'type' => "text");
 $DB_fields[] = array("name" => "fax",           "title" => "Fax",           "type" => "text");
 $DB_fields[] = array("name" => "email",         "title" => "Email",         "type" => "text");
 $DB_fields[] = array("name" => "mail_ok",       "title" => "Mail Ok?",      "type" => "radio");
-$DB_fields[] = array("name" => "interest",      "title" => "Interest",      "type" => "interest");
-$DB_fields[] = array("name" => "contact_type", "title" => "Contact Type", "type" => "drop", "drop" => $cType);
+$DB_fields[] = array( 'name' => "arrival",         'title' => "Arrival",           'type' => "text");
+$DB_fields[] = array( 'name' => "departure",       'title' => "Departure",         'type' => "text");
+$DB_fields[] = array( 'name' => "golfers",         'title' => "Golfers",           'type' => "text");
+$DB_fields[] = array( 'name' => "nongolfers",      'title' => "Non Golfers",       'type' => "text");
+$DB_fields[] = array( 'name' => "pquote",          'title' => "From Price Quote",  'type' => "radio");
+$DB_fields[] = array( 'name' => "lodging",         'title' => "Lodging",           'type' => "drop",   'drop' => $lodging);
+$DB_fields[] = array( 'name' => "couples",         'title' => "Couples",           'type' => "text");
+$DB_fields[] = array( 'name' => "singles",         'title' => "Singles",           'type' => "text");
+$DB_fields[] = array( 'name' => "bathrooms",       'title' => "Bathrooms",         'type' => "text");
+$DB_fields[] = array( 'name' => "rooms",           'title' => "Rooms",             'type' => "text");
+$DB_fields[] = array( 'name' => "beds",            'title' => "Beds",              'type' => "text");
+$DB_fields[] = array( 'name' => "twinok",          'title' => "Twin Ok",           'type' => "radio");
+$DB_fields[] = array( 'name' => "sleepersofaok",   'title' => "Sleeper Sofa Ok",   'type' => "radio");
+$DB_fields[] = array( 'name' => "comments",        'title' => "Comments",          'type' => "textarea");
+$DB_fields[] = array( 'name' => "discover",        'title' => "Discover Big Fore", 'type' => "drop",   'drop' => $discover);
 
 // $fields are used for building the query page
 foreach ($DB_fields as $key=>$value) {
index 737ea2a..bf718f1 100755 (executable)
@@ -178,7 +178,7 @@ GLM_TOOLBOX::html_nav_table($nav,$navWidth);
                 <b>'.$drop_row['title'].'</b>';
             echo '<br>';
             if( is_array( $drop_row['drop'] ) ) {
-                echo GLM_TOOLBOX::build_picklist( $drop_key.'[]', $drop_row['drop'], ${$drop_key}, 'multiple', 0, null, 5 );
+                echo GLM_TOOLBOX::build_picklist( $drop_key.'[]', $drop_row['drop'], $_REQUEST[$drop_key], '', 0, null, 5 );
             }
         }
     }