index.php 78 KB

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