| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  | <?php | 
					
						
							|  |  |  | require_once __DIR__ . "/required.php"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if ($_SESSION['loggedin'] != true) { | 
					
						
							|  |  |  |     header('Location: index.php'); | 
					
						
							|  |  |  |     die("Session expired.  Log in again to continue."); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require_once __DIR__ . "/pages.php"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $pageid = "home"; | 
					
						
							|  |  |  | if (!is_empty($_GET['page'])) { | 
					
						
							|  |  |  |     $pg = strtolower($_GET['page']); | 
					
						
							|  |  |  |     $pg = preg_replace('/[^0-9a-z_]/', "", $pg); | 
					
						
							|  |  |  |     if (array_key_exists($pg, PAGES) && file_exists(__DIR__ . "/pages/" . $pg . ".php")) { | 
					
						
							|  |  |  |         $pageid = $pg; | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         $pageid = "404"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html> | 
					
						
							|  |  |  |     <head> | 
					
						
							|  |  |  |         <meta charset="UTF-8"> | 
					
						
							|  |  |  |         <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 
					
						
							| 
									
										
										
										
											2017-05-04 00:14:08 -06:00
										 |  |  |         <meta name="viewport" content="width=device-width, initial-scale=1"> | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -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-05-14 19:32:43 -06:00
										 |  |  |         <link href="static/css/material-color.min.css" rel="stylesheet"> | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |         <link href="static/css/app.css" rel="stylesheet"> | 
					
						
							| 
									
										
										
										
											2017-05-04 00:14:08 -06:00
										 |  |  |         <?php | 
					
						
							|  |  |  |         // custom page styles
 | 
					
						
							|  |  |  |         if (isset(PAGES[$pageid]['styles'])) { | 
					
						
							|  |  |  |             foreach (PAGES[$pageid]['styles'] as $style) { | 
					
						
							|  |  |  |                 echo "<link href=\"$style\" rel=\"stylesheet\">\n"; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |     </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-04-25 18:22:27 -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.png" /> | 
					
						
							|  |  |  |                             <?php | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                     ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |                 </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |             <nav class="navbar navbar-inverse navbar-<?php echo MENU_BAR_STYLE; ?>-top"> | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -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> | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                         <?php | 
					
						
							|  |  |  |                         if (SHOW_ICON == "both" || SHOW_ICON == "app") { | 
					
						
							|  |  |  |                             if (MENU_BAR_STYLE == "fixed" || ICON_POSITION == "menu") { | 
					
						
							| 
									
										
										
										
											2017-05-14 19:05:23 -06:00
										 |  |  |                                 $src = "static/img/logo.png"; | 
					
						
							|  |  |  |                                 if ($pageid != "home") { | 
					
						
							|  |  |  |                                     $src = "static/img/up-arrow-white.png"; | 
					
						
							|  |  |  |                                 } | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                                 ?>
 | 
					
						
							|  |  |  |                                 <a class="navbar-brand" href="app.php"> | 
					
						
							| 
									
										
										
										
											2017-05-14 19:05:23 -06:00
										 |  |  |                                     <img style="height: 35px; padding-bottom: 12px; padding-left: 5px;" src="<?php echo $src; ?>" /> | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                                 </a> | 
					
						
							|  |  |  |                                 <?php | 
					
						
							|  |  |  |                             } | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                         ?>
 | 
					
						
							|  |  |  |                         <a class="navbar-brand" href="app.php"> | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |                             <?php | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                             echo SITE_TITLE; | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |                             ?>
 | 
					
						
							|  |  |  |                         </a> | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <div class="collapse navbar-collapse" id="navbar-collapse"> | 
					
						
							|  |  |  |                         <ul class="nav navbar-nav"> | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                             <?php | 
					
						
							|  |  |  |                             foreach (PAGES as $id => $pg) { | 
					
						
							|  |  |  |                                 if ($pg['navbar'] === TRUE) { | 
					
						
							|  |  |  |                                     if ($pageid == $id) { | 
					
						
							|  |  |  |                                         ?>
 | 
					
						
							|  |  |  |                                         <li class="active"> | 
					
						
							|  |  |  |                                             <?php | 
					
						
							|  |  |  |                                         } else { | 
					
						
							|  |  |  |                                             ?>
 | 
					
						
							|  |  |  |                                         <li> | 
					
						
							|  |  |  |                                         <?php } ?>
 | 
					
						
							|  |  |  |                                         <a href="app.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-24 17:13:08 -06:00
										 |  |  |                         </ul> | 
					
						
							|  |  |  |                         <ul class="nav navbar-nav navbar-right"> | 
					
						
							| 
									
										
										
										
											2017-05-13 16:39:16 -06:00
										 |  |  |                             <li><a href="<?php echo PORTAL_URL; ?>"><i class="fa fa-user fa-fw"></i> <?php echo $_SESSION['realname'] ?></a></li>
 | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |                             <li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <?php lang("sign out") ?></a></li>
 | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |                         </ul> | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |             </nav> | 
					
						
							|  |  |  |             <?php | 
					
						
							| 
									
										
										
										
											2017-04-25 18:22:27 -06:00
										 |  |  |             if (MENU_BAR_STYLE == "fixed") { | 
					
						
							|  |  |  |                 ?>
 | 
					
						
							|  |  |  |                 <div style="height: 75px;"></div> | 
					
						
							|  |  |  |                 <?php | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             ?>
 | 
					
						
							|  |  |  |             <?php | 
					
						
							|  |  |  | // Alert messages
 | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |             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 { | 
					
						
							| 
									
										
										
										
											2017-04-26 00:46:36 -06:00
										 |  |  |                     $alertmsg = lang2(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false); | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 $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; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             ?>
 | 
					
						
							|  |  |  |             <div> | 
					
						
							|  |  |  |                 <?php | 
					
						
							|  |  |  |                 include_once __DIR__ . '/pages/' . $pageid . ".php"; | 
					
						
							|  |  |  |                 ?>
 | 
					
						
							|  |  |  |             </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> | 
					
						
							| 
									
										
										
										
											2017-05-04 00:14:08 -06:00
										 |  |  |         <?php | 
					
						
							|  |  |  |         // custom page scripts
 | 
					
						
							|  |  |  |         if (isset(PAGES[$pageid]['scripts'])) { | 
					
						
							|  |  |  |             foreach (PAGES[$pageid]['scripts'] as $script) { | 
					
						
							|  |  |  |                 echo "<script src=\"$script\"></script>\n";
 | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         ?>
 | 
					
						
							| 
									
										
										
										
											2017-04-24 17:13:08 -06:00
										 |  |  |     </body> | 
					
						
							|  |  |  | </html> |