Setting and email notice for new member signup form.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Jan 2019 14:01:56 +0000 (09:01 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Jan 2019 14:01:56 +0000 (09:01 -0500)
Implementing the setting for new member signup form.

classes/data/settings/dataSettingsSignup.php [new file with mode: 0755]
models/admin/settings/signupform.php [new file with mode: 0644]
models/front/members/newMemberForm.php
setup/validActions.php
views/admin/settings/header.html
views/admin/settings/signupform.html [new file with mode: 0755]
views/front/members/newMemberForm.html
views/front/members/ownerEmail.html [new file with mode: 0644]
views/front/members/userEmail.html [new file with mode: 0644]

diff --git a/classes/data/settings/dataSettingsSignup.php b/classes/data/settings/dataSettingsSignup.php
new file mode 100755 (executable)
index 0000000..efca2a6
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+
+/**
+ * GLM Member-DB WordPress Plugin
+ * General Settings data class
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package  GLM Member-DB
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  SVN: $Id: dataSettingsGeneral.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataSettingsGeneral class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package EventManagement
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ */
+class GlmDataSettingsSignup extends GlmDataAbstract
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Field definitions
+     *
+     * @var $ini
+     * @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
+     *
+     * @return void
+     * @access public
+     */
+    function __construct ($wpdb, $config)
+    {
+
+        // 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_PLUGIN_DB_PREFIX . 'settings_general';
+
+        /*
+         * Table Data Fields
+         */
+        $this->fields = array(
+
+            'id' => array(
+                'field'     => 'id',
+                'type'      => 'integer',
+                'view_only' => true,
+                'use'       => 'a'
+            ),
+
+            'new_member_intro' => array(
+                'field' => 'new_member_intro',
+                'type'  => 'text',
+                'use'   => 'a'
+            ),
+
+            'new_member_thankyou' => array(
+                'field' => 'new_member_thankyou',
+                'type'  => 'text',
+                'use'   => 'a'
+            ),
+
+            'new_member_notice_to' => array(
+                'field' => 'new_member_notice_to',
+                'type'  => 'text',
+                'use'   => 'a'
+            ),
+
+            'new_member_notice_from' => array(
+                'field'    => 'new_member_notice_from',
+                'type'     => 'text',
+                'use'      => 'a'
+            ),
+
+            'new_member_notice_message' => array(
+                'field'    => 'new_member_notice_message',
+                'type'     => 'text',
+                'use'      => 'a'
+            ),
+
+            'new_member_type_default' => array(
+                'field'      => 'new_member_type_default',
+                'type'       => 'pointer',
+                'p_table'    => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_type',
+                'p_field'    => 'name',
+                'p_orderby'  => 'name',
+                'required'   => false,
+                'force_list' => false,
+                'use'        => 'a'
+            ),
+
+        );
+
+    }
+}
+
+?>
diff --git a/models/admin/settings/signupform.php b/models/admin/settings/signupform.php
new file mode 100644 (file)
index 0000000..f377dce
--- /dev/null
@@ -0,0 +1,228 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Member Type List
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+// Load Member Types data abstract
+require_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/settings/dataSettingsSignup.php';
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_settings_signupform extends GlmDataSettingsSignup
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor 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 members data class
+        parent::__construct(false, false);
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * '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.
+     *
+     */
+    public function modelAction ($actionData = false)
+    {
+
+        $settings_updated      = false;
+        $settings_update_error = false;
+        $success               = true;
+        $haveMemberTypes       = false;
+        $memberTypes           = false;
+        $couldNotDelete        = false;
+        $error                 = false;
+
+        // General settings are always stored in a record with ID=1.
+        $id = 1;
+
+        // Determine if current user can edit configurations
+        if ( !current_user_can('glm_members_settings') ) {
+            return array(
+                'status'           => false,
+                'menuItemRedirect' => 'error',
+                'modelRedirect'    => 'index',
+                'view'             => 'admin/error/index.html',
+                'data'             => array(
+                    'reason' => 'User does not have rights to make configuration changes.'
+                )
+            );
+        }
+
+        // Check for submission option
+        $option = '';
+        if ( isset( $_REQUEST[ 'option' ] ) && $_REQUEST[ 'option' ] == 'submit' ) {
+            $option = $_REQUEST['option'];
+        }
+
+        switch ( $option ) {
+
+            // Update General Settings and redisplay the form
+        case 'submit':
+            foreach ( $this->config[ 'addOns' ] as $a ) {
+                if ( isset( $a[ 'requiredPages' ] ) ) {
+                    foreach ( $a[ 'requiredPages'] as $pageName => $pageData ) {
+
+                        $current_page_id_value = get_option( GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$pageData[ 'underscored_title' ] );
+
+                        // the static slug name used to create unique form field names
+                        $page_title_field_name = 'glm_members_database_title_' . $this->requiredPages[ $a[ 'underscored_name'] ][ $pageName ][ 'static_name' ];
+                        $page_id_field_name    = 'glm_members_database_id_' . $this->requiredPages[ $a[ 'underscored_name' ] ][ $pageName ][ 'static_name' ];
+
+                        // the slug used to update the options table
+                        $page_option_slug = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$pageData['underscored_title'];
+
+                        $current_page_title_value = $this->requiredPages[ $a[ 'underscored_name' ] ][ $pageName][ 'title' ];
+
+                        if ( isset( $_POST[ $page_title_field_name ] ) && ! empty( $_POST[ $page_title_field_name ] ) ) {
+                            $new_page_title_value = filter_var( $_POST[ $page_title_field_name ], FILTER_SANITIZE_STRING);
+                        } else {
+                            $title_error = true;
+                        }
+
+                        // check to make sure the post value isn't empty and is numeric
+                        if ( isset( $_POST[ $page_id_field_name ] ) && ! empty( $_POST[ $page_id_field_name ] ) && is_numeric( $_POST[ $page_id_field_name ] ) ) {
+                            $new_page_id_value = filter_var( $_POST[ $page_id_field_name ], FILTER_SANITIZE_STRING );
+                        } else {
+                            $id_error = true;
+                        }
+
+                        // if the current page title matches the posted value, no need to update
+                        if ( $current_page_title_value !== $new_page_title_value ) {
+                            $args = array (
+                                'ID'         => $current_page_id_value,
+                                'post_title' => $new_page_title_value,
+                            );
+                            wp_update_post( $args );
+                        }
+
+                        // ensure the new page id exists and isn't already the same as the current page ID value
+                        if ( $current_page_id_value !== $new_page_id_value && get_post_status( $new_page_id_value ) ) {
+                            update_option( $page_option_slug, $new_page_id_value );
+                        }
+                    }
+                }
+            }
+
+            // Update all general setttings
+            $generalSettings = $this->updateEntry( 1 );
+
+            if ( $generalSettings[ 'status' ] ) {
+                $settings_updated = true;
+            } else {
+                $settings_update_error = true;
+            }
+
+            $generalSettings = $this->editEntry( $id );
+
+            break;
+
+            // Default is to get the current settings and display the form
+        default:
+
+            // Try to get the first (should be only) entry for general settings.
+            $generalSettings = $this->editEntry( $id );
+
+            break;
+        }
+
+        if ( $settings_update_error ) {
+            $settings_updated = false;
+        }
+
+        // Compile template data
+        $templateData = array(
+            'reason'              => '',
+            'signupFormSettings'  => $generalSettings,
+            'settingsUpdated'     => $settings_updated,
+            'settingsUpdateError' => $settings_update_error,
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status'           => true,
+            'menuItemRedirect' => false,
+            'modelRedirect'    => false,
+            'view'             => 'admin/settings/signupform.html',
+            'data'             => $templateData,
+        );
+
+
+    }
+
+
+}
index 57fdce0..08dff01 100644 (file)
@@ -163,8 +163,22 @@ class GlmMembersFront_members_newMemberForm // extends GlmDataBilling
             $member_fname = filter_var( $_REQUEST['fname'], FILTER_SANITIZE_STRING );
             $member_lname = filter_var( $_REQUEST['lname'], FILTER_SANITIZE_STRING );
             $member_name  = filter_var( $_REQUEST['business_name'], FILTER_SANITIZE_STRING );
+            // Check for existing member with that name
+            $existingMember = $this->wpdb->get_var(
+                $this->wpdb->prepare(
+                    "SELECT id
+                       FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members
+                      WHERE name = %s",
+                    $member_name
+                )
+            );
+            if ( $existingMember ) {
+                $error      = true;
+                $messages[] = $errors['email'] = "<span style='color: red;'>There's a member with that name already!</span>";
+            }
+
             // Member type is based on the renewing_member field (invoice_types)
-            $member_type = 39; // TODO: This need a setting
+            $member_type = $this->config['settings']['new_member_type_default'];
             if ( $member_type === false ) {
                 $error      = true;
                 $messages[] = '<span style="color:red;">An error occurred! member_type</span>';
@@ -172,7 +186,6 @@ class GlmMembersFront_members_newMemberForm // extends GlmDataBilling
             // Start database transaction
             $this->wpdb->show_errors();
             $this->wpdb->query('START TRANSACTION');
-            // $access = $this->config['access_numb']['Full'];
             $this->wpdb->insert(
                 GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members',
                 array(
@@ -219,7 +232,7 @@ class GlmMembersFront_members_newMemberForm // extends GlmDataBilling
                 array(
                     'member'         => $member_id,
                     'member_name'    => $member_name,
-                    'status'         => 10,
+                    'status'         => 20,
                     'reference_name' => 'new member form',
                     'addr1'          => $billing_addr1,
                     'city'           => $billing_city_id,
@@ -339,6 +352,19 @@ class GlmMembersFront_members_newMemberForm // extends GlmDataBilling
                 $this->wpdb->query('ROLLBACK');
             } else {
                 $this->wpdb->query('COMMIT');
+                $formData = array(
+                    'member_name'  => $member_name,
+                    'member_fname' => $member_fname,
+                    'member_lname' => $member_lname,
+                    'addr1'        => $billing_addr1,
+                    'city'         => $billing_city,
+                    'state'        => $billing_state,
+                    'zip'          => $billing_zip,
+                    'phone'        => $phone,
+                    'website'      => $website,
+                    'email'        => $memberContactEmail,
+                );
+                $this->sendNotices( $formData );
                 $view = 'thankyou';
             }
             break;
@@ -373,6 +399,70 @@ class GlmMembersFront_members_newMemberForm // extends GlmDataBilling
 
     }
 
+    public function sendNotices( $formData )
+    {
+        $smarty      = new smartyTemplateSupport();
+        $pendingList = GLM_MEMBERS_PLUGIN_ADMIN_URL . '?page=glm-members-admin-menu-members-list&glm_action=list&filterPending=true';
+        $viewPath    = GLM_MEMBERS_PLUGIN_PATH . '/views';
+        $smarty->template->setTemplateDir( $viewPath );
+        $smarty->templateAssign( 'title', 'New Member Signup' );
+        $toEmail           = $this->config['settings']['new_member_notice_to'];
+        $fromEmail         = $this->config['settings']['new_member_notice_from'];
+        $emailNotification = $this->config['settings']['new_member_notice_message'];
+        $smarty->templateAssign( 'to_email', $toEmail );
+        $smarty->templateAssign( 'from_email', $fromEmail );
+        $smarty->templateAssign( 'emailNotification', $emailNotification );
+        $smarty->templateAssign( 'pendingMembers', $pendingList );
+        $smarty->templateAssign( 'member_data', $formData );
+
+        $userEmail = $formData['email'];
+
+        $eventsList = GLM_MEMBERS_EVENTS_PLUGIN_ADMIN_URL . "?page=glm-members-admin-menu-events-index&glm_action=index";
+        $smarty->templateAssign( 'items', $events );
+
+        // Add standard parameters
+        require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php';
+
+        $viewFile      = 'front/members/ownerEmail.html';
+        $userEmailFile = 'front/members/userEmail.html';
+
+        // Generate output from model data and view
+        $htmlMessage = $smarty->template->fetch( $viewFile );
+        $userMessage = $smarty->template->fetch( $userEmailFile );
+
+        function set_content_type()
+        {
+            return "text/html";
+        }
+
+        add_filter( 'wp_mail_content_type', 'set_content_type' );
+
+        $site_name  = get_bloginfo( 'name' );
+        $adminEmail = $toEmail;
+        $subject    = 'New Member Form Submission';
+
+        $message    = $htmlMessage;
+        $userBody   = $userMessage;
+
+        $header[]   = "From: $site_name <$fromEmail>";
+        $header[]   = 'Reply-To:' . $userEmail;
+
+        wp_mail( $adminEmail, $subject, $message, $header );
+
+        // send a copy to the user submitting the email, using different headers and email template file
+        $userHeader[] = "From: $site_name <$fromEmail>";
+        $userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com';
+
+        if ( wp_mail( $userEmail, $subject, $userBody, $userHeader ) ) {
+
+        } else {
+            echo "Error: Message Not Sent";
+        }
+
+        // remove the filter to avoid conflicts
+        remove_filter( 'wp_mail_content_type', 'set_content_type' );
+    }
+
     public function getCityId( $city_name )
     {
         // First try to get city id
index 55e0ca8..ce6a719 100644 (file)
@@ -78,6 +78,7 @@ $glmMembersValidActions = array(
             'regions'    => 'glm-member-db',
             'counties'   => 'glm-member-db',
             'amenities'  => 'glm-member-db',
+            'signupform' => 'glm-member-db',
         ),
         'management' => array(
             'index'       => 'glm-member-db',        // General Options
index 713b88a..2558929 100644 (file)
@@ -3,22 +3,22 @@
     <h2>{$glmPluginName} Settings</h2>
 
     <h2 class="nav-tab-wrapper">
-{if apply_filters('glm-member-db-common-members-enabled', false)}
-    
+        {if apply_filters('glm-member-db-common-members-enabled', false)}
         <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">{$terms.term_member_cap} Types</a>
         <a href="{$thisUrl}?page={$thisPage}&glm_action=categories" class="nav-tab{if $thisAction==categories} nav-tab-active{/if}">{$terms.term_member_cap} Categories</a>
         <a href="{$thisUrl}?page={$thisPage}&glm_action=amenities" class="nav-tab{if $thisAction==amenities} nav-tab-active{/if}">Amenities</a>
-{/if}
+        {/if}
         <a href="{$thisUrl}?page={$thisPage}&glm_action=cities" class="nav-tab{if $thisAction==cities} nav-tab-active{/if}">Cities</a>
-{if apply_filters('glm-member-db-common-members-enabled', false)}
+        {if apply_filters('glm-member-db-common-members-enabled', false)}
         <a href="{$thisUrl}?page={$thisPage}&glm_action=regions" class="nav-tab{if $thisAction==regions} nav-tab-active{/if}">Regions</a>
-  {if apply_filters('glm-member-db-common-counties-enabled', false)}
+            {if apply_filters('glm-member-db-common-counties-enabled', false)}
             <a href="{$thisUrl}?page={$thisPage}&glm_action=counties" class="nav-tab{if $thisAction==counties} nav-tab-active{/if}">{$terms.term_admin_menu_configure_counties}</a>
-  {/if}
-{/if}
-{foreach $addOnTabs as $a}
+            {/if}
+        {/if}
+        <a href="{$thisUrl}?page={$thisPage}&glm_action=signupform" class="nav-tab{if $thisAction==signupform} nav-tab-active{/if}">Signup Form</a>
+        {foreach $addOnTabs as $a}
         <a href="{$thisUrl}?page={$thisPage}&glm_action={$a.action}" class="nav-tab{if $thisAction==$a.action} nav-tab-active{/if}">{$a.text}</a>
-{/foreach}
+        {/foreach}
     </h2>
     <div id="glm-admin-content-container">
 
diff --git a/views/admin/settings/signupform.html b/views/admin/settings/signupform.html
new file mode 100755 (executable)
index 0000000..f623056
--- /dev/null
@@ -0,0 +1,100 @@
+{include file='admin/settings/header.html'}
+
+<h2>New Member Signup Form Settings </h2>
+
+  <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="signupform">
+        <input type="hidden" name="option" value="submit">
+        <div class="glm-row">
+            <div class="glm-small-12 glm-medium-3 glm-column email-notification-label"> Signup Form Intro </div>
+            <div class="glm-small-12 glm-medium-9 glm-column email-notification-editor">
+                {$intro = ''}
+                {if isset($signupFormSettings)}
+                    {$intro = $signupFormSettings.fieldData.new_member_intro}
+                {/if}
+                {wp_editor(
+                    $intro,
+                    'new_member_intro',
+                    json_decode('{
+                        "media_buttons":    false,
+                        "quicktags":        false,
+                        "textarea_name":    "new_member_intro",
+                        "editor_height":    300
+                    }', true)
+                )}
+            </div>
+        </div>
+        <div class="glm-row">
+            <div class="glm-small-12 glm-medium-3 glm-columns email-notification-label"> Signup Form Thank You </div>
+            <div class="glm-small-12 glm-medium-9 glm-columns email-notification-editor">
+                {$thankyou = ''}
+                {if isset($signupFormSettings)}
+                    {$thankyou = $signupFormSettings.fieldData.new_member_thankyou}
+                {/if}
+                {wp_editor(
+                    $thankyou,
+                    'new_member_thankyou',
+                    json_decode('{
+                        "media_buttons":    false,
+                        "quicktags":        false,
+                        "textarea_name":    "new_member_thankyou",
+                        "editor_height":    300
+                    }', true)
+                )}
+            </div>
+        </div>
+        <div class="glm-row">
+            <div class="glm-small-12 glm-medium-3 glm-columns email-notification-label email-address-label">Default Member Type </div>
+            <div class="glm-small-12 glm-medium-9 glm-columns email-notification-editor">
+                <select id="new_member_type_default" name="new_member_type_default">
+                    <option value="0"></option>
+                {foreach $signupFormSettings.fieldData.new_member_type_default.list as $defaultType}
+                    <option value="{$defaultType.value}"{if $defaultType.value == $signupFormSettings.fieldData.new_member_type_default.value} selected="selected"{/if}>{$defaultType.name}</option>
+                {/foreach}
+                </select>
+            </div>
+            <div class="glm-small-12 glm-medium-3 glm-columns email-notification-label email-address-label">To: Address </div>
+            <div class="glm-small-12 glm-medium-9 glm-columns email-notification-editor">
+                <input class="glm-form-text-input-medium-long" name="new_member_notice_to" id="toEmailAddress" type="text" value="{$signupFormSettings.fieldData.new_member_notice_to}">
+                <div class="email-notification-info">Add email address(es) of persons that should receive New Member Signup Submission notifications. You can add multiple email addresses, with commas separating each address. Example: info@domain.com,sales@domain.com,email@domain.com</div>
+            </div>
+            <div class="glm-small-12 glm-medium-3 glm-columns email-notification-label email-address-label"> From / Reply To: Address </div>
+            <div class="glm-small-12 glm-medium-9 glm-columns email-notification-editor">
+                <input class="glm-form-text-input-medium-long" name="new_member_notice_from" id="fromEmailAddress" type="text" value="{$signupFormSettings.fieldData.new_member_notice_from}">
+            </div>
+        </div>
+        <div class="glm-row">
+            <div class="glm-small-12 glm-medium-3 glm-column email-notification-label"> Email Notification Message </div>
+            <div class="glm-small-12 glm-medium-9 glm-column email-notification-editor">
+                {$emailNotification = ''}
+                {if isset($signupFormSettings)}
+                    {$emailNotification = $signupFormSettings.fieldData.new_member_notice_message}
+                {/if}
+                {wp_editor(
+                    $emailNotification,
+                    'new_member_notice_message',
+                    json_decode('{
+                        "media_buttons":    false,
+                        "quicktags":        false,
+                        "textarea_name":    "new_member_notice_message",
+                        "editor_height":    300
+                    }', true)
+                )}
+            </div>
+        </div>
+
+         <input type="submit" value="Update Settings" class="button-primary">
+    </form>
+
+    <script type="text/javascript">
+
+        jQuery(document).ready(function($) {
+
+            // Flash certain elements for a short time after display
+            $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+        });
+
+    </script>
+
+{include file='admin/footer.html'}
index 64efa55..5246608 100644 (file)
@@ -22,7 +22,7 @@
         <div class="glm-row">
             <div class="glm-columns glm-large-12 glm-small-12 glm-medium-12">
                 <label for="business_name" class="glm-required" >Business Name</label>
-                <input id="business_name" name="business_name" />
+                <input id="business_name" name="business_name" {if isset($smarty.request.business_name) && $smarty.request.business_name}value="{$smarty.request.business_name}"{/if} required/>
             </div>
         </div>
         <div class="glm-row">
diff --git a/views/front/members/ownerEmail.html b/views/front/members/ownerEmail.html
new file mode 100644 (file)
index 0000000..441fa04
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="content-type" content="text/html;charset=utf-8">
+    </head>
+    <body>
+      <h1 id="title"> New Member Submission Notification</h1>
+
+      {if $emailNotification}
+          <div style="width: 500px">
+               <p> {$emailNotification} </p>
+          </div>
+      {/if}
+
+       <table cellspacing="0" cellpadding="0" width="500" style="background: lightgrey;border:1px solid #ccc;border-collapse:collapse;">
+           {foreach $member_data as $key => $val}
+           <tr>
+               <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">{$key}:</td>
+               <td style="width:200px;padding:5px;border:1px solid #ccc;">{$val}</td>
+           </tr>
+           {/foreach}
+        </table>
+
+        <div id="emailFooter">
+            <p style="margin-bottom: 0px;">A new Member has been added to your Website from your &quot;Add Your Business&quot; page.</p>
+            <p style="margin-top: 0px;">To approve it, please go to the pending member  page in your <a href="{$pendingMembers}">admin</a>.</p>
+        </div>
+    </body>
+</html>
diff --git a/views/front/members/userEmail.html b/views/front/members/userEmail.html
new file mode 100644 (file)
index 0000000..6726acd
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="content-type" content="text/html;charset=utf-8">
+    </head>
+    <body>
+      <h1 id="title"> New Member Submission Notification</h1>
+
+       <table cellspacing="0" cellpadding="0" width="500" style="background: lightgrey;border:1px solid #ccc;border-collapse:collapse;">
+           {foreach $member_data as $key => $val}
+           <tr>
+               <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">{$key}:</td>
+               <td style="width:200px;padding:5px;border:1px solid #ccc;">{$val}</td>
+           </tr>
+           {/foreach}
+        </table>
+
+        <div id="emailFooter">
+            <p style="margin-bottom: 0px;">Thank you for submitting your event, please allow up to 48 hours for the event to be reviewed.</p>
+        </div>
+    </body>
+</html>