<!--<?php
include_once PrintEot('left');
if (empty($action)){print <<<EOT
-->
<h2><b>提示信息</b></h2>
<ul class="tr5">

<li>1、計劃任務是一項使系統在規定時間自動執行某些特定任務的功能。</li>

<li>2、合理設置執行時間，能有效地為服務器減輕負擔。</li>

<li>3、對于如“期限頭餃自動回收”此類需每天更新的計劃任務建議不設置月和周的更新時間，否則對于購買一或幾天的頭餃的用戶可能在一周或者一月內都無法回收頭餃。</li>
</ul>

<form action="$basename&" method="POST">
<input type="hidden" name="action" value="unsubmit" />
<h3>計劃任務管理</h3>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3 s3">
		<td width="6%"></td>
		<td width="*">任務標題</td>
		<td width="24%">任務周期</td>
		<td width="17%">上次執行時間</td>
		<td width="17%">下次執行時間</td>
		<td width='6%' class="tal">設置</td>
		<td width='6%'>操 作</td>
	</tr>
<!--
EOT;
$cnWeek = array(
	'1'	=> '星期一',
	'2'	=> '星期二',
	'3'	=> '星期三',
	'4'	=> '星期四',
	'5'	=> '星期五',
	'6'	=> '星期六',
	'7'	=> '星期天',
);
foreach($plandb as $key=>$value){
print <<<EOT
-->
	<tr class="tr3">
		<td>$value[id]</td>
		<td>$value[subject]</td>
		<td>
<!--
EOT;
if($value['todo'] == 'm') {print <<<EOT
-->
每月&nbsp;$value[month]&nbsp;日&nbsp;$value[day]&nbsp;點&nbsp;$value[hour]&nbsp;分
<!--
EOT;
}elseif($value['todo'] == 'w') {print <<<EOT
-->
每周&nbsp;{$cnWeek[$value[week]]}&nbsp;$value[day]&nbsp;點&nbsp;$value[hour]&nbsp;分
<!--
EOT;
}elseif($value['todo'] == 'd') {print <<<EOT
-->
每天&nbsp;$value[day]&nbsp;點&nbsp;$value[hour]&nbsp;分
<!--
EOT;
}elseif($value['todo'] == 'h') {print <<<EOT
-->
每小時&nbsp;$value[hour]&nbsp;分
<!--
EOT;
}print <<<EOT
-->
		</td>
		<td>$value[usetime]</td>
		<td>$value[nexttime]</td>
		<td><a class="fourm-two"  onclick="window.location=('$basename&action=planset&id='+$value[id])" title="設置"><span class="edit"></span></a></td>
		<td>
<!--
EOT;
if($value[id]>7){ print <<<EOT
-->
		<input type="checkbox" name="selid[]" value="$value[id]" />
<!--
EOT;
}else{ print <<<EOT
-->
		--
<!--
EOT;
} print <<<EOT
-->
		</td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
</table><br />
<center><input type="button" class="btn" name="chkall" value="全 選" onclick="CheckAll(this.form)" />
<input type="submit" class="btn" value="刪除所選項" onclick="return check();" /></center><br/>
</form>
<script language="JavaScript">
function check(){
	if(confirm("確定要刪除所有所選項嗎？")){
		return true;
	}else{
		return false;
	}
}
</script>
<!--
EOT;
}elseif($action=='planset'){
print <<<EOT
-->


<ul class="nav3">
<li><a href="$basename">計劃任務管理</a></li>
<li><a href="$basename&action=planset&id=$id" class="two">計劃任務設置</a></li>
</ul>
<div class="c"></div>

<form action="$basename&" method="POST">
<input type="hidden" name="action" value="planset" />
<input type="hidden" name="step" value="3" />
<input type="hidden" name="id" value="$id" />
<h2>計劃任務設置</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3">
		<td width="30%">任務標題</td>
		<td width="*"><input class="input" type="text" name="title" value="$rt[subject]" size="40" /></td>
	</tr>
	<tr class="tr3">
		<td>任務周期</td>
		<td>
			<input type="radio" name="todo" onclick="showTodo('mTodo');" $todo_m />月
			<input type="radio" name="todo" onclick="showTodo('wTodo');" $todo_w />周
			<input type="radio" name="todo" onclick="showTodo('dTodo');" $todo_d />日
			<input type="radio" name="todo" onclick="showTodo('hTodo');" $todo_h />時
		</td>
	</tr>
	<tr class="tr3">
		<td>具體執行時間</td>
		<td id="iTodo">
			每月&nbsp;<select name="month">$month</select>&nbsp;日&nbsp;
			<select name="day">$day</select>&nbsp;點
			（<select name="hours[]">$hours[0]</select>&nbsp;分　或　<select name="hours[]">$hours[1]</select>&nbsp;分　或　<select name="hours[]">$hours[2]</select>&nbsp;分　或　<select name="hours[]">$hours[3]</select>&nbsp;分）執行
		</td>
	</tr>
	<tr class="tr3">
		<td>是否開啟該計劃任務</td>
		<td><input type="radio" name="ifopen" value="1" $ifopen_Y>是<input type="radio" name="ifopen" value="0" $ifopen_N>否</td>
	</tr>
	<tr class="tr3">
		<td>執行文件名<br />(在./require/plan/目錄下)</td>
		<td><input type="text" class="input" name="filename" value="$rt[filename]">.php</td>
	</tr>
<!--
EOT;
if(file_exists(R_P.'template/admin/'.$rt['filename'].'_set.htm')){print <<<EOT
-->
	<tr class="tr3">
		<td>詳細設置</td>
		<td><input type="button" class="btn" value="設置" onclick="window.location=('$basename&action=detail&id=$id')" />
	</tr>
<!--
EOT;
} print <<<EOT
-->
</table>
<br />
<center><input type="submit" value="提 交" class="btn"> <input type=reset value="重 置" class="btn"></center></form><br/>
<table style="display:none">
	<tr class="tr3">
		<td id="mTodo">
			每月&nbsp;<select name="month">$month</select>&nbsp;日&nbsp;
			<select name="day">$day</select>&nbsp;點
			（<select name="hours[]">$hours[0]</select>&nbsp;分　或　<select name="hours[]">$hours[1]</select>&nbsp;分　或　<select name="hours[]">$hours[2]</select>&nbsp;分　或　<select name="hours[]">$hours[3]</select>&nbsp;分）執行
		</td>
		<td id="wTodo">
			每周&nbsp;<select name="week">
			<option value="*">*</option>
			<option value="1" $week_1>星期一</option>
			<option value="2" $week_2>星期二</option>
			<option value="3" $week_3>星期三</option>
			<option value="4" $week_4>星期四</option>
			<option value="5" $week_5>星期五</option>
			<option value="6" $week_6>星期六</option>
			<option value="7" $week_7>星期天</option>
			</select>&nbsp;
			<select name="day">$day</select>&nbsp;點
			（<select name="hours[]">$hours[0]</select>&nbsp;分　或　<select name="hours[]">$hours[1]</select>&nbsp;分　或　<select name="hours[]">$hours[2]</select>&nbsp;分　或　<select name="hours[]">$hours[3]</select>&nbsp;分）執行
		</td>
		<td id="dTodo">
			每天&nbsp;<select name="day">$day</select>&nbsp;點
			（<select name="hours[]">$hours[0]</select>&nbsp;分　或　<select name="hours[]">$hours[1]</select>&nbsp;分　或　<select name="hours[]">$hours[2]</select>&nbsp;分　或　<select name="hours[]">$hours[3]</select>&nbsp;分）執行
		</td>
		<td id="hTodo">
			每小時&nbsp;<select name="hours[]">$hours[0]</select>&nbsp;分　或　<select name="hours[]">$hours[1]</select>&nbsp;分　或　<select name="hours[]">$hours[2]</select>&nbsp;分　或　<select name="hours[]">$hours[3]</select>&nbsp;分　執行
		</td>
	</tr>
</tbody></table>
<script type="text/javascript">
function showTodo(T) {
	getObj('iTodo').innerHTML = getObj(T).innerHTML;
}
showTodo('{$todo}Todo');
</script>
<!--
EOT;
}elseif($action=='detail'){print <<<EOT
-->
<ul class="nav3">
<li><a href="$basename">計劃任務管理</a></li>
<li><a href="$basename&action=planset&id=$id">計劃任務設置</a></li>
<li><a href="#" class="two">詳細設置</a></li>
</ul>
<div class="c"></div>
<!--
EOT;
if(file_exists(PrintEot($filename.'_set'))){
include_once PrintEot($filename.'_set');
}}include_once PrintEot('adminbottom');
?>-->