<%@ page language="C#" autoeventwireup="true" inherits="admin_dynamic, localhost_deploy" %>
<%@ Register Src='../common/formitem.ascx' TagName='formitem' TagPrefix='uc1' %>

<%if(Para("body")=="1"){%>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head runat='server'>
	<title>动态执行</title>
	<link href='/admin/common/client.css' rel='stylesheet' type='text/css' />
	</head>
	<body>
<%}%>
   <%switch(i_sel)
   {
   		case 1://读取目录
   		{
   			%>
   			<script type="text/javascript" src="/common/client.js" charset="utf-8"></script>
   			<script language="javascript">
   			var s_html='<%=GetClass(Para("layer"),Para("id"))%>';
   			
 			  if(s_html!="")
 			  {
 			  	
 			  	$P('spn<%=Para("id")%>').innerHTML=s_html;
 			  	$P('img<%=Para("id")%>').style.display="";
 			  	$P('img<%=Para("id")%>').src=$P('img<%=Para("id")%>').src.replace("plus","minus")	;
 			  }
 			  else
 			  {
 			  	$P('img<%=Para("id")%>').style.display="none";
 			  }
 			  </script>
   			<%
   		  break;
   		}
   		case 2://上载文件
   		{
   			%>
   			<script type="text/javascript" src="/common/client.js" charset="utf-8"></script>
   			<script language="javascript">
   			var s_file="<%=SetSmallImage()%>";
   			$P('<%=Para("hidobj")%>').value=s_file;
   			
   			if(typeof(parent.SetImage)=="function")
				{
					parent.SetImage('<%=Para("hidobj")%>');
				}
   			
   			</script>
   			<%
   		  break;
   		}
   		case 3://动态内部模板
   		{
   			%>
   			var s_value='<%=GetContentTemplet()%>';
   			top.o_contentTemplate["<%=Para("temp")%>"]=s_value;
   			top.o_pageTemplateInput["<%=Para("temp")%>"]="<%=isHaveInputTemp()%>";
   			top.o_parentFrame.SetEditorContents("C_Content",s_value);
   			
   			top.o_parentFrame.ShowTemplateInput();
   			
   			<%
   		  break;
   		}
   		case 4://页面模板
   		{
   			%>
   			<%=GetPageTemplet()%>
   			<%
   		  break;
   		}
   		case 5://获得是否有最新的用户留言
   		{
        %>
        
        <%if(CheckPopedom(19)){%>
        	i_value[0]=<%=GetMaxID("select count(*) as cnt from User_LeaveWord where L_Finished=0 ")%>;
        <%}%>
        
        <%if (s_noextend.IndexOf(",5,") == -1){%>
        	<%if(CheckPopedom(40)){%>
        		i_value[1]=<%=GetMaxID("select count(*) as cnt from Sys_EmailBox where R_Status=0 ")%>;
        	<%}%>
        <%}%>
        
        StartShowTip();
        
        
   			<%
   			break;
   		}
   		
   		case 6://获得最新得分
   		{
        %>
        
   			$('bscore').innerHTML="<%=ds.GetDataString("select D_Content from sys_data where D_Type='MustDo'", "@D_Content@")%>";
   			<%
   			break;
   		}
   		case 7://获得最新得分
   		{
        %>
        
        <div style="margin:0 auto;margin-top:50px;width:300px;border:solid 1px #cccccc;">
        <div style="font-weight:bolder;background-color:#efefef;padding:5px;font-size:14px;border-bottom:solid 1px #cccccc;">提醒信息</div>
        <div style="padding:10px;line-height:25px;">
        <%
        int i_get= GetMaxID("select count(*) as cnt from User_LeaveWord where L_Finished=0 ");
        if(i_get>0)
        {
        	Response.Write("<a href='ordinary/asklist.aspx?ord=L_ID desc' target='main'>留言管理</a> - 有 <span class='red'>"+i_get+"</span> 条客户留言未读。 <br />");
        }
        
       
        if (s_noextend.IndexOf(",5,") == -1)
        {
        	//邮件可以使用
	        i_get= GetMaxID("select count(*) as cnt from Sys_EmailBox where R_Status=0 ");
	        if(i_get>0)
	        {
	        	Response.Write("<a href='email/emailboxlist.aspx?ord=R_Date desc&type=0' target='main'>收件箱</a> - 有 <span class='red'>"+i_get+"</span> 条邮件未读。<br />");
	        }
        }
        %>
        </div>
        <div style="margin:0 auto;width:80px;margin-bottom:10px;">
        <input type="button" class='button' dstyle="width:80px;" value="知道了" onclick='IKnow()' /><br />
        <script>
        function IKnow()
        {
        	parent.frames["banner"].StartTip(false);
        	parent.frames["banner"].IKnow();
        	
        }
        
        function changeButtonColor(s_name)
        {
        	parent.frames["list"].changeButtonColorByName(s_name);
        }
        </script>
        </div>
        </div>
   			
   			<%
   			break;
   		}
   		
   		case 8:// 输入链接
   		{
   		
  
				Formitem.Head="链接记录";
				Formitem.Action="";
				Formitem.AddItem("@@Csharp.SetInputText('名称','name','','50','true','')@@"); 
				Formitem.AddItem("@@Csharp.SetInputText('目标链接','url','http://','100','true','<br /><input class=\"button\" type=\"button\" value=\"测试链接\" onclick=\"TestUrl()\" /> ')@@");
				Formitem.Button = "@@Const.SaveButton()@@ @@Const.ResetButton()@@ <input value=\" 关闭 \" name=\"butreturn\"  type=\"button\" onclick=\"parent.popup_close()\" class=\"button\" /> ";
   			%>
   			<style type="text/css">
   			#itemtable{
   			width:500px;
   			}
   			</style>
				<script type='text/javascript'>
				function TestUrl()
				{
					if($('url').value!="")
						window.open($('url').value,'_blank');
					else
						$('spn_url').innerHTML="<br />目标链接不能为空。";	
				}
				
				function checkOther()
				{
					if(($('name').value!="")&&($('url').value!=""))
					{
						parent.SetUrlValue($('name').value,$('url').value);
					}	
					return true;
				}
				
				</script>
				<uc1:formitem ID='Formitem' runat='server' />
   			<%
   			break;
   		}
   		case 9://读取翻译好的英文 通过Google
   		{
   			string s_url="http://translate.google.com/translate_a/t?client=t&text=@key@&hl=zh-CN&sl=zh-CN&tl=en&otf=2&pc=0";
   			%>
   			
   			Translate('<%=TranslateByGoogle(s_url)%>');
   			<%
   			break;
   		}
   		case 10://格式化内容标题
   		{
   			
   			%>
   			
   			TransTitle('<%=TransTitle()%>');
   			<%
   			break;
   		}
   		case 1000://删除所有有效数据 有危险慎用
   		{
   			ds.ExecuteSQL("delete from Sys_AdminLog");
   			ds.ExecuteSQL("delete from User_Template");
   			ds.ExecuteSQL("delete from Sys_EmailBox");
   			
   			ds.ExecuteSQL("delete from User_Keys");
				ds.ExecuteSQL("delete from Sys_CustomRusult");
				ds.ExecuteSQL("delete from Sys_301ReWrite");
				ds.ExecuteSQL("delete from Sys_301DomainReWrite");
				ds.ExecuteSQL("delete from User_Class");
				ds.ExecuteSQL("delete from User_Content");
				ds.ExecuteSQL("delete from Sys_ErrorKeys");
				ds.ExecuteSQL("delete from Sys_Error");
				ds.ExecuteSQL("delete from Sys_InnerLink");
				ds.ExecuteSQL("delete from Sys_SpiderData");
				ds.ExecuteSQL("delete from Sys_VisitedReport");
				ds.ExecuteSQL("delete from Sys_Finance");
				ds.ExecuteSQL("delete from User_Chat");
				ds.ExecuteSQL("delete from User_ChatRecord");
				ds.ExecuteSQL("delete from Sys_Collection");
				ds.ExecuteSQL("delete from User_LeaveWord");
				ds.ExecuteSQL("delete from Sys_RelationKeys");
				ds.ExecuteSQL("delete from Sys_FastResult");
				ds.ExecuteSQL("delete from User_Wish");
				ds.ExecuteSQL("delete from User_Data");
				ds.ExecuteSQL("delete from User_BlogUser");
				ds.ExecuteSQL("delete from User_Address");
				ds.ExecuteSQL("delete from User_Order");
				ds.ExecuteSQL("delete from User_OrderRecord");
				ds.ExecuteSQL("delete from User_Commend");
				ds.ExecuteSQL("delete from Sys_Email ");
				ds.ExecuteSQL("delete from Sys_SendEmail ");
				ds.ExecuteSQL("delete from sys_Favourite");
				ds.ExecuteSQL("delete from sys_Client");
				ds.ExecuteSQL("delete from Sys_ClientContact");
				ds.ExecuteSQL("delete from Sys_Thesaurus");
				ds.ExecuteSQL("delete from User_Update");
				Response.Write("OK!");
   			break;
   		}
   		
   }
   %>   
<%if(Para("body")=="1"){%>
</body>
</html>   
<%}%>