-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpages.php
More file actions
executable file
·198 lines (112 loc) · 5.95 KB
/
pages.php
File metadata and controls
executable file
·198 lines (112 loc) · 5.95 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
// this php file is responsible for displaying relevant website pages apart from the default grid and projects page
$page['name'] = Csec::sanitizer($_GET['PAGE'], 'string');
$searchsubmit = Csec::sanitizer($_GET['SUBMIT'], 'int');
// all pages edited by ckeditor in the backend i handled the same way here
if (($page['name'] == "about") || ($page['name'] == "contact") || ($page['name'] == "team") || ($page['name'] == "jobs")) {
echo '<div style="margin-left:11px; width:600">';
if ($page['name'] == "contact") Csec::rawStreamer('map1.html');
$utility = Cprojects::getSingleton();
$dbatom = $utility->searchRecords($page, Cprojects::pagetable);
$result = $dbatom->arraysResult();
if ($result) echo $result[0]['htmltext'];
echo '</div>';
exit;
}
// seperate handling logic for publications
if ($page['name'] == "press") {
$utility = Cprojects::getSingleton();
$project2 = null;
$dbatom = $utility->searchRecords($project2, Cprojects::publicationtable, 'date', 'false','DESC');
$sort = Csec::sanitizer($_GET['SORT'], 'string');
if ($sort == "DESC") $utility->printDBatom($dbatom , 'htmlpubs', 1, 'DESC');
else $utility->printDBatom($dbatom , 'htmlpubs', 1);
exit;
}
// & similat seperate handling logic for news
if ($page['name'] == "news") {
echo '<div style="margin-left:15px; width:800">';
//echo '<b>news</b><br><br>';
$utility = Cprojects::getSingleton();
$project2 = null;
$dbatom = $utility->searchRecords($project2, Cprojects::presstable, 'date', 'false', 'DESC');
$sort = Csec::sanitizer($_GET['SORT'], 'string');
if ($sort == "DESC") $utility->printDBatom($dbatom , 'htmlpressW', 1, 'DESC');
else $utility->printDBatom($dbatom , 'htmlpressW', 1);
echo '</div>';
exit;
}
// this is the search logic section, biggest of of the group
if ($page['name'] == "search") {
// are we submitting a search result? if so trim input, search and output
if ($searchsubmit == 1) {
$utility = Cprojects::getSingleton();
$project = null;
$find= null;
$dbatom = $utility->searchRecords($find, Cprojects::settingtable);
$gridresult = $dbatom->arraysResult();
$delay = $gridresult [0]['grid_thumb_fade_delay'];
// set criterias them if only they are sent
if ($_POST[iQuickSearch]) $project ['name'] = Csec::sanitizer($_POST[iQuickSearch], 'string');
if ($_POST[iSearchYear]) $project ['project_year'] = Csec::sanitizer($_POST[iSearchYear], 'string');
if ($_POST[iSearchBudget]) $project ['cost'] = Csec::sanitizer($_POST[iSearchBudget], 'string');
if ($_POST[iSearchType]) $project ['type'] = Csec::sanitizer($_POST[iSearchType], 'string');
if ($_POST[iSearchStatus]) $project ['status'] = Csec::sanitizer($_POST[iSearchStatus], 'string');
echo '<div style="position:absolute; left:10px">';
// reset variable (not sure this is really necessary in this section)
//$project2 = null;
//foreach ($project as $k => $v) {
//if ($v != "") $project2[$k] = $v;
//}
// search
$dbatom= $utility->searchRecords($project, Cprojects::projectstable, 'id', 'true');
if (isset($dbatom)) $result = $dbatom->arraysResult();
$projetcount = null;
// and display results in a modified grid logic system
echo '<b> Results </b><br>';
foreach ($result as $k) {
// find the proper picture thumbnail for this project in the grid
$findpic['project'] = $k['id'];
$findpic['category'] = 'icons';
$thmbresult = $utility->searchRecords($findpic, Cprojects::pixtable);
if (isset($thmbresult)) {
$thmbpix = $thmbresult ->arraysResult();
$thmbpic = 'thumbs/'.$thmbpix[0]['main_link'];
}
// output grid unit
echo "<div class='gridthmbresult' title='".$k['name']."' style=' position: absolute; top:".(($gridresult[0]['grid_thumb_height']+10)*$projetcount+50)."px ; left:15px ; width:".$gridresult[0]['grid_thumb_height']."px ;height:".($gridresult[0]['grid_thumb_height']*0.6)."px ; '><a href='index.php?PROJECT=".$k['name']."' >";
echo "<img style='border:3px solid gray; width: ".$gridresult[0]['grid_thumb_height']."; height: ".($gridresult[0]['grid_thumb_height']*0.6)."; opacity: 0.3;' id='project".$projetcount."' src='".Csec::projectpixFolder.$thmbpic."'>";
echo "</a></div>";
echo '<div style="position:absolute; width:600px; top:'.(($gridresult[0]['grid_thumb_height']+10)*$projetcount+100).'; left:120px"><a href="index.php?PROJECT='.$k['name'].'" >';
echo '<b>'.$k['name'].'</b>-';
for ($i = 0; $i < $k['ranking']; $i++) { echo '<font color=black>*</font>'; }
for ($i = 0; $i < 5-$k['ranking']; $i++) { echo '<font color=#CCCCCC>*</font>'; }
echo '-'.$k['project_year'].'-'.$k['area'].'m2-'.$k['cost'].'$-'.$k['type'];
echo '</a></div>';
// echo the relevant javascript code to handle the animation and such
echo "<script>
$('#project".$projetcount."').animate({ width: '50%', height: '50%', opacity: 0 }, 0);
$('#project".$projetcount."').animate({ width: '100%', height: '100%', opacity: 1 }, (Math.random()*".($delay*500).")+500);
$('#project".$projetcount."').mouseover(function() {
if( $(this).is(':animated') ) return;
//$(this).animate({ width: '".$gridresult[0]['grid_thumb_zoom']."%', height: '".$gridresult[0]['grid_thumb_zoom']."%'}, 250);
$(this).animate({ width: '".($gridresult[0]['grid_thumb_height']*($gridresult[0]['grid_thumb_zoom']/100))."px', height: '".($gridresult[0]['grid_thumb_height']*($gridresult[0]['grid_thumb_zoom']/100)*0.6)."px'}, 250);
});
$('#project".$projetcount."').mouseout(function() {
$(this).animate({ width: '100%', height: '100%'}, 250);
});
</script>";
$projetcount++;
}
echo '</div>';
exit;
}
echo '<div style="position:absolute; left:0px">';
$replacetable['xxx_listTypesYYY']=Cprojects::htmlnamedropbox('types');
$replacetable['xxx_listTypesYYY'] = str_replace('<option>-----------------</option>','<option></option>',$replacetable['xxx_listTypesYYY']);
//Csec::rawStreamer('search.html');
Csec::streamer('search.html', $replacetable);
echo '</div>';
exit;
}
?>