Skip to content

Commit b33db1b

Browse files
Merge pull request #128 from freshprogrammer/layout
Visual Layout Update
2 parents f2705b6 + c6bf9f3 commit b33db1b

13 files changed

Lines changed: 1984 additions & 631 deletions

index.php

Lines changed: 23 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//$errorMessage[] = "initialized";
4040
//$debugMessage[] = "initialized";
4141

42-
global $siteName;
42+
global $appName;
4343
global $pageTitle;
4444
global $versionNote;
4545

@@ -107,7 +107,7 @@
107107
<a href="./"><img src="images/logo.png" border="0"></a>
108108
</td>
109109
<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>
111111
</td>
112112
<?php
113113
if(!UserHasReadPermission())
@@ -176,93 +176,19 @@
176176
//search
177177
if(UserHasReadPermission())
178178
{
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&reg;";
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+
258184
$menuItems .= "<td class='dr-toolbar-int rich-toolbar-item' align='right''>\n";
259185
$menuItems .= " <form name='MainSearch' action='./' method=get>\n";
260186
$menuItems .= " Search: <input type='text' name='search' placeholder=\"$placeholder\">\n";
261187
$menuItems .= " <input type='hidden' name='searchbtn' value='T'>\n";
262188
$menuItems .= " </form>\n";
263189
$menuItems .= "</td>\n";
264190
}
265-
else
191+
else
266192
{
267193
//keep format and left seperator
268194
$menuItems .= "<td class='dr-toolbar-int rich-toolbar-item'>&nbsp;</td>\n";
@@ -273,19 +199,14 @@
273199
</tbody>
274200
</table>
275201
</div>
276-
277-
<!-- Page Body -->
278202
<table id="pagecontainer" id="pagecontainer" cellpadding="0" cellspacing="0" class='center pageMinWidth'><tbody><tr><td>
279-
280-
<?php
281203

204+
<?php
282205
//BackupDatabase();
283206

284207
if(UserHasReadPermission())
285208
{
286-
//TODO this should be an actual room lookup not hardcoded roomids
287-
?>
288-
<!-- HEADER LINKS -->
209+
?><!-- HEADER LINKS -->
289210
<table width=100%><tr>
290211
<td>
291212
<?php echo CustomFunctions::CreateNavigationQuickLinks() ?>
@@ -294,10 +215,9 @@
294215
<a href='#' class='' id='showMessagesButton' onclick='ToggleMessgeVisibility()'>Show Messages</a>&nbsp;
295216
</td>
296217
</tr></table>
297-
<BR>
298-
<?php
218+
<BR><?php
299219
}
300-
220+
301221
//error and reporting mesages - filled in at the bottom of the page with JS
302222
echo "<!-- DEBUG MESSAGE -->\n<div id='debugMessage' style='display:none;' class='debugMessage'></div>\n";
303223
echo "<!-- ERROR MESSAGE -->\n<div id='errorMessage' style='display:none;' class='errorMessage'></div>\n";
@@ -309,49 +229,30 @@
309229
echo "<BR>\n";
310230
LoginPrompt();
311231
}
312-
else
313-
{
314-
//officaliy logged in with min read access-------------------------------------------------------------------------------------------------
232+
else
233+
{//officaliy logged in with min read access-------------------------------------------------------------------------------------------------
315234
echo "<!-- PAGE BODY-->\n";
316235

317236
if(strlen($host) > 0)
318-
{
319-
//build customer page
320-
ShowCustomerPage($host);
321-
322-
}
237+
ShowCustomerPage($host);//build customer page
323238
else if(strlen($roomID) > 0)
324-
{
325-
ListLocationCustomers($roomID);
326-
}
239+
ShowRoomPage($roomID);
327240
else if(strlen($deviceIDInput) > 0)
328-
{
329241
ShowDevicePage($deviceIDInput);
330-
}
331242
else if(strlen($chassisnameInput) > 0)
332-
{
333243
ShowChassisPage($chassisnameInput);
334-
}
335244
else if(strlen($locationIDInput) > 0)
336-
{
337245
ShowLocationPage($locationIDInput);
338-
}
339246
else if(strlen($userIDInput) > 0)
340-
{
341247
ShowUsersPage($userIDInput);
342-
}
343248
else if(strlen($page) > 0)
344249
{
345250
if($page==="PowerAudit")
346251
{
347252
if(strlen($pa_roomID) > 0 && strlen($pa_panel) > 0)
348-
{
349253
PowerAuditPanel($pa_roomID,$pa_panel);
350-
}
351254
else
352-
{
353255
PowerAuditPanelList();
354-
}
355256
}
356257
else if($page==="Audits")
357258
{
@@ -368,7 +269,7 @@
368269
//single customer
369270
ShowCustomerPage($singleCustomerMatch);
370271
}
371-
else
272+
else
372273
{
373274
//search all
374275
$resultCount = 0;
@@ -396,48 +297,16 @@
396297
echo "</div>\n";
397298
echo "</div>\n";
398299
}
399-
else
300+
else
400301
{
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();
437306
}//end search len > 0
438307
}//single cust not found
439308
}//not specific row/ca/cust
440-
echo "<BR>";
309+
echo "<!-- PAGE BODY END-->\n";
441310
}//end - page body vs login - //officaliy logged in with min read access
442311

443312
//end of Body

0 commit comments

Comments
 (0)