return false;
}
- function myEnter(event)
- {
- if (typeof event == "undefined")
- {
- event = window.event;
- }
- alert(event.value);
- }
function checkLink()
{
var toAddress = document.getElementById('toaddress');
}
return false;
}
- function makePopup(url, width, height, overflow)
- {
- if (width > 640) { width = 640; }
- if (height > 480) { height = 480; }
-
- if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow))
- {
- overflow = 'both';
- }
-
- var win = window.open(url, '',
- 'width=' + width + ',height=' + height
- + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')
- + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')
- + ',status=yes,toolbar=yes,menubar=yes,location=yes'
- );
-
- return win;
- }
function closeDialog(dialog,gid)
{
dialog.parentNode.removeChild(dialog);
return true;
}
-
- function addLoadListener(fn)
- {
- if (typeof window.addEventListener != 'undefined')
- {
- window.addEventListener('load', fn, false);
- }
- else if (typeof document.addEventListener != 'undefined')
- {
- document.addEventListener('load', fn, false);
- }
- else if (typeof window.attachEvent != 'undefined')
- {
- window.attachEvent('onload', fn);
- }
- else
- {
- var oldfn = window.onload;
- if (typeof window.onload != 'function')
- {
- window.onload = fn;
- }
- else
- {
- window.onload = function()
- {
- oldfn();
- fn();
- };
- }
- }
- }
function attachEventListener(target, eventType, functionRef, capture)
{
if (typeof target.addEventListener != "undefined")
-i<?php
+<?php
/**
* detail.php
*
*/
public function modelAction($actionData = false)
{
+ //echo '<pre>$actionData: ' . print_r( $actionData, true ) . '</pre>';
$view = 'schedule';
$settings = array();
$content = '';
// Get the schedule from starline
$url = get_option( GLM_MEMBERS_APIS_STARLINE_OPTION_NAME ) . 'ferrySchedule.php';
+ if ( isset( $actionData['request']['in_dropdown'] ) && $inDropDown = filter_var( $actionData['request']['in_dropdown'], FILTER_VALIDATE_BOOLEAN) ) {
+ $url .= '?dropdown=1';
+ }
$curl = curl_init( $url );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
- curl_setopt( $curl, CURLOPT_USERPWD, 'dev55:Glm15Keep!' );
+ curl_setopt( $curl, CURLOPT_USERPWD, 'dev55:Glm15Keep!' );
$content = curl_exec( $curl );
curl_close( $curl );
$templateData = array(
- 'content' => $content
+ 'content' => $content,
+ 'inDropDown' => $inDropDown,
+ 'schedulePage' => 'schedule-test-page'
);
error_reporting(E_ALL ^ E_NOTICE);
'action' => 'schedule',
'table' => false,
'attributes' => array(
- 'template' => false,
+ 'in_dropdown' => false,
)
),
);
<script>
function get_schedule( scheduleId )
{
- console.log(scheduleId);
- $.get(
- '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=schedule&schedule_id=' + scheduleId
- ).done(
- function(data){
- $('#edit-divy').html(data);;
- }
- );
+ {if !$inDropDown}
+ {literal}
+ $.get(
+ {/literal}'{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=schedule&schedule_id=' + scheduleId{literal}
+ ).done(
+ function(data){
+ $('#edit-divy').html(data);
+ }
+ );
+ {/literal}
+ {else}
+ // For the drop down docks schedules
+ var dropdown_dockForm = $("#dockForm");
+ var dropdown_formDockId = $("#formDockId");
+ var dropdown_formSchedId = $("#formSchedId");
+ var dropdown_dock1Sel = $('#dd-sched-1');
+ dropdown_dock1Sel.change(function(){
+ formSchedId.val(1);
+ formDockId.val(dock1Sel.val());
+ dockForm.submit();
+ });
+ var dropdown_dock2Sel = $('#dd-sched-2');
+ dropdown_dock2Sel.change(function(){
+ formSchedId.val(2);
+ formDockId.val(dock2Sel.val());
+ dockForm.submit();
+ });
+ var dropdown_dock3Sel = $('#dd-sched-3');
+ dropdown_dock3Sel.change(function(){
+ formSchedId.val(3);
+ formDockId.val(dock3Sel.val());
+ dockForm.submit();
+ });
+ var dropdown_dock4Sel = $('#dd-sched-4');
+ dropdown_dock4Sel.change(function(){
+ formSchedId.val(4);
+ formDockId.val(dock4Sel.val());
+ dockForm.submit();
+ });
+ var dropdown_mapLink1 = $('#dropdown-google-map-link1');
+ dropdown_mapLink1.click(function(){
+ window.location = '{$schedulePage}/?mapLink=1';
+ return false;
+ });
+ var dropdown_mapLink2 = $('#dropdown-google-map-link2');
+ dropdown_mapLink2.click(function(){
+ window.location = '{$schedulePage}/?mapLink=2';
+ return false;
+ });
+ var dropdown_mapLink3 = $('#dropdown-google-map-link3');
+ dropdown_mapLink3.click(function(){
+ console.log('test test test');
+ return false;
+ //window.location = '{$schedulePage}/?mapLink=3';
+ //return false;
+ });
+ var dropdown_mapLink4 = $('#dropdown-google-map-link4');
+ dropdown_mapLink4.click(function(){
+ window.location = '{$schedulePage}/?mapLink=4';
+ return false;
+ });
+ {/if}
}
</script>