| 
									
										
										
										
											2017-04-14 21:40:24 -06:00
										 |  |  | <?php | 
					
						
							|  |  |  | require_once __DIR__ . "/required.php"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  | if ($_SESSION['loggedin'] != true) { | 
					
						
							|  |  |  |     header('Location: index.php'); | 
					
						
							|  |  |  |     die("Session expired.  Log in again to continue."); | 
					
						
							| 
									
										
										
										
											2017-05-13 16:17:58 -06:00
										 |  |  | } else if (is_empty($_SESSION['password'])) { | 
					
						
							|  |  |  |     header('Location: index.php'); | 
					
						
							|  |  |  |     die("You need to log in again."); | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require_once __DIR__ . "/pages.php"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $pageid = "home"; | 
					
						
							|  |  |  | if (!is_empty($_GET['page'])) { | 
					
						
							|  |  |  |     if (array_key_exists($_GET['page'], PAGES)) { | 
					
						
							|  |  |  |         $pageid = $_GET['page']; | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         $pageid = "404"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-04-14 21:40:24 -06:00
										 |  |  | ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html> | 
					
						
							|  |  |  |     <head> | 
					
						
							|  |  |  |         <meta charset="UTF-8"> | 
					
						
							|  |  |  |         <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 
					
						
							| 
									
										
										
										
											2017-05-05 17:15:00 -06:00
										 |  |  |         <meta name="viewport" content="width=device-width, initial-scale=1"> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <title><?php echo SITE_TITLE; ?></title>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         <link href="static/css/bootstrap.min.css" rel="stylesheet"> | 
					
						
							|  |  |  |         <link href="static/css/font-awesome.min.css" rel="stylesheet"> | 
					
						
							| 
									
										
										
										
											2017-06-19 00:54:49 -06:00
										 |  |  |         <link href="static/css/material-color.min.css" rel="stylesheet"> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |         <link href="static/css/app.css" rel="stylesheet"> | 
					
						
							|  |  |  |     </head> | 
					
						
							|  |  |  |     <body> | 
					
						
							|  |  |  |         <div class="container"> | 
					
						
							|  |  |  |             <div class="row"> | 
					
						
							|  |  |  |                 <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4"> | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                     <?php | 
					
						
							|  |  |  |                     if ((SHOW_ICON == "both" || SHOW_ICON == "app") && ICON_POSITION != "menu") { | 
					
						
							|  |  |  |                         if (MENU_BAR_STYLE != "fixed") { | 
					
						
							|  |  |  |                             ?>
 | 
					
						
							|  |  |  |                             <img class="img-responsive banner-image" src="static/img/logo.svg" /> | 
					
						
							|  |  |  |                             <?php | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                     ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                 </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |             <nav class="navbar navbar-default navbar-orange navbar-<?php echo MENU_BAR_STYLE; ?>-top"> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                 <div class="container-fluid"> | 
					
						
							|  |  |  |                     <div class="navbar-header"> | 
					
						
							|  |  |  |                         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse"> | 
					
						
							|  |  |  |                             <span class="sr-only">Toggle navigation</span> | 
					
						
							|  |  |  |                             <span class="icon-bar"></span> | 
					
						
							|  |  |  |                             <span class="icon-bar"></span> | 
					
						
							|  |  |  |                             <span class="icon-bar"></span> | 
					
						
							|  |  |  |                         </button> | 
					
						
							|  |  |  |                         <?php | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                         if (SHOW_ICON == "both" || SHOW_ICON == "app") { | 
					
						
							|  |  |  |                             if (MENU_BAR_STYLE == "fixed" || ICON_POSITION == "menu") { | 
					
						
							|  |  |  |                                 $src = "static/img/logo.svg"; | 
					
						
							|  |  |  |                                 if ($pageid != "home") { | 
					
						
							|  |  |  |                                     $src = "static/img/up-arrow-black.png"; | 
					
						
							|  |  |  |                                 } | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                                 ?>
 | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                                 <a class="navbar-brand" href="home.php"> | 
					
						
							|  |  |  |                                     <img style="height: 35px; padding-bottom: 12px; padding-left: 5px;" src="<?php echo $src; ?>" /> | 
					
						
							|  |  |  |                                 </a> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                                 <?php | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                             } | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                         } | 
					
						
							|  |  |  |                         ?>
 | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                         <a class="navbar-brand" href="home.php"> | 
					
						
							|  |  |  |                             <?php | 
					
						
							|  |  |  |                             echo SITE_TITLE; | 
					
						
							|  |  |  |                             ?>
 | 
					
						
							|  |  |  |                         </a> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                     </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <div class="collapse navbar-collapse" id="navbar-collapse"> | 
					
						
							|  |  |  |                         <ul class="nav navbar-nav"> | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                             <?php | 
					
						
							|  |  |  |                             foreach (PAGES as $id => $pg) { | 
					
						
							|  |  |  |                                 if ($pg['navbar'] === TRUE) { | 
					
						
							|  |  |  |                                     if ($pageid == $id) { | 
					
						
							|  |  |  |                                         ?>
 | 
					
						
							|  |  |  |                                         <li class="active"> | 
					
						
							|  |  |  |                                             <?php | 
					
						
							|  |  |  |                                         } else { | 
					
						
							|  |  |  |                                             ?>
 | 
					
						
							|  |  |  |                                         <li> | 
					
						
							|  |  |  |                                         <?php } ?>
 | 
					
						
							|  |  |  |                                         <a href="home.php?page=<?php echo $id; ?>"> | 
					
						
							|  |  |  |                                             <?php | 
					
						
							|  |  |  |                                             if (isset($pg['icon'])) { | 
					
						
							|  |  |  |                                                 ?>
 | 
					
						
							|  |  |  |                                                 <i class="fa fa-<?php echo $pg['icon']; ?> fa-fw"></i>  | 
					
						
							|  |  |  |                                             <?php } ?>
 | 
					
						
							|  |  |  |                                             <?php lang($pg['title']) ?>
 | 
					
						
							|  |  |  |                                         </a> | 
					
						
							|  |  |  |                                     </li> | 
					
						
							|  |  |  |                                     <?php | 
					
						
							|  |  |  |                                 } | 
					
						
							|  |  |  |                             } | 
					
						
							|  |  |  |                             ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                         </ul> | 
					
						
							|  |  |  |                         <ul class="nav navbar-nav navbar-right"> | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |                             <li><a href="home.php"><i class="fa fa-user fa-fw"></i> <?php echo $_SESSION['realname'] ?></a></li>
 | 
					
						
							|  |  |  |                             <li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <?php lang("sign out") ?></a></li>
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                         </ul> | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |             </nav> | 
					
						
							| 
									
										
										
										
											2017-07-21 00:58:25 -06:00
										 |  |  |             <?php | 
					
						
							|  |  |  |             if (MENU_BAR_STYLE == "fixed") { | 
					
						
							|  |  |  |                 ?>
 | 
					
						
							|  |  |  |                 <div style="height: 75px;"></div> | 
					
						
							|  |  |  |                 <?php | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             ?>
 | 
					
						
							| 
									
										
										
										
											2017-06-24 00:32:33 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-03 03:00:23 -06:00
										 |  |  |             <div class="app-dock-container mobile-app-hide"> | 
					
						
							| 
									
										
										
										
											2017-06-24 19:02:50 -06:00
										 |  |  |                 <div class="app-dock"> | 
					
						
							| 
									
										
										
										
											2017-06-24 00:32:33 -06:00
										 |  |  |                     <?php | 
					
						
							| 
									
										
										
										
											2017-06-24 19:02:50 -06:00
										 |  |  |                     foreach (EXTERNAL_APPS as $a) { | 
					
						
							|  |  |  |                         ?>
 | 
					
						
							|  |  |  |                         <div class="app-dock-item"> | 
					
						
							|  |  |  |                             <p> | 
					
						
							|  |  |  |                                 <a href="<?php echo $a['url']; ?>"> | 
					
						
							|  |  |  |                                     <img class="img-responsive app-icon" src="<?php
 | 
					
						
							|  |  |  |                                     if (strpos($a['icon'], "http") !== 0) { | 
					
						
							|  |  |  |                                         echo $a['url'] . $a['icon']; | 
					
						
							|  |  |  |                                     } else { | 
					
						
							|  |  |  |                                         echo $a['icon']; | 
					
						
							|  |  |  |                                     } | 
					
						
							|  |  |  |                                     ?>"/>
 | 
					
						
							|  |  |  |                                     <span><?php echo $a['title']; ?></span>
 | 
					
						
							|  |  |  |                                 </a> | 
					
						
							|  |  |  |                             </p> | 
					
						
							|  |  |  |                         </div> | 
					
						
							|  |  |  |                         <?php | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                     ?>
 | 
					
						
							|  |  |  |                 </div> | 
					
						
							| 
									
										
										
										
											2017-06-24 00:32:33 -06:00
										 |  |  |             </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |             <?php | 
					
						
							|  |  |  |             // Alert messages
 | 
					
						
							|  |  |  |             if (!is_empty($_GET['msg']) && array_key_exists($_GET['msg'], MESSAGES)) { | 
					
						
							|  |  |  |                 // optional string generation argument
 | 
					
						
							|  |  |  |                 if (is_empty($_GET['arg'])) { | 
					
						
							|  |  |  |                     $alertmsg = lang(MESSAGES[$_GET['msg']]['string'], false); | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $alertmsg = lang2(MESSAGES[$_GET['msg']]['string'], ["arg" => $_GET['arg']], false); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 $alerttype = MESSAGES[$_GET['msg']]['type']; | 
					
						
							|  |  |  |                 $alerticon = "square-o"; | 
					
						
							|  |  |  |                 switch (MESSAGES[$_GET['msg']]['type']) { | 
					
						
							|  |  |  |                     case "danger": | 
					
						
							|  |  |  |                         $alerticon = "times"; | 
					
						
							|  |  |  |                         break; | 
					
						
							|  |  |  |                     case "warning": | 
					
						
							|  |  |  |                         $alerticon = "exclamation-triangle"; | 
					
						
							|  |  |  |                         break; | 
					
						
							|  |  |  |                     case "info": | 
					
						
							|  |  |  |                         $alerticon = "info-circle"; | 
					
						
							|  |  |  |                         break; | 
					
						
							|  |  |  |                     case "success": | 
					
						
							|  |  |  |                         $alerticon = "check"; | 
					
						
							|  |  |  |                         break; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 echo <<<END | 
					
						
							|  |  |  |             <div class="row"> | 
					
						
							|  |  |  |                 <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4"> | 
					
						
							|  |  |  |                     <div class="alert alert-dismissible alert-$alerttype"> | 
					
						
							|  |  |  |                         <button type="button" class="close">×</button> | 
					
						
							|  |  |  |                         <i class="fa fa-$alerticon"></i> $alertmsg | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  | END; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             ?>
 | 
					
						
							| 
									
										
										
										
											2017-06-23 17:12:12 -06:00
										 |  |  |             <div class="row widget-box"> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                 <?php | 
					
						
							|  |  |  |                 // Center the widgets horizontally on the screen
 | 
					
						
							| 
									
										
										
										
											2017-07-03 03:27:08 -06:00
										 |  |  |                 $appcount = 0; | 
					
						
							|  |  |  |                 foreach (APPS[$pageid] as $app) { | 
					
						
							|  |  |  |                     if (file_exists(__DIR__ . "/apps/" . $app . ".php")) { | 
					
						
							|  |  |  |                         include_once __DIR__ . "/apps/" . $app . ".php"; | 
					
						
							|  |  |  |                         if (isset($APPS[$app])) { | 
					
						
							|  |  |  |                             $appcount++; | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                 if ($appcount == 1) { | 
					
						
							|  |  |  |                     ?>
 | 
					
						
							|  |  |  |                     <div class="hidden-xs col-sm-3 col-md-4 col-lg-4"> | 
					
						
							| 
									
										
										
										
											2017-04-29 02:35:49 -06:00
										 |  |  |                         <!-- Empty placeholder column for nice center-align --> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                     </div> | 
					
						
							|  |  |  |                     <?php | 
					
						
							|  |  |  |                 } else if ($appcount == 2) { | 
					
						
							|  |  |  |                     ?>
 | 
					
						
							|  |  |  |                     <div class="hidden-xs hidden-sm col-md-2 col-lg-2"> | 
					
						
							| 
									
										
										
										
											2017-04-29 02:35:49 -06:00
										 |  |  |                         <!-- Empty placeholder column for nice center-align --> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                     </div> | 
					
						
							|  |  |  |                     <?php | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-29 02:35:49 -06:00
										 |  |  |                 // Load app widgets
 | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                 foreach (APPS[$pageid] as $app) { | 
					
						
							|  |  |  |                     if (file_exists(__DIR__ . "/apps/" . $app . ".php")) { | 
					
						
							|  |  |  |                         include_once __DIR__ . "/apps/" . $app . ".php"; | 
					
						
							| 
									
										
										
										
											2017-07-03 03:27:08 -06:00
										 |  |  |                         if (!isset($APPS[$app])) { | 
					
						
							|  |  |  |                             continue; | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2017-05-13 16:17:58 -06:00
										 |  |  |                         $apptitle = ($APPS[$app]['i18n'] === TRUE ? lang($APPS[$app]['title'], false) : $APPS[$app]['title']); | 
					
						
							| 
									
										
										
										
											2017-04-17 19:28:56 -06:00
										 |  |  |                         $appicon = (is_empty($APPS[$app]['icon']) ? "" : "fa fa-fw fa-" . $APPS[$app]['icon']); | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                         $apptype = (is_empty($APPS[$app]['type']) ? "default" : $APPS[$app]['type']); | 
					
						
							|  |  |  |                         $appcontent = $APPS[$app]['content']; | 
					
						
							|  |  |  |                         echo <<<END | 
					
						
							|  |  |  |                         <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> | 
					
						
							| 
									
										
										
										
											2017-06-19 00:54:49 -06:00
										 |  |  |                             <div class="panel panel-$apptype apppanel"> | 
					
						
							| 
									
										
										
										
											2017-04-16 02:05:18 -06:00
										 |  |  |                                 <div class="panel-heading"> | 
					
						
							|  |  |  |                                     <h3 class="panel-title"><i class="$appicon"></i> $apptitle </h3> | 
					
						
							|  |  |  |                                 </div> | 
					
						
							|  |  |  |                                 <div class="panel-body"> | 
					
						
							|  |  |  |                                     $appcontent | 
					
						
							|  |  |  |                                 </div> | 
					
						
							|  |  |  |                             </div> | 
					
						
							|  |  |  |                         </div> | 
					
						
							|  |  |  | END; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 ?>
 | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div class="footer"> | 
					
						
							|  |  |  |                 <?php echo LICENSE_TEXT; ?><br />
 | 
					
						
							|  |  |  |                 Copyright © <?php echo date('Y'); ?> <?php echo COPYRIGHT_NAME; ?>
 | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |         <script src="static/js/jquery-3.2.1.min.js"></script> | 
					
						
							|  |  |  |         <script src="static/js/bootstrap.min.js"></script> | 
					
						
							|  |  |  |         <script src="static/js/app.js"></script> | 
					
						
							|  |  |  |     </body> | 
					
						
							|  |  |  | </html> |