index.php 74 KB

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