Advertisement
Guest User

Untitled

a guest
May 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <head>
  2.  
  3. include("include/config.php");
  4. include("include/functions/import.php");
  5. STemplate::assign('home',"1");
  6. STemplate::display('header.tpl');
  7. STemplate::display('index.tpl');
  8. STemplate::display('footer.tpl');
  9.  
  10. </head>
  11. <body>
  12.  
  13. <?php
  14. $weekdays = array(
  15. 'Monday',
  16. 'Tuesday',
  17. 'Wednsday',
  18. 'Thursday',
  19. 'Friday'
  20. );
  21.  
  22. $holiday = array(
  23. 'Saturday',
  24. 'Sunday'
  25. );
  26.  
  27. date_default_timezone_set('Europe/Stockholm');
  28.  
  29. $now = new Datetime("now");
  30. $begintime = new DateTime('09:00');
  31. $endtime = new DateTime('16:00');
  32.  
  33. if($now >= $begintime && $now <= $endtime && in_array( date("l"), $weekdays ) ){
  34. // between times
  35.  
  36. include("include/config.php");
  37. include("include/functions/import.php");
  38. STemplate::assign('home',"1");
  39. STemplate::display('header.tpl');
  40. STemplate::display('index.tpl');
  41. STemplate::display('footer.tpl');
  42.  
  43. } else {
  44. // not between times
  45. // DÖLJ ALLT PÅ SITEN MEN VISA ÄVEN EN 404-SIDA
  46. echo '<div id="custom404"><h1>404-not found</h1></div>';
  47. die();
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement