summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xedit_timer.html105
-rwxr-xr-xincludes/inc_edittimer.php105
-rwxr-xr-xincludes/inc_timers.php2
-rwxr-xr-xincludes/inc_vdr.php25
-rwxr-xr-xincludes/include.php32
-rwxr-xr-xnew_timer.html87
6 files changed, 161 insertions, 195 deletions
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 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<meta content="yes" name="apple-mobile-web-app-capable" />
-
-<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
-
-<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
-<link href="css/style.css" rel="stylesheet" type="text/css" />
-<script src="javascript/functions.js" type="text/javascript"></script>
-
-
-
-<link rel="stylesheet" href="css/spinningwheel.css" type="text/css" media="all" />
-<script type="text/javascript" src="javascript/spinningwheel-min.js?v=1.4"></script>
-<title>Title of your page</title>
-<meta content="keyword1,keyword2,keyword3" name="keywords" />
-<meta content="Description of your page" name="description" />
-</head>
-
-<body onorientationchange="updateOrientation();" onload="updateOrientation();">
-
-<div id="topbar" class="transparent">
-<div id="leftnav">
-
-<a href="javascript:sendForm('getback')">Back</a></div>
-<div id="rightnav">
-<a href="index.php"><img alt="home" src="images/home.png" /></a></div>
-<div id="title">
-
-iStream
-</div>
-</div>
-<div id="content"> <span class="graytitle">Edit Timer</span>
-
-<form name="timer" id="timer" method="post" action="index.php">
- <ul class="pageitem">
- <li class="textbox"><span class="header">Recording name</span></li>
- <li class="bigfield">
- <input type="text" placeholder="Enter recording name" name="timer_name" value="Two Lovers" />
- </li>
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">Channel</span></li>
- <li class="select">
-
- <select name="timer_chan">
- <option value="1">TF1</option>
- <option value="2">France 2</option>
- <option value="3">France 3</option>
- <option value="4">France 4</option>
- <option value="5">France 5</option>
- <option value="6" selected>M6</option>
- </select>
- <span class="arrow"></span></li>
- </ul>
-
- <ul class="pageitem">
- <li class="textbox"><span class="header">Date</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectDate(2010,3,24)">
- <span class="name" id="layer_date">24-Mar-2010</span><span class="arrow"></span></a></li>
-
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">Start time</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_starttime',22,15)">
- <span class="name" id="layer_starttime">22h15</span><span class="arrow"></span></a></li>
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">End time</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_endtime',23,45)">
- <span class="name" id="layer_endtime">23h45</span><span class="arrow"></span></a></li>
- </ul>
-<input name="action" type="hidden" id="action" value="edittimer"/>
-<input name="timer_id" type="hidden" id="timer_id" value="2" />
-<input name="timer_date" type="hidden" id="timer_date" value="" />
-<input name="timer_starttime" type="hidden" id="timer_starttime" value="" />
-<input name="timer_endtime" type="hidden" id="timer_endtime" value="" />
-
-<ul class="pageitem">
-<li class="button">
- <input name="Submit" type="submit" value="Submit" /></li>
- </ul>
-</form>
-
-<form name="deltimer" id="deltimer" method="post" action="index.php"><input name="action" type="hidden" id="action" value="deletetimer" /><input name="timer_id" type="hidden" id="timer_id" value="2" />
-<input name="timer_id" type="hidden" id="timer_id" value="2" />
-<ul class="pageitem">
-<li class="button">
-<input name="Submit" type="submit" value="Delete" /></li>
-</ul>
-</form>
-
-</div>
-<div id="footer">
-
-
- iStreamdev 2010
-</div>
-<form name="getback" id="getback" method="post" action="index.php"><input name="action" type="hidden" id="action" value="timers" /></form>
-
-</body>
-
-</html>
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 @@
+<?php
+
+print "<body onorientationchange=\"updateOrientation();\" onload=\"updateOrientation();\">\r\n";
+print "<div id=\"topbar\" class=\"transparent\">\r\n";
+print "<div id=\"leftnav\">\r\n";
+print "<a href=\"javascript:sendForm('getback')\">Back</a></div>\r\n";
+print "<div id=\"rightnav\">\r\n";
+print "<a href=\"index.php\"><img alt=\"home\" src=\"images/home.png\" /></a></div>\r\n";
+print "<div id=\"title\">iStream</div>\r\n";
+print "</div>\r\n";
+print "<div id=\"content\"> <span class=\"graytitle\">Edit Timer</span>\r\n";
+
+$timer = $_REQUEST['timer'];
+
+list($type, $channame, $date, $stime, $etime, $desc) = vdrgettimerinfo($timer);
+
+// Timer name
+print "<form name=\"timer\" id=\"timer\" method=\"post\" action=\"index.php\">\r\n";
+print " <ul class=\"pageitem\">\r\n";
+print " <li class=\"textbox\"><span class=\"header\">Recording name</span></li>\r\n";
+print " <li class=\"bigfield\">\r\n";
+print " <input type=\"text\" placeholder=\"Enter recording name\" name=\"desc\" value=\"{$desc}\" />\r\n";
+print " </li>\r\n";
+print " </ul>\r\n";
+print " <ul class=\"pageitem\">\r\n";
+print " <li class=\"textbox\"><span class=\"header\">Channel</span></li>\r\n";
+print " <li class=\"select\">\r\n";
+
+// Channel selection
+print " <select name=\"timer_chan\">\r\n";
+
+vdrlistchannelsdrop($channame);
+
+print " </select>\r\n";
+print " <span class=\"arrow\"></span>";
+print " </li>\r\n";
+print " </ul>\r\n";
+
+// Date selection
+print " <ul class=\"pageitem\">\r\n";
+print " <li class=\"textbox\"><span class=\"header\">Date</span></li>\r\n";
+
+$datearray = explode("-", $date);
+
+print " <li class=\"menu\"><a class=\"noeffect\" href=\"javascript:openSelectDate({$datearray[0]},{$datearray[1]},{$datearray[2]})\">\r\n";
+print " <span class=\"name\" id=\"layer_date\">{$date}</span><span class=\"arrow\"></span></a>";
+print " </li>\r\n";
+print " </ul>\r\n";
+
+// Start/End time selection
+print " <ul class=\"pageitem\">\r\n";
+print " <li class=\"textbox\"><span class=\"header\">Start time</span></li>\r\n";
+
+$smin = substr($stime, 0, 2);
+$ssec = substr($stime, 2);
+
+print " <li class=\"menu\">";
+print " <a class=\"noeffect\" href=\"javascript:openSelectTime('layer_starttime',{$smin}, {$ssec})\">\r\n";
+print " <span class=\"name\" id=\"layer_starttime\">{$smin}h{$ssec}</span>";
+print " <span class=\"arrow\"></span>";
+print " </a>";
+print " </li>\r\n";
+print " </ul>\r\n";
+print " <ul class=\"pageitem\">\r\n";
+print " <li class=\"textbox\"><span class=\"header\">End time</span></li>\r\n";
+
+$emin = substr($etime, 0, 2);
+$esec = substr($etime, 2);
+
+print " <li class=\"menu\"><a class=\"noeffect\" href=\"javascript:openSelectTime('layer_endtime',{$emin},{$esec})\">\r\n";
+print " <span class=\"name\" id=\"layer_endtime\">{$emin}h{$esec}</span><span class=\"arrow\"></span></a></li>\r\n";
+print " </ul>\r\n";
+
+print "<input name=\"action\" type=\"hidden\" id=\"action\" value=\"addtimer\"/>\r\n";
+print "<input name=\"chan\" type=\"hidden\" id=\"chan\" value=\"\" />\r\n";
+print "<input name=\"date\" type=\"hidden\" id=\"date\" value=\"\" />\r\n";
+print "<input name=\"stime\" type=\"hidden\" id=\"stime\" value=\"\" />\r\n";
+print "<input name=\"etime\" type=\"hidden\" id=\"etime\" value=\"\" />\r\n";
+print "<input name=\"prevtimer\" type=\"hidden\" id=\"prevtimer\" value=\"{$timer}\" />\r\n";
+
+print "<ul class=\"pageitem\">\r\n";
+print "<li class=\"button\">\r\n";
+if ($timer == -1)
+ print " <input name=\"Submit\" type=\"submit\" value=\"Submit\" /></li>\r\n";
+else
+ print " <input name=\"Update\" type=\"Submit\" value=\"Update\" /></li>\r\n";
+print "</ul>\r\n";
+print "</form>\r\n";
+
+if ($timer != -1)
+{
+ print "<form name=\"deltimer\" id=\"deltimer\" method=\"post\" action=\"index.php\">\r\n";
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"deletetimer\" />\r\n";
+ print " <input name=\"timer\" type=\"hidden\" id=\"timer\" value=\"{$timer}\" />\r\n";
+ print " <ul class=\"pageitem\">\r\n";
+ print " <li class=\"button\">\r\n";
+ print " <input name=\"Submit\" type=\"submit\" value=\"Delete\" /></li>\r\n";
+ print "</ul>\r\n";
+ print "</form>\r\n";
+}
+
+print "</div>\r\n";
+print "<form name=\"getback\" id=\"getback\" method=\"post\" action=\"index.php\"><input name=\"action\" type=\"hidden\" id=\"action\" value=\"timers\" /></form>\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 " <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=\"edit_timer\"/>";
+print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"edittimer\"/>";
print " <input name=\"timer\" type=\"hidden\" id=\"timer\" value=\"-1\" />";
print " </form>";
print "</ul>";
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 "</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=\"action\" type=\"hidden\" id=\"action\" value=\"edittimer\"/>";
print " <input name=\"timer\" type=\"hidden\" id=\"timer\" value=\"{$timernum}\" />";
print "</form>";
}
}
+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 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<meta content="yes" name="apple-mobile-web-app-capable" />
-<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
-<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
-<link href="css/style.css" rel="stylesheet" type="text/css" />
-<script src="javascript/functions.js" type="text/javascript"></script>
-<link rel="stylesheet" href="css/spinningwheel.css" type="text/css" media="all" />
-<script type="text/javascript" src="javascript/spinningwheel-min.js?v=1.4"></script>
-<title>Title of your page</title>
-<meta content="keyword1,keyword2,keyword3" name="keywords" />
-<meta content="Description of your page" name="description" />
-
-</head>
-
-<body onorientationchange="updateOrientation();" onload="updateOrientation();">
-
-<div id="topbar" class="transparent">
-<div id="leftnav">
-<a href="javascript:sendForm('getback')">Back</a></div>
-<div id="rightnav">
-<a href="index.php"><img alt="home" src="images/home.png" /></a></div>
-<div id="title">
-iStream
-</div>
-</div>
-<div id="content"> <span class="graytitle">New Timer</span>
-
-<form name="timer" id="timer" method="post" action="index.php">
- <ul class="pageitem">
- <li class="textbox"><span class="header">Recording name</span></li>
- <li class="bigfield">
- <input type="text" placeholder="Enter recording name" name="timer_name" />
- </li>
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">Channel</span></li>
- <li class="select">
- <select name="timer_chan">
- <option value="1">TF1</option>
- <option value="2">France 2</option>
- <option value="3">France 3</option>
- <option value="4">France 4</option>
- <option value="4">France 5</option>
- <option value="4">M6</option>
- </select>
- <span class="arrow"></span></li>
- </ul>
-
- <ul class="pageitem">
- <li class="textbox"><span class="header">Date</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectDate()">
- <span class="name" id="layer_date">Select timer date</span><span class="arrow"></span></a></li>
-
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">Start time</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_starttime')">
- <span class="name" id="layer_starttime">Select start time</span><span class="arrow"></span></a></li>
- </ul>
- <ul class="pageitem">
- <li class="textbox"><span class="header">End time</span></li>
- <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_endtime')">
- <span class="name" id="layer_endtime">Select end time</span><span class="arrow"></span></a></li>
- </ul>
-<input name="action" type="hidden" id="action" value="newtimer"/>
-<input name="timer_date" type="hidden" id="timer_date" value="" />
-<input name="timer_starttime" type="hidden" id="timer_starttime" value="" />
-<input name="timer_endtime" type="hidden" id="timer_endtime" value="" />
-
-<ul class="pageitem">
-<li class="button">
- <input name="Submit" type="submit" value="Submit" /></li>
- </ul>
-</form>
-</div>
-<div id="footer">
-
- iStreamdev 2010
-</div>
-<form name="getback" id="getback" method="post" action="index.php"><input name="action" type="hidden" id="action" value="timers" /></form>
-
-</body>
-
-</html>