index.php 78 KB

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