Front list account box and email display added
authorLaury GvR <laury@gaslightmedia.com>
Tue, 27 Nov 2018 16:40:08 +0000 (11:40 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 27 Nov 2018 16:40:08 +0000 (11:40 -0500)
assets/email_edit.png [new file with mode: 0644]
assets/help.png [new file with mode: 0644]
assets/hiker.png [new file with mode: 0644]
assets/map.png [new file with mode: 0644]
assets/printer.png [new file with mode: 0644]
css/front.css [new file with mode: 0644]
models/front/itinerary/list.php
views/front/itinerary/list.html

diff --git a/assets/email_edit.png b/assets/email_edit.png
new file mode 100644 (file)
index 0000000..244f04a
Binary files /dev/null and b/assets/email_edit.png differ
diff --git a/assets/help.png b/assets/help.png
new file mode 100644 (file)
index 0000000..5c87017
Binary files /dev/null and b/assets/help.png differ
diff --git a/assets/hiker.png b/assets/hiker.png
new file mode 100644 (file)
index 0000000..f429a41
Binary files /dev/null and b/assets/hiker.png differ
diff --git a/assets/map.png b/assets/map.png
new file mode 100644 (file)
index 0000000..f90ef25
Binary files /dev/null and b/assets/map.png differ
diff --git a/assets/printer.png b/assets/printer.png
new file mode 100644 (file)
index 0000000..a350d18
Binary files /dev/null and b/assets/printer.png differ
diff --git a/css/front.css b/css/front.css
new file mode 100644 (file)
index 0000000..369311e
--- /dev/null
@@ -0,0 +1,63 @@
+#tpAccountBox {
+    background: #eee;
+    float: left;
+    width: 98%;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    margin-left: 1%;
+    margin-right: 1%;
+    border: 1px solid #CCC;
+    border-radius: 8px;
+    padding: 10px 20px;
+}
+#tpLoggedInAs {
+    display: block;
+    position: relative;
+    min-height: 73px;
+    background: url("../assets/hiker.png") 0 100% no-repeat;
+}
+#tpLoggedInAs #tpLoggedInAsLabel {
+    float: left;
+    margin: 0 0 0 16%;
+}
+#tpLoggedInAs #tpLoggedInAsUser {
+    float: left;
+    clear: left;
+    margin: 8px 0 0 16%;
+    font-weight: bold;
+    color: #790000;
+    word-wrap: break-word;
+}
+#tpLogOutLink {
+    display: block;
+    position: absolute;
+    bottom: 4px;
+    right: 0;
+}
+#tpPlannerNav ul {
+    list-style-type: none;
+    margin: 0;
+    padding: 10px;
+}
+#tpPlannerNav ul li {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+#tpPlannerNav ul li a {
+    display: block;
+    padding: 5px 0 5px 26px;
+    background-position: 4px center;
+    background-repeat: no-repeat;
+    margin-bottom: 3px;
+    border: 1px solid #eee;
+}
+#tpPlannerNav #tpMoreInfo a {
+    background-image: url("../assets/email_edit.png");
+}
+#tpPlannerNav #tpPrintList a {
+    background-image: url("../assets/printer.png");
+}
+#tpPlannerNav #tpHelp a {
+    background-image: url("../assets/help.png");
+}
\ No newline at end of file
index e4f11f9..2cc457e 100755 (executable)
@@ -77,6 +77,7 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
         $states            =
         $membersNoEmails   =
         $formErrors        = array();
+        $userInfo          = array();
 
         if ( isset( $_SESSION['travel-list'] ) ) {
             foreach ( $_SESSION['travel-list'] as $item ) {
@@ -93,6 +94,11 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
         if ( isset( $_SESSION['itinerary-auth'] ) && filter_var( $_SESSION['itinerary-auth'], FILTER_VALIDATE_INT ) ) {
             $userLoggedIn = true;
         }
+        
+        if ( isset( $_SESSION['username'])) {
+            
+
+        }
 
         switch ( $option ) {
         case 'addAccount':
@@ -208,7 +214,7 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
                         );
                     }
                 }
-            }
+            } 
             global $wp;
             $tripPlannerPage = get_permalink( $this->config['settings']['itinerary_page'] );
             // Redirect to trip planner page
@@ -270,6 +276,14 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
             }
             break;
         case 'list':
+            $userInfo['email'] = $this->wpdb->get_var(
+                $this->wpdb->prepare(
+                    "SELECT email
+                    FROM " . GLM_MEMBERS_ITINERARY_PLUGIN_DB_PREFIX . "user
+                    WHERE id = %s",
+                    filter_var( $_SESSION['itinerary-auth'], FILTER_VALIDATE_INT )
+                )
+            );
             $view = 'list.html';
         default:
             break;
@@ -285,6 +299,7 @@ class GlmMembersFront_itinerary_list // extends GlmMembersFront_events_baseActio
             'userLoggedIn'      => $userLoggedIn,
             'formErrors'        => $formErrors,
             'createSuccess'     => $createSuccess,
+            'userInfo'          => $userInfo,
         );
 
         error_reporting(E_ALL ^ E_NOTICE);
index de7b24b..2248310 100644 (file)
 <p>{$settings.itinerary_page_content}</p>
 
 
-<div class="glm_row">
+<div id="tpAccountBox" class="glm_row">
 
     {if !$userLoggedIn}
-    <form action="{$thisUrl}" method="post">
-        <input type="hidden" name="option" value="login" />
-        <div class="glm-columns glm-small-12 glm-medium-4">
-            <h2>Sign In:</h2>
-            <label for="username" class="glm-required"> Email </label>
-            <input type="text" id="username" name="username" />
-            <label for="password" class="glm-required"> Password </label>
-            <input type="password" id="password" name="password"  />
-            <input type="submit" value="Log in" class="button" />
-
-            <a href="{$thisUrl}?option=forgot">Forgot your Password?</a>
-        </div>
-    </form>
+    <div id="tpLogin" class="glma-columns glma-small-12 glma-medium-4">
+        <form action="{$thisUrl}" method="post">
+            <input type="hidden" name="option" value="login" />
+            <div class="glm-columns glm-small-12 glm-medium-4">
+                <h2>Sign In:</h2>
+                <label for="username" class="glm-required"> Email </label>
+                <input type="text" id="username" name="username" />
+                <label for="password" class="glm-required"> Password </label>
+                <input type="password" id="password" name="password"  />
+                <input type="submit" value="Log in" class="button" />
+
+                <a href="{$thisUrl}?option=forgot">Forgot your Password?</a>
+            </div>
+        </form>
+    </div>
 
-    <div class="glm-columns glm-small-12 glm-medium-4">
+    <div id="tpAccount" class="glma-columns glma-small-12 glma-medium-4">
         <h2>If you do not have an account</h2>
         <a href="{$thisUrl}?option=create"> Create Account </a><br>
         By creating an account, you'll be able to save your list for later.
     </div>
     {else}
-        <div style="width: 60%; float: left; padding: 5px;">
-            <p>Logged in as ...</p>
-        </div>
+    <div id="tpLoggedInAs" class="glma-columns glma-small-12 glma-medium-8">
+        <span id="tpLoggedInAsLabel">Logged in as </span>
+        <span id="tpLoggedInAsUser">{$userInfo.email}</span>
+        <a id="tpLogOutLink" href="https://www.uptravel.com/Toolkit/Members/TripPlanner/login.php?logout=1" style="display: block; margin-top: 6px;">Log Out</a>
+    </div>
     {/if}
 
     {if $members}
-    <div class="glm-columns glm-small-12 glm-medium-4">
+    <div id="tpPlannerNav" class="glma-columns glma-small-12 glma-medium-4">
         <ul>
-            <li> <a href="{$thisUrl}?option=moreinfo">Get more info</a> </li>
-            <li> <a href="#" class="list-print" data-areaToPrint="PrintArea">Print this list</a> </li>
+            <li id="tpMoreInfo"> <a href="{$thisUrl}?option=moreinfo">Get more info</a> </li>
+            <li id="tpPrintList"> <a href="#" class="list-print" data-areaToPrint="PrintArea">Print this list</a> </li>
             <!-- <li> <a href="#">View Map</a> </li> -->
-            <li> <a href="#">Help</a> </li>
+            <li id="tpHelp"> <a href="#">Help</a> </li>
         </ul>
     </div>
     {/if}
-
 </div>
+
 <div class="glm_row">
     <div class="glm-columns glm-small-12" style="text-align: right;">
         <button id="toggle-map-view">Hide Map</button>
@@ -77,6 +81,7 @@
     <div id="PrintArea">
         {foreach $members as $data}
             <div class="glm-itinerary-list-item" style="border:1px solid black; padding: 10px; margin: 10px;">
+                <div class="tpBreadcrumb">/breadcrumbs/../{$data.member_name}</div>
                 <a href="#" class="dashicons dashicons-trash glm-itinerary-delete" data-id="{$data.member}" data-baseurl="{$baseurl}" style="float:right;" alt="Remove"></a>
                 <h4 style="width:90%; clear: none;">{$data.member_name}</h4>
                 <div>