index.php 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033
  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, $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. }.login-btn:hover {
  353. background: <?=$hoverbg;?>;
  354. color: <?=$hovertext;?>;
  355. text-decoration: none;
  356. font-weight: 700;
  357. }
  358. <?php if(SLIMBAR == "true") : ?>
  359. /* Slim Styling */
  360. body{
  361. padding-top: 30px !important;
  362. }.gn-menu-main {
  363. height: 30px !important;
  364. }.gn-menu-wrapper {
  365. top: 30px !important;
  366. }.gn-menu-main .navbar-right {
  367. line-height: 30px !important;
  368. }img.img-circle {
  369. vertical-align: inherit;
  370. margin-top: 2px;
  371. }.menu-toggle .hamburger {
  372. top: 0px !important;
  373. }.top-clock {
  374. line-height: 30px !important;
  375. }img.titlelogoclass {
  376. vertical-align: inherit;
  377. }.members-sidebar {
  378. top: 30px !important;
  379. }.menu-toggle .cross span:nth-child(2) {
  380. left: -9px;
  381. top: 40px;
  382. }.menu-toggle.gn-selected .cross span:nth-child(2) {
  383. width: 49%;
  384. }.menu-toggle.gn-selected .cross span:nth-child(1) {
  385. height: 105% !important;
  386. }.menu-toggle .cross span:nth-child(1) {
  387. left: 6px !important;
  388. top: 26px !important;
  389. }.menu-toggle .hamburger span {
  390. margin: 5px 0;
  391. width: 25px;
  392. }.menu-toggle .hamburger {
  393. margin-left: -17px;
  394. }.ns-effect-slidetop {
  395. padding: 6px 22px;
  396. }.ns-effect-exploader {
  397. padding: 5px 22px;
  398. }
  399. <?php endif; ?>
  400. <?php if(CUSTOMCSS == "true") :
  401. $template_file = "custom.css";
  402. $file_handle = fopen($template_file, "rb");
  403. echo fread($file_handle, filesize($template_file));
  404. fclose($file_handle);
  405. echo "\n";
  406. endif; ?>
  407. </style>
  408. <body style="overflow: hidden">
  409. <?php if (LOADINGSCREEN == "true") : ?>
  410. <!--Preloader-->
  411. <div id="preloader" class="preloader table-wrapper">
  412. <div class="table-row">
  413. <div class="table-cell">
  414. <div class="la-ball-scale-multiple la-3x" style="color: <?=$topbar;?>">
  415. <?php if (pathinfo($loadingIcon, PATHINFO_EXTENSION) !== "gif" ) :
  416. echo "<div></div><div></div><div></div>";
  417. endif; ?>
  418. <logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. <?php endif; ?>
  424. <div id="main-wrapper" class="main-wrapper" tabindex="-1">
  425. <ul id="gn-menu" class="gn-menu-main">
  426. <li class="gn-trigger">
  427. <a id="menu-toggle" class="menu-toggle gn-icon gn-icon-menu">
  428. <div class="hamburger">
  429. <span></span>
  430. <span></span>
  431. <span></span>
  432. </div>
  433. <div class="cross">
  434. <span></span>
  435. <span></span>
  436. </div>
  437. </a>
  438. <nav class="gn-menu-wrapper">
  439. <div class="gn-scroller" id="gn-scroller">
  440. <ul id="tabList" class="gn-menu metismenu">
  441. <!--Start Tab List-->
  442. <?php if($tabSetup == "No") : $tabCount = 1; foreach($result as $row) :
  443. if($row['defaultz'] == "true") : $defaultz = "active"; else : $defaultz = ""; endif; ?>
  444. <li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
  445. <a class="tab-link">
  446. <?php if($row['iconurl']) : ?>
  447. <i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  448. <img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
  449. </i>
  450. <?php else : ?>
  451. <i class="fa <?=$row['icon'];?> fa-lg"></i>
  452. <?php endif; ?>
  453. <?=$row['name'];?>
  454. </a>
  455. </li>
  456. <?php $tabCount++; endforeach; endif;?>
  457. <?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
  458. <li class="tab-item <?=$settingsActive;?>" id="settings.phpx" data-title="Settings" name="settings">
  459. <a class="tab-link">
  460. <?php if($settingsicon == "Yes") :
  461. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  462. <img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
  463. else :
  464. echo '<i id="settings-icon" class="fa fa-cog"></i>';
  465. endif; ?>
  466. <?php echo $language->translate("SETTINGS");?>
  467. </a>
  468. </li>
  469. <li style="display: none;" class="tab-item" id="updatedb.phpx" data-title="Upgrade" name="upgrade">
  470. <a class="tab-link">
  471. <?php if($settingsicon == "Yes") :
  472. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  473. <img id="upgrade-icon" src="images/upgrade.png" style="height: 30px; margin-top: -2px;"></i>';
  474. else :
  475. echo '<i id="upgrade-icon" class="fa fa-arrow-up"></i>';
  476. endif; ?>
  477. <?php echo $language->translate("UPGRADE");?>
  478. </a>
  479. </li>
  480. <?php endif; endif;?>
  481. <!--End Tab List-->
  482. </ul>
  483. </div>
  484. <!-- /gn-scroller -->
  485. <div class="bottom-bnts">
  486. <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
  487. </div>
  488. </nav>
  489. </li>
  490. <li class="top-clock">
  491. <?php
  492. if($configReady == "Yes") :
  493. if(TITLELOGO == "") :
  494. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  495. else :
  496. echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
  497. endif;
  498. else :
  499. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  500. endif;
  501. ?>
  502. </li>
  503. <li class="pull-right">
  504. <ul class="nav navbar-right right-menu">
  505. <li class="dropdown notifications">
  506. <?php if($configReady == "Yes") : if(!$USER->authenticated) : ?>
  507. <a class="log-in">
  508. <?php endif; endif;?>
  509. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  510. <a class="show-members">
  511. <?php endif; endif;?>
  512. <i class="userpic"><?=$showPic;?></i>
  513. </a>
  514. </li>
  515. <li class="dropdown some-btn">
  516. <a class="fullscreen">
  517. <i class="mdi mdi-fullscreen"></i>
  518. </a>
  519. </li>
  520. <li class="dropdown some-btn">
  521. <a id="reload" class="refresh">
  522. <i class="mdi mdi-refresh"></i>
  523. </a>
  524. </li>
  525. <li style="display: none" id="splitView" class="dropdown some-btn">
  526. <a class="spltView">
  527. <i class="mdi mdi-window-close"></i>
  528. </a>
  529. </li>
  530. </ul>
  531. </li>
  532. </ul>
  533. <!--Content-->
  534. <div id="content" class="content" style="">
  535. <script>addToHomescreen();</script>
  536. <!--Load Framed Content-->
  537. <?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
  538. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  539. <div class="table-row">
  540. <div class="table-cell text-center">
  541. <div class="login i-block">
  542. <div class="content-box">
  543. <div class="biggest-box" style="background:<?=$topbar;?>;">
  544. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>
  545. </div>
  546. <div class="big-box text-left registration-form">
  547. <h4 class="text-center"><?php echo $language->translate("CREATE_ACCOUNT");?></h4>
  548. <form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  549. <input type="hidden" name="op" value="register"/>
  550. <input type="hidden" name="sha1" value=""/>
  551. <input type="hidden" name="settings" value="false"/>
  552. <div class="form-group">
  553. <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>
  554. </div>
  555. <div class="form-group">
  556. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  557. </div>
  558. <div class="form-group">
  559. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  560. </div>
  561. <div class="form-group">
  562. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  563. </div>
  564. <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>
  565. </form>
  566. </div>
  567. </div>
  568. </div>
  569. </div>
  570. </div>
  571. </div>
  572. <?php endif; ?>
  573. <?php if($needSetup == "Yes" && $configReady == "No") : ?>
  574. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  575. <div class="table-row">
  576. <div class="table-cell text-center">
  577. <div class="login i-block">
  578. <div class="content-box">
  579. <div class="biggest-box" style="background:<?=$topbar;?>;">
  580. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>
  581. </div>
  582. <div class="big-box text-left">
  583. <h3 class="text-center"><?php echo $language->translate("SPECIFY_LOCATION");?></h3>
  584. <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>
  585. <form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  586. <input type="hidden" name="action" value="createLocation" />
  587. <div class="form-group">
  588. <input type="text" class="form-control material" name="databaseLocation" autofocus value="<?php echo dirname(__DIR__);?>" autocorrect="off" autocapitalize="off" required>
  589. <h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
  590. <?php echo getTimezone();?>
  591. <h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
  592. <?php
  593. if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db')) :
  594. echo '<h5 class="text-center red">';
  595. echo $language->translate("DONT_WORRY");
  596. echo '</h5>';
  597. endif;?>
  598. </div>
  599. <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>
  600. </form>
  601. </div>
  602. </div>
  603. </div>
  604. </div>
  605. </div>
  606. </div>
  607. <?php endif; ?>
  608. <?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
  609. <div class="table-wrapper">
  610. <div class="table-row">
  611. <div class="table-cell text-center">
  612. <div class="login i-block">
  613. <div class="content-box">
  614. <div class="blue-bg biggest-box">
  615. <h1 class="zero-m text-uppercase"><?php echo $language->translate("AWESOME");?></h1>
  616. </div>
  617. <div class="big-box text-left">
  618. <h4 class="text-center"><?php echo $language->translate("TIME_TO_LOGIN");?></h4>
  619. <button type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("LOGIN");?></button>
  620. </div>
  621. </div>
  622. </div>
  623. </div>
  624. </div>
  625. </div>
  626. <?php endif; endif; ?>
  627. <?php if($tabSetup == "No" && $needSetup == "No") :?>
  628. <div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
  629. <div class="table-row">
  630. <div class="table-cell text-center">
  631. <div class="login i-block">
  632. <div class="content-box">
  633. <div class="biggest-box" style="background:<?=$topbar;?>;">
  634. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("HOLD_UP");?></h1>
  635. </div>
  636. <div class="big-box text-left">
  637. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  638. <h2 class="text-center"><?php echo $language->translate("LOOKS_LIKE_YOU_DONT_HAVE_ACCESS");?></h2>
  639. <?php if(!$USER->authenticated) : ?>
  640. <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>
  641. <?php endif; ?>
  642. </div>
  643. </div>
  644. </div>
  645. </div>
  646. </div>
  647. </div>
  648. <?php endif;?>
  649. <!--End Load Framed Content-->
  650. </div>
  651. <div id="contentRight" class="content splitRight" style="">
  652. </div>
  653. <!--End Content-->
  654. <!--Welcome notification-->
  655. <div id="welcome"></div>
  656. <div id="members-sidebar" style="background: <?=$sidebar;?>;" class="members-sidebar">
  657. <h4 class="pull-left zero-m"><?php echo $language->translate("OPTIONS");?></h4>
  658. <span class="close-members-sidebar"><i class="fa fa-remove fa-lg pull-right"></i></span>
  659. <div class="clearfix"><br/></div>
  660. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  661. <br>
  662. <div class="content-box profile-sidebar box-shadow">
  663. <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="">
  664. <div class="profile-usertitle">
  665. <div class="profile-usertitle-name">
  666. <?php echo strtoupper($USER->username); ?>
  667. </div>
  668. <div class="profile-usertitle-job">
  669. <?php echo strtoupper($USER->role); ?>
  670. </div>
  671. </div>
  672. <div id="buttonsDiv" class="profile-userbuttons">
  673. <button id="editInfo" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("EDIT_INFO");?></button>
  674. <button type="button" class="logout btn btn-warning waves waves-effect waves-float"><?php echo $language->translate("LOGOUT");?></button>
  675. </div>
  676. <div id="editInfoDiv" style="display: none" class="profile-usertitle">
  677. <form class="content-form form-inline" name="update" id="update" action="" method="POST">
  678. <input type="hidden" name="op" value="update"/>
  679. <input type="hidden" name="sha1" value=""/>
  680. <input type="hidden" name="username" value="<?php echo $USER->username; ?>"/>
  681. <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
  682. <div class="form-group">
  683. <input autocomplete="off" type="text" value="<?php echo $USER->email; ?>" class="form-control" name="email" placeholder="<?php echo $language->translate("EMAIL_ADDRESS");?>">
  684. </div>
  685. <div class="form-group">
  686. <input autocomplete="off" type="password" class="form-control" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  687. </div>
  688. <div class="form-group">
  689. <input autocomplete="off" type="password" class="form-control" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  690. </div>
  691. <br>
  692. <div class="form-group">
  693. <input type="button" class="btn btn-success text-uppercase waves-effect waves-float" value="<?php echo $language->translate("UPDATE");?>" onclick="User.processUpdate()"/>
  694. <button id="goBackButtons" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("GO_BACK");?></button>
  695. </div>
  696. </form>
  697. </div>
  698. </div>
  699. <?php endif; endif;?>
  700. </div>
  701. </div>
  702. <?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
  703. <div class="login-modal modal fade">
  704. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  705. <div class="table-row">
  706. <div class="table-cell text-center">
  707. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  708. <span aria-hidden="true">&times;</span>
  709. </button>
  710. <div class="login i-block">
  711. <div class="content-box">
  712. <div style="background:<?=$topbar;?>;" class="biggest-box">
  713. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  714. </div>
  715. <div class="big-box text-left login-form">
  716. <?php if($USER->error!="") : ?>
  717. <p class="error">Error: <?php echo $USER->error; ?></p>
  718. <?php endif; ?>
  719. <form name="log in" id="login" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  720. <h4 class="text-center"><?php echo $language->translate("LOGIN");?></h4>
  721. <div class="form-group">
  722. <input type="hidden" name="op" value="login">
  723. <input type="hidden" name="sha1" value="">
  724. <input type="hidden" name="rememberMe" value="false"/>
  725. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="" autofocus required>
  726. </div>
  727. <div class="form-group">
  728. <input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
  729. </div>
  730. <div class="form-group">
  731. <div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
  732. <label for="rememberMe" class="pull-left"></label>
  733. <label class="pull-right"> &nbsp; <?php echo $language->translate("REMEMBER_ME");?></label>
  734. </div>
  735. </div>
  736. <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>
  737. </form>
  738. <?php if (ENABLEMAIL == "true") : ?>
  739. <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>
  740. <?php endif; ?>
  741. <?php if(REGISTERPASSWORD != "") : ?>
  742. <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>
  743. <?php endif; ?>
  744. <form style="display: none;" name="forgotPassword" id="forgotPassword" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  745. <h4 class="text-center"><?php echo $language->translate("FORGOT_PASSWORD");?></h4>
  746. <div class="form-group">
  747. <input type="hidden" name="op" value="reset">
  748. <input type="text" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  749. </div>
  750. <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>
  751. </form>
  752. <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>
  753. <?php if(REGISTERPASSWORD != "") : ?>
  754. <div id="userPassForm" style="display: none;">
  755. <form id="userCreateForm" action="register.php" method="POST">
  756. <h4 class="text-center"><?php echo $language->translate("ENTER_PASSWORD_TO_REGISTER");?></h4>
  757. <center><h5 id="userCreateErrors" style="color: red"></h5></center>
  758. <div class="form-group">
  759. <input type="text" class="form-control material" name="registerPasswordValue" placeholder="<?php echo $language->translate("PASSWORD");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  760. </div>
  761. <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>
  762. </form>
  763. <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>
  764. </div>
  765. <form style="display: none;" name="createUser" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  766. <h4 class="text-center"><?php echo $language->translate("CREATE_USER");?></h4>
  767. <input type="hidden" name="op" value="register"/>
  768. <input type="hidden" name="sha1" value=""/>
  769. <input type="hidden" name="settings" value="false"/>
  770. <div class="form-group">
  771. <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>
  772. </div>
  773. <div class="form-group">
  774. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  775. </div>
  776. <div class="form-group">
  777. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  778. </div>
  779. <div class="form-group">
  780. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  781. </div>
  782. <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>
  783. <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>
  784. </form>
  785. <?php endif; ?>
  786. </div>
  787. </div>
  788. </div>
  789. </div>
  790. </div>
  791. </div>
  792. </div>
  793. <?php endif; endif;?>
  794. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  795. <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
  796. <div class="table-wrapper" style="background: <?=$sidebar;?>">
  797. <div class="table-row">
  798. <div class="table-cell text-center">
  799. <div class="login i-block">
  800. <div class="content-box">
  801. <div style="background:<?=$topbar;?>;" class="biggest-box">
  802. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
  803. </div>
  804. <div class="big-box login-form">
  805. <form name="log out" id="logout" action="" method="POST">
  806. <input type="hidden" name="op" value="logout">
  807. <input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
  808. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  809. <h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
  810. <a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
  811. <a style="color:<?=$topbar;?>;" class="i-block" data-dismiss="modal"><?php echo $language->translate("NO_WORD");?></a>
  812. </form>
  813. </div>
  814. </div>
  815. </div>
  816. </div>
  817. </div>
  818. </div>
  819. </div>
  820. <?php endif; endif;?>
  821. <!--Scripts-->
  822. <script src="<?=$baseURL;?>bower_components/jquery/dist/jquery.min.js"></script>
  823. <script src="<?=$baseURL;?>bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  824. <script src="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.js"></script>
  825. <script src="<?=$baseURL;?>bower_components/Waves/dist/waves.min.js"></script>
  826. <script src="<?=$baseURL;?>bower_components/moment/min/moment.min.js"></script>
  827. <script src="<?=$baseURL;?>bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  828. <script src="<?=$baseURL;?>bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  829. <script src="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  830. <script src="<?=$baseURL;?>bower_components/cta/dist/cta.min.js"></script>
  831. <!--Menu-->
  832. <script src="<?=$baseURL;?>js/menu/classie.js"></script>
  833. <script src="<?=$baseURL;?>js/menu/gnmenu.js"></script>
  834. <!--Selects-->
  835. <script src="<?=$baseURL;?>js/selects/selectFx.js"></script>
  836. <script src="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.min.js"></script>
  837. <script src="<?=$baseURL;?>bower_components/smoke/dist/js/smoke.min.js"></script>
  838. <!--Notification-->
  839. <script src="<?=$baseURL;?>js/notifications/notificationFx.js"></script>
  840. <!--Custom Scripts-->
  841. <script src="<?=$baseURL;?>js/common.js"></script>
  842. <script src="<?=$baseURL;?>js/mousetrap.min.js"></script>
  843. <script>
  844. var fixed = document.getElementById('gn-scroller');
  845. fixed.addEventListener('touchmove', function(e) {
  846. e.preventDefault();
  847. }, false);
  848. function setHeight() {
  849. windowHeight = $(window).innerHeight();
  850. $("div").find(".iframe").css('height', windowHeight - <?=$slimBar;?> + "px");
  851. $('#content').css('height', windowHeight - <?=$slimBar;?> + "px");
  852. };
  853. function notify(notifyString, notifyIcon, notifyType, notifyLength, notifyLayout, notifyEffect) {
  854. var notifyString = notifyString;
  855. var notifyIcon = notifyIcon;
  856. var notifyType = notifyType;
  857. var notifyLength = notifyLength;
  858. var notifyLayout = notifyLayout;
  859. var notifyEffect = notifyEffect;
  860. if (notifyEffect === "slidetop"){
  861. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x"></span>' + '<p>' + notifyString + '</p>';
  862. }else if (notifyEffect === "exploader"){
  863. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x pull-left"></span>' + '<p>' + notifyString + '</p>';
  864. }else if (notifyEffect === "thumbslider"){
  865. var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';
  866. }else{
  867. var addMeesage = '<p>' + notifyString + '</p>';
  868. }
  869. setTimeout(function () {
  870. var notification = new NotificationFx({
  871. message: addMeesage,
  872. layout: notifyLayout,
  873. effect: notifyEffect,
  874. ttl: notifyLength,
  875. type: notifyType,
  876. onClose: function () {
  877. $(".ns-box.ns-effect-thumbslider").fadeOut(400);
  878. }
  879. });
  880. notification.show();
  881. }, 500);
  882. }
  883. $('#loginSubmit').click(function() {
  884. if ($('#login').smkValidate()) {
  885. console.log("validated");
  886. }
  887. console.log("didnt validate");
  888. });
  889. $('#registerSubmit').click(function() {
  890. if ($('#registration').smkValidate()) {
  891. console.log("validated");
  892. }
  893. console.log("didnt validate");
  894. User.processRegistration();
  895. });
  896. $("#editInfo").click(function(){
  897. $( "div[id^='editInfoDiv']" ).toggle();
  898. $( "div[id^='buttonsDiv']" ).toggle();
  899. });
  900. $("#goBackButtons").click(function(){
  901. $( "div[id^='editInfoDiv']" ).toggle();
  902. $( "div[id^='buttonsDiv']" ).toggle();
  903. });
  904. $("#welcomeGoBack").click(function(){
  905. $( "form[id^='login']" ).toggle();
  906. $( "form[id^='forgotPassword']" ).toggle();
  907. $("#switchForgot").toggle();
  908. $("#switchCreateUser").toggle();
  909. $("#welcomeGoBack").toggle();
  910. });
  911. $("#welcomeGoBack2").click(function(){
  912. $( "form[id^='login']" ).toggle();
  913. $("#userPassForm").toggle();
  914. $("#switchForgot").toggle();
  915. $("#switchCreateUser").toggle();
  916. $("#welcomeGoBack2").toggle();
  917. });
  918. $("#welcomeGoBack3").click(function(){
  919. $("#registration").toggle();
  920. $("#welcomeGoBack3").toggle();
  921. $( "form[id^='login']" ).toggle();
  922. $("#switchForgot").toggle();
  923. $("#switchCreateUser").toggle();
  924. });
  925. $("#switchForgot").click(function(){
  926. $( "form[id^='login']" ).toggle();
  927. $( "form[id^='forgotPassword']" ).toggle();
  928. $("#switchForgot").toggle();
  929. $("#switchCreateUser").toggle();
  930. $("#welcomeGoBack").toggle();
  931. });
  932. $("#switchCreateUser").click(function(){
  933. $( "form[id^='login']" ).toggle();
  934. $("#userPassForm").toggle();
  935. $("#switchForgot").toggle();
  936. $("#switchCreateUser").toggle();
  937. $("#welcomeGoBack2").toggle();
  938. });
  939. //Sign in
  940. $(".log-in").click(function(e){
  941. var e1 = document.querySelector(".log-in"),
  942. e2 = document.querySelector(".login-modal");
  943. cta(e1, e2, {relativeToWindow: true}, function () {
  944. $('.login-modal').modal("show");
  945. });
  946. e.preventDefault();
  947. });
  948. //Logout
  949. $(".logout").click(function(e){
  950. var el1 = document.querySelector(".logout"),
  951. el2 = document.querySelector(".logout-modal");
  952. cta(el1, el2, {relativeToWindow: true}, function () {
  953. $('.logout-modal').modal("show");
  954. });
  955. e.preventDefault();
  956. });
  957. //Members Sidebar
  958. $(".show-members").click(function(e){
  959. var e_s1 = document.querySelector(".show-members"),
  960. e_s2 = document.querySelector("#members-sidebar");
  961. cta(e_s1, e_s2, {relativeToWindow: true}, function () {
  962. $('#members-sidebar').addClass('members-sidebar-open');
  963. });
  964. e.preventDefault();
  965. });
  966. $('.close-members-sidebar').click(function(){
  967. $('#members-sidebar').removeClass('members-sidebar-open');
  968. });
  969. $(document).ready(function(){
  970. $('#userCreateForm').submit(function(event) {
  971. var formData = {
  972. 'registerPasswordValue' : $('input[name=registerPasswordValue]').val()
  973. };
  974. $.ajax({
  975. type : 'POST',
  976. url : 'register.php',
  977. data : formData,
  978. dataType : 'json',
  979. encode : true
  980. })
  981. .done(function(data) {
  982. console.log(data);
  983. if ( ! data.success) {
  984. $('#userCreateErrors').html('Wrong Password!'); // add the actual error message under our input
  985. } else {
  986. $("#userPassForm").toggle();
  987. $("#registration").toggle();
  988. $("#welcomeGoBack3").toggle();
  989. }
  990. });
  991. event.preventDefault();
  992. });
  993. defaultTab = $("li[class^='tab-item active']").attr("id");
  994. if (defaultTab){
  995. defaultTab = defaultTab.substr(0, defaultTab.length-1);
  996. }else{
  997. defaultTabNone = $("li[class^='tab-item']").attr("id");
  998. if (defaultTabNone){
  999. $("li[class^='tab-item']").first().attr("class", "tab-item active");
  1000. defaultTab = defaultTabNone.substr(0, defaultTabNone.length-1);
  1001. }
  1002. }
  1003. if (defaultTab){
  1004. $("#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>');
  1005. document.getElementById('main-wrapper').focus();
  1006. }
  1007. if (defaultTab == null){
  1008. $("div[id^='tabEmpty']").show();
  1009. <?php if($needSetup == "No" && $configReady == "Yes") : if(!$USER->authenticated) : ?>
  1010. $('.login-modal').modal("show");
  1011. <?php endif; endif; ?>
  1012. }
  1013. if ($(location).attr('hash')){
  1014. var getHash = $(location).attr('hash').substr(1).replace("%20", " ").replace("_", " ");
  1015. var gotHash = getHash.toLowerCase();
  1016. var getLiTab = $("li[name^='" + gotHash + "']");
  1017. if(gotHash === "upgrade"){ getLiTab.toggle(); console.log("got it"); }
  1018. getLiTab.trigger("click");
  1019. }
  1020. setHeight();
  1021. });
  1022. <?php if(!empty($USER->info_log)) : ?>
  1023. notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1024. <?php endif; ?>
  1025. <?php if(!empty($USER->error_log)) : ?>
  1026. notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1027. <?php endif; ?>
  1028. $('#reload').on('click tap', function(){
  1029. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1030. var activeFrame = $('#content').find('.active').children('iframe');
  1031. activeFrame.attr('src', activeFrame.attr('src'));
  1032. var refreshBox = $('#content').find('.active');
  1033. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1034. setTimeout(function(){
  1035. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1036. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1037. refreshPreloader.remove();
  1038. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1039. });
  1040. },500);
  1041. });
  1042. $('#reload').on('contextmenu', function(e){
  1043. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1044. var activeFrame = $('#contentRight').find('.active').children('iframe');
  1045. activeFrame.attr('src', activeFrame.attr('src'));
  1046. var refreshBox = $('#contentRight').find('.active');
  1047. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1048. setTimeout(function(){
  1049. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1050. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1051. refreshPreloader.remove();
  1052. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1053. });
  1054. },500);
  1055. return false;
  1056. });
  1057. $('#splitView').on('click tap', function(){
  1058. $('#splitView').hide();
  1059. $("#content").attr("class", "content");
  1060. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1061. $("#contentRight").html('');
  1062. });
  1063. <?php if($iconRotate == "true") : ?>
  1064. $("li[id^='settings.phpx']").on('click tap', function(){
  1065. $("img[id^='settings-icon']").attr("class", "fa-spin");
  1066. $("i[id^='settings-icon']").attr("class", "fa fa-cog fa-spin");
  1067. setTimeout(function(){
  1068. $("img[id^='settings-icon']").attr("class", "");
  1069. $("i[id^='settings-icon']").attr("class", "fa fa-cog");
  1070. },1000);
  1071. });
  1072. <?php endif; ?>
  1073. $('#logoutSubmit').on('click tap', function(){
  1074. $( "#logout" ).submit();
  1075. });
  1076. $(window).resize(function(){
  1077. setHeight();
  1078. });
  1079. $("li[class^='tab-item']").on('click vclick', function(){
  1080. var thisidfull = $(this).attr("id");
  1081. var thistitle = $(this).attr("data-title");
  1082. var thisname = $(this).attr("name");
  1083. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1084. var currentframe = $("#content div[data-content-url^='"+thisid+"']");
  1085. if (currentframe.attr("class") == "iframe active") {
  1086. console.log(thisid + " is active already");
  1087. setHeight();
  1088. }else if (currentframe.attr("class") == "iframe hidden") {
  1089. console.log(thisid + " is active already but hidden");
  1090. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1091. currentframe.attr("class", "iframe active");
  1092. document.title = thistitle;
  1093. window.location.href = '#' + thisname;
  1094. setHeight();
  1095. $("li[class^='tab-item active']").attr("class", "tab-item");
  1096. $(this).attr("class", "tab-item active");
  1097. }else {
  1098. if ($(this).attr("window") == "true") {
  1099. window.open(thisid,'_blank');
  1100. }else {
  1101. console.log(thisid + " make new div");
  1102. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1103. $( '<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" );
  1104. document.title = thistitle;
  1105. window.location.href = '#' + thisname;
  1106. setHeight();
  1107. $("li[class^='tab-item active']").attr("class", "tab-item");
  1108. $(this).attr("class", "tab-item active");
  1109. }
  1110. }
  1111. });
  1112. $("li[class^='tab-item']").on('contextmenu', function(e){
  1113. e.stopPropagation();
  1114. $('#splitView').show();
  1115. $("#content").attr("class", "content split");
  1116. var thisidfull = $(this).attr("id");
  1117. var thistitle = $(this).attr("data-title");
  1118. var thisname = $(this).attr("name");
  1119. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1120. var currentframe = $("#contentRight div[data-content-url^='"+thisid+"']");
  1121. if (currentframe.attr("class") == "iframe active") {
  1122. console.log(thisid + " is active already");
  1123. }else if (currentframe.attr("class") == "iframe hidden") {
  1124. console.log(thisid + " is active already but hidden");
  1125. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1126. currentframe.attr("class", "iframe active");
  1127. document.title = thistitle;
  1128. window.location.href = '#' + thisname;
  1129. setHeight();
  1130. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1131. $(this).attr("class", "tab-item rightActive");
  1132. }else {
  1133. if ($(this).attr("window") == "true") {
  1134. window.open(thisid,'_blank');
  1135. }else {
  1136. console.log(thisid + " make new div");
  1137. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1138. $( '<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" );
  1139. document.title = thistitle;
  1140. window.location.href = '#' + thisname;
  1141. setHeight();
  1142. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1143. $(this).attr("class", "tab-item rightActive");
  1144. }
  1145. }
  1146. return false;
  1147. });
  1148. Mousetrap.bind('ctrl+shift+up', function(e) {
  1149. var getCurrentTab = $("li[class^='tab-item active']");
  1150. var previousTab = getCurrentTab.prev().attr( "class", "tab-item" );
  1151. previousTab.trigger("click");
  1152. return false;
  1153. });
  1154. Mousetrap.bind('ctrl+shift+down', function(e) {
  1155. var getCurrentTab = $("li[class^='tab-item active']");
  1156. var nextTab = getCurrentTab.next().attr( "class", "tab-item" );
  1157. nextTab.trigger("click");
  1158. return false;
  1159. });
  1160. Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click"); });
  1161. Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click"); });
  1162. Mousetrap.bind('m m', function() { $("div[class^='hamburger']").trigger("click"); });
  1163. Mousetrap.bind('r r', function() { $("a[id^='reload']").trigger("click"); });
  1164. Mousetrap.bind('f f', function() { $("a[class^='fullscreen']").trigger("click"); });
  1165. <?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
  1166. Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });
  1167. <?php endforeach; endif; ?>
  1168. Mousetrap.bind('esc esc', function() {
  1169. $("#content").attr("class", "content");
  1170. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1171. $("#contentRight").html('');
  1172. });
  1173. var ref = document.referrer;
  1174. if(ref.indexOf("updated")>=0){
  1175. notify("<?php echo $language->translate('UPDATE_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1176. }
  1177. if(ref.indexOf("submit")>=0){
  1178. notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1179. }
  1180. </script>
  1181. </body>
  1182. </html>