/patches/Servicios/sbin/www/rc/main.php

https://github.com/frisco82/HMR600.com-Firmware · PHP · 94 lines · 81 code · 10 blank · 3 comment · 7 complexity · 307f9b7460e22ba6bc52c1dcd106ef13 MD5 · raw file

  1. <?
  2. error_reporting(0);
  3. session_start();
  4. $_SESSION['redirect'] = $_SERVER['REQUEST_URI'];
  5. include "../chooselang.php";
  6. include '/tmp/lang.php';
  7. $file = "/usr/local/etc/setup.php";
  8. $fp = fopen($file, 'r');
  9. $fileData = fread($fp, filesize($file));
  10. fclose($fp);
  11. $line = explode("\n", $fileData);
  12. $i = 1;
  13. while ($i <= 5) {
  14. $dataPair = explode('=', $line[$i]);
  15. if ($dataPair[0] == "Login" && $dataPair[1] == "true") {
  16. if ($_SESSION['loggedIn'] != 1) {
  17. //header("Location:../login_form.php");
  18. echo "<script>document.location.href='../login_form.php'</script>";
  19. exit;
  20. }
  21. }
  22. $i++;
  23. }
  24. //Read currently playing file name
  25. exec("echo -n '*' >> /tmp/ir");
  26. usleep(300000);
  27. $file1 = "/tmp/nowstatus";
  28. $fp1 = fopen($file1, 'r');
  29. $fileData1 = fread($fp1, filesize($file1));
  30. fclose($fp1);
  31. $line1 = explode("\n", $fileData1);
  32. $type = $line1[1];
  33. $playing = substr(strrchr($line1[2], '/'), 1);
  34. $shufl_seq = $line1[3];
  35. $repeat = $line1[4];
  36. $time = $line1[5];
  37. //echo "<script>alert('$playing');</script>";
  38. ?>
  39. <!--meta http-equiv="refresh" content="5"-->
  40. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41. <html xmlns="http://www.w3.org/1999/xhtml" >
  42. <head>
  43. <title>Xtreamer</title>
  44. <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
  45. <meta name="apple-mobile-web-app-capable" content="yes" />
  46. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  47. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  48. <link href="statics/styles/general.css" rel="stylesheet" type="text/css" />
  49. <script src="statics/scripts/panel_funcs.js"></script>
  50. <script src="statics/scripts/global.js"></script>
  51. </head>
  52. <body>
  53. <img id="progressImg" src="statics/images/wifi_icon.png" />
  54. <map name="mainPage">
  55. <area shape="rect" coords="2,60,85,0" title="Power" href="#" onclick="goTo('fPower')">
  56. <area shape="rect" coords="238,70,318,127" title="Subtitles" href="#" onclick="goTo('fSubtitles')">
  57. <area shape="rect" coords="237,60,317,2" title="Info" href="#" onclick="goTo('fInfo')">
  58. <area shape="rect" coords="238,130,319,167" title="Home" href="#" onclick="goTo('fHome')">
  59. <area shape="rect" coords="85,131,0,167" title="Return" href="#" onclick="goTo('fReturn')">
  60. <area shape="rect" coords="79,61,3,127" title="Settings" href="#" onclick="goTo('fSettings')">
  61. <area shape="poly" coords="127,53,106,31,85,83,105,132,126,112,116,82,125,54,124,53,123,52,127,53" title="Left" href="#" onclick="goTo('fLeftarrow')">
  62. <area shape="poly" coords="191,53,213,33,235,81,214,134,195,112,206,83,191,52,191,52,191,53" title="Right" href="#" onclick="goTo('fRightarrow')">
  63. <area shape="poly" coords="128,49,156,38,188,49,211,29,158,3,105,29,108,31,108,31,128,49" title="Up" href="#" onclick="goTo('fToparrow')">
  64. <area shape="poly" coords="130,114,158,125,188,114,211,136,158,158,108,137,129,116,129,116,130,114" title="Down" href="#" onclick="goTo('fBottomarrow')">
  65. <area shape="circle" coords="162,84,40" title="Enter" href="#" onclick="goTo('fEnter')">
  66. <area shape="circle" coords="192,194,31" title="Stop" href="#" onclick="goTo('fStop')">
  67. <area shape="circle" coords="126,196,30" title="Play/Pause" href="#" onclick="goTo('fPlay')">
  68. <area shape="rect" coords="226,170,270,220" title="Next" href="#" onclick="goTo('fNext')">
  69. <area shape="rect" coords="93,170,50,224" title="Previous" href="#" onclick="goTo('fPrevious')">
  70. <area shape="rect" coords="58,263,5,215" title="Rewind" href="#" onclick="goTo('fRW')">
  71. <area shape="rect" coords="260,263,310,215" title="FastForward" href="#" onclick="goTo('fFF')">
  72. <area shape="rect" coords="118,267,1,308" title="Vol -" href="#" onclick="goTo('fVolumminus')">
  73. <area shape="rect" coords="207,309,319,268" title="Vol +" href="#" onclick="goTo('fVolumplus')">
  74. <area shape="rect" coords="123,246,205,377" title="<?echo $STR_Sub_panel;?>" href="#" onclick="goTo('fGotosub')">
  75. <area shape="rect" coords="44,314,-2,360" title="<?echo $STR_Refresh;?>" href="#" onclick="goTo('fAll')">
  76. <area shape="rect" coords="49,313,109,356" title="<?echo $STR_Play_Video_list;?>" href="#" onclick="goTo('fMovies')">
  77. <area shape="rect" coords="210,313,264,355" title="<?echo $STR_Play_Audeo_list;?>" href="#" onclick="goTo('fMusic')">
  78. <area shape="rect" coords="270,313,318,355" title="<?echo $STR_Play_Photo_list;?>" href="#" onclick="goTo('fPictures')">
  79. </map>
  80. <img src="statics/images/main.png" border="0" usemap="#mainPage"/>
  81. <div id="nowplaying"><marquee scrolldelay=200 onmouseover="this.stop();" onmouseout="this.start();" behavior="alternate"><a href="nowplaying.php"><span id="filename"><?echo $playing;?></span></a></marquee></div>
  82. <iframe name='gframe' width=0 height=0 style="display:none"></iframe>
  83. </body>
  84. </html>