Jump to content

funstad

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by funstad

  1. mktime() is on the list.

     

    You'll probably need a table containing the holidays.

     

    i already have one ?

    $feestdag_01     = date('Y/m/d', mktime (0,0,0,1,1,$Jaar));                 // Newyear$feestdag_02    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 1,  $EY));     // Easter Monday$feestdag_03    = date('Y/m/d', mktime (0,0,0,5,1,$Jaar));                 // Labor Day$feestdag_04    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 39,  $EY)); // Our Dear Lord Ascension$feestdag_05    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 50,  $EY)); // Pinkster Monday$feestdag_06    = date('Y/m/d', mktime (0,0,0,7,21,$Jaar));             // Nationale feestdag$feestdag_07    = date('Y/m/d', mktime (0,0,0,8,15,$Jaar));              // Our Dear Lady Assumption$feestdag_08    = date('Y/m/d', mktime (0,0,0,11,1,$Jaar));             // All Hallows$feestdag_09    = date('Y/m/d', mktime (0,0,0,11,11,$Jaar));             // Truce$feestdag_10    = date('Y/m/d', mktime (0,0,0,12,25,$Jaar));            // Christmas
  2. There's many different ways to identify a date:

     

    http://www.w3schools.com/php/php_ref_date.asp

     

    Mmhh I dont think the solution can be found there?

     

    I'm looking how i can check if there is a holiday from the list that will occurs between today and 7 days

    if so i have to know witch day it is (mon, thu, wen, ..)

    something like :

    if (is_a_holiday == true) {echo $date_of_holiday} else if (is_closed == true) {echo $date_of_closed} else {echo $Display_regular}
  3. Hey all,

     

    I'm trying to build a dynamic store opening hours display (see image below)

    2zptojq.jpg

    what I have:

    as you can see on the image above, a red box shows what day it is today.

    When the store is open 09:00 till 12:00 and 13:00 till 18:00 the red box will change into a green one.

    When closed a red box appears.

     

    Holidays are calculated in PHP

    Closed days are stored in MYSQL and pulled in php

     

    what I still need:

    I'm searching for a easy and correct way to check if for example today is 17/11/2014

    If there is going to be a holiday or a closed day within 7 days. (18,19,20,21,22,23/11/2014)

    If there is a holiday or closed day within 7days it had to been displayed (Arrow on image)

     

    Something like this:

    if (is_a_holiday == true && Monday) {echo $date_of_holiday} else if (is_closed == true && Monday) {echo $date_of_closed} else {echo $Display_regular_Monday}    if (is_a_holiday == true && Thuesday) {echo $date_of_holiday} else if (is_closed == true && Thuesday) {echo $date_of_closed} else {echo $Display_regular_Thuesday}        // Other days calculation ...

    Holidays are callculated this way:

    <?php//                vvvvv                HOLIDAYS                vvvvv            // START$Jaar = date('Y');                                                        // Current Year$dezeweek1 = date('Y/m/d');                                                // Current Day$dezeweek7 = date('Y/m/d', strtotime("+7 day"));                        // Current Day + 7 Days$EA = easter_date($Jaar);                                                // Easter This Year$ED = date('j', $EA);                                                    // Easter Day$EM = date('n', $EA);                                                    // Easter Month$EY = date('Y', $EA);                                                    // Easter Year    $feestdag_01     = date('Y/m/d', mktime (0,0,0,1,1,$Jaar));                 // Newyear$feestdag_02    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 1,  $EY));     // Easter Monday$feestdag_03    = date('Y/m/d', mktime (0,0,0,5,1,$Jaar));                 // Labor Day$feestdag_04    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 39,  $EY)); // Our Dear Lord Ascension$feestdag_05    = date('Y/m/d', mktime (0, 0, 0, $EM, $ED + 50,  $EY)); // Pinkster Monday$feestdag_06    = date('Y/m/d', mktime (0,0,0,7,21,$Jaar));             // Nationale feestdag$feestdag_07    = date('Y/m/d', mktime (0,0,0,8,15,$Jaar));              // Our Dear Lady Assumption$feestdag_08    = date('Y/m/d', mktime (0,0,0,11,1,$Jaar));             // All Hallows$feestdag_09    = date('Y/m/d', mktime (0,0,0,11,11,$Jaar));             // Truce$feestdag_10    = date('Y/m/d', mktime (0,0,0,12,25,$Jaar));            // Christmas    $feestdag_15    = date('Y/m/d', mktime (0,0,0,11,18,$Jaar));            // Test Date$feestdag_16    = date('Y/m/d', mktime (0,0,0,11,19,$Jaar));            // Test Date//                ^^^^^                HOLIDAYS                ^^^^^            // END?>

    English is not my mother language so if my syntax is not correct I apologize

     

    Thank you.

  4.  

    I managed to get it working using a timer, I'm not sure which data needs to be updated to avoid using a timer, but it works with an interval of 1 millisecond.

     

    change

    maxHeight.expand.call(maxHeight);

    to

    setTimeout(function() { maxHeight.expand.call(maxHeight); }, 1);

    thank you! Here I was looking for a couple of weeks!

  5. Try changing

    <body onload="new ElementMaxHeight();">

    to:

    <body onload="maxHeight = new ElementMaxHeight();">

    and add:

    maxHeight.expand.call(maxHeight);

    under:

    directionsDisplay.setDirections(response);

    If that doesn't work can you post a link to your site.

    I have just added it but when u press on calculate route (Bereken route) nothing happens.

     

    site: http://tinyurl.com/mxgu25v

  6. I think i need to add some changes in the code below but adding ElementMaxHeight(); doesnt work.

    if (status == google.maps.DirectionsStatus.OK) {directionsDisplay.setDirections(response);			} else {

    It's called like this:

    <body onload="new ElementMaxHeight();"></body>
  7. This is what i found with resize:

    // Refresh elements height onResize event var __expand = this.expand; if (window.addEventListener) { window.addEventListener('resize', function(event) {return __expand.apply(__object, [( event || window.event)])}, false);} else if (window.attachEvent) { window.attachEvent('onresize', function(event) {return __expand.apply(__object, [( event || window.event)])}); } },
  8. Look inside maxheight for whatever it does when the browser is resized, and run the same code after adding the directions. It will probably be listening for a resize event.

    I have added the maxheight.js script.I have totally no clue how to do this because i only know a few things about js.So i'm looking for someone who can help me with this.

  9. SOLVED (Thanks to JamesB)

    Hey all,

     

    I use Google Maps to allow people to navigate to our shop.the problem is that my route description always disappears under my footer.When I resize my browser directions get fully displayedso the problem is in my maxheight.js

    So i search a way that when calcRoute() is launched my maxheight resize without the need of resize my browers.

     

    K9JDBLh.jpg

     

    Google JS code:

    	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>    <script type="text/javascript">		var directionDisplay;	var directionsService = new google.maps.DirectionsService();	function initialize() {		var latlng = new google.maps.LatLng(51.100899,4.415780);		directionsDisplay = new google.maps.DirectionsRenderer();		var myOptions = {			zoom: 17,			center: latlng,			mapTypeId: google.maps.MapTypeId.ROADMAP,			mapTypeControl: false		};		var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);		directionsDisplay.setMap(map);		directionsDisplay.setPanel(document.getElementById("directionsPanel"));  var image = '../images/contact/mapsicon.png';	  var marker = new google.maps.Marker({      position: latlng,	  title: 'Rijwielen De Zwaluw NV',      map: map,      icon: image		}); 	}		function calcRoute() {		var start = document.getElementById("routeStart").value;		var end = "51.100899,4.415780";		var request = {			origin:start,			destination:end,			travelMode: google.maps.DirectionsTravelMode.DRIVING		};		directionsService.route(request, function(response, status) {			if (status == google.maps.DirectionsStatus.OK) {				directionsDisplay.setDirections(response);						} else {				if (status == 'ZERO_RESULTS') {					alert('No route could be found between the origin and destination.');				} else if (status == 'UNKNOWN_ERROR') {					alert('A directions request could not be processed due to a server error. The request may succeed if you try again.');				} else if (status == 'REQUEST_DENIED') {					alert('This webpage is not allowed to use the directions service.');				} else if (status == 'OVER_QUERY_LIMIT') {					alert('The webpage has gone over the requests limit in too short a period of time.');				} else if (status == 'NOT_FOUND') {					alert('At least one of the origin, destination, or waypoints could not be geocoded.');				} else if (status == 'INVALID_REQUEST') {					alert('The DirectionsRequest provided was invalid.');									} else {					alert("There was an unknown error in your request. Requeststatus: nn"+status);				}			}		});	}	</script>
×
×
  • Create New...