<!--<?php
if (!defined('AJAX')){
include_once PrintEot('left');
}print<<<EOT
-->
<style type="text/css">
.cate_search{}
.cate_search span{float:left;height:30px;line-height:30px;margin-right:10px;}
.cate_search span input{ vertical-align:middle;margin:0 3px;}
.cate_search span select{margin:0 3px;}
</style>
<!--
EOT;
if (empty($action)) {print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li class="current"><a href="$basename">鏈接列表</a></li>
        <li><a href="$basename&action=types">鏈接分類</a></li>
    </ul>
</div>
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
	<div class="legend"> 友情鏈接添加說明:<ol><li>特殊鏈接(顯示順序<0，每行顯示一個)</li><li>普通連接(顯示順序>=0)</li></ol></div>
</div>
<form method="post" action="$basename&" name="FORM">
	<h2 class="h1 cc">
		<span class="linka fr"><select onchange="window.location=('$basename&state='+this.value);">
			<option value="0" $state_0>所有狀態</option>
			<option value="1" $state_1>已審</option>
			<option value="2" $state_2>未審</option>
		</select></span>
		<span class="fl mr10">友情鏈接列表</span>
		<a class="btn_add fl" href="$basename&action=add&state=$state" hidefocus="true"><i>添加友情鏈接</i></a>
	</h2>
	<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr2 vt td_bgB">
			<td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
			<td width="30">順序</td>
			<td width="18%">站點名稱</td>
			<td width="25%">站點URL</td>
			<td width="*">站點說明</td>
			<td width="100">分類</td>
			<td width="50">狀態</td>
			<td width="50">操作</td>
		</tr>
<!--
EOT;
if (empty($threaddb)) {print <<<EOT
-->
<tr><td class="p10" colspan="7"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($threaddb as $key=> $thread){
$tmpstate=$thread[ifcheck] ? '<span class="s3">已審</span>' : '<span class="s1">未審</span>';
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="td2"><input type='checkbox' name='deiaid[]' value="$thread[sid]"></td>
			<td class="td2"><input type="text" class="input input_wd" name="vieworder[$thread[sid]]" value="$thread[threadorder]" ></td>
			<td class="td2"><a href="$basename&action=edit&sid=$thread[sid]">$thread[name]</a></td>
			<td class="td2">$thread[url]</td>
			<td class="td2">$thread[descrip]</td>
			<td class="td2">$thread[type]</td>
			<td class="td2">{$tmpstate}</td>
			<td class="td2"><a href="$basename&action=edit&sid=$thread[sid]&state=$state" title="編輯">[編輯]</a></td>
		</tr>
		<!--
EOT;
}}print <<<EOT
-->
	</table>
	</div>
	<input name=action type=hidden value="del">
	<div class="tac mb10">
		<span class="bt2"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
        <input name="order" class="bt3" value="提 交" type="submit" />
        <input name="pass" class="btn3" value="審 核" type="submit" />
        <input name="unpass" class="bt3" value="未 審" type="submit" />
        <input name="delete" class="bt3" value="刪 除" type="submit" />
	</div>
</form>
<!--
EOT;
}elseif($action=='add' || $action=='edit'){print <<<EOT
-->
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
	<div class="legend"> 友情鏈接添加說明:<ol><li>特殊鏈接(顯示順序<0，每行顯示一個)</li><li>普通連接(顯示順序>=0)</li></ol></div>
</div>
<form name="checkform" action="$basename" method=POST onsubmit="return checkpost(document.checkform);" >
	<input type=hidden name="action" value=$action />
	<input type=hidden name="step" value="2" />
	<input type=hidden name="sid" value=$sid />
	<h2 class="h1">
<!--
EOT;
if($action=='edit'){ print <<<EOT
-->
		<span class="mr10">編輯友情鏈接</span>
<!--
EOT;
}else{ print <<<EOT
-->
		<span class="mr10">添加友情鏈接</span>
<!--
EOT;
} print <<<EOT
-->
		<a href="$basename&state=$state" class="linka">返回上一級<span class="f9">▲</span></a>
	</h2>
	<div class="admin_table mb10">
	<table cellspacing="0" cellpadding="0" width="100%">
		<tr class="tr1 vt">
			<td class="td1">站點名稱 <span class="s1">*</span></td>
			<td class="td2"><input type="text" class="input input_wa" name="name" value='$name' /></td>
		</tr>

		<tr class="tr1 vt">
			<td class="td1">站點URL <span class="s1">*</span></td>
			<td class="td2"><input type="text" class="input input_wa" name="url" value='$url' /></td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">顯示順序(默認為0)</td>
			<td class="td2"><input type="text" class="input input_wa" name="threadorder" value='$threadorder' /></td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">聯系方式</td>
			<td class="td2"><input type="text" class="input input_wa" name="username" value='$username' /></td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">站點說明</td>
			<td class="td2"><input type="text" class="input input_wb" name="descrip" value='$descrip' /></td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">站點LOGO<br />(設置文字鏈接請留空)</td>
			<td class="td2"><input type="text" class="input input_wa" name="logo" value='$logo' /></td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">分類</td>
			<td class="td2">
            <ul class="list_A list_80 cc" style="width:600px;">
<!--
EOT;
if ( $action == 'add' ) $ifcheck_N = 'checked';
foreach ($typeCates as $key=>$value) {
$ifable = '';
if ($action == 'edit') {
	($value[stid] && S::inArray($value[stid],$stids)) && $ifable = 'checked';
}
print <<<EOT
--> 

            <li><input type="checkbox" name="stid[]" value="$value[stid]" $ifable>$value[name]</li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
            </td>
		</tr>
		<tr class="tr1 vt">
			<td class="td1">狀態</td>
			<td class="td2">
				<ul class="list_A list_80 cc">
					<li><input type="radio" name="ifcheck" $ifcheck_Y value="1" />已審</li>
					<li><input type="radio" name="ifcheck" $ifcheck_N value="0" />未審</li>
				</ul>
			</td>
		</tr>
	</table>
	</div>
	<div class="tac mb10">
		<span class="btn"><span><button type="submit">提 交</button></span></span>
	</div>
</form>
<script type="text/javascript">
function checkpost(obj) { 
	if (obj.name.value == "") {
			obj.name.setAttribute("hasError", 1);
			showDialog("error","站點名稱不能為空",2);
			obj.name.focus();
			return false;
	} 
	if (obj.url.value == "") {
			obj.url.setAttribute("hasError", 1);
			showDialog("error","站點url不能為空",2);
			obj.url.focus();
			return false;
	} 
}
</script>
<!--
EOT;
} elseif ($action == 'types') {print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
        <li><a href="$basename">鏈接列表</a></li>
        <li class="current"><a href="$basename&action=types">鏈接分類</a></li>
    </ul>
</div>

<form action="$basename" method="post" name="sharetype">
<input type="hidden" name="action" value="edittype" />
<h2 class="h1 cc"><span class="fl mr10">分類管理</span><a href="javascript:;" onclick="sendmsg('$ajax_basename_add','',this.id);" id="addtype" class="btn_add fl"><i>添加分類</i></a></h2>
<div class="admin_table mb10">
<table cellpadding="0" cellspacing="0" width="100%">
	<tr class="tr2">
		<td width="30" class="cp" onclick="CheckAll(document.sharetype)">啟用</td>
		<td style="width:80px;">順序</td>
		<td style="width:350px;">分類名稱</td>
		<td></td>
	</tr>
<!--
EOT;
foreach ($typeCates as $key => $value) {
$ifable = '';
if ($value[ifable]) $ifable = 'checked';
print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2"><input type="checkbox" name="types[$value[stid]][ifable]" value="$value[stid]" $ifable></td>
		<td class="td2"><input type="text" class="input input_wc" name="types[$value[stid]][vieworder]" value="$value[vieworder]"></td>
		<td class="td2"><input name="types[$value[stid]][name]" type="text" class="input input_wb" value="$value[name]" /></td>
		<td class="td2">
            <a href="$basename&action=deltype&stid=$value[stid]" onclick="if(!confirm('刪除友情鏈接分類將刪除友情鏈接關系表中與該分類相關的所以數據，請確認')){return false;}" class="mr20">[刪除]</a>
        </td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="mb10 tac"><span class="btn"><span><button type="submit">提 交</button></span></span></div>
</form>

<!--
EOT;
} elseif (in_array($action,array('addtype'))){print<<<EOT
-->
<form name="form" method="post" action="$ajax_basename_add&" onsubmit="return false;">
<input type="hidden" name="stid" value="$stid">
<input type="hidden" name="step" value="2">
<h2 class="h1" style="cursor:move" onmousedown="read.move(event);">
<!--
EOT;
if ($action == 'addtype'){print<<<EOT
-->
	添加分類
<!--
EOT;
}print<<<EOT
-->
</h2>
<div class="admin_table mb10">
<table cellpadding="0" cellspacing="0" width="100%" style="table-layout:auto;">
	<tr class="tr1 vt">
		<td class="td2" style="width:75px;">分類名稱</td>
		<td class="td2"><input name="name" id="cate_name" class="input input_wa" value="$types[name]" maxlength="30">&nbsp;最多30個字節</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td2">啟用</td>
		<td class="td2">
       		<ul class="cc list_80 list_A mr10">
                <li><input type="radio" name="ifable" value="1" $ifable_Y> 開啟</li>
                <li><input type="radio" name="ifable" value="0" $ifable_N> 關閉</li>
            </ul>
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td2">順序</td>
		<td class="td2"><input name="vieworder" class="input input_wa" value="0"></td>
	</tr>
</table>
</div>
<div class="tac mb10">
<!--
EOT;
if ($action == 'addtype'){print<<<EOT
-->
	<span class="btn2"><span><button type="button" onclick="ajax.submit(this.form,ajax.guide)">提 交</button></span></span>
	<span class="bt2"><span><button type="button" onclick="closep();">取 消</button></span></span>
<!--
EOT;
}print<<<EOT
-->
</div>
</form>
<!--
EOT;
}if (!defined('AJAX')) {
include_once PrintEot('adminbottom');
}
?>-->