index.php 68 KB

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