|
39 | 39 | //$errorMessage[] = "initialized"; |
40 | 40 | //$debugMessage[] = "initialized"; |
41 | 41 |
|
42 | | - global $siteName; |
| 42 | + global $appName; |
43 | 43 | global $pageTitle; |
44 | 44 | global $versionNote; |
45 | 45 |
|
|
107 | 107 | <a href="./"><img src="images/logo.png" border="0"></a> |
108 | 108 | </td> |
109 | 109 | <td valign="middle"> |
110 | | - <div id="appname"><h1><?php echo $siteName;?></h1><?php echo $versionNote;?></div> |
| 110 | + <div id="appname"><h1><?php echo $appName;?></h1><?php echo $versionNote;?></div> |
111 | 111 | </td> |
112 | 112 | <?php |
113 | 113 | if(!UserHasReadPermission()) |
|
176 | 176 | //search |
177 | 177 | if(UserHasReadPermission()) |
178 | 178 | { |
179 | | - $placeholder = ""; |
180 | | - //random placeholders |
181 | | - if(true) |
182 | | - { |
183 | | - $linesOfCode = CountLinesInDir(); |
184 | | - $dbRecs = CountDBRecords(); |
185 | | - $rand = rand(0,90); |
186 | | - $searchPlaceHolders = array(); |
187 | | - //ROUGH LIMIT "------------------------" |
188 | | - $searchPlaceHolders[] = "Search"; |
189 | | - $searchPlaceHolders[] = "Search from here"; |
190 | | - $searchPlaceHolders[] = "Everyone loves to search"; |
191 | | - $searchPlaceHolders[] = "Your companion"; |
192 | | - $searchPlaceHolders[] = "Like a pet but useful"; |
193 | | - $searchPlaceHolders[] = "Type here"; |
194 | | - $searchPlaceHolders[] = "Waiting..."; |
195 | | - $searchPlaceHolders[] = "Got your back"; |
196 | | - $searchPlaceHolders[] = "It's cool, I got this"; |
197 | | - $searchPlaceHolders[] = "You know what to do"; |
198 | | - $searchPlaceHolders[] = "Self explanatory"; |
199 | | - $searchPlaceHolders[] = "This is where your search"; |
200 | | - $searchPlaceHolders[] = "See KB for details"; |
201 | | - $searchPlaceHolders[] = "Search is your friend"; |
202 | | - $searchPlaceHolders[] = "Search could save your life some day"; |
203 | | - $searchPlaceHolders[] = "Indexes to the rescue"; |
204 | | - $searchPlaceHolders[] = "Pioneering Omni-Search"; |
205 | | - $searchPlaceHolders[] = "Into the depths"; |
206 | | - $searchPlaceHolders[] = "Almost lunch time"; |
207 | | - $searchPlaceHolders[] = "Who's behind you"; |
208 | | - $searchPlaceHolders[] = "Not on break"; |
209 | | - $searchPlaceHolders[] = "Almost never on break"; |
210 | | - $searchPlaceHolders[] = "Like an unpaid intern"; |
211 | | - $searchPlaceHolders[] = "I am so smart... SMRT"; |
212 | | - $searchPlaceHolders[] = "Your coffee is ready"; |
213 | | - $searchPlaceHolders[] = "Search never sleeps"; |
214 | | - $searchPlaceHolders[] = "Wont save you on car inssurance"; |
215 | | - $searchPlaceHolders[] = "Smoke free for $rand days"; |
216 | | - $searchPlaceHolders[] = "NSA free for 0 days"; |
217 | | - $searchPlaceHolders[] = "Not a calculator"; |
218 | | - $searchPlaceHolders[] = "Still not a calculator"; |
219 | | - $searchPlaceHolders[] = "Sponsored by your tax dollars"; |
220 | | - $searchPlaceHolders[] = "You are here *"; |
221 | | - $searchPlaceHolders[] = "I search to serve"; |
222 | | - $searchPlaceHolders[] = "Give a man a match..."; |
223 | | - $searchPlaceHolders[] = "Not from The Simpsons®"; |
224 | | - $searchPlaceHolders[] = "One man's dream of data"; |
225 | | - $searchPlaceHolders[] = "Please like and subscribe"; |
226 | | - $searchPlaceHolders[] = "Doesn't search Facebook"; |
227 | | - $searchPlaceHolders[] = "No Facebook login"; |
228 | | - $searchPlaceHolders[] = "No like buttons here"; |
229 | | - |
230 | | - $searchPlaceHolders[] = "$linesOfCode+ lines of code"; |
231 | | - $searchPlaceHolders[] = "$linesOfCode+ free range lines"; |
232 | | - $searchPlaceHolders[] = "$linesOfCode lines, but cutting back"; |
233 | | - $searchPlaceHolders[] = "10K+ line club"; |
234 | | - $searchPlaceHolders[] = "$dbRecs+ DB Records"; |
235 | | - $searchPlaceHolders[] = "$dbRecs Records and counting"; |
236 | | - |
237 | | - $searchPlaceHolders[] = "Google's nemesis"; |
238 | | - $searchPlaceHolders[] = "Googol * Googol"; |
239 | | - $searchPlaceHolders[] = "Who cares about Bing"; |
240 | | - $searchPlaceHolders[] = "Remember Yahoo!?"; |
241 | | - $searchPlaceHolders[] = "DuckDuckGo"; |
242 | | - $searchPlaceHolders[] = "One DogPile for all"; |
243 | | - $searchPlaceHolders[] = "Making search Cuil again"; |
244 | | - $searchPlaceHolders[] = "Not AltaVista"; |
245 | | - $searchPlaceHolders[] = "Fetch Jeeves"; |
246 | | - $searchPlaceHolders[] = "Fresh Search"; |
247 | | - |
248 | | - $searchPlaceHolders[] = "e.g. H######"; |
249 | | - $searchPlaceHolders[] = "e.g. C######"; |
250 | | - $searchPlaceHolders[] = "e.g. Company name"; |
251 | | - $searchPlaceHolders[] = "e.g. Company note"; |
252 | | - $searchPlaceHolders[] = "e.g. Device Name"; |
253 | | - $searchPlaceHolders[] = "e.g. Badge Holder"; |
254 | | - $searchPlaceHolders[] = "e.g. Location Name"; |
255 | | - $placeholder = $searchPlaceHolders[array_rand($searchPlaceHolders)]; |
256 | | - } |
257 | | - |
| 179 | + $placeholder = "Search"; |
| 180 | + |
| 181 | + if(true)//custom search placeholder(s) |
| 182 | + $placeholder = CustomFunctions::GetSearchPlaceholder(); |
| 183 | + |
258 | 184 | $menuItems .= "<td class='dr-toolbar-int rich-toolbar-item' align='right''>\n"; |
259 | 185 | $menuItems .= " <form name='MainSearch' action='./' method=get>\n"; |
260 | 186 | $menuItems .= " Search: <input type='text' name='search' placeholder=\"$placeholder\">\n"; |
261 | 187 | $menuItems .= " <input type='hidden' name='searchbtn' value='T'>\n"; |
262 | 188 | $menuItems .= " </form>\n"; |
263 | 189 | $menuItems .= "</td>\n"; |
264 | 190 | } |
265 | | - else |
| 191 | + else |
266 | 192 | { |
267 | 193 | //keep format and left seperator |
268 | 194 | $menuItems .= "<td class='dr-toolbar-int rich-toolbar-item'> </td>\n"; |
|
273 | 199 | </tbody> |
274 | 200 | </table> |
275 | 201 | </div> |
276 | | - |
277 | | - <!-- Page Body --> |
278 | 202 | <table id="pagecontainer" id="pagecontainer" cellpadding="0" cellspacing="0" class='center pageMinWidth'><tbody><tr><td> |
279 | | - |
280 | | - <?php |
281 | 203 |
|
| 204 | + <?php |
282 | 205 | //BackupDatabase(); |
283 | 206 |
|
284 | 207 | if(UserHasReadPermission()) |
285 | 208 | { |
286 | | - //TODO this should be an actual room lookup not hardcoded roomids |
287 | | - ?> |
288 | | - <!-- HEADER LINKS --> |
| 209 | + ?><!-- HEADER LINKS --> |
289 | 210 | <table width=100%><tr> |
290 | 211 | <td> |
291 | 212 | <?php echo CustomFunctions::CreateNavigationQuickLinks() ?> |
|
294 | 215 | <a href='#' class='' id='showMessagesButton' onclick='ToggleMessgeVisibility()'>Show Messages</a> |
295 | 216 | </td> |
296 | 217 | </tr></table> |
297 | | - <BR> |
298 | | - <?php |
| 218 | + <BR><?php |
299 | 219 | } |
300 | | - |
| 220 | + |
301 | 221 | //error and reporting mesages - filled in at the bottom of the page with JS |
302 | 222 | echo "<!-- DEBUG MESSAGE -->\n<div id='debugMessage' style='display:none;' class='debugMessage'></div>\n"; |
303 | 223 | echo "<!-- ERROR MESSAGE -->\n<div id='errorMessage' style='display:none;' class='errorMessage'></div>\n"; |
|
309 | 229 | echo "<BR>\n"; |
310 | 230 | LoginPrompt(); |
311 | 231 | } |
312 | | - else |
313 | | - { |
314 | | - //officaliy logged in with min read access------------------------------------------------------------------------------------------------- |
| 232 | + else |
| 233 | + {//officaliy logged in with min read access------------------------------------------------------------------------------------------------- |
315 | 234 | echo "<!-- PAGE BODY-->\n"; |
316 | 235 |
|
317 | 236 | if(strlen($host) > 0) |
318 | | - { |
319 | | - //build customer page |
320 | | - ShowCustomerPage($host); |
321 | | - |
322 | | - } |
| 237 | + ShowCustomerPage($host);//build customer page |
323 | 238 | else if(strlen($roomID) > 0) |
324 | | - { |
325 | | - ListLocationCustomers($roomID); |
326 | | - } |
| 239 | + ShowRoomPage($roomID); |
327 | 240 | else if(strlen($deviceIDInput) > 0) |
328 | | - { |
329 | 241 | ShowDevicePage($deviceIDInput); |
330 | | - } |
331 | 242 | else if(strlen($chassisnameInput) > 0) |
332 | | - { |
333 | 243 | ShowChassisPage($chassisnameInput); |
334 | | - } |
335 | 244 | else if(strlen($locationIDInput) > 0) |
336 | | - { |
337 | 245 | ShowLocationPage($locationIDInput); |
338 | | - } |
339 | 246 | else if(strlen($userIDInput) > 0) |
340 | | - { |
341 | 247 | ShowUsersPage($userIDInput); |
342 | | - } |
343 | 248 | else if(strlen($page) > 0) |
344 | 249 | { |
345 | 250 | if($page==="PowerAudit") |
346 | 251 | { |
347 | 252 | if(strlen($pa_roomID) > 0 && strlen($pa_panel) > 0) |
348 | | - { |
349 | 253 | PowerAuditPanel($pa_roomID,$pa_panel); |
350 | | - } |
351 | 254 | else |
352 | | - { |
353 | 255 | PowerAuditPanelList(); |
354 | | - } |
355 | 256 | } |
356 | 257 | else if($page==="Audits") |
357 | 258 | { |
|
368 | 269 | //single customer |
369 | 270 | ShowCustomerPage($singleCustomerMatch); |
370 | 271 | } |
371 | | - else |
| 272 | + else |
372 | 273 | { |
373 | 274 | //search all |
374 | 275 | $resultCount = 0; |
|
396 | 297 | echo "</div>\n"; |
397 | 298 | echo "</div>\n"; |
398 | 299 | } |
399 | | - else |
| 300 | + else |
400 | 301 | { |
401 | | - if($searchbtn==="T") |
402 | | - { |
403 | | - //mock for empty search |
404 | | - $pageSubTitle = "Blank Search"; |
405 | | - echo "<div class=\"panel\">\n"; |
406 | | - echo "<div class=\"panel-header\">\n"; |
407 | | - echo "Search for nuthin ($search) yields a whole lot of nuthin.\n"; |
408 | | - echo "</div>\n"; |
409 | | - |
410 | | - echo "<div class=\"panel-body\">\n\n"; |
411 | | - |
412 | | - //nothing here |
413 | | - |
414 | | - echo "</div>\n"; |
415 | | - echo "</div>\n"; |
416 | | - } |
417 | | - else |
418 | | - { |
419 | | - //just logged in |
420 | | - echo "<div class=\"panel\">\n"; |
421 | | - echo "<div class=\"panel-header\">\n"; |
422 | | - echo "Welcome\n"; |
423 | | - echo "</div>\n"; |
424 | | - |
425 | | - echo "<div class=\"panel-body\">\n\n"; |
426 | | - |
427 | | - echo "Welcome to $siteName."; |
428 | | - |
429 | | - if(UserHasWritePermission() && IsUserUsingDefaultPassword()) |
430 | | - { |
431 | | - echo "<BR><BR>Please <a href='./?userid=$userID'>change your password</a> from the default when you get a chance."; |
432 | | - } |
433 | | - |
434 | | - echo "</div>\n"; |
435 | | - echo "</div>\n"; |
436 | | - } |
| 302 | + if($searchbtn==="T")//mock for empty search |
| 303 | + $errorMessage[] ="Search for nuthin yields a whole lot of nuthin."; |
| 304 | + |
| 305 | + echo CustomFunctions::CreateHomePageContent(); |
437 | 306 | }//end search len > 0 |
438 | 307 | }//single cust not found |
439 | 308 | }//not specific row/ca/cust |
440 | | - echo "<BR>"; |
| 309 | + echo "<!-- PAGE BODY END-->\n"; |
441 | 310 | }//end - page body vs login - //officaliy logged in with min read access |
442 | 311 |
|
443 | 312 | //end of Body |
|
0 commit comments