From 22136c401ac7f240f60d0d9ce71c7274429b38e0 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Mon, 22 Feb 2010 23:22:26 +0100 Subject: Timers implemntation WIP --- edit_timer.html | 105 --------------------------------------------- includes/inc_edittimer.php | 105 +++++++++++++++++++++++++++++++++++++++++++++ includes/inc_timers.php | 2 +- includes/inc_vdr.php | 25 ++++++++++- includes/include.php | 32 +++++++++++++- new_timer.html | 87 ------------------------------------- 6 files changed, 161 insertions(+), 195 deletions(-) delete mode 100755 edit_timer.html create mode 100755 includes/inc_edittimer.php delete mode 100755 new_timer.html diff --git a/edit_timer.html b/edit_timer.html deleted file mode 100755 index c901128..0000000 --- a/edit_timer.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - -Title of your page - - - - - - -
-
- -Back
-
-home
-
- -iStream -
-
-
Edit Timer - -
-
    -
  • Recording name
  • -
  • - -
  • -
-
    -
  • Channel
  • -
  • - - -
  • -
- - - - - - - - - - -
    -
  • -
  • -
-
- -
- -
    -
  • -
  • -
-
- -
- -
- - - - diff --git a/includes/inc_edittimer.php b/includes/inc_edittimer.php new file mode 100755 index 0000000..a9591e0 --- /dev/null +++ b/includes/inc_edittimer.php @@ -0,0 +1,105 @@ +\r\n"; +print "
\r\n"; +print "
\r\n"; +print "Back
\r\n"; +print "
\r\n"; +print "\"home\"
\r\n"; +print "
iStream
\r\n"; +print "
\r\n"; +print "
Edit Timer\r\n"; + +$timer = $_REQUEST['timer']; + +list($type, $channame, $date, $stime, $etime, $desc) = vdrgettimerinfo($timer); + +// Timer name +print "
\r\n"; +print "
    \r\n"; +print "
  • Recording name
  • \r\n"; +print "
  • \r\n"; +print " \r\n"; +print "
  • \r\n"; +print "
\r\n"; +print "
    \r\n"; +print "
  • Channel
  • \r\n"; +print "
  • \r\n"; + +// Channel selection +print " \r\n"; +print " "; +print "
  • \r\n"; +print "
\r\n"; + +// Date selection +print "
    \r\n"; +print "
  • Date
  • \r\n"; + +$datearray = explode("-", $date); + +print "
  • \r\n"; +print " {$date}"; +print "
  • \r\n"; +print "
\r\n"; + +// Start/End time selection +print " \r\n"; +print " \r\n"; + +print "\r\n"; +print "\r\n"; +print "\r\n"; +print "\r\n"; +print "\r\n"; +print "\r\n"; + +print "
    \r\n"; +print "
  • \r\n"; +if ($timer == -1) + print "
  • \r\n"; +else + print " \r\n"; +print "
\r\n"; +print "
\r\n"; + +if ($timer != -1) +{ + print "
\r\n"; + print " \r\n"; + print " \r\n"; + print "
    \r\n"; + print "
  • \r\n"; + print "
  • \r\n"; + print "
\r\n"; + print "
\r\n"; +} + +print "
\r\n"; +print "
\r\n"; + +?> diff --git a/includes/inc_timers.php b/includes/inc_timers.php index c5ce230..c1556a8 100755 --- a/includes/inc_timers.php +++ b/includes/inc_timers.php @@ -25,7 +25,7 @@ print " "; print " "; print " "; print "
"; -print " "; +print " "; print " "; print "
"; print ""; diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index 79eb22e..857cb8d 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -317,13 +317,36 @@ function vdrlisttimers() print ""; print "
"; - print " "; + print " "; print " "; print "
"; } } +function vdrdeltimer($timer=0) +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $svdrp->Command("DELT " .$timer); + $svdrp->Disconnect(); +} + +function vdrsettimer($channame, $date, $stime, $etime, $desc) +{ + global $svdrpip, $svdrpport; + + $channum = vdrgetchannum($channame); + + $timer = "1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; + print $timer; + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $svdrp->Command("ADDT " .$timer); + $svdrp->Disconnect(); +} ?> diff --git a/includes/include.php b/includes/include.php index 46e758f..4cf2834 100755 --- a/includes/include.php +++ b/includes/include.php @@ -48,9 +48,22 @@ function selectpage() case ("timers"): gen_timers(); break; - case ("edit_timer"): + case ("edittimer"): gen_edit_timer(); break; + case ("deletetimer"): + $timer = $_REQUEST['timer']; + delete_timer($timer); + break; + case ("addtimer"): + $channame = $_REQUEST['chan']; + $date = $_REQUEST['date']; + $stime = $_REQUEST['stime']; + $etime = $_REQUEST['etime']; + $desc = $_REQUEST['desc']; + $prevtimer = $_REQUEST['prevtimer']; + set_timer($channame, $date, $stime, $etime, $desc, $prevtimer); + break; case ("startstream"): $type = $_REQUEST['type']; $name = $_REQUEST['name']; @@ -141,4 +154,21 @@ function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, include('includes/inc_stream.php'); } +function delete_timer($timer) +{ + vdrdeltimer($timer); + + include('includes/inc_timers.php'); +} + +function set_timer($channame, $date, $stime, $etime, $desc, $prevtimer) +{ + + if ($prevtimer != -1) + vdrdeltimer($prevtimer); + vdrsettimer($channame, $date, $stime, $etime, $desc); + + include('includes/inc_timers.php'); +} + ?> diff --git a/new_timer.html b/new_timer.html deleted file mode 100755 index 0c2de96..0000000 --- a/new_timer.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - -Title of your page - - - - - - - -
- -
-home
-
-iStream -
-
-
New Timer - -
-
    -
  • Recording name
  • -
  • - -
  • -
-
    -
  • Channel
  • -
  • - -
  • -
- - - - - - - - - -
    -
  • -
  • -
-
-
- -
- - - - -- cgit v1.2.3