/
index.php
executable file
·129 lines (100 loc) · 4.66 KB
/
index.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
/* algemene controller */
//error_reporting(E_ALL); //commentarieer
@define('__ROOT__', dirname(dirname(__FILE__)."/mvc_2013"));
require_once(__ROOT__."/data/plantendao.php");
require_once(__ROOT__."/data/soortendao.php");
require_once(__ROOT__."/man/templateManager.php");
require_once(__ROOT__."/content/inhoud.php");
//require_once "content/dyn_elementen.php";
//default waarden
$tpl['title'] = "de Plantenshop, een vdab jQuery tutorial"; // title in head
$tpl['body_id'] = ""; // id van body tag
$tpl['links'] = getMenu();// inhoud linkerkolom
$tpl['rechts'] = ""; // inhoud rechterkolom
$tpl['paginaScripts'] = ""; // pagina specifiek scripts //gebruikt ondersteunende functies in inhoud.php
$tpl['paginaStylesheets'] = ""; // pagina specifiek link element
$tpl['dyn'] = ""; // om verborgen dynamische elementen op te roepen via script,
//********welke pagina**********************
if(isset($_GET['page'])){
//specifieke pagina
$page = $_GET['page'];
switch ($page){
case "about":
/*** About pagina ***/
$tpl['title'] = "de Plantenshop: wie zijn we en wat doen we?";
$tpl['body_id'] = "about";
//content
$tpl['rechts'] = getAbout();
$tpl['paginaScripts'] = getScriptElements("js/about.js");
break;
case "shop":
/*** Planten pagina, PHP, non-ajax ***/
//init zoekvariabelen
$soort_id = (isset($_GET['soort_id'])) ?$_GET['soort_id'] :'%';
$kleur = (isset($_GET['kleur'])) ?$_GET['kleur'] :'%';
$hoogte_min = (isset($_GET['hoogte_min'])) ?intval($_GET['hoogte_min']):0;
$hoogte_max = (isset($_GET['hoogte_max'])) ?intval($_GET['hoogte_max']):5000;
$tpl['title'] = "de Plantenshop: ons aanbod";
$tpl['body_id'] = "shop";
//content
$tpl['rechts'] = getPlanten($soort_id, $kleur, $hoogte_min, $hoogte_max);
$tpl['paginaStylesheets'] = getLinkElements("https://cdn.datatables.net/r/ju-1.11.4/dt-1.10.9,cr-1.2.0/datatables.min.css");
$tpl['paginaScripts'] = getScriptElements(array("js/slider_shop.js", "https://cdn.datatables.net/r/ju-1.11.4/dt-1.10.9,cr-1.2.0/datatables.min.js", "js/ajaxshop.js"));
break;
/* case "ajaxshop":
$soort_id = (isset($_GET['soort_id'])) ?$_GET['soort_id'] :'%';
$kleur = (isset($_GET['kleur'])) ?$_GET['kleur'] :'%';
$hoogte_min = (isset($_GET['hoogte_min'])) ?intval($_GET['hoogte_min']):0;
$hoogte_max = (isset($_GET['hoogte_max'])) ?intval($_GET['hoogte_max']):5000;
$tpl['title'] = "de Plantenshop: ons aanbod";
$tpl['body_id'] = "shop";
//content
$tpl['rechts'] = getAjaxPlanten();
$tpl['paginaStylesheets'] = getLinkElements("https://cdn.datatables.net/r/ju-1.11.4/dt-1.10.9,cr-1.2.0/datatables.min.css");
$tpl['paginaScripts'] = getScriptElements(array("js/slider_shop.js", "https://cdn.datatables.net/r/ju-1.11.4/dt-1.10.9,cr-1.2.0/datatables.min.js", "js/dataTables.fnReloadAjax.js", "js/ajaxshop.js"));
break;*/
case "zorg":
/*** Verzorging pagina ***/
$tpl['title'] = "de Plantenshop: welke zorg moet je je planten geven?";
$tpl['body_id'] = "zorg";
//content
$tpl['rechts'] = getVerzorging();
$tpl['paginaScripts'] = getScriptElements("js/zorg.js");
break;
case "galerij":
/*** Fotogalerij ***/
$tpl['title'] = "de Plantenshop: fotogalerij";
$tpl['body_id'] = "galerij";
//content
$tpl['rechts'] = getGalerij();
break;
case "registreer":
/*** Registreer formulier pagina ***/
$tpl['title'] = "de Plantenshop: registreer u als klant";
$tpl['body_id'] = "registreer";
//content
$tpl['rechts'] = getRegistreer();
$tpl['paginaScripts'] = getScriptElements(array("js/vendor/jquery/jquery-validation-1.14.0/dist/jquery.validate.min.js", "js/registreer.js"));
break;
default:
//foutieve pagina gaat nr home?
$tpl['title'] = "de Plantenshop: fout";
$tpl['body_id'] = "fout";
$tpl['rechts'] = getFoutePagina();
}//einde switch
}
else {
/*** homepagina ***/
$tpl['body_id'] = "home";
//content
$tpl['rechts'] = getHome();
$tpl['paginaScripts'] = getScriptElements("js/accordion_home.js");
}
//***** uitvoering *******************
$tm = new TemplateManager();
$html = $tm->template($tpl);
echo $html;
?>