index.php 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. <?php
  2. // Include functions if not already included
  3. require_once('functions.php');
  4. // Upgrade environment
  5. upgradeCheck();
  6. // Lazyload settings
  7. $databaseConfig = configLazy('config/config.php');
  8. //Set some variables
  9. ini_set("display_errors", 1);
  10. ini_set("error_reporting", E_ALL | E_STRICT);
  11. $data = false;
  12. $databaseLocation = "databaseLocation.ini.php";
  13. $needSetup = "Yes";
  14. $tabSetup = "Yes";
  15. $hasOptions = "No";
  16. $settingsicon = "No";
  17. $settingsActive = "";
  18. $action = "";
  19. $title = "Organizr";
  20. $topbar = "#333333";
  21. $topbartext = "#66D9EF";
  22. $bottombar = "#333333";
  23. $sidebar = "#393939";
  24. $hoverbg = "#AD80FD";
  25. $activetabBG = "#F92671";
  26. $activetabicon = "#FFFFFF";
  27. $activetabtext = "#FFFFFF";
  28. $inactiveicon = "#66D9EF";
  29. $inactivetext = "#66D9EF";
  30. $loading = "#66D9EF";
  31. $hovertext = "#000000";
  32. $loadingIcon = "images/organizr-load-w-thick.gif";
  33. $baseURL = "";
  34. // Get Action
  35. if(isset($_POST['action'])) {
  36. $action = $_POST['action'];
  37. unset($_POST['action']);
  38. }
  39. // Check for config file
  40. if(!file_exists('config/config.php')) {
  41. if($action == "createLocation") {
  42. if (isset($_POST['database_Location'])) {
  43. $_POST['database_Location'] = str_replace('//','/',$_POST['database_Location'].'/');
  44. if(substr($_POST['database_Location'], -1) != "/") : $_POST['database_Location'] = $_POST['database_Location'] . "/"; endif;
  45. $_POST['user_home'] = $_POST['database_Location'].'users/';
  46. }
  47. if (file_exists($_POST['database_Location'])) {
  48. updateConfig($_POST);
  49. } else {
  50. debug_out('Dir doesn\'t exist: '.$_POST['database_Location'],1); // Pretty Up
  51. }
  52. } else {
  53. $configReady = "No";
  54. $userpic = "";
  55. $showPic = "";
  56. }
  57. }
  58. if (file_exists('config/config.php')) {
  59. $configReady = "Yes";
  60. require_once("user.php");
  61. $USER = new User("registration_callback");
  62. $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  63. $database = new PDO("sqlite:" . $dbfile);
  64. $query = "SELECT * FROM users";
  65. foreach($database->query($query) as $data) {
  66. $needSetup = "No";
  67. }
  68. $db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  69. $file_db = new PDO("sqlite:" . $db);
  70. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  71. $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
  72. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  73. foreach($dbTab as $row) :
  74. if (in_array("tabs", $row)) :
  75. $tabSetup = "No";
  76. endif;
  77. endforeach;
  78. if($tabSetup == "Yes") :
  79. $settingsActive = "active";
  80. endif;
  81. foreach($dbOptions as $row) :
  82. if (in_array("options", $row)) :
  83. $hasOptions = "Yes";
  84. endif;
  85. endforeach;
  86. if($tabSetup == "No") :
  87. if($USER->authenticated && $USER->role == "admin") :
  88. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc');
  89. $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc');
  90. foreach($getsettings as $row) :
  91. if(!empty($row['iconurl']) && $settingsicon == "No") :
  92. $settingsicon = "Yes";
  93. endif;
  94. endforeach;
  95. elseif($USER->authenticated && $USER->role == "user") :
  96. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true" ORDER BY `order` asc');
  97. else :
  98. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true" ORDER BY `order` asc');
  99. endif;
  100. endif;
  101. if($hasOptions == "Yes") :
  102. $resulto = $file_db->query('SELECT * FROM options');
  103. foreach($resulto as $row) :
  104. $title = isset($row['title']) ? $row['title'] : "Organizr";
  105. $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF";
  106. $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333";
  107. $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333";
  108. $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939";
  109. $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD";
  110. $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671";
  111. $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF";
  112. $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF";
  113. $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF";
  114. $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF";
  115. $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF";
  116. $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000";
  117. endforeach;
  118. endif;
  119. $userpic = md5( strtolower( trim( $USER->email ) ) );
  120. if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
  121. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  122. if($USER->authenticated) :
  123. if(GRAVATAR == "true") :
  124. $showPic = "<img src='https://www.gravatar.com/avatar/$userpic?s=$userSize' class='img-circle'>";
  125. else:
  126. $showPic = "<i class=\"mdi mdi-account-box-outline\"></i>";
  127. endif;
  128. else :
  129. $showPic = "<login class='login-btn text-uppercase'>" . $language->translate("LOGIN") . "</login>";
  130. endif;
  131. }
  132. if(!defined('SLIMBAR')) : define('SLIMBAR', 'true'); endif;
  133. if(!defined('AUTOHIDE')) : define('AUTOHIDE', 'false'); endif;
  134. if(!defined('ENABLEMAIL')) : define('ENABLEMAIL', 'false'); endif;
  135. if(!defined('CUSTOMCSS')) : define('CUSTOMCSS', 'false'); endif;
  136. if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
  137. if(!isset($notifyExplode)) :
  138. $notifyExplode = array("bar","slidetop");
  139. endif;
  140. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  141. if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon = "settings2.png"; else: $iconRotate = "true"; $settingsIcon = "settings.png"; endif;
  142. ?>
  143. <!--
  144. ___ ___ ___ ___ ___ ___ ___ ___
  145. /\ \ /\ \ /\ \ /\ \ /\__\ /\ \ /\ \ /\ \
  146. /::\ \ /::\ \ /::\ \ /::\ \ /:| _|_ _\:\ \ _\:\ \ /::\ \
  147. /:/\:\__\ /::\:\__\ /:/\:\__\ /::\:\__\ /::|/\__\ /\/::\__\ /::::\__\ /::\:\__\
  148. \:\/:/ / \;:::/ / \:\:\/__/ \/\::/ / \/|::/ / \::/\/__/ \::;;/__/ \;:::/ /
  149. \::/ / |:\/__/ \::/ / /:/ / |:/ / \:\__\ \:\__\ |:\/__/
  150. \/__/ \|__| \/__/ \/__/ \/__/ \/__/ \/__/ \|__|
  151. [Organizr Version: <?php echo INSTALLEDVERSION; ?> - By: CauseFX]
  152. -->
  153. <!DOCTYPE html>
  154. <html lang="<?php echo $language->getLang(); ?>" class="no-js">
  155. <head>
  156. <meta charset="UTF-8">
  157. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  158. <meta name="apple-mobile-web-app-capable" content="yes" />
  159. <meta name="mobile-web-app-capable" content="yes" /
  160. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  161. <meta name="msapplication-tap-highlight" content="no" />
  162. <title><?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?></title>
  163. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  164. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/font-awesome/css/font-awesome.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  165. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  166. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  167. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/Waves/dist/waves.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  168. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css?v=<?php echo INSTALLEDVERSION; ?>">
  169. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-select.css?v=<?php echo INSTALLEDVERSION; ?>">
  170. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-skin-elastic.css?v=<?php echo INSTALLEDVERSION; ?>">
  171. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
  172. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.css?v=<?php echo INSTALLEDVERSION; ?>">
  173. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/smoke/dist/css/smoke.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  174. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-growl.css?v=<?php echo INSTALLEDVERSION; ?>">
  175. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-other.css?v=<?php echo INSTALLEDVERSION; ?>">
  176. <script src="<?=$baseURL;?>js/menu/modernizr.custom.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  177. <script type="text/javascript" src="<?=$baseURL;?>js/sha1.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  178. <script type="text/javascript" src="<?=$baseURL;?>js/user.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  179. <link rel="stylesheet" href="<?=$baseURL;?>css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  180. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  181. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/android-chrome-192x192.png" sizes="192x192">
  182. <link rel="apple-touch-icon" sizes="180x180" href="<?=$baseURL;?>images/favicon/apple-touch-icon.png">
  183. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-32x32.png" sizes="32x32">
  184. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-16x16.png" sizes="16x16">
  185. <link rel="manifest" href="<?=$baseURL;?>images/favicon/manifest.json">
  186. <link rel="mask-icon" href="<?=$baseURL;?>images/favicon/safari-pinned-tab.svg" color="#2d89ef">
  187. <link rel="shortcut icon" href="<?=$baseURL;?>images/favicon/favicon.ico">
  188. <meta name="msapplication-config" content="<?=$baseURL;?>images/favicon/browserconfig.xml">
  189. <meta name="theme-color" content="#2d89ef">
  190. <link rel="stylesheet" type="text/css" href="css/addtohomescreen.css">
  191. <script src="js/addtohomescreen.js"></script>
  192. <script src="js/push.js"></script>
  193. <!--Other-->
  194. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  195. <!--[if lt IE 9]>
  196. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  197. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  198. <![endif]-->
  199. </head>
  200. <style>
  201. .TabOpened {
  202. -webkit-filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  203. filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  204. }.bottom-bnts a {
  205. background: <?=$bottombar;?> !important;
  206. color: <?=$topbartext;?> !important;
  207. }.bottom-bnts {
  208. background-color: <?=$bottombar;?> !important;
  209. }.gn-menu-main {
  210. background-color: <?=$topbar;?>;
  211. }.gn-menu-main ul.gn-menu {
  212. background: <?=$sidebar;?>;
  213. }.gn-menu-wrapper {
  214. background: <?=$sidebar;?>;
  215. }.gn-menu i {
  216. height: 18px;
  217. width: 52px;
  218. }.la-timer.la-dark {
  219. color: <?=$topbartext;?>
  220. }.refresh-preloader {
  221. background: <?=$loading;?>;
  222. }.la-timer {
  223. width: 75px;
  224. height: 75px;
  225. padding-top: 20px;
  226. border-radius: 100px;
  227. background: <?=$sidebar;?>;
  228. border: 2px solid <?=$topbar;?>;
  229. }@media screen and (min-width:737px){
  230. .tab-item:hover a {
  231. color: <?=$hovertext;?> !important;
  232. background: <?=$hoverbg;?>;
  233. border-radius: 100px 0 0 100px;
  234. }
  235. }.gn-menu li.active > a {
  236. color: <?=$activetabtext;?> !important;
  237. background: <?=$activetabBG;?>;
  238. border-radius: 100px 0 0 100px;
  239. }.gn-menu li.rightActive > a {
  240. background: <?=$hoverbg;?>;
  241. border-radius: 100px 0 0 100px;
  242. }.active {
  243. display: block;
  244. }.hidden {
  245. display: none;
  246. }.errorz {
  247. background-image: linear-gradient(red, red), linear-gradient(#d2d2d2, #d2d2d2);
  248. outline: none;
  249. animation: input-highlight .5s forwards;
  250. box-shadow: none;
  251. padding-left: 0;
  252. border: 0;
  253. border-radius: 0;
  254. background-size: 0 2px,100% 1px;
  255. background-repeat: no-repeat;
  256. background-position: center bottom,center calc(100% - 1px);
  257. background-color: transparent;
  258. box-shadow: none;
  259. }.gn-menu li.active i.fa {
  260. color: <?=$activetabicon;?>;
  261. }.gn-menu li i.fa {
  262. color: <?=$inactiveicon;?>;
  263. }.gn-menu-main ul.gn-menu a {
  264. color: <?=$inactivetext;?>;
  265. }li.dropdown.some-btn .mdi {
  266. color: <?=$topbartext;?>;
  267. }li.dropdown.some-btn .mdi:hover {
  268. color: <?=$hoverbg;?>;
  269. }.nav>li>a:focus, .nav>li>a:hover {
  270. text-decoration: none;
  271. background-color: transparent;
  272. }div#preloader {
  273. background-color: <?=$loading;?>;
  274. }.iframe {
  275. -webkit-overflow-scrolling: touch;
  276. }.main-wrapper{
  277. position: absolute !important;
  278. }#menu-toggle span {
  279. background: <?=$topbartext;?>;
  280. }logo.logo {
  281. opacity: 0.5;
  282. filter: alpha(opacity=50);
  283. }.mini-nav .split {
  284. width: calc(50% - 25px);
  285. }.splitRight {
  286. width: 50%;
  287. margin-left: 50% !important;
  288. position: absolute !important;
  289. }.split {
  290. width: 50%;
  291. position: absolute !important;
  292. }.mini-nav .splitRight {
  293. margin-left: calc(50% + 25px) !important;
  294. width: calc(50% - 25px);
  295. }.form-control.material {
  296. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  297. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  298. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  299. }img.titlelogoclass {
  300. max-width: 250px;
  301. max-height: <?=$slimBar;?>px;
  302. }@media only screen and (max-width: 450px) {
  303. img.titlelogoclass {
  304. max-width: 150px;
  305. }
  306. }.login-btn {
  307. -webkit-border-radius: 4;
  308. -moz-border-radius: 4;
  309. border-radius: 4px;
  310. -webkit-box-shadow: 0px 1px 3px #666666;
  311. -moz-box-shadow: 0px 1px 3px #666666;
  312. box-shadow: 0px 1px 3px #666666;
  313. font-family: Arial;
  314. color: <?=$topbar;?>;
  315. font-size: 10px;
  316. vertical-align: top;
  317. background: <?=$topbartext;?>;
  318. padding: 5px 10px 5px 10px;
  319. text-decoration: none;
  320. font-weight: 700;
  321. font-style: normal;
  322. }.login-btn:hover {
  323. background: <?=$hoverbg;?>;
  324. color: <?=$hovertext;?>;
  325. text-decoration: none;
  326. font-weight: 700;
  327. }
  328. <?php if(SLIMBAR == "true") : ?>
  329. /* Slim Styling */
  330. body{
  331. padding-top: 30px !important;
  332. }.gn-menu-main {
  333. height: 30px !important;
  334. }.gn-menu-wrapper {
  335. top: 30px !important;
  336. }.gn-menu-main .navbar-right {
  337. line-height: 30px !important;
  338. }img.img-circle {
  339. vertical-align: inherit;
  340. margin-top: 2px;
  341. }.menu-toggle .hamburger {
  342. top: 0px !important;
  343. }.top-clock {
  344. line-height: 30px !important;
  345. }img.titlelogoclass {
  346. vertical-align: inherit;
  347. }.members-sidebar {
  348. top: 30px !important;
  349. }.menu-toggle .cross span:nth-child(2) {
  350. left: -9px;
  351. top: 41px;
  352. }.menu-toggle.gn-selected .cross span:nth-child(2) {
  353. width: 53%;
  354. }.menu-toggle.gn-selected .cross span:nth-child(1) {
  355. height: 105% !important;
  356. }.menu-toggle .cross span:nth-child(1) {
  357. left: 6px !important;
  358. top: 26px !important;
  359. }.menu-toggle .hamburger span {
  360. margin: 5px 0;
  361. width: 25px;
  362. }.menu-toggle .hamburger {
  363. margin-left: -17px;
  364. }.ns-effect-slidetop {
  365. padding: 6px 22px;
  366. }.ns-effect-exploader {
  367. padding: 5px 22px;
  368. }
  369. <?php endif; ?>
  370. <?php if(CUSTOMCSS == "true") :
  371. $template_file = "custom.css";
  372. $file_handle = fopen($template_file, "rb");
  373. echo fread($file_handle, filesize($template_file));
  374. fclose($file_handle);
  375. echo "\n";
  376. endif; ?>
  377. </style>
  378. <body style="overflow: hidden">
  379. <?php if (LOADINGSCREEN == "true") : ?>
  380. <!--Preloader-->
  381. <div id="preloader" class="preloader table-wrapper">
  382. <div class="table-row">
  383. <div class="table-cell">
  384. <div class="la-ball-scale-multiple la-3x" style="color: <?=$topbar;?>">
  385. <?php if (pathinfo($loadingIcon, PATHINFO_EXTENSION) !== "gif" ) :
  386. echo "<div></div><div></div><div></div>";
  387. endif; ?>
  388. <logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. <?php endif; ?>
  394. <div id="main-wrapper" class="main-wrapper" tabindex="-1">
  395. <ul id="gn-menu" class="gn-menu-main">
  396. <li class="gn-trigger">
  397. <a id="menu-toggle" class="menu-toggle gn-icon gn-icon-menu">
  398. <div class="hamburger">
  399. <span></span>
  400. <span></span>
  401. <span></span>
  402. </div>
  403. <div class="cross">
  404. <span></span>
  405. <span></span>
  406. </div>
  407. </a>
  408. <nav class="gn-menu-wrapper">
  409. <div class="gn-scroller" id="gn-scroller">
  410. <ul id="tabList" class="gn-menu metismenu">
  411. <!--Start Tab List-->
  412. <?php if($tabSetup == "No") : $tabCount = 1; foreach($result as $row) :
  413. if($row['defaultz'] == "true") : $defaultz = "active"; else : $defaultz = ""; endif; ?>
  414. <li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
  415. <a class="tab-link">
  416. <?php if($row['iconurl']) : ?>
  417. <i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  418. <span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
  419. <img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
  420. </i>
  421. <?php else : ?>
  422. <i class="fa <?=$row['icon'];?> fa-lg"><span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span></i>
  423. <?php endif; ?>
  424. <?=$row['name'];?>
  425. </a>
  426. </li>
  427. <?php $tabCount++; endforeach; endif;?>
  428. <?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
  429. <li class="tab-item <?=$settingsActive;?>" id="settings.phpx" data-title="Settings" name="settings">
  430. <a class="tab-link">
  431. <?php if($settingsicon == "Yes") :
  432. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  433. <img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
  434. else :
  435. echo '<i id="settings-icon" class="fa fa-cog"></i>';
  436. endif; ?>
  437. <?php echo $language->translate("SETTINGS");?>
  438. </a>
  439. </li>
  440. <li style="display: none;" class="tab-item" id="updatedb.phpx" data-title="Upgrade" name="upgrade">
  441. <a class="tab-link">
  442. <?php if($settingsicon == "Yes") :
  443. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  444. <img id="upgrade-icon" src="images/upgrade.png" style="height: 30px; margin-top: -2px;"></i>';
  445. else :
  446. echo '<i id="upgrade-icon" class="fa fa-arrow-up"></i>';
  447. endif; ?>
  448. <?php echo $language->translate("UPGRADE");?>
  449. </a>
  450. </li>
  451. <?php endif; endif;?>
  452. <!--End Tab List-->
  453. </ul>
  454. </div>
  455. <!-- /gn-scroller -->
  456. <div class="bottom-bnts">
  457. <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
  458. </div>
  459. </nav>
  460. </li>
  461. <li class="top-clock">
  462. <?php
  463. if($configReady == "Yes") :
  464. if(TITLELOGO == "") :
  465. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  466. else :
  467. echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
  468. endif;
  469. else :
  470. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  471. endif;
  472. ?>
  473. </li>
  474. <li class="pull-right">
  475. <ul class="nav navbar-right right-menu">
  476. <li class="dropdown some-btn">
  477. <?php if($configReady == "Yes") : if(!$USER->authenticated) : ?>
  478. <a class="log-in">
  479. <?php endif; endif;?>
  480. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  481. <a class="show-members">
  482. <?php endif; endif;?>
  483. <i class="userpic"><?=$showPic;?></i>
  484. </a>
  485. </li>
  486. <li class="dropdown some-btn">
  487. <a class="fullscreen">
  488. <i class="mdi mdi-fullscreen"></i>
  489. </a>
  490. </li>
  491. <li class="dropdown some-btn">
  492. <a id="reload" class="refresh">
  493. <i class="mdi mdi-refresh"></i>
  494. </a>
  495. </li>
  496. <li class="dropdown some-btn">
  497. <a id="popout" class="popout">
  498. <i class="mdi mdi-window-restore"></i>
  499. </a>
  500. </li>
  501. <li style="display: none" id="splitView" class="dropdown some-btn">
  502. <a class="spltView">
  503. <i class="mdi mdi-window-close"></i>
  504. </a>
  505. </li>
  506. </ul>
  507. </li>
  508. </ul>
  509. <!--Content-->
  510. <div id="content" class="content" style="">
  511. <script>addToHomescreen();</script>
  512. <!--Load Framed Content-->
  513. <?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
  514. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  515. <div class="table-row">
  516. <div class="table-cell text-center">
  517. <div class="login i-block">
  518. <div class="content-box">
  519. <div class="biggest-box" style="background:<?=$topbar;?>;">
  520. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>
  521. </div>
  522. <div class="big-box text-left registration-form">
  523. <h4 class="text-center"><?php echo $language->translate("CREATE_ACCOUNT");?></h4>
  524. <form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  525. <input type="hidden" name="op" value="register"/>
  526. <input type="hidden" name="sha1" value=""/>
  527. <input type="hidden" name="settings" value="false"/>
  528. <div class="form-group">
  529. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  530. </div>
  531. <div class="form-group">
  532. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  533. </div>
  534. <div class="form-group">
  535. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  536. </div>
  537. <div class="form-group">
  538. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  539. </div>
  540. <button id="registerSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block text-uppercase waves waves-effect waves-float" value="Register"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("REGISTER");?></text></button>
  541. </form>
  542. </div>
  543. </div>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. <?php endif; ?>
  549. <?php if($needSetup == "Yes" && $configReady == "No") : ?>
  550. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  551. <div class="table-row">
  552. <div class="table-cell text-center">
  553. <div class="login i-block">
  554. <div class="content-box">
  555. <div class="biggest-box" style="background:<?=$topbar;?>;">
  556. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>
  557. </div>
  558. <div class="big-box text-left">
  559. <h3 class="text-center"><?php echo $language->translate("SPECIFY_LOCATION");?></h3>
  560. <h5 class="text-left"><strong><?php echo $language->translate("CURRENT_DIRECTORY");?>: <?php echo __DIR__; ?> <br><?php echo $language->translate("PARENT_DIRECTORY");?>: <?php echo dirname(__DIR__); ?></strong></h5>
  561. <form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  562. <input type="hidden" name="action" value="createLocation" />
  563. <div class="form-group">
  564. <input type="text" class="form-control material" name="database_Location" autofocus value="<?php echo dirname(__DIR__);?>" autocorrect="off" autocapitalize="off" required>
  565. <h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
  566. <?php echo getTimezone();?>
  567. <h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
  568. <?php
  569. if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) :
  570. echo '<h5 class="text-center red">';
  571. echo $language->translate("DONT_WORRY");
  572. echo '</h5>';
  573. endif;?>
  574. </div>
  575. <button style="background:<?=$topbar;?>;" id="databaseLocationSubmit" type="submit" class="btn btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SAVE_LOCATION");?></text></button>
  576. </form>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. <?php endif; ?>
  584. <?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
  585. <div class="table-wrapper">
  586. <div class="table-row">
  587. <div class="table-cell text-center">
  588. <div class="login i-block">
  589. <div class="content-box">
  590. <div class="blue-bg biggest-box">
  591. <h1 class="zero-m text-uppercase"><?php echo $language->translate("AWESOME");?></h1>
  592. </div>
  593. <div class="big-box text-left">
  594. <h4 class="text-center"><?php echo $language->translate("TIME_TO_LOGIN");?></h4>
  595. <button type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("LOGIN");?></button>
  596. </div>
  597. </div>
  598. </div>
  599. </div>
  600. </div>
  601. </div>
  602. <?php endif; endif; ?>
  603. <?php if($tabSetup == "No" && $needSetup == "No") :?>
  604. <div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
  605. <div class="table-row">
  606. <div class="table-cell text-center">
  607. <div class="login i-block">
  608. <div class="content-box">
  609. <div class="biggest-box" style="background:<?=$topbar;?>;">
  610. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("HOLD_UP");?></h1>
  611. </div>
  612. <div class="big-box text-left">
  613. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  614. <h2 class="text-center"><?php echo $language->translate("LOOKS_LIKE_YOU_DONT_HAVE_ACCESS");?></h2>
  615. <?php if(!$USER->authenticated) : ?>
  616. <button style="background:<?=$topbar;?>;" type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
  617. <?php endif; ?>
  618. </div>
  619. </div>
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. <?php endif;?>
  625. <!--End Load Framed Content-->
  626. </div>
  627. <div id="contentRight" class="content splitRight" style="">
  628. </div>
  629. <!--End Content-->
  630. <!--Welcome notification-->
  631. <div id="welcome"></div>
  632. <div id="members-sidebar" style="background: <?=$sidebar;?>;" class="members-sidebar fade in">
  633. <h4 class="pull-left zero-m"><?php echo $language->translate("OPTIONS");?></h4>
  634. <span class="close-members-sidebar"><i class="fa fa-remove fa-lg pull-right"></i></span>
  635. <div class="clearfix"><br/></div>
  636. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  637. <br>
  638. <div class="content-box profile-sidebar box-shadow">
  639. <?php if(GRAVATAR == "true") : ?>
  640. <img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=100&d=mm" class="img-responsive img-circle center-block" alt="user">
  641. <?php endif; ?>
  642. <div class="profile-usertitle">
  643. <div class="profile-usertitle-name">
  644. <?php echo strtoupper($USER->username); ?>
  645. </div>
  646. <div class="profile-usertitle-job">
  647. <?php echo strtoupper($USER->role); ?>
  648. </div>
  649. </div>
  650. <div id="buttonsDiv" class="profile-userbuttons">
  651. <button id="editInfo" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("EDIT_INFO");?></button>
  652. <button type="button" class="logout btn btn-warning waves waves-effect waves-float"><?php echo $language->translate("LOGOUT");?></button>
  653. </div>
  654. <div id="editInfoDiv" style="display: none" class="profile-usertitle">
  655. <form class="content-form form-inline" name="update" id="update" action="" method="POST">
  656. <input type="hidden" name="op" value="update"/>
  657. <input type="hidden" name="sha1" value=""/>
  658. <input type="hidden" name="password" value="">
  659. <input type="hidden" name="username" value="<?php echo $USER->username; ?>"/>
  660. <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
  661. <div class="form-group">
  662. <input autocomplete="off" type="text" value="<?php echo $USER->email; ?>" class="form-control" name="email" placeholder="<?php echo $language->translate("EMAIL_ADDRESS");?>">
  663. </div>
  664. <div class="form-group">
  665. <input autocomplete="off" type="password" class="form-control" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  666. </div>
  667. <div class="form-group">
  668. <input autocomplete="off" type="password" class="form-control" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  669. </div>
  670. <br>
  671. <div class="form-group">
  672. <input type="button" class="btn btn-success text-uppercase waves-effect waves-float" value="<?php echo $language->translate("UPDATE");?>" onclick="User.processUpdate()"/>
  673. <button id="goBackButtons" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("GO_BACK");?></button>
  674. </div>
  675. </form>
  676. </div>
  677. </div>
  678. <?php endif; endif;?>
  679. </div>
  680. </div>
  681. <?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
  682. <div class="login-modal modal fade">
  683. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  684. <div class="table-row">
  685. <div class="table-cell text-center">
  686. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  687. <span aria-hidden="true">&times;</span>
  688. </button>
  689. <div class="login i-block">
  690. <div class="content-box">
  691. <div style="background:<?=$topbar;?>;" class="biggest-box">
  692. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  693. </div>
  694. <div class="big-box text-left login-form">
  695. <?php if($USER->error!="") : ?>
  696. <p class="error">Error: <?php echo $USER->error; ?></p>
  697. <?php endif; ?>
  698. <form name="log in" id="login" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  699. <h4 class="text-center"><?php echo $language->translate("LOGIN");?></h4>
  700. <div class="form-group">
  701. <input type="hidden" name="op" value="login">
  702. <input type="hidden" name="sha1" value="">
  703. <input type="hidden" name="password" value="">
  704. <input type="hidden" name="rememberMe" value="false"/>
  705. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="" autofocus required>
  706. </div>
  707. <div class="form-group">
  708. <input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
  709. </div>
  710. <div class="form-group">
  711. <div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
  712. <label for="rememberMe" class="pull-left"></label>
  713. <label class="pull-right"> &nbsp; <?php echo $language->translate("REMEMBER_ME");?></label>
  714. </div>
  715. </div>
  716. <button id="loginSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
  717. </form>
  718. <?php if (ENABLEMAIL == "true") : ?>
  719. <button id="switchForgot" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("FORGOT_PASSWORD");?></text></button>
  720. <?php endif; ?>
  721. <?php if(REGISTERPASSWORD != "") : ?>
  722. <button id="switchCreateUser" style="background:<?=$hoverbg;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$hovertext;?>;"><?php echo $language->translate("CREATE_USER");?></text></button>
  723. <?php endif; ?>
  724. <form style="display: none;" name="forgotPassword" id="forgotPassword" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  725. <h4 class="text-center"><?php echo $language->translate("FORGOT_PASSWORD");?></h4>
  726. <div class="form-group">
  727. <input type="hidden" name="op" value="reset">
  728. <input type="text" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  729. </div>
  730. <button style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("RESET_PASSWORD");?></text></button>
  731. </form>
  732. <button id="welcomeGoBack" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  733. <?php if(REGISTERPASSWORD != "") : ?>
  734. <div id="userPassForm" style="display: none;">
  735. <form id="userCreateForm" action="register.php" method="POST">
  736. <h4 class="text-center"><?php echo $language->translate("ENTER_PASSWORD_TO_REGISTER");?></h4>
  737. <center><h5 id="userCreateErrors" style="color: red"></h5></center>
  738. <div class="form-group">
  739. <input type="text" class="form-control material" name="registerPasswordValue" placeholder="<?php echo $language->translate("PASSWORD");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  740. </div>
  741. <button style="background:<?=$topbar;?>;" type="submit" id="checkRegisterPass" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT");?></text></button>
  742. </form>
  743. <button id="welcomeGoBack2" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  744. </div>
  745. <form style="display: none;" name="createUser" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  746. <h4 class="text-center"><?php echo $language->translate("CREATE_USER");?></h4>
  747. <input type="hidden" name="op" value="register"/>
  748. <input type="hidden" name="sha1" value=""/>
  749. <input type="hidden" name="settings" value="false"/>
  750. <div class="form-group">
  751. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  752. </div>
  753. <div class="form-group">
  754. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  755. </div>
  756. <div class="form-group">
  757. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  758. </div>
  759. <div class="form-group">
  760. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  761. </div>
  762. <button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
  763. <button id="welcomeGoBack3" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  764. </form>
  765. <?php endif; ?>
  766. </div>
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. </div>
  772. </div>
  773. <?php endif; endif;?>
  774. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  775. <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
  776. <div class="table-wrapper" style="background: <?=$sidebar;?>">
  777. <div class="table-row">
  778. <div class="table-cell text-center">
  779. <div class="login i-block">
  780. <div class="content-box">
  781. <div style="background:<?=$topbar;?>;" class="biggest-box">
  782. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
  783. </div>
  784. <div class="big-box login-form">
  785. <form name="log out" id="logout" action="" method="POST">
  786. <input type="hidden" name="op" value="logout">
  787. <input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
  788. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  789. <h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
  790. <a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
  791. <a style="color:<?=$topbar;?>;" class="i-block" data-dismiss="modal"><?php echo $language->translate("NO_WORD");?></a>
  792. </form>
  793. </div>
  794. </div>
  795. </div>
  796. </div>
  797. </div>
  798. </div>
  799. </div>
  800. <?php endif; endif;?>
  801. <!--Scripts-->
  802. <script src="<?=$baseURL;?>bower_components/jquery/dist/jquery.min.js"></script>
  803. <script src="<?=$baseURL;?>bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  804. <script src="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.js"></script>
  805. <script src="<?=$baseURL;?>bower_components/Waves/dist/waves.min.js"></script>
  806. <script src="<?=$baseURL;?>bower_components/moment/min/moment.min.js"></script>
  807. <script src="<?=$baseURL;?>bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  808. <script src="<?=$baseURL;?>bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  809. <script src="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  810. <script src="<?=$baseURL;?>bower_components/cta/dist/cta.min.js"></script>
  811. <!--Menu-->
  812. <script src="<?=$baseURL;?>js/menu/classie.js"></script>
  813. <script src="<?=$baseURL;?>js/menu/gnmenu.js"></script>
  814. <!--Selects-->
  815. <script src="<?=$baseURL;?>js/selects/selectFx.js"></script>
  816. <script src="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.min.js"></script>
  817. <script src="<?=$baseURL;?>bower_components/smoke/dist/js/smoke.min.js"></script>
  818. <!--Notification-->
  819. <script src="<?=$baseURL;?>js/notifications/notificationFx.js"></script>
  820. <!--Custom Scripts-->
  821. <script src="<?=$baseURL;?>js/common.js"></script>
  822. <script src="<?=$baseURL;?>js/mousetrap.min.js"></script>
  823. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  824. <script>
  825. var fixed = document.getElementById('gn-scroller');
  826. fixed.addEventListener('touchmove', function(e) {
  827. e.preventDefault();
  828. }, false);
  829. function setHeight() {
  830. windowHeight = $(window).innerHeight();
  831. $("div").find(".iframe").css('height', windowHeight - <?=$slimBar;?> + "px");
  832. $('#content').css('height', windowHeight - <?=$slimBar;?> + "px");
  833. };
  834. function notify(notifyString, notifyIcon, notifyType, notifyLength, notifyLayout, notifyEffect) {
  835. var notifyString = notifyString;
  836. var notifyIcon = notifyIcon;
  837. var notifyType = notifyType;
  838. var notifyLength = notifyLength;
  839. var notifyLayout = notifyLayout;
  840. var notifyEffect = notifyEffect;
  841. if (notifyEffect === "slidetop"){
  842. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x"></span>' + '<p>' + notifyString + '</p>';
  843. }else if (notifyEffect === "exploader"){
  844. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x pull-left"></span>' + '<p>' + notifyString + '</p>';
  845. }else if (notifyEffect === "thumbslider"){
  846. var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';
  847. }else{
  848. var addMeesage = '<p>' + notifyString + '</p>';
  849. }
  850. setTimeout(function () {
  851. var notification = new NotificationFx({
  852. message: addMeesage,
  853. layout: notifyLayout,
  854. effect: notifyEffect,
  855. ttl: notifyLength,
  856. type: notifyType,
  857. onClose: function () {
  858. $(".ns-box.ns-effect-thumbslider").fadeOut(400);
  859. }
  860. });
  861. notification.show();
  862. }, 500);
  863. }
  864. $('#loginSubmit').click(function() {
  865. if ($('#login').smkValidate()) {
  866. console.log("validated");
  867. }
  868. console.log("didnt validate");
  869. });
  870. $('#registerSubmit').click(function() {
  871. if ($('#registration').smkValidate()) {
  872. console.log("validated");
  873. }
  874. console.log("didnt validate");
  875. User.processRegistration();
  876. });
  877. $("#editInfo").click(function(){
  878. $( "div[id^='editInfoDiv']" ).toggle();
  879. $( "div[id^='buttonsDiv']" ).toggle();
  880. });
  881. $("#goBackButtons").click(function(){
  882. $( "div[id^='editInfoDiv']" ).toggle();
  883. $( "div[id^='buttonsDiv']" ).toggle();
  884. });
  885. $("#welcomeGoBack").click(function(){
  886. $( "form[id^='login']" ).toggle();
  887. $( "form[id^='forgotPassword']" ).toggle();
  888. $("#switchForgot").toggle();
  889. $("#switchCreateUser").toggle();
  890. $("#welcomeGoBack").toggle();
  891. });
  892. $("#welcomeGoBack2").click(function(){
  893. $( "form[id^='login']" ).toggle();
  894. $("#userPassForm").toggle();
  895. $("#switchForgot").toggle();
  896. $("#switchCreateUser").toggle();
  897. $("#welcomeGoBack2").toggle();
  898. });
  899. $("#welcomeGoBack3").click(function(){
  900. $("#registration").toggle();
  901. $("#welcomeGoBack3").toggle();
  902. $( "form[id^='login']" ).toggle();
  903. $("#switchForgot").toggle();
  904. $("#switchCreateUser").toggle();
  905. });
  906. $("#switchForgot").click(function(){
  907. $( "form[id^='login']" ).toggle();
  908. $( "form[id^='forgotPassword']" ).toggle();
  909. $("#switchForgot").toggle();
  910. $("#switchCreateUser").toggle();
  911. $("#welcomeGoBack").toggle();
  912. });
  913. $("#switchCreateUser").click(function(){
  914. $( "form[id^='login']" ).toggle();
  915. $("#userPassForm").toggle();
  916. $("#switchForgot").toggle();
  917. $("#switchCreateUser").toggle();
  918. $("#welcomeGoBack2").toggle();
  919. });
  920. //Sign in
  921. $(".log-in").click(function(e){
  922. var e1 = document.querySelector(".log-in"),
  923. e2 = document.querySelector(".login-modal");
  924. cta(e1, e2, {relativeToWindow: true}, function () {
  925. $('.login-modal').modal("show");
  926. });
  927. e.preventDefault();
  928. });
  929. //Logout
  930. $(".logout").click(function(e){
  931. var el1 = document.querySelector(".logout"),
  932. el2 = document.querySelector(".logout-modal");
  933. cta(el1, el2, {relativeToWindow: true}, function () {
  934. $('.logout-modal').modal("show");
  935. });
  936. e.preventDefault();
  937. });
  938. //Members Sidebar
  939. $(".show-members").click(function(e){
  940. var e_s1 = document.querySelector(".show-members"),
  941. e_s2 = document.querySelector("#members-sidebar");
  942. cta(e_s1, e_s2, {relativeToWindow: true}, function () {
  943. $('#members-sidebar').addClass('members-sidebar-open');
  944. });
  945. e.preventDefault();
  946. });
  947. $('.close-members-sidebar').click(function(){
  948. $('#members-sidebar').removeClass('members-sidebar-open');
  949. });
  950. $(document).ready(function(){
  951. $('#userCreateForm').submit(function(event) {
  952. var formData = {
  953. 'registerPasswordValue' : $('input[name=registerPasswordValue]').val()
  954. };
  955. $.ajax({
  956. type : 'POST',
  957. url : 'register.php',
  958. data : formData,
  959. dataType : 'json',
  960. encode : true
  961. })
  962. .done(function(data) {
  963. console.log(data);
  964. if ( ! data.success) {
  965. $('#userCreateErrors').html('Wrong Password!'); // add the actual error message under our input
  966. } else {
  967. $("#userPassForm").toggle();
  968. $("#registration").toggle();
  969. $("#welcomeGoBack3").toggle();
  970. }
  971. });
  972. event.preventDefault();
  973. });
  974. defaultTab = $("li[class^='tab-item active']").attr("id");
  975. $("li[class^='tab-item active']").first().find("img").addClass("TabOpened");
  976. if (defaultTab){
  977. defaultTab = defaultTab.substr(0, defaultTab.length-1);
  978. }else{
  979. defaultTabNone = $("li[class^='tab-item']").attr("id");
  980. if (defaultTabNone){
  981. $("li[class^='tab-item']").first().attr("class", "tab-item active");
  982. $("li[class^='tab-item']").first().find("img").addClass("TabOpened");
  983. defaultTab = defaultTabNone.substr(0, defaultTabNone.length-1);
  984. }
  985. }
  986. if (defaultTab){
  987. $("#content").html('<div class="iframe active" data-content-url="'+defaultTab+'"><iframe scrolling="auto" sandbox="allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+defaultTab+'"></iframe></div>');
  988. document.getElementById('main-wrapper').focus();
  989. }
  990. if (defaultTab == null){
  991. $("div[id^='tabEmpty']").show();
  992. <?php if($needSetup == "No" && $configReady == "Yes") : if(!$USER->authenticated) : ?>
  993. $('.login-modal').modal("show");
  994. <?php endif; endif; ?>
  995. }
  996. if ($(location).attr('hash')){
  997. var getHash = $(location).attr('hash').substr(1).replace("%20", " ").replace("_", " ");
  998. var gotHash = getHash.toLowerCase();
  999. var getLiTab = $("li[name^='" + gotHash + "']");
  1000. if(gotHash === "upgrade"){ getLiTab.toggle(); console.log("got it"); }
  1001. getLiTab.trigger("click");
  1002. }
  1003. setHeight();
  1004. });
  1005. <?php if(!empty($USER->info_log)) : ?>
  1006. notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1007. <?php endif; ?>
  1008. <?php if(!empty($USER->error_log)) : ?>
  1009. notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1010. <?php endif; ?>
  1011. $("li[class^='tab-item']").dblclick(function(){
  1012. var thisidfull = $(this).attr("id");
  1013. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1014. var thisframe = $("#content div[data-content-url^='"+thisid+"']").children('iframe');
  1015. $(thisframe).attr('src', $(thisframe).attr('src'));
  1016. var refreshBox = $('#content').find('.active');
  1017. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1018. setTimeout(function(){
  1019. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1020. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1021. refreshPreloader.remove();
  1022. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1023. });
  1024. },800);
  1025. });
  1026. $('#reload').on('click tap', function(){
  1027. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1028. var activeFrame = $('#content').find('.active').children('iframe');
  1029. activeFrame.attr('src', activeFrame.attr('src'));
  1030. var refreshBox = $('#content').find('.active');
  1031. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1032. setTimeout(function(){
  1033. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1034. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1035. refreshPreloader.remove();
  1036. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1037. });
  1038. },500);
  1039. });
  1040. $('#popout').on('click tap', function(){
  1041. var activeFrame = $('#content').find('.active').children('iframe');
  1042. console.log(activeFrame.attr('src'));
  1043. window.open(activeFrame.attr('src'), '_blank');
  1044. });
  1045. $('#reload').on('contextmenu', function(e){
  1046. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1047. var activeFrame = $('#contentRight').find('.active').children('iframe');
  1048. activeFrame.attr('src', activeFrame.attr('src'));
  1049. var refreshBox = $('#contentRight').find('.active');
  1050. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1051. setTimeout(function(){
  1052. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1053. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1054. refreshPreloader.remove();
  1055. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1056. });
  1057. },500);
  1058. return false;
  1059. });
  1060. $('#splitView').on('click tap', function(){
  1061. $('#splitView').hide();
  1062. $("#content").attr("class", "content");
  1063. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1064. $("#contentRight").html('');
  1065. });
  1066. <?php if($iconRotate == "true") : ?>
  1067. $("li[id^='settings.phpx']").on('click tap', function(){
  1068. $("img[id^='settings-icon']").addClass("fa-spin");
  1069. $("i[id^='settings-icon']").addClass("fa-spin");
  1070. setTimeout(function(){
  1071. $("img[id^='settings-icon']").removeClass("fa-spin");
  1072. $("i[id^='settings-icon']").removeClass("fa-spin");
  1073. },1000);
  1074. });
  1075. <?php endif; ?>
  1076. $('#logoutSubmit').on('click tap', function(){
  1077. $( "#logout" ).submit();
  1078. });
  1079. $(window).resize(function(){
  1080. setHeight();
  1081. });
  1082. $("li[class^='tab-item']").on('click vclick', function(){
  1083. var thisidfull = $(this).attr("id");
  1084. var thistitle = $(this).attr("data-title");
  1085. var thisname = $(this).attr("name");
  1086. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1087. var currentframe = $("#content div[data-content-url^='"+thisid+"']");
  1088. if (currentframe.attr("class") == "iframe active") {
  1089. console.log(thisid + " is active already");
  1090. setHeight();
  1091. }else if (currentframe.attr("class") == "iframe hidden") {
  1092. console.log(thisid + " is active already but hidden");
  1093. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1094. currentframe.attr("class", "iframe active");
  1095. document.title = thistitle;
  1096. //window.location.href = '#' + thisname;
  1097. setHeight();
  1098. $("li[class^='tab-item active']").attr("class", "tab-item");
  1099. $(this).attr("class", "tab-item active");
  1100. }else {
  1101. if ($(this).attr("window") == "true") {
  1102. window.open(thisid,'_blank');
  1103. }else {
  1104. console.log(thisid + " make new div");
  1105. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1106. $( '<div class="iframe active" data-content-url="'+thisid+'"><iframe scrolling="auto" sandbox="allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#content" );
  1107. document.title = thistitle;
  1108. // window.location.href = '#' + thisname;
  1109. setHeight();
  1110. $("li[class^='tab-item active']").attr("class", "tab-item");
  1111. $(this).attr("class", "tab-item active");
  1112. jQuery(this).find("img").addClass("TabOpened");
  1113. }
  1114. }
  1115. });
  1116. $("li[class^='tab-item']").on('contextmenu', function(e){
  1117. e.stopPropagation();
  1118. $('#splitView').show();
  1119. $("#content").attr("class", "content split");
  1120. var thisidfull = $(this).attr("id");
  1121. var thistitle = $(this).attr("data-title");
  1122. var thisname = $(this).attr("name");
  1123. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1124. var currentframe = $("#contentRight div[data-content-url^='"+thisid+"']");
  1125. if (currentframe.attr("class") == "iframe active") {
  1126. console.log(thisid + " is active already");
  1127. }else if (currentframe.attr("class") == "iframe hidden") {
  1128. console.log(thisid + " is active already but hidden");
  1129. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1130. currentframe.attr("class", "iframe active");
  1131. document.title = thistitle;
  1132. window.location.href = '#' + thisname;
  1133. setHeight();
  1134. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1135. $(this).attr("class", "tab-item rightActive");
  1136. }else {
  1137. if ($(this).attr("window") == "true") {
  1138. window.open(thisid,'_blank');
  1139. }else {
  1140. console.log(thisid + " make new div");
  1141. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1142. $( '<div class="iframe active" data-content-url="'+thisid+'"><iframe scrolling="auto" sandbox="allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#contentRight" );
  1143. document.title = thistitle;
  1144. window.location.href = '#' + thisname;
  1145. setHeight();
  1146. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1147. $(this).attr("class", "tab-item rightActive");
  1148. jQuery(this).find("img").addClass("TabOpened");
  1149. }
  1150. }
  1151. return false;
  1152. });
  1153. Mousetrap.bind('ctrl+shift+up', function(e) {
  1154. var getCurrentTab = $("li[class^='tab-item active']");
  1155. var previousTab = getCurrentTab.prev().attr( "class", "tab-item" );
  1156. previousTab.trigger("click");
  1157. return false;
  1158. });
  1159. Mousetrap.bind('ctrl+shift+down', function(e) {
  1160. var getCurrentTab = $("li[class^='tab-item active']");
  1161. var nextTab = getCurrentTab.next().attr( "class", "tab-item" );
  1162. nextTab.trigger("click");
  1163. return false;
  1164. });
  1165. Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click"); });
  1166. Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click"); });
  1167. Mousetrap.bind('m m', function() { $("div[class^='hamburger']").trigger("click"); });
  1168. Mousetrap.bind('r r', function() { $("a[id^='reload']").trigger("click"); });
  1169. Mousetrap.bind('f f', function() { $("a[class^='fullscreen']").trigger("click"); });
  1170. <?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
  1171. Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });
  1172. <?php endforeach; endif; ?>
  1173. Mousetrap.bind('esc esc', function() {
  1174. $("#content").attr("class", "content");
  1175. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1176. $("#contentRight").html('');
  1177. });
  1178. var ref = document.referrer;
  1179. if(ref.indexOf("updated")>=0){
  1180. notify("<?php echo $language->translate('UPDATE_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1181. }
  1182. if(ref.indexOf("submit")>=0){
  1183. notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1184. }
  1185. </script>
  1186. </body>
  1187. </html>