<%'guidedisplay=1%>
<!--#include file="admin_start.asp" -->
<%
id=request("id")
if not MySys.check.isInteger(id) then
   MySys.Error.info = "请提交合法的标签id！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

id=int(id)

rs.open"select * from jins_template_label where label_id="&id&" ",conn,1,1
if rs.eof then
   MySys.Error.info = "您请求的标签不存在！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

if request("label_type")<>"" then
label_type=request("label_type")
else
label_type=rs("label_type")
end if

%>
<body topmargin="30" marginwidth="10" marginheight="10">
<form name=edit_template target=admin_edit_template method=post><input type=hidden name=c value=''><input type=hidden name=c_sql value=''><input type=hidden name=formname value=''><input type=hidden name=inputname value=''></form>
<form name=edit_sql target=admin_edit_sql method=post><input type=hidden name=c value=''><input type=hidden name=formname value=''><input type=hidden name=inputname value=''></form>
<form name=template_label action="admin_template_label_edit_handle.asp?action=edit&id=<%=id%>" method=post>
<table cellpadding="3" cellspacing="4" width="90%" height="30" align=center style='border:1px solid #ebebeb' >
	<tr>
		<td width="2%" align=right><img alt='点击弹开编辑框' onclick="opencat(basic_open)" style='CURSOR: hand' src="Images/index_search.gif" width="8" height="16"></td>
		<td  width="98%" align=left>
		<font color="#ebebeb"> | </font>
		<img alt='点击弹开提示信息框' onclick="opencat(help_ads_open)" style='CURSOR: hand' src="Images/icon_info.gif" width="13" height="13" hspace="0" align="absmiddle">			
		<font color="#ebebeb"> | </font>
		标签编辑
	    </td>
	</tr>		
	<tr id="help_ads_open" style="display:  ">
		<td colspan="10" align=left>
		<table cellpadding="4" cellspacing="2" width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				·您可以更改用户的类型<br>
				·通过更改登陆ip锁定可以解除用户错误的操作造成的无法登陆！<br>
				·通过重置取回密码问题和答案可以帮助用户在忘记密码和密码提示问题的情况下恢复用户权限！<br>
			</td>
			</tr>
		</table>
		</td>
	</tr>
	
	<tr id="basic_open" >
		<td colspan="10" align=left style='padding-bottom:5px'>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="15%" align=right>标签类型:</td>
				<td  width="85%" align=left>
				<select name=label_type onchange='cc();'>
				<option value='0' <%if label_type=0 then response.write "selected"%>>静态标签</option>
				<option value='1' <%if label_type=1 then response.write "selected"%>>动态标签</option>
				</select>				
				<script language="javascript" defer>
				function cc(){
				window.location="admin_template_label_edit.asp?id=<%=id%>&label_type="+document.template_label.label_type.value;
				}
				</script>

				</td>
			</tr>
			<tr>
				<td  width="15%" align=right>所属模版方案:</td>
				<td  width="85%" align=left>
				  <select name=label_project >
				  <option value=0>公用</option>
				  <%
				  set rss=conn.execute("select sort_id,sort_name from jins_template_sort where sort_up=0 ")
				  do while not rss.eof
				  response.write "<option value="&rss("sort_id")&"  "
				  if rss("sort_id")=rs("label_project") then 
				  response.write "selected"
				  label_p=rss("sort_name")
				  end if
				 response.write " >"&rss("sort_name")&"</option>"
				  rss.movenext
				  loop
				  set rss=nothing
				  %>
				  </select>
				</td>
			</tr>
			<tr>
				<td  width="15%" align=right>标签标识:</td>
				<td  width="85%" align=left>
				  <input name=label_name value='<%=rs("label_name")%>' size=25 >
				  <select name=label_link >
				  <option value=0 <%if rs("label_link")=0 then response.write "selected" %>>一般标签</option>
				  <option value=1 <%if rs("label_link")=1 then response.write "selected" %>>快捷标签</option>
				  </select>

				</td>
			</tr>
			<tr>
				<td  width="15%" align=right>加入时间:</td>
				<td  width="85%" align=left>
				<input name=label_addtime value='<%if rs("label_addtime")<>"" then response.write rs("label_addtime") else response.write now()%>' size=25 >
				<a title='点击设置此标签的缓存配置' href='admin_template_label_cache_edit.asp?id=<%=rs("label_id")%>'><img  hspace=1 border='0' src='Images/icon07_o.gif' align='absmiddle' alt='缓存设置！'></a>
				</td>
			</tr>
			<tr>
				<td  width="15%" align=right valign=top >标签描述:</td>
				<td  width="85%" align=left>
                <textarea id="label_description" name="label_description" cols="70" rows="3"><%=rs("label_description")%></textarea>
			    </td>
			</tr>
		</table><br>
		<%
		'////////////////////////////////////////////////////////////////////////////////////////////////////////
		if label_type=1 then
		if rs("label_argument")<>"" then
			label_argument=split(rs("label_argument"),"<#>")
			label_argument_0=label_argument(0)
			if label_argument_0="" then label_argument_0=rs("label_content")
			if ubound(label_argument)>0 then label_argument_1=label_argument(1) else label_argument_1=1
			if ubound(label_argument)>1 then label_argument_2=label_argument(2) else label_argument_2=""
			if ubound(label_argument)>2 then label_argument_3=label_argument(3) else label_argument_3=0 
			if ubound(label_argument)>3 then label_argument_4=label_argument(4) else label_argument_4="" 
			if ubound(label_argument)>4 then label_argument_5=label_argument(5) else label_argument_5="" 
			'if ubound(label_argument)>5 then label_argument_6=label_argument(6) else label_argument_6="" 
		end if
		
		if label_argument_0="" then label_argument_0=rs("label_content")
		if label_argument_0="" then label_argument_0="循环体"
		if label_argument_1="" then label_argument_1=1
		'if label_argument_2="" then label_argument_2="br"
		
		%>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="15%" align=right valign=top>sql语句:</td>
				<td  width="85%" align=left>
                <textarea id="label_sql" name="label_sql" cols="70" rows="5"><%=rs("label_sql")%></textarea>
				<a title='点击进行详细编辑！' href="javascript:openedit_sql('template_label','label_sql');" >
				<img border=0 src="Images/old.gif" width="21" height="20" align="top">
				</a>
				</td>
			</tr>
			<tr>
				<td  width="15%" align=right >列数:</td>
				<td  width="85%" align=left>
                <input id="label_argument_1" name="label_argument_1" value='<%=label_argument_1%>' size=83 >
			    </td>
			</tr>
			<tr>
				<td  width="15%" align=right >行分割符:</td>
				<td  width="85%" align=left>
				<select  name="label_argument_2_c" onchange='ccc();'>
				<option value='' <%if label_argument_2="" then response.write "selected"%>>无</option>
				<option value='br' <%if label_argument_2="br" then response.write "selected"%>>换行[< br >]</option>
				<option value='td' <%if label_argument_2="td" then response.write "selected"%>>列[< td >]</option>
				<option value='tr' <%if label_argument_2="tr" then response.write "selected"%>>行[< tr >]</option>
				<option value='table' <%if label_argument_2="table" then response.write "selected"%>>表格[< table >]</option>
				<option value='div' <%if label_argument_2="div" then response.write "selected"%>>层[< div >]</option>
				<option value='p' <%if label_argument_2="p" then response.write "selected"%>>回车换行[< p >]</option>
				</select>				
				<input id="label_argument_2" name="label_argument_2" value='<%=label_argument_2%>' size=60>
				<script language="javascript" defer>
				function ccc(){
				document.template_label.label_argument_2.value=document.template_label.label_argument_2_c.value;
				}
				</script>
			    </td>
			</tr>
			<tr>
				<td  width="15%" align=right >每页显示:</td>
				<td  width="85%" align=left>
				 <input id="label_argument_3" name="label_argument_3" value='<%=label_argument_3%>' size=76 > 条纪录
			    </td>
			</tr>
			<tr>
				<td  width="15%" align=right valign=top>排序栏:</td>
				<td  width="85%" align=left>
                <textarea wrap="off" id="label_argument_4" name="label_argument_4" cols="70" rows="5"><%=label_argument_4%></textarea>
				<a title='点击进行详细编辑！' href="javascript:openedit_template('template_label','label_argument_4','public,link,sql?order=y','','<%=int(timer)%>','自定义标签排序栏内容编辑 > <%=label_p%> > '+template_label.label_name.value);" >
				<img border=0 src="Images/old.gif" width="21" height="20" align="top">
				</a>
				</td>
			</tr>
			<tr>
				<td   width="15%" align=right valign=top>插入栏:</td>
				<td  width="85%" align=left>
                <textarea wrap="off" id="label_argument_5" name="label_argument_5" cols="70" rows="15"><%=MySys.functions.TransForm(label_argument_5)%></textarea>
				<a title='点击进行详细编辑！' href="javascript:openedit_template('template_label','label_argument_5','object,private?project='+template_label.label_project.value+',public,link','','<%=int(timer)%>','自定义标签插入栏内容编辑 > <%=label_p%> > '+template_label.label_name.value);" >
				<img border=0 src="Images/old.gif" width="21" height="20" align="top">
				</a>
				</td>
			</tr>
			<tr>
				<td  width="15%" align=right valign=top>循环体:</td>
				<td  width="85%" align=left>
                <textarea wrap="off" id="label_argument_0" name="label_argument_0" cols="70" rows="20"><%=MySys.functions.TransForm(label_argument_0)%></textarea>
				<a title='点击进行详细编辑！' href="javascript:openedit_template('template_label','label_argument_0','private?project='+template_label.label_project.value+',public,link,sql','','<%=int(timer)%>','自定义标签循环体内容编辑 > <%=label_p%> > '+template_label.label_name.value);" >
				<img border=0 src="Images/old.gif" width="21" height="20" align="top">
				</a>
				</td>
			</tr>
			
		</table>
		<br>
		<%end if%>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="15%" align=right valign=top>标签内容:</td>
				<td  width="85%" align=left>
                <textarea wrap="off" id="label_content" name="label_content" cols="70" rows="20"><%
			    if label_type=1 then
					l_s=instr(1,rs("label_content"),"{$Handle_Label_Loop")
					if l_s>0 then 
						l_e=instr(l_s,rs("label_content"),"$}")
						response.write MySys.functions.TransForm(mid(rs("label_content"),1,l_s-1))
						response.write "{$loop$}"
						response.write MySys.functions.TransForm(mid(rs("label_content"),l_e+2))
					else
						response.write MySys.functions.TransForm(rs("label_content"))
					end if
				else
					response.write MySys.functions.TransForm(rs("label_content"))
				end if
				%></textarea>
				<a title='点击进行详细编辑！' href="javascript:openedit_template('template_label','label_content','object,private?project='+template_label.label_project.value+',public,link','label_id','<%=rs("label_id")%>','自定义标签标签内容编辑 > <%=label_p%> > '+template_label.label_name.value);" >
				<img border=0 src="Images/old.gif" width="21" height="20" align="top">
				</a>

				</td>
			</tr>
		</table>
		<br>
		</td>
	</tr>

	<tr>
		<td height='1' colspan="9" background='images/dot03.gif'></td>
	</tr>
	
	<tr>
	  <td height='30' colspan="8" width='100%' align=center >
	  <input type=submit value="提交设置！" >
	   <input type=reset value="重置" > 
	   <input onclick='history.back(-1)' type=button value="返回" >	  </td>
	</tr>
</table>		
<SCRIPT language=javascript>
	function opencat(cat)
	{
 	 	if(cat.style.display=="none"){
     	cat.style.display="";
  		} else {
     	cat.style.display="none"; 
  		}
	}</SCRIPT>
</form>
<%
rs.close
%>
<!--#include file="admin_end.asp" -->