<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
	<meta http-equiv="content-type" content="text/html;<%! charset=ISO-8859-1 !%>" />
	<title>VDRAdmin - <tmpl_if newtimer><%! Create New Timer !%><tmpl_else><%! Edit Timer !%></tmpl_if></title>
	<link href="style.css" rel="stylesheet" media="screen" type="text/css" />
	<tmpl_if usercss>
		<link href="user.css" rel="stylesheet" media="screen" type="text/css" />
	</tmpl_if>
	<script type="text/javascript" language="JavaScript1.2" src="library.js"></script>
	<script type="text/javascript" language="JavaScript1.2">
	<!--
      function cTimer(idx) {
        var Timer = "";
        var dor = document.form.dor.value;
        var StartDay = dor.indexOf('@') > 0 ? dor.substring(dor.indexOf('@')) : "";
        Days = new Array("M", "T", "W", "T", "F", "S", "S");
        for(var i = 0; i <= 6; i++) {
          Status = eval("document.form.D" + i + ".checked");
          if(Status == true) {
            Timer = Timer + Days[i];
          } else {
            Timer = Timer + "-";
          }
          document.form.dor.value = Timer + StartDay;
        }
      }
      
      function eCheckbox(complTimer) {
        if(complTimer.length == 7 || complTimer.length == 18) {
          for(var i = 0; i <= 6; i++) {
            if(complTimer.substring(i, i + 1) != "-") {
              eval("document.form.D" + i + ".click();");
            }
          }
        }
      }
    //--> 
	</script>
</head>

<body onload='eCheckbox("<tmpl_var dor>")' id="timer_new">
	<form action="<tmpl_var url>" method="get" name="form">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="heading">
			<tr>
				<td class="col_left"></td>
				<td class="col_title">
					<h1><tmpl_if newtimer><%! Create New Timer !%><tmpl_else><%! Edit Timer !%></tmpl_if></h1>
				</td>
<tmpl_if name="help_url">
				<td class="col_help">
					<a href="javascript:open_help('<tmpl_var help_url>');"><img src="bilder/help.gif" border="0" alt="help" title="<%! Help !%>" /></a>
				</td>
</tmpl_if>
				<td class="col_right"></td>
			</tr>
		</table>

		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="content" class="group">
			<tr class="heading">
				<td class="col_left"></td>
				<td colspan="2"></td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_spacer">
				<td class="col_left"></td>
				<td colspan="2"></td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_odd">
				<td class="col_left"></td>
				<td class="col_label"><h5><%! Timer Active: !%></h5></td>
				<td class="col_value">
					<input type="radio" name="active" value="1" id="active_yes" <tmpl_if active>checked</tmpl_if> /><label for="active_yes"><%! Yes !%></label>
					<input type="radio" name="active" value="0" id="active_no" <tmpl_unless active>checked</tmpl_unless> /><label for="active_no"><%! No !%></label>
				</td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_even">
				<td class="col_left"></td>
				<td class="col_label"><h5><%! AutoTimer Checking: !%></h5></td>
				<td class="col_value">
					<tmpl_if expr="event_id > 1">
						<input type="radio" name="event_id" value="<tmpl_var event_id>" id="event_id" checked /><label for="event_id"><%! Transmission Identification !%></label>
					</tmpl_if>
					<input type="radio" name="event_id" value="1" id="event_time" <tmpl_if expr="event_id == 1">checked</tmpl_if> /><label for="event_time"><%! Time !%></label>
					<input type="radio" name="event_id" value="0" id="event_off" <tmpl_if expr="event_id == 0">checked</tmpl_if> /><label for="event_off"><%! off !%></label>
				</td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_odd">
				<td class="col_left"></td>
				<td class="col_label"><h5><%! Channel: !%></h5></td>
				<td class="col_value">
					<select name="channel" class="submit">
<tmpl_loop name="channels">
						<option value="<tmpl_var vdr_id>" <tmpl_if current>selected</tmpl_if>><tmpl_var name="name" escape="html"></option>
</tmpl_loop>
					</select>
				</td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_even">
				<td valign="top"  class="col_left"></td>
				<td valign="top"  class="col_label"><h5><%! Day Of Recording: !%></h5></td>
				<td class="col_value">
					<input type="text" name="dor" value="<tmpl_var dor>" size="20" />
					<br />
					<input onclick="cTimer(1)" type="checkbox" name="D0" value="1" id="wday_mon" /><label for="wday_mon"><%! Monday !%></label>
					<input onclick="cTimer(2)" type="checkbox" name="D1" value="1" id="wday_tue" /><label for="wday_tue"><%! Tuesday !%></label>
					<input onclick="cTimer(3)" type="checkbox" name="D2" value="1" id="wday_wed" /><label for="wday_wed"><%! Wednesday !%></label>
					<input onclick="cTimer(4)" type="checkbox" name="D3" value="1" id="wday_thu" /><label for="wday_thu"><%! Thursday !%></label>
					<input onclick="cTimer(5)" type="checkbox" name="D4" value="1" id="wday_fri" /><label for="wday_fri"><%! Friday !%></label>
					<input onclick="cTimer(6)" type="checkbox" name="D5" value="1" id="wday_sat" /><label for="wday_sat"><%! Saturday !%></label>
					<input onclick="cTimer(7)" type="checkbox" name="D6" value="1" id="wday_sun" /><label for="wday_sun"><%! Sunday !%></label>
				</td>
				<td class="col_right"></td>
			</tr>
			<tr class="row_odd">
				<td class="col_left"></td>
				<td class="col_label"><h5><%! Start Time: !%></h5></td>
				<td class="col_value">
					<input type="text" name="starth" value="<tmpl_var starth>" size="2" maxlength="2" />
					<b>&nbsp;:&nbsp;</b>
					<input type="text" name="startm" value="<tmpl_var startm>" size="2" maxlength="2" />
					&nbsp;<%! o'clock !%>
				</td>
				<td  class="col_right"></td>
			</tr>
			<tr class="row_even">
				<td  class="col_left"></td>
				<td  class="col_label"><h5><%! End Time: !%></h5></td>
				<td  class="col_value">
					<input type="text" name="stoph" value="<tmpl_var stoph>" size="2" maxlength="2" />
					<b>&nbsp;:&nbsp;</b>
					<input type="text" name="stopm" value="<tmpl_var stopm>" size="2" maxlength="2" />
					&nbsp;<%! o'clock !%>
				</td>
				<td  class="col_right"></td>
			</tr>
			<tr class="row_odd">
				<td  class="col_left"></td>
				<td  class="col_label"><h5><%! Priority: !%></h5></td>
				<td  class="col_value"><input type="text" name="prio" value="<tmpl_var prio>" size="2" maxlength="2" /></td>
				<td  class="col_right"></td>
			</tr>
			<tr class="row_even">
				<td  class="col_left"></td>
				<td  class="col_label"><h5><%! Lifetime: !%></h5></td>
				<td  class="col_value"><input type="text" name="lft" value="<tmpl_var lft>" size="2" maxlength="2" /></td>
				<td  class="col_right"></td>
			</tr>
			<tr class="row_odd">
				<td  class="col_left"></td>
				<td  class="col_label"><h5><%! Title of Recording: !%></h5></td>
				<td  class="col_value"><input type="text" name="title" value="<tmpl_var title>" size="80" /></td>
				<td  class="col_right"></td>
			</tr>
			<tr class="row_even">
				<td class="col_left"></td>
				<td class="col_label" valign="top"><h5><%! Summary: !%></h5></td>
				<td class="col_value"><textarea name="summary" rows="6" cols="80"><tmpl_var summary></textarea></td>
				<td class="col_right"></td>
			</tr>
			<tr class="footer">
				<td class="col_left"></td>
				<td colspan="2"></td>
				<td class="col_right"></td>
			</tr>
		</table>

		<div id="buttons">
			<input type="submit" class="submit" name="save" value="<%! Save !%>" />
			<input type="submit" class="submit" name="exit" value="<%! Cancel !%>" />
		</div>
		<input type="hidden" name="aktion" value="timer_add" /> 
		<tmpl_if referer>
			<input type="hidden" name="referer" value="<tmpl_var referer>" />
		</tmpl_if>
		<tmpl_if timer_id>
			<input type="hidden" name="timer_id" value="<tmpl_var timer_id>" /> 
		</tmpl_if>
	</form>
</body>

</html>
