<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="siteedit.aspx.cs" Inherits="SearchEasy.SiteSearch.admin.siteedit" %>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>类型管理</title>
<link href="images/style.css?v=20180810" rel="stylesheet" type="text/css" />
<script src="js/lib/jquery.js"></script>
<script src="js/dist/jquery.validate.js"></script>
<script>

    jQuery.validator.addMethod("english", function (value, element) {
        var chrnum = /^([a-zA-Z0-9]+)$/;
        return this.optional(element) || (chrnum.test(value));
    }, "只能输入字母和数字");


	$().ready(function() {
		// validate signup form on keyup and submit
        $("#Form1").validate({
			rules: {
                txtUniqueSiteName: {
					required: true,
                    minlength: 2,
                    english: true
				},
                txtSiteName: {
					required: true,
					minlength: 2
				},
                txtDBHost: "required",
                txtDBName: "required",
                txtDBUser: "required",
                txtDBPwd: "required"
			},
			messages: {
                txtUniqueSiteName: {
                    required: "请填写唯一编号",
					minlength: "唯一编码需两个字符以上"
				},
                txtSiteName: {
                    required: "请填写类型名称",
					minlength: "类型名称需两个字符以上"
				},
                txtDBHost: "请填写数据库服务器",
                txtDBName: "请填写数据库名称",
                txtDBUser: "请填写登陆账号",
                txtDBPwd: "请填写登陆密码"
			}
		});

	});
	</script>
<style type="text/css">
<!--
body { padding:10px }
-->
</style>
</head>
<body>
<form id="Form1" runat="server">
<h3 class="boxtitle">后台管理 &gt;&gt; 添加/编辑搜索类型</h3>
<table height="0" border="0" cellpadding="0" cellspacing="1" class="tabBgColor">
<tr>
  <td height="25" background="Images/Top.gif"><a href="sitelist.aspx">返回搜索类型列表</a></td>
</tr>
</table>
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="sitedittb">
    <tr>
      <td width="100%" class="tdbg" colspan="2">提示：因站内搜索需与你原有网站系统的数据对接，但每个网站的系统均不同，无法一一举例，请按提示结合实际举一反三</td>
    </tr>
    <tr>
      <td width="100%" class="tdbg" colspan="2"><strong>基本设置：</strong></td>
    </tr>
    <tr class="tdbg">
      <td width="15%" align="center" class="tdbg"><font color=red>*</font>唯一编号：</td>
      <td  class="tdbg"><asp:TextBox runat="server" ID="txtUniqueSiteName" CssClass="input" Width="270px" /></td>
    </tr>
    <tr class="tdbg">
      <td align="center" class="tdbg"><font color=red>*</font>类型名称：</td>
      <td  class="tdbg"><asp:TextBox runat="server" ID="txtSiteName" CssClass="input" Width="270px" /> 由中英文构成，如文章，视频等等</td>
    </tr>
    <tr class="tdbg">
      <td align="center" class="tdbg">显示控制：</td>
      <td  class="tdbg">
      <asp:CheckBox runat="server" ID="chkIsShowForPc" CssClass="input" Checked="true" />电脑版显示 <asp:CheckBox runat="server" ID="chkIsShowForMobile" CssClass="input" Checked="true" /> 手机版显示 | 
      显示排序：<asp:TextBox runat="server" ID="txtOrderNo" CssClass="input" Width="30px" ToolTip="用1,2,3等数字表示" /> | 
      搜索排序: <asp:DropDownList runat="server" ID="ddlSearchResultOrder" CssClass="input" ToolTip="搜索结果默认排序">
           <asp:ListItem Text="按相关度排序" Value=""></asp:ListItem>
           <asp:ListItem Text="按时间排序" Value="date"></asp:ListItem>
         </asp:DropDownList>
      </td>
     </tr>
    <tr>
      <td width="100%" class="tdbg" colspan="2"><strong>数据源设置：（有<font color=red>*</font>的为必填项)</strong></td>
    </tr>
    <tr>
      <td width="15%" align="center" class="tdbg">数据库类型：</td>
      <td  class="tdbg">
         <asp:RadioButtonList runat="server" ID="rblDBType" CssClass="input" RepeatLayout="Flow" RepeatDirection="Horizontal">
            <asp:ListItem Text="SQL SERVER" Value="mssql" />
            <asp:ListItem Text="My SQL" Value="mysql" />
         </asp:RadioButtonList>
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg">数据库设置：</td>
      <td  class="tdbg">
       <font color=red>*</font>服务器名称：<asp:TextBox runat="server" ID="txtDBHost" CssClass="input" Width="300px" /> 如localhost等<br />
       <font color=red>*</font>数据库名称：<asp:TextBox runat="server" ID="txtDBName" CssClass="input" Width="300px" /> <br />
       <font color=red>*</font>登陆用户名：<asp:TextBox runat="server" ID="txtDBUser" CssClass="input" Width="300px" /> <br />
       <font color=red>*</font>登陆密码：<asp:TextBox runat="server" ID="txtDBPwd" CssClass="input" Width="300px" /> <br />
       数据库端口：<asp:TextBox runat="server" ID="txtDBPort" CssClass="input" Width="300px" /> 不填则默认 <br />
       数据编码：<asp:TextBox runat="server" ID="txtDBCharset" CssClass="input" Width="300px" /> 比如utf8/utf8mb4/gbk等,MSSQL可不填
      </td>
   </tr>
   <tr class="tdbg">
	  <td>&nbsp;</td>
      <td><asp:Button runat="server" CssClass="bnt" Text="测试链接" ID="btnLinkDB" onclick="btnLinkDB_Click" />  <asp:Label runat="server" ForeColor="Red" ID="ltlConectDbTips" /> </td>
   </tr>
   <tr>
      <td align="center" class="tdbg">单数据表：</td>
      <td  class="tdbg">
      表名称：<asp:TextBox runat="server" ID="txtDBTable" CssClass="input" /> <br />
      WHERE SQL:<asp:TextBox runat="server" ID="txtWhereSql" CssClass="input" Width="380px" />(限定SQL，如：isdel=1 and cid=11 无请留空) <br />
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg">多数据表：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtCustomSql" CssClass="input" Width="500px" TextMode="MultiLine" Height="71px" /> <br />
      多表汇入数据的情况请填写自定义Sql语句，具体如何使用，请参照官方说明文档。
      </td>
   </tr>
   <tr>
      <td width="100%" class="tdbg" colspan="2"><strong>字段设置：（有<font color=red>*</font>的为必填项)</strong></td>
    </tr>
    <tr>
      <td align="center" class="tdbg"><font color=red>*</font>ID：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtInfoId" CssClass="input" /> 比如ID字段名是tid,即填tid,下同</td>
   </tr>
   <tr>
      <td align="center" class="tdbg"><font color=red>*</font>标题：</td>
      <td  class="tdbg">
         <asp:TextBox runat="server" ID="txtTitle" CssClass="input" /> 
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg"><font color=red>*</font>内容：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtContent" CssClass="input" /> 
     </td>
   </tr>
   <tr>
      <td class="tdbg" align="center" width="15%">作者：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtAuthor" CssClass="input" />(前端调用标签 Author)</td>
   </tr>
  <tr>
      <td class="tdbg" align="center">关键词：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtTag" CssClass="input" /> (前端调用标签 Tag)
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg"><font color="red">*</font>时间：</td>
      <td  class="tdbg">
      <asp:TextBox runat="server" ID="txtPublishDate" CssClass="input" /> （发布或更新时间等时间类字段）</td>
   </tr>
   <tr>
      <td align="center" class="tdbg">自定义显示内容：</td>
      <td  class="tdbg" style="font-size:9pt;">
      <asp:TextBox runat="server" ID="txtCustomContent" CssClass="input" Width="90%" ToolTip="" />  <br />
      用于在搜索结果中显示附加信息，无则留空，可自定义格式(可带html标签)，如需显示'类型：pdf 下载积分：20'这样的格式，可以这样填写：类型：{tn} 下载积分：{jn} ，其中{tn},{jn}中的英文为相应数据表字段的小写形式。(前端调用标签 CustomContent)
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg"><font color=red>*</font>URL：</td>
      <td  class="tdbg" style="font-size:9pt;">
      <asp:TextBox runat="server" ID="txtUrl" CssClass="input" Width="500px" />
      <br />请注意URL的设置跟上面的字段填写不一样。
      <br />
      标签{infoid}可调用ID字段，{year},{monthm},{monthmm},{dayd},{daydd}可调用时间字段的年，月，日<br />
      调用其他字段可用{字段名}的调用【<font color="red">注意调用全部均用小写形式</font>】<br />
      例子：http://www.yourdomain.com/{year}{monthmm}/{infoid}.html。
      </td>
   </tr>
   <tr>
      <td align="center" class="tdbg">缩略图URL：</td>
      <td  class="tdbg" style="font-size:9pt;">
      <asp:TextBox runat="server" ID="txtThumbPicUrl" CssClass="input" Width="500px" /><br />
      参照上面的URL的设置方法，调用标签是一样的。例子：<br />
      比如你有个字段picurl是存储图片地址的字段,那上面可填 http://www.yourdomain.com/{picurl} 
      </td>
   </tr>
   <tr>
      <td width="100%" class="tdbg" colspan="2"><strong>索引设置：</strong></td>
    </tr>
    <tr>
      <td width="15%" class="tdbg" align="center">内容权重：</td>
      <td  class="tdbg"><asp:TextBox runat="server" ID="txtBoostNo" Text="1" CssClass="input" Width="139px" />默认1，可设1-100</td>
   </tr>
   <tr>
      <td class="tdbg" align="center">索引分片数：</td>
      <td  class="tdbg" style="font-size:9pt;">
      <asp:TextBox runat="server" ID="txtPerIndexRecordCount" CssClass="input" Text="200000" ToolTip="索引分片表示每个索引库索引的记录数，分片可提升索引的速度，但分片数过多会影响搜索的性能，需综合考虑服务器性能。使用默认或者咨询官方技术支持。"  /><br />
        平衡索引效率和搜索速度的参数，参考公式：索引分片数 = 预估总索引数据量 / 10 
      </td>
   </tr>
    <tr class="tdbg">
	  <td>&nbsp;</td>
      <td><asp:Button runat="server" Text="保 存" ID="btnSave" CssClass="bnt" onclick="btnSave_Click" /></td>
    </tr>
  </table>
</form>
</body>
</html>