<!--#include file="../../fy.Function.asp"-->
<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>标签生成</title>
<link rel="stylesheet" type="text/css" href="../../css/base.css">
<link rel="stylesheet" type="text/css" href="../../css/content.css">
</head>
<body>
<div class="content">
<% 
Dim table,rs,Selected
table=fycms.s("table")
Function gettable()
Dim j,shm
j=0 
dim tablecount 
tablecount=0 
Set shm = conn.OpenSchema(20) 
shm.MoveFirst 
Do While Not shm.EOF 
  If shm("TABLE_TYPE") = "TABLE" Then 
        If Left(shm("table_name"), 1) <> "~" Then '这里过滤掉隐藏表 
           j=j+1 
           'call GetFileds(shm("table_name")) 
		  '   gettable=gettable&"<option  value='"&shm("table_name")&"' >"&lan(shm("table_name"))&"</option>"& vbCrLf
		  gettable=gettable&shm("table_name")&","
			'  gettable=gettable&","&shm("table_name")
		    ' gettable=gettable&"case """&shm("table_name")&""" "& vbCrLf&" echo ""数据库表名称"""& vbCrLf
        End If 
  End If 
  shm.MoveNext 
Loop 
'response.write "共有 "&j&" 个数据表!" 

End Function 

	Function MXArr()
		Dim IF_NULL,i
		IF_NULL=fycms.Act_MXtab_Arr()
 		If IsArray(IF_NULL) Then
			For I=0 To Ubound(IF_NULL,2)
			 MXArr=MXArr&IF_NULL(1,I)&","
			Next
		End If
	End Function 
	Function getalltable()

		Dim tarr,ii
		tarr=MXArr&"AC_fy,Admin_fy,ads_fy,ATT_fy,Book_fy,Card_fy,Class_fy,ClassLink_fy,Comment_fy,Config_fy,dbquery_fy,Digg_fy,DiyMenu_fy,DiyPage_fy,diyplus_fy,diysearch_fy,Edays_fy,Field_User_fy,Friend_fy,Group_fy,Link_fy,Log_fy,Message_fy,Mode_fy,ModeForm_fy,ModeUser_fy,Money_Log_fy,Mood_List_fy,Mood_Plus_fy,Node_fy,Plus_fy,plusget_fy,Point_Log_fy,Show_fy,Sitelink_fy,space_fy,Special_fy,SpecialPicUrl_fy,Table_fy,Tags_fy,templets_fy,Upload_fy,User_fy,Vote_fy"
		tarr=Split(tarr,",")
		For ii=0 To ubound(tarr)
				'echo tarr(ii)&"<br />"
				If tarr(ii)=table Then Selected=" Selected"
			  If fycms.FoundInArr(gettable,Trim(tarr(ii)),",")=true Then
			 
				getalltable=getalltable&"<option  value='"&tarr(ii)&"' "&Selected&">"&lan(tarr(ii))&"</option>"& vbCrLf
			  Else 
 				 getalltable=getalltable&"<option   value='"&tarr(ii)&"' "&Selected&">"&lan(tarr(ii))&"</option>"& vbCrLf
			  End If 
			  Selected=""
		Next 
	End Function 


Function lan(tab)
	Select Case tab
		case "AC_fy" 
		 lan = "资源属性表"
		case "Admin_fy" 
		 lan = "管理员表"
		case "ads_fy" 
		 lan = "广告表"
		case "Article" 
		 lan = "文章模型表"
		case "ATT_fy" 
		 lan = "数据库表名称"
		case "Book_fy" 
		 lan = "留言板"
		case "Card_fy" 
		 lan = "充值卡"&tab
		case "Class_fy" 
		 lan = "栏目数据表"
		case "ClassLink_fy" 
		 lan = "友情链接分类表"
		case "Comment_fy" 
		 lan = "评论表"
		case "Config_fy" 
		 lan = "系统配置数据表"
		case "dbquery_fy" 
		 lan = "数据源"
		case "Digg_fy" 
		 lan = "digg"
		case "DiyMenu_fy" 
		 lan = "自定义后台菜单"
		case "DiyPage_fy" 
		 lan = "单页表"
		case "diyplus_fy" 
		 lan = "自定义插件"
		case "diysearch_fy" 
		 lan = "自定义搜索"
		case "Edays_fy" 
		 lan = "未知"&tab
		case "Field_User_fy" 
		 lan = "默认会员自定义字段"
		case "Friend_fy" 
		 lan = "会员好友"
		case "Group_fy" 
		 lan = "会员组"
		case "Link_fy" 
		 lan = "友情链接"
		case "Log_fy" 
		 lan = "日志"
		case "Message_fy" 
		 lan = "会员短消息"
		case "Mode_fy" 
		 lan = "未知"
		case "ModeForm_fy" 
		 lan = "未知"&tab
		case "ModeUser_fy" 
		 lan = "会员模型配置"
		case "Money_Log_fy" 
		 lan = "未知"&tab
		case "Mood_List_fy" 
		 lan = "心情插件列表"
		case "Mood_Plus_fy" 
		 lan = "心情插件"
		case "Node_fy" 
		 lan = "专题节点"
		case "Plus_fy" 
		 lan = "系统插件表"
		case "plusget_fy" 
		 lan = "未知"&tab
		case "Point_Log_fy" 
		 lan = "未知"&tab
		case "Show_fy" 
		 lan = "未知"&tab
		case "Sitelink_fy" 
		 lan = "友情链接"
		case "space_fy" 
		 lan = "未知"&tab
		case "Special_fy" 
		 lan = "专题"
		case "SpecialPicUrl_fy" 
		 lan = "未知"&tab
		case "Table_fy" 
		 lan = "未知"&tab
		case "Tags_fy" 
		 lan = "Tags"
		case "templets_fy" 
		 lan = "空间模版"
		case "Upload_fy" 
		 lan = "文件上传"
		case "User_fy" 
		 lan = "默认会员表"
		case "Vote_fy" 
		 lan = "投票"
		Case Else 
		 lan =getmode(tab)
		  
	End Select 
		lan=lan&"("&tab&")"
End Function 

 	Function getmode(mtab)
		  Set Rs =fycms.ACTEXE("SELECT ModeID, ModeName,ModeTable, ModeStatus, IFmake,ModeNote  FROM Mode_fy  where ModeTable='"&mtab&"' order by ModeID asc")
		 If Not  Rs.EOF  Then 	getmode=rs("ModeName")&"模型表"
		
		 
	End Function 




Function GetFileds(TableName)
 If Trim(TableName)="" Then Exit Function 
Set rs = server.createobject("adodb.recordset") 
Dim SQL ,rs,i
SQL = "select * from " & TableName 
rs.Open SQL, conn, 1, 1 
Dim Cont 
Cont = rs.Fields.Count 
response.write "<div style=""margin-bottom:10px;padding:5px;border:1px #dddddd solid;background:#eeeeee"">"&vbcrlf 
response.write "表 <font color=red><b>"&TableName&"</b></font> 中含有"&Cont&"个字段,具体如下:<br>"&vbcrlf 
For i = 0 To Cont - 1 
  dim filtype 
  filtype=getType(rs.fields(i).type)
  response.write " <label for="""&rs.fields(i).name&"s""><input type=""checkbox"" name=""Fileds"" id="""&rs.fields(i).name&"s"" onclick=""CheckForm();"" value="""&rs.fields(i).name&""" >"&rs.fields(i).name&"</label>"
  'response.write "  <font color=red>"&i&"</font>--<font color=green><b>"&rs.fields(i).name&"</b></font>--"&filtype&rs.fields(i).type&";<br />"&vbcrlf 
Next 
response.write "</div>"&vbcrlf 
rs.Close 
set rs=nothing 
End Function 



function getType(num)
   getType=num
   select case num
     case "202" :
       getType="文本"
     case "203" :
       getType="备注"
     case "3" :
       getType="长整型"
     case "2" :
       getType="整型"
     case "17" :
       getType="字节"
     case "3" :
       getType="长整型"
     case "4" :
       getType="单精浮点"
     case "5" :
       getType="双精浮点"
     case "3" :
       getType="长整型"
     case "72" :
       getType="同步复制ID"
     case "131" :
       getType="小数"
     case "135" :
       getType="日期/时间"
     case "6" :
       getType="货币"
     case "11" :
       getType="是/否"
     case "205" :
       getType="OLE对象"
   end select
end function
 %> 
 <script type='text/javascript' src='../../../fy_inc/js/jquery.js'></script>
 <script type='text/javascript' src='../../../fy_inc/js/lhg/lhgdialog.min.js'></script>
<script type='text/javascript' src='../../js/main.js'></script>

 

<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 标签生成</div>
   <form action="tags.asp" method="post" name="frm" target="stafrm" id="frm">

  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
	

<tr>
	  <td colspan="2" align="center"  class="bg_tr">FYCMS标签生成</td>
	  </tr>
<input type="hidden" name="tagsAhelp" id="tagsAhelp">
	<tr>
      <td width="18%" align="right"  ><strong>所属数据表：</strong></td>
      <td width="82%"   class="tl">
<select name="table"  id="table"  size="1"  onchange="ajaxpost();CheckForm();">
<option value="">请选择数据表</option>
    
		<%=getalltable()%>
    </select> 
  <a target=_blank href="http://bq.fycms.com/"><font color=green>标签在线帮助</font></a>
  <a target=_blank href="http://help.fycms.com/link.asp?id=makelabel"><font color=red>查看标签生成教程</font></a>
	</td>
    </tr>	




 

	<tr>
      <td width="18%" align="right"  ><strong>字段：</strong></td>
      <td width="82%"   id="fe" class="tl">
<%=GetFileds(fycms.s("table"))%>
	</td>
    </tr>	



   	<tr>
      <td width="18%" align="right"  ><strong>属性：</strong></td>
      <td width="82%"   class="tl">
 		<label for="islist1"><input type="radio" value="1" name="islist" id="islist1" checked onClick="CheckForm();" >文章列表</label>
		<label for="islist2"><input type="radio" value="2" name="islist" id="islist2"  onclick="CheckForm();" >文章分页</label>
		<label for="islist3"><input type="radio" value="3" name="islist" id="islist3"   onclick="CheckForm();" >双重循环</label>

	</td>
    </tr>	


 
    	<tr>
      <td width="18%" align="right"  ><strong>条件：</strong></td>
      <td width="82%"   class="tl">
 
	 <select name="LeftRulers"   onchange="CheckForm();">
			<option value="">数据关系</option>
			<option value="?if=<>">&lt;&gt;</option>
			<option value="?if=<=">&lt;=</option>
			<option value="?if=>=">&gt;=</option>
			<option value="?if=<">&lt;</option>
			<option value="?if=>">&gt;</option>
			<option value="?if==">=</option>
			<option value="?if=In">In</option>
			<option value="?if=Like">Like</option>
		</select>

	</td>
    </tr>	


    
    	<tr>
      <td width="18%" align="right"  ><strong>常用属性：</strong></td>
      <td width="82%"   class="tl">
 
		调用数量<input name="topnum" type="text" id="topnum" onKeyUp="CheckForm();" size="16" />
自增长[AutoID0]<br />
	</td>
    </tr>	


       	<tr>
      <td width="18%" align="right"  ><strong>所属栏目：</strong></td>
      <td width="82%"  class="tl">
 
<input name="classid" type="text" id="classid" onClick="classidhelp.innerHTML='为空则显示所有文章,指定单个栏目则填写该栏目的ID即可,如 &lt;a&gt;1&lt;/a&gt; ,如需指定多个栏目下的文章则用英文状态下的逗号(,)分隔多个栏目ID,如 &lt;a&gt;1,2,3,4&lt;/a&gt;';" onKeyUp="CheckForm();" size="30" />


<select name="select"   onchange="document.frm.classid.value=this.value;CheckForm();">
          <option selected>-- 请选择 --</option>
          <option value="[type:classid] ">当前栏目id</option>
          <option value="[type:rootclassid]">上一级栏目id</option>
          <option value="[type:allclassid]">当前栏目下的所有id</option>
        </select>


或者 [type:classid="指定栏目ID@参数2"] 栏目ID如果用@分隔.那么获取到的栏目ID以参数2分隔 





<br /><span id="classidhelp"></span>标签说明<br />
	</td>
    </tr>	

  
  	<tr>
      <td width="18%" align="right"  ><strong>标签：</strong></td>
      <td width="82%"  >

 		<iframe src="Tags.Asp?Act=Int" name="stafrm" width="100%" marginwidth="0" height="340" marginheight="0" scrolling="Auto" frameborder="0" id="stafrm"></iframe>
	</td>
    </tr>	
 
  </table>

 

</form>
</div>
 <script language = "JavaScript">
 

function CheckForm()
{ 	var chk=true;
  	if(chk)frm.submit();

      
}
function ajaxpost()
 	{

 
$.ajax({ 
url: "GetFileds.asp?A=c&table="+document.frm.table.value+"&m="+Math.random(), 

  success: function (data, textStatus) { 

			 	document.getElementById("fe").innerHTML = data;
}

}); 
 }




function ajaxpostFields(ta,fie,fdata)
 	{

 
$.ajax({ 
url: "1.asp?A=c&table="+ta+"&m="+Math.random(), 

  success: function (data, textStatus) { 
		alert("12312");
			 	document.getElementById(ta+fie).innerHTML = data;
}

}); 
 }




 </script>
 		
</body>
</html>
