subCustomers.asp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <!--#include file="Conn.asp"--><%Checklogin()%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>管理区域</title>
  7. <link rel="stylesheet" href="css/common.css" type="text/css" />
  8. <link rel="stylesheet" href="css/alert.css" type="text/css" />
  9. <script language="javascript" src="system/js/jquery-1.7.2.min.js"></script>
  10. <script type="text/javascript" src="js/js.js"></script>
  11. </head>
  12. <body class="clear">
  13. <!--#include file="panel.asp"-->
  14. <div id="man_zone">
  15. <%
  16. Act = Request.QueryString("act")
  17. If Act="postchk" Then
  18. Keys = Server.UrlEnCode(Request.QueryString("Keys"))
  19. Page = Request.QueryString("Page")
  20. chkact = replace(Request.Form("chkact"),"t","")
  21. SqlStr="("&Request.Form("chkbox")&")"
  22. Select Case chkact
  23. Case "0":SqlStr = "Update Customer Set cs_deal="&chkact&SqlStr
  24. Case Else:SqlStr = "Update Customer Set cs_code=Replace(cs_code,'-','/0'+(select SUBSTRING(em_code,2,2) as code from employee where id="&chkact&")+'-'), cs_belong="&chkact&",cs_chain=cs_chain+',"&chkact&"' where id in" &SqlStr
  25. End Select
  26. deleteTag="delete from tagTable where customerId in "&SqlStr
  27. Conn.Execute(SqlStr):Conn.Execute(deleteTag):Conn.Close:Set Conn=Nothing
  28. Response.Redirect "?Keys="&Keys&"&Page="&Page
  29. Response.End
  30. End If 'End postchk
  31. Keys=Request.QueryString("Keys")
  32. Keyscode=TextEnCode(Keys)
  33. Page = Request.QueryString("Page")
  34. fliterCountry=Request.QueryString("fliterCountry")
  35. fliterQudao=Request.QueryString("fliterQudao")
  36. fliterDeal=Request.QueryString("fliterDeal")
  37. fliterBusiness=Request.QueryString("fliterBusiness")
  38. fliterContact=Request.QueryString("fliterContact")
  39. fliterStr=""
  40. If fliterCountry<>"" Then
  41. fliterStr=fliterStr&" and cs_country="&Cint(fliterCountry)
  42. urlStr=urlStr&"&fliterCountry="&fliterCountry
  43. End If
  44. If fliterQudao<>"" Then
  45. fliterStr=fliterStr&" and cs_from="&Cint(fliterQudao)
  46. urlStr=urlStr&"&fliterQudao="&fliterQudao
  47. End If
  48. If fliterDeal<>"" Then
  49. fliterStr=fliterStr&" and cs_deal="&Cint(fliterDeal)
  50. urlStr=urlStr&"&fliterDeal="&fliterDeal
  51. End If
  52. If fliterBusiness<>"" Then
  53. fliterStr=fliterStr&" and cs_type="&Cint(fliterBusiness)
  54. urlStr=urlStr&"&fliterBusiness="&fliterBusiness
  55. End If
  56. If fliterContact<>"" Then
  57. Select Case fliterContact
  58. Case "1":fliterStr=fliterStr&" and cs_tel<>''"
  59. Case "2":fliterStr=fliterStr&" and cs_wechat<>''"
  60. Case "3":fliterStr=fliterStr&" and cs_whatsapp<>''"
  61. Case "4":fliterStr=fliterStr&" and cs_email<>''"
  62. Case "5":fliterStr=fliterStr&" and cs_linkedin<>''"
  63. Case "6":fliterStr=fliterStr&" and cs_facebook<>''"
  64. Case Else:fliterStr=fliterStr&" and cs_alibaba<>''"
  65. End Select
  66. urlStr=urlStr&"&fliterContact="&fliterContact
  67. End If
  68. Set Rs=Server.CreateObject("ADODB.RecordSet")
  69. Keys=Server.UrlEnCode(Keys)
  70. hrefstr = "?keys="&Keys
  71. %>
  72. <form id="form1" method="post" action="?act=postchk&Keys=<%=keys%>&Page=<%=Page%>" onSubmit="return false" />
  73. <div class="fastSelect clear">
  74. <H1>搜索条件</H1>
  75. <div class="selectItem">
  76. <label>区域</label>
  77. <select name="fliterCountry" class="filterSearch">
  78. <option value="">请选择国家地区</option>
  79. <%Rs.Open "Select id,countryName from country",conn,1,1
  80. Do while Not Rs.Bof And Not Rs.eof
  81. %>
  82. <option value="<%=Rs("id")%>" <%if StrComp(fliterCountry,Rs("id"))=0 Then response.Write "Selected=""Selected"""%> ><%=Rs("countryName")%></option>
  83. <%
  84. Rs.moveNext
  85. loop
  86. Rs.close
  87. %>
  88. </select>
  89. </div>
  90. <div class="selectItem">
  91. <label>来源渠道</label>
  92. <select name="fliterQudao" class="filterSearch">
  93. <option value="">请选择渠道</option>
  94. <%Rs.Open "Select id,ch_name from qudao",conn,1,1
  95. Do while Not Rs.Bof And Not Rs.eof
  96. %>
  97. <option value="<%=Rs("id")%>" <%if StrComp(fliterQudao,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("ch_name")%></option>
  98. <%
  99. Rs.moveNext
  100. loop
  101. Rs.close
  102. %>
  103. </select>
  104. </div>
  105. <div class="selectItem">
  106. <label>跟进阶段</label>
  107. <select name="fliterDeal" class="filterSearch">
  108. <option value="">请选择</option>
  109. <option value="0" <%if StrComp(fliterDeal,"0")=0 Then response.Write "Selected=""Selected"""%>>无响应</option>
  110. <option value="1" <%if StrComp(fliterDeal,"1")=0 Then response.Write "Selected=""Selected"""%>>背景调查</option>
  111. <option value="2" <%if StrComp(fliterDeal,"2")=0 Then response.Write "Selected=""Selected"""%>>明确需求</option>
  112. <option value="3" <%if StrComp(fliterDeal,"3")=0 Then response.Write "Selected=""Selected"""%>>已成交</option>
  113. </select>
  114. </div>
  115. <div class="selectItem">
  116. <label>客户类型</label>
  117. <select name="fliterBusiness" class="filterSearch">
  118. <option value="">请选择</option>
  119. <%Rs.Open "Select id,businessType from clientType",conn,1,1
  120. Do while Not Rs.Bof And Not Rs.eof
  121. %>
  122. <option value="<%=Rs("id")%>" <%if StrComp(fliterBusiness,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("businessType")%></option>
  123. <%
  124. Rs.moveNext
  125. loop
  126. Rs.close
  127. %>
  128. </select>
  129. </div>
  130. <div class="selectItem">
  131. <label>联系方式</label>
  132. <select name="fliterContact" class="filterSearch">
  133. <option value="">请选择</option>
  134. <option value="1" <%if StrComp(fliterContact,"1")=0 Then response.Write "Selected=""Selected"""%>>电话</option>
  135. <option value="2" <%if StrComp(fliterContact,"2")=0 Then response.Write "Selected=""Selected"""%>>微信</option>
  136. <option value="3" <%if StrComp(fliterContact,"3")=0 Then response.Write "Selected=""Selected"""%>>WhatsApp</option>
  137. <option value="4" <%if StrComp(fliterContact,"4")=0 Then response.Write "Selected=""Selected"""%>>邮箱</option>
  138. <option value="5" <%if StrComp(fliterContact,"5")=0 Then response.Write "Selected=""Selected"""%>>领英</option>
  139. <option value="6" <%if StrComp(fliterContact,"6")=0 Then response.Write "Selected=""Selected"""%>>Facebook</option>
  140. <option value="7" <%if StrComp(fliterContact,"7")=0 Then response.Write "Selected=""Selected"""%>>阿里巴巴</option>
  141. </select>
  142. </div>
  143. <div class="inputSearch">
  144. <input type="text" id="keys" class="inputTxt" value="<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>" onFocus="if(this.value == '<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>'){this.value='';}" onBlur="if(this.value == ''){this.value='<%If Keyscode="" Then Response.Write "请输入搜索关键词" Else Response.Write Keyscode%>';}" onKeyDown="if(event.keyCode==13){location.href='?Keys='+escape(document.getElementById('keys').value)}" /><input type="button" id="searchgo" class="searchgo" value="go" onClick="location.href='?Keys='+escape(document.getElementById('keys').value)" />
  145. </div>
  146. </div>
  147. <div width="100%" border="0" cellpadding="3" cellspacing="1" class="table2">
  148. <div class="theader">
  149. <div class="col1" ><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></div>
  150. <div class="col2" >序号</div>
  151. <div class="col3">客户编号</div>
  152. <div class="col4">渠道来源</div>
  153. <div class="col5">区域</div>
  154. <div class="col6">客户类型</div>
  155. <div class="col7">跟进阶段</div>
  156. <div class="col8">录入时间</div>
  157. <div class="col9">组员</div>
  158. </div>
  159. <%
  160. sqlStr="Select id,cs_code,cs_from,cs_country,cs_type,cs_deal,cs_addtime,cs_tel,cs_email,cs_whatsapp,cs_wechat,cs_linkedin,cs_facebook,cs_alibaba,cs_belong,cs_note,cs_claimFrom From customer Where (cs_code like '%"&Keyscode&"%' or cs_name like '%"&Keyscode&"%' or cs_email like '%"&Keyscode&"%' or cs_wechat like '%"&Keyscode&"%' or cs_tel like '%"&Keyscode&"%' or cs_whatsapp like '%"&Keyscode&"%') and cs_belong in (Select id from employee where em_role="&Session("employee_id")&")" &fliterStr&" Order By cs_state desc,id Desc"
  161. Rs.Open sqlStr ,Conn,1,1
  162. If Not Rs.Bof And Not Rs.Eof Then
  163. Rs.PageSize = 15
  164. If Page = "" Then Page = 1
  165. If Page = "end" Then Page = Rs.PageCount
  166. If Not IsNumeric(Page) Or Page < 1 Then Page = 1
  167. Page = Cint(Page)
  168. If Page > Rs.PageCount Then Page = Rs.PageCount
  169. Rs.AbsolutePage = Page
  170. TempNum = Rs.PageSize * (Page - 1)
  171. Set Rs1=Server.CreateObject("ADODB.RecordSet")
  172. For i=1 To Rs.PageSize
  173. If Rs.Bof Or Rs.Eof Then Exit For
  174. TempNum=TempNum+1:classid=Rs(1)
  175. %>
  176. <div class="tline">
  177. <div class="col1" align="center" ><input type="checkbox" name="chkbox" value="<%=Rs(0)%>" /></div>
  178. <div class="col2" ><%=TempNum%></div>
  179. <div class="col3 slidepanel"><%=Rs("cs_code")%><%If Rs("cs_claimFrom")>0 Then%><img src="../images/yijiao.png" class="handover"><%End If%></div>
  180. <div class="col4">
  181. <%Rs1.Open "select ch_name from qudao where id="&Rs("cs_from")&"",conn,1,1
  182. IF Not Rs1.bof and Not Rs1.eof Then
  183. Response.write Rs1("ch_name")
  184. Else
  185. Response.write "未填写"
  186. End If
  187. Rs1.Close
  188. %>
  189. </div>
  190. <div class="col5">
  191. <%Rs1.Open "select countryName from country where id="&Rs("cs_country")&"",conn,1,1
  192. IF Not Rs1.bof and Not Rs1.eof Then
  193. Response.write Rs1("countryName")
  194. Else
  195. Response.write "未填写"
  196. End If
  197. Rs1.Close
  198. %>
  199. </div>
  200. <div class="col6">
  201. <%Rs1.Open "select businessType from clientType where id="&Rs("cs_type")&"",conn,1,1
  202. IF Not Rs1.bof and Not Rs1.eof Then
  203. Response.write Rs1("businessType")
  204. Else
  205. Response.write "未填写"
  206. End If
  207. Rs1.Close
  208. %>
  209. </div>
  210. <div class="col7"><%If Rs("cs_deal")=3 then
  211. response.write "<span style='color:red;'>成交</span>"
  212. elseif Rs("cs_deal")=2 then
  213. Response.write "明确需求"
  214. elseif Rs("cs_deal")=1 then
  215. Response.write "背景调查"
  216. else
  217. Response.write "未成交"
  218. End IF
  219. %>
  220. </div>
  221. <div class="col8"><%=Rs("cs_addtime")%></div>
  222. <div class="col9" >
  223. <%Rs1.Open "select em_user from employee where id="&Rs("cs_belong"),conn,1,1
  224. IF Not Rs1.bof and Not Rs1.eof Then
  225. Response.write HtmlUnCode(Rs1("em_user"))
  226. Else
  227. Response.write "未填写"
  228. End If
  229. Rs1.Close
  230. %>
  231. </div>
  232. </div>
  233. <div class="notepanel clear">
  234. <div class="noteItem">
  235. 联系方式
  236. </div>
  237. <div class="lx">
  238. <div class="tel"><%=Rs("cs_tel")%></div>
  239. <div class="mail"><a href="mailto:<%=Rs("cs_email")%>"><%=Rs("cs_email")%></a></div>
  240. <div class="whatsapp"><%=Rs("cs_whatsapp")%></div>
  241. <div class="wechat"><%=Rs("cs_wechat")%></div>
  242. <div class="linkedin"><%=Rs("cs_linkedin")%></div>
  243. <div class="facebook"><%=Rs("cs_facebook")%></div>
  244. <div class="alibaba"><%=Rs("cs_alibaba")%></div>
  245. </div>
  246. <div class="noteItem2">
  247. 备注
  248. </div>
  249. <div class="notecontent">
  250. <%=HtmlUncode(Rs("cs_note"))%>
  251. </div>
  252. </div>
  253. <%
  254. Rs.MoveNext
  255. Next
  256. Else
  257. If Keys="" Then
  258. %>
  259. <tr>
  260. <div align="center" colspan="9">Sorry,当前暂无信息</div>
  261. </tr>
  262. <%
  263. Else
  264. %>
  265. <tr>
  266. <div align="center" colspan="9"><a href="?">Sorry,没有找到“<%=Keyscode%>”相关的信息,点击返回</a></div>
  267. </tr>
  268. <%
  269. End If
  270. End If
  271. %>
  272. <div colspan="9">
  273. <div class="showpagebox">
  274. <%
  275. If Rs.PageCount > 1 Then
  276. PageName="?Keys="&Keys&urlStr&"&"
  277. Pagelen=3
  278. If Page>1 Then
  279. Response.Write "<a href="""&PageName&"Page=1"">首页</a>"
  280. Response.Write "<a href="""&PageName&"Page="&Page-1&""">上一页</a>"
  281. End If
  282. If Pagelen*2+1 >= Rs.PageCount Then
  283. StartPage=1:EndPage=Rs.PageCount
  284. Else
  285. If Page<=Pagelen+1 Then
  286. StartPage=1
  287. EndPage=Pagelen*2+1
  288. Else
  289. StartPage=Page-Pagelen
  290. EndPage=Page+Pagelen
  291. End If
  292. If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
  293. End If
  294. For i = StartPage To EndPage
  295. If i = Page Then
  296. Response.Write "<a class=""current"">"&i&"</a>"
  297. Else
  298. Response.Write "<a href="""&PageName&"Page="&i&""">"&i&"</a>"
  299. End If
  300. Next
  301. If Page<Rs.PageCount Then
  302. If Rs.PageCount - Page > Pagelen Then Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
  303. Response.Write "<a href="""&PageName&"Page="&Page+1&""">下一页</a>"
  304. Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">尾页</a>"
  305. End If
  306. End If
  307. %>
  308. </div>
  309. <div class="postchkbox">
  310. <select id="chkact" name="chkact">
  311. <%
  312. Set Rs2=Server.CreateObject("ADODB.RecordSet")
  313. Rs2.Open "select id,em_user from employee where em_role="&Session("employee_id"),conn,1,1
  314. Do while Not Rs2.bof and Not Rs2.eof
  315. %>
  316. <option value="t<%=Rs2("id")%>">转给<%=Rs2("em_user")%></option>
  317. <%
  318. Rs2.moveNext
  319. loop
  320. Rs2.close
  321. Set Rs2=Nothing
  322. %>
  323. </select>
  324. <input type="button" value="执行" onClick="postchk(1)" class="btn1" />
  325. </div>
  326. </div>
  327. </div>
  328. </form>
  329. <%Rs.Close:Set Rs=Nothing:Set Rs1=Nothing:Conn.Close:Set Conn=Nothing%>
  330. </div>
  331. </body>
  332. </html>