From: Steve Sutton Date: Tue, 22 May 2018 20:34:33 +0000 (-0400) Subject: End of day commit X-Git-Tag: v1.0.0^2~30 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=ac8d83cb715effb9034260cf31eabcbe7de2f9e7;p=WP-Plugins%2Fglm-member-db-travel.git End of day commit I have the list view showing the leads. will need to add paging and alpha sorting I added the jqueryui tabs have been working on the contacts and notes tabs. These are done using ajax calls. the edit is done by just a form submit. --- diff --git a/assets/cancel.png b/assets/cancel.png new file mode 100755 index 0000000..c149c2b Binary files /dev/null and b/assets/cancel.png differ diff --git a/assets/goCompany.png b/assets/goCompany.png new file mode 100755 index 0000000..79bf4ba Binary files /dev/null and b/assets/goCompany.png differ diff --git a/assets/goContact.png b/assets/goContact.png new file mode 100755 index 0000000..60a982d Binary files /dev/null and b/assets/goContact.png differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..ecab363 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/new.png b/assets/new.png new file mode 100755 index 0000000..555b127 Binary files /dev/null and b/assets/new.png differ diff --git a/assets/newLead.png b/assets/newLead.png new file mode 100755 index 0000000..184347f Binary files /dev/null and b/assets/newLead.png differ diff --git a/assets/tlSave.png b/assets/tlSave.png new file mode 100755 index 0000000..c4c1ec8 Binary files /dev/null and b/assets/tlSave.png differ diff --git a/assets/travelLeads.png b/assets/travelLeads.png new file mode 100755 index 0000000..beb4ec1 Binary files /dev/null and b/assets/travelLeads.png differ diff --git a/assets/travelToList.png b/assets/travelToList.png new file mode 100755 index 0000000..8f61849 Binary files /dev/null and b/assets/travelToList.png differ diff --git a/classes/data/dataContacts.php b/classes/data/dataContacts.php new file mode 100644 index 0000000..13d99fe --- /dev/null +++ b/classes/data/dataContacts.php @@ -0,0 +1,181 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataLeads.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataLeads class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataTravelContacts extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_contacts'; + + /* + * Table Data Fields + */ + + $this->fields = array( + + 'id' => array( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a', + ), + + 'lead' => array( + 'field' => 'lead', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'leads', + 'p_field' => 'id', + 'p_id' => 'id', + 'p_orderby' => 'lname,fname', + 'required' => true, + 'use' => 'a', + ), + + 'updated' => array( + 'field' => 'updated', + 'type' => 'datetime', + 'required' => true, + 'use' => 'a', + ), + + 'name' => array( + 'field' => 'name', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'email' => array( + 'field' => 'email', + 'type' => 'text', + 'required' => false, + 'unique' => false, + 'use' => 'a', + ), + + 'phone' => array( + 'field' => 'phone', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + ); + + } + + /** + * Entry Post Processing Call-Back Method + * + * Perform post-processing for all result entries. + * + * In this case we're using it to append an array of category + * data to each member result and also sort by member name. + * + * @param array $r Array of field result data for a single entry + * @param string $a Action being performed (l, i, g, ...) + * + * @return object Class object + * + */ + public function entryPostProcessing($r, $a) + { + return $r; + } + +} diff --git a/classes/data/dataLeads.php b/classes/data/dataLeads.php new file mode 100644 index 0000000..8aadd80 --- /dev/null +++ b/classes/data/dataLeads.php @@ -0,0 +1,265 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataLeads.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataLeads class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataTravelLeads extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'leads'; + + /* + * Table Data Fields + */ + + $this->fields = array( + + 'id' => array( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a', + ), + + 'create_date' => array( + 'field' => 'create_date', + 'type' => 'date', + 'required' => true, + 'use' => 'a', + ), + + 'updated' => array( + 'field' => 'updated', + 'type' => 'datetime', + 'required' => true, + 'use' => 'a', + ), + + 'status' => array( + 'field' => 'status', + 'type' => 'list', + 'list' => $this->config['lead_status'], + 'required' => true, + 'default' => $this->config['lead_status_numb']['Inactive'], + 'use' => 'a' + ), + + 'fname' => array( + 'field' => 'fname', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'lname' => array( + 'field' => 'lname', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'email' => array( + 'field' => 'email', + 'type' => 'text', + 'required' => false, + 'unique' => false, + 'use' => 'a', + ), + + 'company' => array( + 'field' => 'company', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'address' => array( + 'field' => 'address', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'address2' => array( + 'field' => 'address2', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'city' => array( + 'field' => 'city', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'state' => array( + 'field' => 'state', + 'type' => 'list', + 'list' => $this->config['states'], + 'default' => 'MI', + 'required' => false, + 'use' => 'a', + ), + + 'zip' => array( + 'field' => 'zip', + 'type' => 'list', + 'required' => false, + 'use' => 'a', + ), + + 'phone' => array( + 'field' => 'phone', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'fax' => array( + 'field' => 'fax', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'website' => array( + 'field' => 'website', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + 'mail_ok' => array( + 'field' => 'mail_ok', + 'type' => 'checkbox', + 'required' => false, + 'use' => 'a', + ), + + // 'member_ok' => array( + // 'field' => 'member_ok', + // 'type' => 'checkbox', + // 'required' => false, + // 'use' => 'a', + // ), + + ); + + } + + /** + * Entry Post Processing Call-Back Method + * + * Perform post-processing for all result entries. + * + * In this case we're using it to append an array of category + * data to each member result and also sort by member name. + * + * @param array $r Array of field result data for a single entry + * @param string $a Action being performed (l, i, g, ...) + * + * @return object Class object + * + */ + public function entryPostProcessing($r, $a) + { + return $r; + } + +} diff --git a/classes/data/dataNotes.php b/classes/data/dataNotes.php new file mode 100644 index 0000000..9fd55ed --- /dev/null +++ b/classes/data/dataNotes.php @@ -0,0 +1,173 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataLeads.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + */ + +/** + * GlmDataLeads class + * + * PHP version 5 + * + * @category Data + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmDataTravelNotes extends GlmDataAbstract +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + /** + * Data Table Name + * + * @var $table + * @access public + */ + public $table; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d database connection + * @param array $config Configuration array + * @param bool $limitedEdit Flag to say indicate limited edit requested + * + * @return void + * @access public + */ + public function __construct($wpdb, $config, $limitedEdit = false) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_notes'; + + /* + * Table Data Fields + */ + + $this->fields = array( + + 'id' => array( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a', + ), + + 'lead' => array( + 'field' => 'lead', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'leads', + 'p_field' => 'id', + 'p_id' => 'id', + 'p_orderby' => 'lname,fname', + 'required' => true, + 'use' => 'a', + ), + + 'created' => array( + 'field' => 'created', + 'type' => 'date', + 'required' => true, + 'use' => 'a', + ), + + 'updated' => array( + 'field' => 'updated', + 'type' => 'datetime', + 'required' => true, + 'use' => 'a', + ), + + 'notes' => array( + 'field' => 'notes', + 'type' => 'text', + 'required' => false, + 'use' => 'a', + ), + + ); + + } + + /** + * Entry Post Processing Call-Back Method + * + * Perform post-processing for all result entries. + * + * In this case we're using it to append an array of category + * data to each member result and also sort by member name. + * + * @param array $r Array of field result data for a single entry + * @param string $a Action being performed (l, i, g, ...) + * + * @return object Class object + * + */ + public function entryPostProcessing($r, $a) + { + return $r; + } + +} diff --git a/config/plugin.ini b/config/plugin.ini index 9222f7e..99b840b 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -2,7 +2,13 @@ ; Main Configuration File ; {descrName} ; -; Place any static configuration parameters here. +; Place any static configuration parameters here. ; [common] + +lead_status[10] = 'Active' +lead_status[20] = 'Inactive' + +lead_status_numb['Active'] = 10 +lead_status_numb['Inactive'] = 20 diff --git a/css/admin.css.save b/css/admin.css.save new file mode 100755 index 0000000..0cb8e47 --- /dev/null +++ b/css/admin.css.save @@ -0,0 +1,287 @@ +#travel-admin { + font-family: arial, sans-serif; + /* font-size: 13px !important; */ + /* font-size: 1.3rem !important; */ + margin: 0; + padding: 0; + padding-left: 40px; + background: url(http://www.circlemichigan.com/assets/logo.png) fixed no-repeat 1:w + 15px 100px; + } +#travel-admin a:link { + color: #28195e; + } +#travel-admin a:visited { + color: #28195e; + } +#travel-admin a:hover { + color: #000; + } +#travel-admin a:active { + color: #28195e; + } + +/* Travel Leads style framework */ +#travel-admin .tlRounded { + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + } +#travel-admin .tlShadow { + -moz-box-shadow:inset 0 0 7px #fff,1px 1px 7px rgba(153, 153, 153, 0.2); + -webkit-box-shadow:inset 0 0 7px #fff,1px 1px 7px rgba(153, 153, 153, 0.2); + box-shadow:inset 0 0 7px #fff,1px 1px 7px rgba(153, 153, 153, 0.2); + } +#travel-admin .tlBorder { + border: 1px solid #999; + } +#travel-admin .tlTrans1 { + background: #fff; + background: rgba(255, 255, 255, .9); + } +#travel-wrapper { + padding: 25px; + width: 720px; + min-height: 400px; + background: rgba(255, 255, 255, .7); + } + /* main page fieldsets */ +#fieldsets { + height: 1%; + overflow: hidden; + } +#travel-admin fieldset { + display: block; + float: left; + margin-right: 20px; + height: 9em; + padding: 10px; + } +#travel-admin fieldset:last-child { + margin-right: 0; + } +#travel-admin fieldset p { + font-weight: bold; + font-family: Georgia, arial, sans-serif; + font-size: 16px; + font-size: 1.2rem; + margin: 0.5em 0; + } +#findLeads div { + margin: 0 0 10px 0; + } +#findLeads label { + width: 100px; + display: block; + float: left; + line-height: 30px; + } +#travel-admin fieldset form input { + height: 28px; + padding: 0; + margin: 0; + border-width: 1px; + font-size: 14px; + font-size: 1.0rem; + display: block; + width: 99%; + } +/* Buttons */ +#travel-admin .button { + width: 198px; + height: 30px; + text-indent: -9000px; + display: block; + cursor: pointer; + margin-top: 10px; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-left: 1px solid #eee; + border-top: 1px solid #eee; + } +#travel-admin .button:hover { + border-right: 1px solid #888; + border-bottom: 1px solid #888; + border-left: 1px solid #ccc; + border-top: 1px solid #ccc; + } +/* Save Button */ +#travel-admin .tlSave { + float: right; + background-image: url(../assets/tlSave.png); + margin-right: 5px; + margin-top: -5px; + } +#travel-admin fieldset form #leadCompanySearch { + background-image: url(../assets/goCompany.png); + } +#travel-admin fieldset form #leadContactSearch { + background-image: url(../assets/goContact.png); + } +#travelToList { + background-image: url(../assets/travelToList.png); + } +#newLead { + background-image: url(../assets/newLead.png); + } +/* Pagination */ + +#travel-admin .paging { + display: block; + } +#travel-admin .paging, +#travel-admin .business-first-letter { + clear: both; + margin: 1em 0; + padding: 1em 0 0 0; + height: 1%; + overflow: hidden; + margin-left: 2px; + } +#travel-admin .business-first-letter { + margin-bottom: 1em; + border-bottom: 1px dotted #369; + padding-bottom: 1em; + } +#travel-admin .paging b, +#travel-admin .business-first-letter a.curr { + padding: 0.2em 0.4em; + background: #eee; + border: 1px solid #9AAFE5; + margin-left: 0.2em; + display: block; + float: left; + } +#travel-admin .paging a, +#travel-admin .business-first-letter a { + margin-left: 0.2em; + color: #036; + padding: 0.2em 0.4em; + border: 1px solid #9AAFE5; + text-decoration: none; + background: white; + display: block; + float: left; + } +#travel-admin .paging a:hover, +#travel-admin .business-first-letter a:hover { + border: 1px solid #2e8d32; + background: #eee; + } +/* Table Grid */ +#dataGrid { + margin: 0.5em 0 1em 0; + background: rgba(255, 255, 255, 0.0); + } +#dataGrid, #dataGrid tr, #dataGrid th, #dataGrid td { + border: 1px solid #999; + border-collapse: collapse; + } +#dataGrid th, #dataGrid td { + padding: 10px 20px; + } +#dataGrid th { + background: #fff; + } +#dataGrid tr:nth-child(even) { + background: rgba(231, 231, 231, .9); + } +#dataGrid tr:nth-child(odd) { + background: rgba(248, 248, 248, .9);; + } +#dataGrid tr:hover { + background: #fff; + cursor: pointer; + } +#dataGrid a { + text-decoration: none; + color: black; + } +#dataGrid th a { + text-decoration: underline; + font-family: Georgia, arial, sans-serif; + white-space: nowrap; + } +/* Breadcrumbs */ +#breadcrumbs { + background: white; + color: #000; + padding: 10px 15px; + margin-bottom: 1em; + } +#breadcrumbs i { + font-weight: bold; + font-style: normal; + } +#lead-delete { + float: right; + margin-top: 10px; + } +#lead-delete a { + margin: 5px; + background: red; + background: rgba(204, 0, 0, .4); + padding: 5px; + border: 1px solid #ccc; + border-radius: 5px; + color: white; + text-shadow: 1px 1px 1px #888; + text-decoration: none; + } +#lead-delete a:hover { + background: red; + background: rgba(204, 0, 0, 1.0); +} +/* Overriding Form Framework */ +div.webform td { + font-size: 13px !important; + font-size: 1.3rem !important; + } +div.webform table, div.webform td { + border: 1px solid #aaa !important; + } +/* Overriding JqueryUI */ +#travel-admin .ui-state-highlight { + margin-bottom: .5em; + padding: 15px; + } +#travel-admin .ui-state-highlight p { + margin: 0; + } +#travel-admin .ui-icon { + float: left; + margin-right: .3em; + display: block; + } +#tabs li a { + font-size: 13px; + font-size: 1.3rem; + } +#travel-admin .tsLog { + margin: 10px 0; + border-top: 1px dotted #369; + border: 1px solid #eee; + height: 1%; + overflow: hidden; + } +#travel-admin .tsLog h2 { + font-family: Georgia, arial, sans-serif; + font-size: 16px; + font-size: 1.6rem; + padding: 5px 10px; + background: #eee; + font-weight: normal; + margin: 0 0 1em 0 ; + } +#travel-admin .tsLog p { + margin: 0 10px; + } +#travel-admin .tlDelete { + display: block; + float: right; + width: 16px; + height: 16px; + background: url(assets/cancel.png) no-repeat; + text-indent: -9000px; + margin: 10px; + } diff --git a/index.php b/index.php index c31475e..11455c0 100644 --- a/index.php +++ b/index.php @@ -150,16 +150,16 @@ if (is_file(GLM_MEMBERS_TRAVEL_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { * * Then add the data to the "config" array under "// Add this add-on to the add-ons array" below. */ -$glmMembersTravelDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion'); +$glmMembersTravelDatabasePluginVersion = get_option('glmMembersTravelDbVersion'); if ( $glmMembersTravelDatabasePluginVersion ) { // Management - $glmMembersTravelManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); - unset($glmMembersTravelManagementSettings['id']); + // $glmMembersTravelManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); + // unset($glmMembersTravelManagementSettings['id']); // Settings - $glmMembersTravelSettingsTerms = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX."settings_terms WHERE id = 1", ARRAY_A ); - unset($glmMembersTravelSettingsTerms['id']); + // $glmMembersTravelSettingsTerms = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX."settings_terms WHERE id = 1", ARRAY_A ); + // unset($glmMembersTravelSettingsTerms['id']); } @@ -174,8 +174,8 @@ function glmMembersTravelRegisterAddOn($addOns) { 'slug' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG, 'actions' => $GLOBALS['glmMembersTravelAddOnValidActions'], 'config' => array( - 'settings' => $GLOBALS['glmMembersTravelManagementSettings'], - 'terms' => $GLOBALS['glmMembersTravelSettingsTerms'] + // 'settings' => $GLOBALS['glmMembersTravelManagementSettings'], + // 'terms' => $GLOBALS['glmMembersTravelSettingsTerms'] ), 'shortcodes' => $GLOBALS['glmMembersTravelShortcodes'], 'shortcodesDescription' => $GLOBALS['glmMembersTravelShortcodesDescription'] diff --git a/models/admin/ajax/travelContacts.php b/models/admin/ajax/travelContacts.php new file mode 100644 index 0000000..9bf197c --- /dev/null +++ b/models/admin/ajax/travelContacts.php @@ -0,0 +1,108 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + +// Load Members data abstract +require_once GLM_MEMBERS_TRAVEL_PLUGIN_CLASS_PATH . '/data/dataContacts.php'; + +/** + * This class performs the work of handling images passed to it via + * an AJAX call that goes through the WorPress AJAX Handler. + * + */ +class GlmMembersAdmin_ajax_travelContacts extends GlmDataTravelContacts +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This constructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for data class + parent::__construct(false, false); + + } + + /* + * Perform Model Action + * + * This model checks to see if the credentials passed in are correct. + * + * This model action does not return, it simply does it's work then calls die(); + * + * @param $actionData + * + * Output JSON string as response and does not return + */ + public function modelAction( $actionData = false ) + { + $return = false; + $success = true; + + $option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING ); + trigger_error( print_r( $_REQUEST, E_USER_NOTICE ) ); + + switch ( $option ) { + case 'list': + default: + $lead_id = filter_var( $_REQUEST['lead_id'], FILTER_VALIDATE_INT ); + $return = $this->getList( "T.lead = $lead_id" ); + + $view = 'list.html'; + break; + } + + // Compile template data + $templateData = array( + 'data' => $return, + ); + + // Return status, suggested view, and data to controller + return array( + 'status' => $success, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => 'admin/ajax/contacts/'.$view, + 'data' => $templateData + ); + } +} diff --git a/models/admin/ajax/travelNotes.php b/models/admin/ajax/travelNotes.php new file mode 100644 index 0000000..693be80 --- /dev/null +++ b/models/admin/ajax/travelNotes.php @@ -0,0 +1,110 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + +// Load Members data abstract +require_once GLM_MEMBERS_TRAVEL_PLUGIN_CLASS_PATH . '/data/dataNotes.php'; + +/** + * This class performs the work of handling images passed to it via + * an AJAX call that goes through the WorPress AJAX Handler. + * + */ +class GlmMembersAdmin_ajax_travelNotes extends GlmDataTravelNotes +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This constructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for data class + parent::__construct(false, false); + + } + + /* + * Perform Model Action + * + * This model checks to see if the credentials passed in are correct. + * + * This model action does not return, it simply does it's work then calls die(); + * + * @param $actionData + * + * Output JSON string as response and does not return + */ + public function modelAction( $actionData = false ) + { + $return = false; + $success = true; + + $option = isset($_REQUEST['option']) ? filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING ) : ''; + trigger_error( print_r( $_REQUEST, E_USER_NOTICE ) ); + + switch ( $option ) { + case 'list': + default: + $lead_id = filter_var( $_REQUEST['lead_id'], FILTER_VALIDATE_INT ); + $notes = $this->getList( "T.lead = $lead_id" ); + + $view = 'list.html'; + break; + } + + // Compile template data + $templateData = array( + 'lead_id' => $lead_id, + 'notes' => $notes, + 'editPage' => 'glm-members-admin-menu-glm-travel', + ); + + // Return status, suggested view, and data to controller + return array( + 'status' => $success, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => 'admin/ajax/notes/'.$view, + 'data' => $templateData + ); + } +} diff --git a/models/admin/travel/index.php b/models/admin/travel/index.php new file mode 100644 index 0000000..819d733 --- /dev/null +++ b/models/admin/travel/index.php @@ -0,0 +1,503 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Leads data abstract +require_once GLM_MEMBERS_TRAVEL_PLUGIN_CLASS_PATH.'/data/dataLeads.php'; +require_once GLM_MEMBERS_TRAVEL_PLUGIN_CLASS_PATH . '/data/dataContacts.php'; +require_once GLM_MEMBERS_TRAVEL_PLUGIN_CLASS_PATH . '/data/dataNotes.php'; + +class GlmMembersAdmin_travel_index extends GlmDataTravelLeads +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + public $entryId = false; + /* + * Constructor + * + * This contructor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + * @wpdb object WordPress database object + * + * @return array Array containing status, suggested view, and any data + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the data class + * + * Note, the third parameter is a flag that indicates to the + * data class that it should flag a group of fields as 'view_only'. + */ + parent::__construct(false, false, true); + + + } + + public function modelAction($actionData = false) + { + $where = ' true '; + $option = false; + $user_can_edit_leads = false; + $wpUser = $this->config['loggedInUser']['wpUser']; + $search_id = false; + $numbDisplayed = false; + $lastDisplayed = false; + $paging = true; + $prevStart = false; + $nextStart = false; + $start = 1; + $limit = 20; // Set to the number of listings per page + $haveLeads = false; + $leadCount = 0; + $addingLead = false; + $searching = false; + $updating = false; + $updating_error = false; + $inserting = false; + $inserting_error = false; + $groups = false; + $sources = false; + $entry = false; + $hasSearch = false; + + // Get any provided option + if ( isset( $_REQUEST['option'] ) ) { + $option = $_REQUEST['option']; + } + + if ( isset( $_REQUEST['glm_action'] ) && $_REQUEST['glm_action'] === 'csvExport' ) { + $search = true; + $option = 'csv'; + } + + // Get entry ID if supplied + if (isset($_REQUEST['id'])) { + + // Make sure it's numeric + $this->entryId = ( $_REQUEST['id'] - 0 ); + + if ( $this->entryId <= 0 ) { + $this->entryId = false; + } + + } + + // Check for a search being done. + if ( isset( $_REQUEST['search'] ) ) { + $search = filter_var( $_REQUEST['search'], FILTER_VALIDATE_BOOLEAN); + } + if ( isset( $_REQUEST['back'] ) ) { + $back = filter_var( $_REQUEST['back'], FILTER_VALIDATE_BOOLEAN); + if ( $back ) { + $searching = true; + } + } + + if ( isset( $this->config['loggedInUser']['contactUser'] ) && empty( $this->config['loggedInUser']['contactUser'] ) ) { + $user_can_edit_leads = true; + } + + if ( ( isset( $search ) && $search ) || isset( $search_params ) && $search_params ) { + if ( isset( $search ) && $search ) { + $searching = true; + } + // Filter the $_POST variables from the search form. + // Verify mm/dd/YYYY date format for the from and to dates. + if ( !isset( $search_params ) ) { + $search_params = filter_var_array( + $_POST, + array( + 'source_id' => FILTER_VALIDATE_INT, + 'company' => FILTER_SANITIZE_STRING, + 'contact' => FILTER_SANITIZE_STRING, + 'from_date' => array( + 'filter' => FILTER_VALIDATE_REGEXP, + 'options' => array( + 'regexp' => '%([0-9]{2})/([0-9]{2})/([0-9]{4})%' + ) + ), + 'to_date' => array( + 'filter' => FILTER_VALIDATE_REGEXP, + 'options' => array( + 'regexp' => '%([0-9]{2})/([0-9]{2})/([0-9]{4})%' + ) + ), + 'mail_ok' => FILTER_VALIDATE_BOOLEAN, + 'member_ok' => FILTER_VALIDATE_BOOLEAN, + 'interests' => array( + 'filter' => FILTER_VALIDATE_BOOLEAN, + 'flags' => FILTER_FORCE_ARRAY + ) + ) + ); + } + // checking the booleans for empty or false + if ( isset( $_REQUEST['mail_ok'] ) && $_REQUEST['mail_ok'] === '0' ) { + $search_params['mail_ok'] = (int)0; + } + if ( isset( $_REQUEST['member_ok'] ) && $_REQUEST['member_ok'] === '0' ) { + $search_params['member_ok'] = (int)0; + } + + + // build the $where part + $where_parts = array(); + if ( isset( $search_params['member_ok'] ) && $search_params['member_ok'] !== false ) { + $member_ok = ( $search_params['member_ok'] === true ) ? 'true' : 'false'; + $where_parts[] = "T.lead_id IN ( + SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads + WHERE member_ok = $member_ok)"; + } + if ( isset( $search_params['mail_ok'] ) && $search_params['mail_ok'] !== false ) { + $mail_ok = ( $search_params['mail_ok'] === true ) ? 'true' : 'false'; + $where_parts[] = "T.lead_id IN ( + SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads + WHERE mail_ok = $mail_ok)"; + } + if ( isset( $this->config['loggedInUser']['contactUser'] ) && !empty( $this->config['loggedInUser']['contactUser'] ) ) { + $where_parts[] = "T.lead_id IN ( + SELECT id + FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads + WHERE member_ok = true)"; + } else { + $user_can_edit_leads = true; + } + if ( $search_params['source_id'] ) { + $where_parts[] = "source_id = {$search_params['source_id']}"; + } + if ( $search_params['company'] ) { + $where_parts[] = "org = '" . esc_sql( $search_params['company'] ) . "'"; + } + if ( $search_params['contact'] ) { + // Search for name. + // Could be in these formats: + // fname lname + // lname, fname + // lname fname + // lname + // fname + $name_parts = array(); + $name_parts[] = "SOUNDEX(CONCAT_WS(' ', fname, lname)) = SOUNDEX( '" . esc_sql( $search_params['contact'] ) . "')"; + $name_parts[] = "SOUNDEX(CONCAT_WS(' ', lname, fname)) = SOUNDEX( '" . esc_sql( $search_params['contact'] ) . "')"; + $name_parts[] = "SOUNDEX(fname) = SOUNDEX( '" . esc_sql( $search_params['contact'] ) . "')"; + $name_parts[] = "SOUNDEX(lname) = SOUNDEX( '" . esc_sql( $search_params['contact'] ) . "')"; + $where_parts[] = implode( ' OR ', $name_parts ); + } + if ( $search_params['interests'] ) { + /* + * Search for the interest. + * Checks the tables for lead_interests. + */ + // $where_parts[] = " T.id IN ( + // SELECT lead_entry_id + // FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_interests + // WHERE interest_id IN ( " . implode( ", ", array_keys( $search_params['interests'] ) ) . " ) ) "; + } + if ( $search_params['from_date'] && $search_params['to_date'] ) { + /* + * We get a date from the form in mm/dd/YYYY format. + * Here in mysql we reformat the date using STR_TO_DATE function. + */ + $where_parts[] = "T.date_submitted BETWEEN STR_TO_DATE('{$search_params['from_date']}', '%m/%d/%Y') " + . "AND STR_TO_DATE('{$search_params['to_date']}', '%m/%d/%Y')"; + } else if ( $search_params['from_date'] ) { + $where_parts[] = "T.date_submitted >= STR_TO_DATE('{$search_params['from_date']}', '%m/%d/%Y')"; + } else if ( $search_params['to_date'] ) { + $where_parts[] = "T.date_submitted <= STR_TO_DATE('{$search_params['to_date']}', '%m/%d/%Y')"; + } + if ( ( isset( $search ) && $search ) || $searching ) { + if ( isset( $where_parts ) && !empty( $where_parts ) ) { + $where .= ' AND ' . implode( ' AND ', $where_parts ); + } + $order = "T.lname, T.fname"; + + // Check if we're doing paging + if (isset($_REQUEST['pageSelect'])) { + + // If request is for Next + if ( isset( $_REQUEST['pageSelect'][0] ) && $_REQUEST['pageSelect'][0] == 'N') { + $newStart = $_REQUEST['nextStart'] - 0; + + // Otherwise it must be Previous + } else { + $newStart = $_REQUEST['prevStart'] - 0; + } + + if ($newStart > 0) { + $start = $newStart; + } + } + + // Get count of members listed + $leadCount = $this->getStats($where); + + // If the number of members is less than a page, don't do paging + if ($leadCount <= $limit) { + $paging = false; + } + + + switch ( $option ) { + case 'csv': + // $sql = " + // SELECT T.*,L.email + // FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T, + // " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "leads L + // WHERE $where + // AND T.lead_id = L.id + // ORDER BY $order"; + $leads = $this->wpdb->get_results( $sql, ARRAY_A ); + break; + default: + $listResult = $this->getSimpleEntriesList( $where, $order, true, 'id', $start, $limit ); + // Get paging results + $numbDisplayed = $listResult['returned']; + $lastDisplayed = $listResult['last']; + if ($start == 1) { + $prevStart = false; + } else { + $prevStart = $start - $limit; + if ($start < 1) { + $start = 1; + } + } + if ($listResult['returned'] == $limit) { + $nextStart = $start + $limit; + } + + // since we're doing paging, we have to break out just the member data + $leads = $listResult['list']; + //echo '
$leads: ' . print_r( $leads, true ) . '
'; + //exit; + unset($listResult); + + // If we have list entries - even if it's an empty list + break; + } + $success = true; + $haveLeads = false; + if ($leads !== false) { + + $success = true; + + // If we have any entries + if (count($leads) > 0) { + $haveLeads = true; + } + } + + + + } else { + $leads = false; + } + } else { + $leads = ''; + $search_params = array( + 'mail_ok' => null, + 'member_ok' => null, + 'company' => '', + 'contact' => '', + 'from_date' => '', + 'to_date' => '', + 'interests' => array(), + ); + } + + // Initialize the interests array + $interests = array(); + + // Initialize the grouped_interests array + $grouped_interests = array(); + + switch ( $option ) { + case 'addLog': + echo '
$_REQUEST: ' . print_r( $_REQUEST, true ) . '
'; + + $this->wpdb->insert( + GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_notes', + array( + 'lead' => $this->entryId, + 'created' => date( 'Y-m-d' ), + 'updated' => date( 'Y-m-d' ), + 'notes' => filter_var( $_REQUEST['new_log'], FILTER_SANITIZE_STRING ) + ), + array( + '%d', + '%s', + '%s', + '%s' + ) + ); + + $entry = $this->editEntry( $this->entryId ); + $view = 'edit.html'; + break; + case 'delete': + // echo '
$this->entryId: ' . print_r( $this->entryId, true ) . '
'; + if ( $this->entryId ) { + $return = $this->deleteEntry( $this->entryId, true, 'id' ); + // echo '
$return: ' . print_r( $return, true ) . '
'; + } + $entry = $this->getList(); + $view = 'index.html'; + break; + + case 'update': + $updating = true; + if ( $this->config['loggedInUser']['contactUser'] ) { + break; + } + $entry = $this->updateEntry( $this->entryId ); + $view = 'index.html'; + + break; + + case 'edit': + if ( $this->config['loggedInUser']['contactUser'] ) { + break; + } + // Get the record for this Entry. + $entry = $this->editEntry( $this->entryId ); + + // Use the edit view file. + $view = 'edit.html'; + + break; + + case 'insert': + $inserting = true; + + // Setup the create date and update date + $_REQUEST['create_date'] = date('Y-m-d'); + $_REQUEST['updated'] = date('Y-m-d H:i'); + + $lead = $this->insertEntry(); + + // echo '
$lead: ' . print_r( $lead, true ) . '
'; + + if ( $lead['status'] ) { + // Then goto edit page. + $entry = $lead; + + } else { + // There's an error. + $inserting_error = true; + } + + $view = 'edit.html'; + break; + + case 'add': + if ( $this->config['loggedInUser']['contactUser'] ) { + break; + } + $entry = $this->newEntry(); + $addingLead = true; + + // Use the edit view file. + $view = 'edit.html'; + + break; + + default: + + $entry = $this->getList(); + + // echo '
$entry: ' . print_r( $entry, true ) . '
'; + + $view = 'index.html'; + + break; + } + + // Enqueue the scripts for jqueryui + wp_enqueue_script( 'jquery-ui-tabs' ); + wp_enqueue_style( 'jquery-ui-smoothness', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.min.css' ); + + // Common things to place into the $templateData array + $templateData = array( + 'hasSearch' => $hasSearch, + 'lead' => $entry, + 'haveLeads' => $haveLeads, + 'leadCount' => $leadCount, + 'numbDisplayed' => $numbDisplayed, + 'lastDisplayed' => $lastDisplayed, + 'prevStart' => $prevStart, + 'nextStart' => $nextStart, + 'prev' => ( isset( $_REQUEST['prevStart'] ) ? $_REQUEST['prevStart'] : ''), + 'next' => ( isset( $_REQUEST['nextStart'] ) ? $_REQUEST['nextStart'] : ''), + 'pageSelect' => ( isset( $_REQUEST['pageSelect'] ) ? $_REQUEST['pageSelect'] : ''), + 'start' => $start, + 'limit' => $limit, + 'paging' => $paging, + 'searching' => $searching, + 'updating' => $updating, + 'updating_error' => $updating_error, + 'inserting' => $inserting, + 'inserting_error' => $inserting_error, + ); + + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/travel/' . $view, + 'data' => $templateData + ); + + } + +} diff --git a/setup/adminMenus.php b/setup/adminMenus.php index d2decd2..793b4a4 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -50,3 +50,28 @@ * */ +// Add Travel leads sub-menu for GLM Members Members (admins) +add_submenu_page( + 'glm-members-admin-menu-members', + 'Travel Leads', + 'Travel Leads', + 'glm_members_members', + 'glm-members-admin-menu-glm-travel', + function(){$this->controller('travel');} +); + +// If a contact is logged in (ownEntity isn't false), add Contact Profile menu item +if ( isset( $this->config['loggedInUser']['contactUser'] ) && $this->config['loggedInUser']['contactUser'] ) { + // Check for the option GLM_MEMBERS_LEADS_PLUGIN_MEMBER_ACCESS_OPTION + // $memberCanAccessLeads = get_option( GLM_MEMBERS_LEADS_PLUGIN_MEMBER_ACCESS_OPTION ); + // if ( $memberCanAccessLeads ) { + add_submenu_page( + $mainMenuSlug, + 'Leads', + 'Leads', + 'glm_members_edit_my_entity', + 'glm-members-admin-menu-travel-index', + function() {$this->controller('travel');} + ); + // } +} diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql index 1fc8b5a..a4cf815 100644 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ b/setup/databaseScripts/create_database_V0.0.1.sql @@ -14,8 +14,10 @@ CREATE TABLE {prefix}leads ( id INT NOT NULL AUTO_INCREMENT, status INT NOT NULL DEFAULT 0, -- Lead Status (active, inactive) create_date DATE NOT NULL, -- Date contact was created + updated DATETIME NOT NULL, -- Updated Timestamp fname TEXT NULL, -- First Name lname TEXT NULL, -- Last Name + email TINYTEXT NULL, -- Email company TEXT NULL, -- Company Name address TEXT NULL, -- Address address2 TEXT NULL, -- Address 2 @@ -57,10 +59,11 @@ CREATE TABLE {prefix}referredby ( ---- -- Lead Notes -CREATE TABLE {prefix}lead_notes +CREATE TABLE {prefix}lead_notes ( id INT NOT NULL AUTO_INCREMENT, lead INT NOT NULL, -- Reference to lead table created DATETIME NOT NULL, -- Created Timestamp + updated DATETIME NOT NULL, -- Updated Timestamp notes TEXT, -- Note Entry PRIMARY KEY (id), INDEX(lead) @@ -72,25 +75,10 @@ CREATE TABLE {prefix}lead_notes CREATE TABLE {prefix}lead_contacts ( id INT NOT NULL AUTO_INCREMENT, lead INT NOT NULL, -- Reference to lead table + updated DATETIME NOT NULL, -- Updated Timestamp name TINYTEXT, -- Name of Contact email TINYTEXT, -- Email of Contact phone TINYTEXT, -- Phone of Contact PRIMARY KEY (id), INDEX(lead) ); - ----- - --- Management -CREATE TABLE {prefix}management ( - id INT NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) -); - ----- - --- settings_terms -CREATE TABLE {prefix}settings_terms ( - id INT NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) -); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index f271145..1a972c5 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -25,7 +25,7 @@ * again and the proper number of tables that should * exist with that version. */ -$glmMembersDbVersions = array( +$glmMembersTravelDbVersions = array( '0.0.1' => array('version' => '0.0.1', 'tables' => 5, 'date' => '05/18/18'), ); diff --git a/setup/validActions.php b/setup/validActions.php index f132376..89159c2 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -59,9 +59,17 @@ $glmMembersTravelAddOnValidActions = array( 'adminActions' => array( + 'ajax' => array( + 'travelContacts' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG, + 'travelInterest' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG, + 'travelNotes' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG, + ), + 'travel' => array( + 'index' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG, + ) ), 'frontActions' => array( ) ); -?> \ No newline at end of file +?> diff --git a/views/admin/ajax/contacts/list.html b/views/admin/ajax/contacts/list.html new file mode 100644 index 0000000..5a3487a --- /dev/null +++ b/views/admin/ajax/contacts/list.html @@ -0,0 +1,16 @@ + +
+
+ Add New Contact + + + + +
+
diff --git a/views/admin/ajax/notes/list.html b/views/admin/ajax/notes/list.html new file mode 100644 index 0000000..78c2420 --- /dev/null +++ b/views/admin/ajax/notes/list.html @@ -0,0 +1,14 @@ +
+ + + + + + +
+ +{foreach $notes as $n} +
+ {$n.notes} +
+{/foreach} diff --git a/views/admin/travel/edit.html b/views/admin/travel/edit.html new file mode 100644 index 0000000..d788d19 --- /dev/null +++ b/views/admin/travel/edit.html @@ -0,0 +1,177 @@ +{include file='admin/travel/header.html'} + +

Lead

+{if isset($lead.fieldData) && isset($lead.fieldData.id)} + +{/if} + +
+ + + +
+
+ + + {if isset($lead.fieldData) && isset($lead.fieldData.id)} + + + {else} + + {/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Status: + + {if $lead.fieldFail.status}

{$lead.fieldFail.status}

{/if} +
Company: + + {if $lead.fieldFail.company}

{$lead.fieldFail.company}

{/if} +
First Name: + + {if $lead.fieldFail.fname}

{$lead.fieldFail.fname}

{/if} +
Last Name: + + {if $lead.fieldFail.lname}

{$lead.fieldFail.lname}

{/if} +
Address: + + {if $lead.fieldFail.address}

{$lead.fieldFail.address}

{/if} +
Address 2: + + {if $lead.fieldFail.address2}

{$lead.fieldFail.address2}

{/if} +
City: + + {if $lead.fieldFail.city}

{$lead.fieldFail.city}

{/if} +
State/Province: + + {if $lead.fieldFail.state}

{$lead.fieldFail.state}

{/if} +
ZIP/Postal Code: + + {if $lead.fieldFail.zip}

{$lead.fieldFail.zip}

{/if} +
Email: + + {if $lead.fieldFail.email}

{$lead.fieldFail.email}

{/if} +
Phone: + + {if $lead.fieldFail.phone}

{$lead.fieldFail.phone}

{/if} +
Fax: + + {if $lead.fieldFail.fax}

{$lead.fieldFail.fax}

{/if} +
Website: + + {if $lead.fieldFail.website}

{$lead.fieldFail.website}

{/if} +
+ +
+ +
+
+ +
+ + + +{include file='admin/travel/footer.html'} diff --git a/views/admin/travel/footer.html b/views/admin/travel/footer.html new file mode 100644 index 0000000..ebc6381 --- /dev/null +++ b/views/admin/travel/footer.html @@ -0,0 +1,2 @@ + + diff --git a/views/admin/travel/header.html b/views/admin/travel/header.html new file mode 100644 index 0000000..201b1e2 --- /dev/null +++ b/views/admin/travel/header.html @@ -0,0 +1,3 @@ +
+

Travel Leads

+
diff --git a/views/admin/travel/index.html b/views/admin/travel/index.html new file mode 100644 index 0000000..e746ccf --- /dev/null +++ b/views/admin/travel/index.html @@ -0,0 +1,31 @@ +{include file='admin/travel/header.html'} + +{include file='admin/travel/searchForm.html'} + + + + + + + + + + + + + + + {foreach $lead as $e} + + + + + + + + + {/foreach} + +
EditCompanyFirst NameLast NameUpdatedStatus
Edit {$e.company} {$e.fname} {$e.lname} {$e.updated.datetime} {$e.status.name}
+ +{include file='admin/travel/footer.html'} diff --git a/views/admin/travel/searchForm.html b/views/admin/travel/searchForm.html new file mode 100644 index 0000000..cbfd15d --- /dev/null +++ b/views/admin/travel/searchForm.html @@ -0,0 +1,30 @@ +{if $hasSearch} + +{/if} +
+
+

Find Company

+
+
+ + +
+
+
+
+

Find Contact

+
+
+ + +
+
+
+
+

Quick Links

+ New Lead +
+
+