<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (Getconfig("SK_Client")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK200000000") AND JudgePopedomTF(Session("UserName"),"SK200000103") AND (JudgePopedomTF(Session("UserName"),"SK200000100") OR JudgePopedomTF(Session("UserName"),"SK200000102"))))) then Call ReturnError()%>
<%
if F("ID")="" then Call ReturnError7()

'Mod Client
if RQ("Action")="Mod" and F("ID")<>"" then
str2=split(F("ID"),",")
for i=0 to ubound(str2)
set rs=server.createobject("adodb.recordset")
sql="select * from SK_Client where SK_Del=0 and Clientid="&trim(str2(i))
rs.open sql,conn,1,3

if F("S_Di")<>"" then
rs("SK_Di")=NoCSSHackInput(F("S_Di"))
rs("SK_Editor")=Session("UserName")
rs("SK_ETime")=Now()
end if

if F("S_AreaID")<>"0" then
rs("SK_AreaID")=NoCSSHackInput(F("S_AreaID"))
rs("SK_Editor")=Session("UserName")
rs("SK_ETime")=Now()
end if

set RsOption=Server.createobject("adodb.recordset")
sqlOption="SELECT * from SK_ClientOptions where SK_Di=0 and SK_ShowOnForm=0"
RsOption.Open sqlOption,conn,1,1
B=0
while not RsOption.eof
B=B+1
if F(""&RsOption("SK_FieldName")&"")<>"" then
rs(""&RsOption("SK_FieldName")&"")=NoCSSHackInput(F(""&RsOption("SK_FieldName")&""))
rs("SK_Editor")=Session("UserName")
rs("SK_Etime")=Now()
end if
RsOption.movenext
wend
RsOption.close
Set RsOption=Nothing

if F("S_User")<>"" then
rs("SK_SalesID")=NoCSSHackInput(F("S_UserID"))
end if

rs.Update

'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="批量修改客户信息"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End

next
rs.Close 
set rs=Nothing
Call Returnoktoback()
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>批量修改客户信息</title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../Inc/Check.js"></script>
<script language="javascript" src="../Inc/Calendar.js"></script>
<script language="javascript" src="../Inc/jquery.js"></script>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">批量修改客户信息</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<form name="thisForm" id="form1" method="post" action="?Action=Mod" onSubmit="return Form1_Validator(this)"> 
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td colspan="2" class="SK_Title1">基本资料</td>
</tr>

<tr>
  <td class="SK_Text2">客户类型</td>
  <td class="SK_Text1"><Select name="S_Di"> 
<Option value="" selected>请选择类别</Option>
<Option value="0">单位客户</Option>
<Option value="1">个人客户</Option>
</Select> <font color=red>不修改请留空</font></td>
</tr>

<tr>
  <td width="18%" class="SK_Text2">所在区域</td>
  <td width="82%" class="SK_Text1"><input name="S_Area" type="text" size="20" readonly> 
  <input name="S_AreaID" type="hidden"> <a onClick="JavaScript:window.open('../Inc/SK.SArea.asp','SArea','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=820,height=400,top=176,left=161');" style="cursor:hand">选择</a>  <font color=red>不修改请留空</font></td>
</tr>
<%
'自定义选项开始
set RsOptions=server.createobject("adodb.recordset")
sqlOptions="SELECT * from SK_ClientOptions where SK_Di=0 and SK_ShowOnForm=0 Order by SK_OrderID asc"
RsOptions.Open sqlOptions,conn,1,1
if RsOptions.bof and RsOptions.eof then
else
%>
<tr>
  <td colspan="2" class="SK_Text1">
<%
if RsOptions.bof and RsOptions.eof then Call ReturnError8()
Response.write"<table width=""90%"" border=""0"" cellpadding=""0"" cellspacing=""1"">"
for Optionsi=1 to RsOptions.recordCount '变量i从1循环到数据库中的全部记录数 
if (Optionsi mod 2 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr>" 
end if
Response.write"<td class=""SK_Text2"" width=""20%"">"&RsOptions("SK_Title")&"</td><td class=""SK_Text1""><select name="&RsOptions("SK_FieldName")&">"

Set rsOptionsDetail=Server.CreateObject("ADODB.RecordSet") 
sqlOptionsDetail="SELECT * from SK_ClientOptionsDetail where SK_OptionsID="&RsOptions("FieldID")&"" 
rsOptionsDetail.Open sqlOptionsDetail,conn,1,1
Response.write"<option value="""" selected>--请选择--</option>"
do while not rsOptionsDetail.eof
Response.write"<option value="&rsOptionsDetail("OptionsDetailID")&">"&rsOptionsDetail("SK_OName")&"</option>"
rsOptionsDetail.movenext
loop
rsOptionsDetail.close
set rsOptionsDetail=Nothing

Response.write"</select> <font color=red>不修改请留空</font></td>"
if (Optionsi mod 2 = 0) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "</tr>" 
end if 
RsOptions.movenext 
next 
Response.write"</table>"
RsOptions.close
set RsOptions=Nothing
'自定义选项结束
%> </td>
  </tr>
<%
end if
RsOptions.close
set RsOptions=Nothing
'自定义选项结束
%>

<tr>
  <td class="SK_Text2">业务人员</td>
  <td class="SK_Text1"><input name="S_User" type="text" size="20" value="" readonly> <a onClick="JavaScript:window.open('../System/SK.SSales.asp','SSales','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=820,height=400,top=176,left=161');" style="cursor:hand"><img src="../images/SUser.gif" /></a>
<input name="S_UserID" type="hidden"></td>
</tr>

<tr>
<td colspan="2" class="SK_Text">
<input type="hidden" name="id" value="<%=F("ID")%>">
<INPUT class="button1" type="submit" value=" 保存 "> 
<input type="button" value=" 返回 " onClick="javascript:history.back(-1);" class="button1" /></td>
</tr>
</table>
</form>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>