diff options
Diffstat (limited to 'includes')
-rwxr-xr-x[-rw-r--r--] | includes/inc_timers.php | 28 | ||||
-rwxr-xr-x | includes/inc_vdr.php | 79 |
2 files changed, 96 insertions, 11 deletions
diff --git a/includes/inc_timers.php b/includes/inc_timers.php index bf14074..9d66e27 100644..100755 --- a/includes/inc_timers.php +++ b/includes/inc_timers.php @@ -7,23 +7,29 @@ print "<div id=\"title\">iStreamdev</div>\r\n"; print "</div>\r\n"; print "<div id=\"content\">\r\n"; print " <span class=\"graytitle\">Timers</span>\r\n"; -print " <ul class=\"pageitem\">"; -print " <li class=\"textbox\"><span class=\"header\">Incoming feature</span"; -print " <p>This is just a template...</p></li></ul>"; print " <ul class=\"pageitem\">"; -print " <li class=\"textbox\"> <span class=\"header\">Current timers</span> </li>"; -print " <li class=\"menu\"><a href=\"javascript:sendForm('23.02.2010: TF1 Gran Torino')\"> <img alt=\"list\" src=\"images/pictos/timers.png\" /><span class=\"name\">23.02.2010: TF1 Gran Torino</span><span class=\"arrow\"></span></a></li>"; -print "<form name=\"23.02.2010: TF1 Gran Torino\" id=\"23.02.2010: TF1 Gran Torino\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"edit_timer\"/><input name=\"timer\" type=\"hidden\" id=\"timer\" value=\"23.02.2010: TF1 Gran Torino\" /></form>"; -print " <li class=\"menu\"><a href=\"javascript:sendForm('23.02.2010: TF1 Gran Torino')\"> <img src=\"images/pictos/timers.png\" /><span class=\"name\">12.03.2010: Canal + Les Guignols de l'Info </span><span class=\"arrow\"></span></a></li>"; -print "<form name=\">12.03.2010: Canal + Les Guignols de l'Info\" id=\">12.03.2010: Canal + Les Guignols de l'Info\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"edit_timer\"/><input name=\"timer\" type=\"hidden\" id=\"timer\" value=\">12.03.2010: Canal + Les Guignols de l'Info\" /></form>"; +print " <li class=\"textbox\">"; +print " <span class=\"header\">Current timers</span>"; +print " </li>"; + +vdrlisttimers(); + print "</ul>"; -print "<ul class=\"pageitem\">"; -print " <li class=\"menu\"><a href=\"javascript:sendForm('new_timer')\"><span class=\"name\">New Timer</span><span class=\"arrow\"></span></a></li>"; -print "<form name=\"new_timer\" id=\"new_timer\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"new_timer\"/></form>"; +print "<ul class=\"pageitem\">"; +print " <li class=\"menu\">"; +print " <a href=\"javascript:sendForm('new_timer')\">"; +print " <span class=\"name\">New Timer</span>"; +print " <span class=\"arrow\"></span>"; +print " </a>"; +print " </li>"; +print " <form name=\"new_timer\" id=\"new_timer\" method=\"post\" action=\"index.php\">"; +print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"new_timer\"/>"; +print " </form>"; print "</ul>"; print "</div>\r\n"; +a ?> diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index 7e52d4b..0a7f48a 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -94,6 +94,29 @@ function vdrgetinfostream($stream = "NULL", $ischan = 1) return array($epgtitle, $epgdesc, $channame); } +function vdrgettimerinfo($timernum=0) +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $timer = $svdrp->Command("LSTT " .$timernum); + $svdrp->Disconnect(); + + $timerarray = explode(":", $timer); + + $typearray = explode(" ", $timerarray[0]); + $type = $typearray[1]; + $channel = $timerarray[1]; + $channame = vdrgetchanname($channel); + $date = $timerarray[2]; + $starthour = $timerarray[3]; + $endhour = $timerarray[4]; + $desc = $timerarray[7]; + + return array($type, $channame, $date, $starthour, $endhour, $desc); +} + function vdrgetchannum($chan = "NULL") { global $svdrpip, $svdrpport; @@ -113,6 +136,25 @@ function vdrgetchannum($chan = "NULL") return $channum; } +function vdrgetchanname($channum = 0) +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $channel = $svdrp->Command("LSTC " .$channum); + $svdrp->Disconnect(); + + // Get channel name + $chanarray = explode(":", $channel); + $chanarray = explode(";", $chanarray[0]); + $channame = $chanarray[0]; + $channame = substr($channame, strlen($channum)+1); + + return $channame; +} + + function vdrlistcategories() { global $vdrchannels; @@ -209,4 +251,41 @@ function vdrlistchannels($category = "NULL") } fclose($fp); } + +function vdrlisttimers() +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $timers = $svdrp->Command("LSTT"); + $svdrp->Disconnect(); + + foreach($timers as $timer) + { + // Extract timer # + $timerarray = explode(" ", $timer); + $timernum = $timerarray[0]; + + list($type, $channame, $date, $starthour, $endhour, $desc) = vdrgettimerinfo($timernum); + + print "<li class=\"menu\">"; + print " <a href=\"javascript:sendForm('timer {$timernum}')\">"; + print " <img alt=\"list\" src=\"images/pictos/timers.png\" />"; + + print " <span class=\"name\">{$date}: {$channame}</span><span class=\"arrow\"></span>"; + + print " </a>"; + print "</li>"; + + print "<form name=\"timer {$timernum}\" id=\"timer {$timernum}\" method=\"post\" action=\"index.php\">"; + print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"edit_timer\"/>"; + print " <input name=\"timer\" type=\"hidden\" id=\"timer\" value=\"{$timernum}\" />"; + print "</form>"; + } +} + + + + ?> |