OpenToday is a program you can use on your website to view the opening hours of the day.
It is made by me and improved a bit by http://www.kodevelopment.nl
The example shown below is the OpenToday version I made for: http://www.cafegouwezicht.nl/site/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<link rel="stylesheet" href="opentoday.css" type="text/css" /> <div id='test'> <?php date_default_timezone_set('Europe/Amsterdam'); $status_today = strtolower(date("D")); $xml = simplexml_load_file("xml/tijden.xml"); $volgendedag = time() > strtotime('06:00'); if ($status_today == 'mon' && $volgendedag) { echo '<div class="closed">'.$xml->maandag->boskoop->text.'</div>'; } if ($status_today == 'tue' && $volgendedag) { echo '<div class="closed">'.$xml->dinsdag->boskoop->text.'</div>'; } if ($status_today == 'wed' || $status_today == 'thu' && !$volgendedag) { showDag($xml->woensdag); } if ($status_today == 'thu' && $volgendedag || $status_today == 'fri' && !$volgendedag) { showDag($xml->donderdag); } if ($status_today == 'fri' && $volgendedag || $status_today == 'sat' && !$volgendedag) { showDag($xml->vrijdag); } if ($status_today == 'sat' && $volgendedag || $status_today == 'sun' && !$volgendedag) { showDag($xml->zaterdag); } if ($status_today == 'sun' && $volgendedag || $status_today == 'mon' && !$volgendedag) { showDag($xml->zondag); } function showDag($xmldag){ echo'<div class="openingstijd"> Openingstijd </div>'.'<div class="dag">'.$xmldag->day."<br \> ".$xmldag->boskoop->open." - ".$xmldag->boskoop->gesloten . '</div>'; } ?> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
@CHARSET "UTF-8"; body{ background:#FFFFFF url("logo.png") no-repeat; font-family:ariel; border:none; } #test{ padding-top: 60px; padding-left: 115px; } #contactgegevens{ font-size: 10pt; padding-bottom: 5px; } .closed{ color: white; width: 100px; margin-left: -5px; text-align:left; font-size: 18pt; } .closed_echo{ color: white; width: 100px; text-align:center; font-size: 18pt; } .dag{ color: white; width: 100px; padding-left: 0px; text-align:center; font-size: 13.5pt; } .plaats{ font-size: 10pt; list-style-image: url("bullet.png"); padding-top: 5px; } .openingstijd{ color:white; font-size:18pt; margin-left:-10px; margin-top: 0px; padding-bottom: 30px; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
<?xml version="1.0" encoding="UTF-8"?> <tijd> <maandag> <day>Maandag</day> <boskoop> <text>Cafe Gouwezicht is vandaag gesloten</text> </boskoop> </maandag> <dinsdag> <day>Dinsdag</day> <boskoop> <text>Cafe Gouwezicht is vandaag gesloten</text> </boskoop> </dinsdag> <woensdag> <day>Woensdag</day> <boskoop> <open>15:00</open> <gesloten>2:00</gesloten> </boskoop> </woensdag> <donderdag> <day>Donderdag</day> <boskoop> <open>15:00</open> <gesloten>2:00</gesloten> </boskoop> </donderdag> <vrijdag> <day>Vrijdag</day> <boskoop> <open>15:00</open> <gesloten>3:00</gesloten> </boskoop> </vrijdag> <zaterdag> <day>Zaterdag</day> <boskoop> <open>15:00</open> <gesloten>3:00</gesloten> </boskoop> </zaterdag> <zondag> <day>Zondag</day> <boskoop> <open>14:00</open> <gesloten>2:00</gesloten> </boskoop> <day>Zondag</day> </zondag> </tijd> |
Leave a Reply