homepage.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?php
  2. $data = false;
  3. ini_set("display_errors", 1);
  4. ini_set("error_reporting", E_ALL | E_STRICT);
  5. require_once("user.php");
  6. require_once("translate.php");
  7. require_once("functions.php");
  8. $USER = new User("registration_callback");
  9. $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  10. $file_db = new PDO("sqlite:" . $dbfile);
  11. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  12. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  13. $hasOptions = "No";
  14. foreach($dbOptions as $row) :
  15. if (in_array("options", $row)) :
  16. $hasOptions = "Yes";
  17. endif;
  18. endforeach;
  19. if($hasOptions == "No") :
  20. $title = "Organizr";
  21. $topbar = "#333333";
  22. $topbartext = "#66D9EF";
  23. $bottombar = "#333333";
  24. $sidebar = "#393939";
  25. $hoverbg = "#AD80FD";
  26. $activetabBG = "#F92671";
  27. $activetabicon = "#FFFFFF";
  28. $activetabtext = "#FFFFFF";
  29. $inactiveicon = "#66D9EF";
  30. $inactivetext = "#66D9EF";
  31. $loading = "#66D9EF";
  32. $hovertext = "#000000";
  33. endif;
  34. if($hasOptions == "Yes") :
  35. $resulto = $file_db->query('SELECT * FROM options');
  36. foreach($resulto as $row) :
  37. $title = isset($row['title']) ? $row['title'] : "Organizr";
  38. $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF";
  39. $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333";
  40. $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333";
  41. $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939";
  42. $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD";
  43. $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671";
  44. $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF";
  45. $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF";
  46. $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF";
  47. $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF";
  48. $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF";
  49. $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000";
  50. endforeach;
  51. endif;
  52. ?>
  53. <!DOCTYPE html>
  54. <html lang="en" class="no-js">
  55. <head>
  56. <meta charset="UTF-8">
  57. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  58. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  59. <meta name="msapplication-tap-highlight" content="no" />
  60. <title><?=$title;?> Homepage</title>
  61. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  62. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  63. <!--<link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
  64. <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
  65. <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css"> -->
  66. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  67. <script src="js/menu/modernizr.custom.js"></script>
  68. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  69. <link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css">
  70. <link rel="stylesheet" href="css/style.css">
  71. <!--[if lt IE 9]>
  72. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  73. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  74. <![endif]-->
  75. <style>
  76. table.fc-list-table {
  77. table-layout: auto;
  78. }.fc-day-grid-event .fc-content {
  79. white-space: normal;
  80. }.fc-list-item {
  81. table-layout: auto;
  82. position: inherit;
  83. margin: 10px;
  84. border-radius: 4px;
  85. padding: 0 5px 0 5px;
  86. color: #fff !important;
  87. }.fc-calendar .fc-toolbar {
  88. background: <?=$topbar;?>;
  89. color: <?=$topbartext;?>;
  90. border-radius: 5px 5px 0 0;
  91. padding: 15px;
  92. }.fc-calendar .fc-toolbar .fc-right {
  93. bottom: 0px;
  94. right: 20px;
  95. }.fc-calendar .fc-toolbar .fc-right button {
  96. color: <?=$topbartext;?>;
  97. }.fc-calendar .fc-toolbar .fc-prev-button, .fc-calendar .fc-toolbar .fc-next-button {
  98. color: <?=$topbartext;?>;
  99. }.carousel-image{
  100. width: 100px !important;
  101. height: 150px !important;
  102. border-radius: 3px 0 0 3px;
  103. }.carousel-image.album{
  104. width: 150px !important;
  105. height: 150px !important;
  106. border-radius: 3px 0 0 3px;
  107. }.carousel-control.album {
  108. top: 5px !important;
  109. width: 4% !important;
  110. }.carousel-control {
  111. top: 5px !important;
  112. width: 4% !important;
  113. }.carousel-caption.album {
  114. position: absolute;
  115. right: 4%;
  116. top: 0px;
  117. left: 160px;
  118. z-index: 10;
  119. bottom: 0px;
  120. padding-top: 0px;
  121. color: #fff;
  122. text-align: left;
  123. }.carousel-caption {
  124. position: absolute;
  125. right: 4%;
  126. top: 0px;
  127. left: 110px;
  128. z-index: 10;
  129. bottom: 0px;
  130. padding-top: 0px;
  131. color: #fff;
  132. text-align: left;
  133. padding-bottom: 2px !important;
  134. }<?php if(CUSTOMCSS == "true") :
  135. $template_file = "custom.css";
  136. $file_handle = fopen($template_file, "rb");
  137. echo fread($file_handle, filesize($template_file));
  138. fclose($file_handle);
  139. echo "\n";
  140. endif; ?>
  141. </style>
  142. </head>
  143. <body class="scroller-body" style="padding: 0px;">
  144. <div class="main-wrapper" style="position: initial;">
  145. <div id="content" class="container-fluid">
  146. <div class="row">
  147. <?php
  148. $plexSize = 0;
  149. if(PLEXRECENTMOVIE == "true"){ $plexSize++; }
  150. if(PLEXRECENTTV == "true"){ $plexSize++; }
  151. if(PLEXRECENTMUSIC == "true"){ $plexSize++; }
  152. if(PLEXPLAYINGNOW == "true"){ $plexSize++; }
  153. if($plexSize >= 4){ $plexSize = 3; }elseif($plexSize == 3){ $plexSize = 4; }elseif($plexSize == 2){ $plexSize = 6; }elseif($plexSize == 1){ $plexSize = 12; }
  154. if(PLEXRECENTMOVIE == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "movie", PLEXTOKEN, $plexSize, $language->translate("MOVIES")); }
  155. if(PLEXRECENTTV == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "season", PLEXTOKEN, $plexSize, $language->translate("TV_SHOWS")); }
  156. if(PLEXRECENTMUSIC == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "album", PLEXTOKEN, $plexSize, $language->translate("MUSIC")); }
  157. if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams(PLEXURL, PLEXPORT, PLEXTOKEN, $plexSize, $language->translate("PLAYING_NOW_ON_PLEX")); }
  158. ?>
  159. </div>
  160. <?php if(SONARRURL != "" || RADARRURL != "") : ?>
  161. <div class="row" style="padding: 0 0 10px 0;">
  162. <div class="col-lg-4">
  163. <span class="label progress-bar-success progress-bar-striped well-sm"><span class="fc-image"><i class="fa fa-film"></i></span> Available</span>
  164. <span class="label progress-bar-danger progress-bar-striped well-sm"><span class="fc-image"><i class="fa fa-film"></i></span> Unavailable</span>
  165. <span class="label label-primary well-sm"><span class="fc-image"><i class="fa fa-tv"></i></span> Available</span>
  166. <span class="label label-danger well-sm"><span class="fc-image"><i class="fa fa-tv"></i></span> Unavailable</span>
  167. </div>
  168. </div>
  169. <div class="row">
  170. <div class="col-lg-12">
  171. <div id="calendar" class="fc-calendar box-shadow fc fc-ltr fc-unthemed"></div>
  172. </div>
  173. </div>
  174. <?php endif; ?>
  175. </div>
  176. </div>
  177. <!--Scripts-->
  178. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  179. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  180. <script src="bower_components/moment/min/moment.min.js"></script>
  181. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  182. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  183. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  184. <script src="bower_components/cta/dist/cta.min.js"></script>
  185. <script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
  186. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  187. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  188. <script>
  189. $( document ).ready(function() {
  190. $(".carousel-caption").mCustomScrollbar({
  191. theme:"inset-2",
  192. scrollInertia: 300,
  193. autoHideScrollbar: true,
  194. autoExpandScrollbar: true
  195. });
  196. $(".scroller-body").mCustomScrollbar({
  197. theme:"inset-3",
  198. scrollInertia: 300,
  199. autoHideScrollbar: true,
  200. autoExpandScrollbar: true
  201. });
  202. $("fc-scroller").mCustomScrollbar({
  203. theme:"inset-3",
  204. scrollInertia: 300,
  205. autoHideScrollbar: true,
  206. autoExpandScrollbar: true
  207. });
  208. });
  209. </script>
  210. <?php if(SONARRURL != "" || RADARRURL != "") : ?>
  211. <script>
  212. $(function () {
  213. /* initialize the calendar */
  214. var date = new Date();
  215. var d = date.getDate();
  216. var m = date.getMonth();
  217. var y = date.getFullYear();
  218. $('#calendar').fullCalendar({
  219. eventLimit: false,
  220. height: "auto",
  221. //defaultDate: '2017-03-21',
  222. defaultView: 'basicWeek',
  223. header: {
  224. left: 'prev, next',
  225. center: 'title',
  226. right: 'month, basicDay,basicWeek,'
  227. },
  228. views: {
  229. basicDay: { buttonText: '<?php echo $language->translate("DAY");?>', eventLimit: false },
  230. basicWeek: { buttonText: '<?php echo $language->translate("WEEK");?>', eventLimit: false },
  231. month: { buttonText: '<?php echo $language->translate("MONTH");?>', eventLimit: false },
  232. },
  233. events: [
  234. <?php if(SONARRURL != ""){ echo getSonarrCalendar(SONARRURL, SONARRPORT,SONARRKEY); } ?>
  235. <?php if(RADARRURL != ""){ echo getRadarrCalendar(RADARRURL, RADARRPORT,RADARRKEY); } ?>
  236. ],
  237. editable: false,
  238. droppable: false,
  239. });
  240. });
  241. </script>
  242. <?php endif; ?>
  243. </body>
  244. </html>