index.php 75 KB

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