<!--
<?php 
print <<<EOT
-->
<div class="nav4 mb10">
    <ul class="cc">
        <li class="current"><a href="$basename&job=stman" hidefocus="true">專題內容管理</a></li>
        <li><a href="$basename&job=cgman" hidefocus="true">專題分類管理</a></li>
        <li><a href="$basename&job=bgman" hidefocus="true">背景圖片管理</a></li>
    </ul>
</div>
<div class="mb10 search tar">
<form action="{$basename}&job=$job" method="post">
	專題名稱:
	<input type="text" class="input input_wa mr5" name="search_title" value="$search_title" />
	分類:
	<select name="search_cid" class="select_wa">
	
		<option value="0">所有分類</option>
<!--
EOT;
foreach ($category_list as $category) {
	$selected = $category['id'] == $search_cid ? "selected" : "";
print <<<EOT
-->
		<option value="{$category['id']}" $selected>{$category['title']}</option>
<!--
EOT;
}
print <<<EOT
-->
	</select>
    <span class="bt2"><span><button type="submit" onfocus="blur();">搜 索</button></span></span>
</form>
</div>
<form action="{$basename}&job=$job" method="post" id="listForm" onsubmit="return checkSubmit();">
<h2 class="h1">已有專題列表</h2>
<div class="admin_table mb10">
<table width="100%">
	<tr class="tr2 td_bgB">
		<td width="25">&nbsp;</td>
		<td width="100">專題名稱</td>
		<td>鏈接地址</td>
		<td width="80">所屬分類</td>
		<td width="120">創建時間</td>
		<td width="50">操作</td>
	</tr>
<!--
EOT;
	foreach ($stopic_list as $stopic) {
		$start_time = get_date($stopic['start_date'], "Y/m/d");
		$end_time = get_date($stopic['end_date'], "Y/m/d");
print <<<EOT
-->
	<tr class="tr1">
		<td class="td2"><input name="stopic_ids[]" type="checkbox" value="{$stopic['stopic_id']}" /></td>
<!--
EOT;
		if ($stopic[url]) {
print <<<EOT
-->
		<td class="td2">{$stopic['title']}</td>
		<td class="td2"><a href="{$stopic['url']}" target="_blank">{$stopic['url']}</a></td>
<!--
EOT;
		} else {
print <<<EOT
-->
		<td class="td2">{$stopic['title']}</td>
		<td class="td2">頁面還未生成</td>
<!--
EOT;
		}
print <<<EOT
-->
		<td class="td2">{$stopic['catetitle']}</td>
		<td class="td2">{$stopic['create_date']}</td>
		<td class="td2"><a href="$basename&job=make&stopic_id={$stopic['stopic_id']}">[編輯]</a></td>
	</tr>
<!--
EOT;
	}
print <<<EOT
-->
</table>
	<div class="mg_pw">
		<ul>
        	<li><a href="javascript:void(0);" onclick="CheckAll(getObj('listForm'))">全選</a></li>
            <li><input type="hidden" name="jobact" value="delete" /><input class="bt3" type="submit" value="刪除所選" /></li>
        </ul>
	</div>
</div>
<div class="mb10">$pages</div>
</form>
<script type="text/javascript">
function checkSubmit() {
	if (!checkSelectBox('stopic_ids[]')) {
		alert('請選擇要刪除的專題');
		return false;
	} else {
		return confirm('該操作將刪除選中專題的所有數據，你確定要繼續麼？');
	}
}
function checkSelectBox(checkBoxName) {
	var obj;
	obj = document.getElementsByName(checkBoxName);
	if (obj != null) {
		var i;
		for(i=0; i<obj.length; i++){
			if (obj[i].checked) return true;
		}
	}
	return false;
}
</script>

<!--
EOT;


?>
-->