silentCustomer.asp 13 KB

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