customersFollow.asp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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 "3":SqlStr = "Update Customer Set cs_deal="&chkact&SqlStr
  34. Case Else:SqlStr = "Update Customer Set cs_belong="&replace(chkact,"t","")&SqlStr
  35. End Select
  36. Conn.Execute(SqlStr):Conn.Close:Set Conn=Nothing
  37. Response.Redirect "?Keys="&Keys&"&Page="&Page
  38. Response.End
  39. End If 'End postchk
  40. Keys=Request.QueryString("Keys")
  41. Keyscode=TextEnCode(Keys)
  42. Page = Request.QueryString("Page")
  43. fliterCountry=Request.QueryString("fliterCountry")
  44. fliterQudao=Request.QueryString("fliterQudao")
  45. fliterDeal=Request.QueryString("fliterDeal")
  46. fliterBusiness=Request.QueryString("fliterBusiness")
  47. fliterContact=Request.QueryString("fliterContact")
  48. fliterStr=""
  49. If fliterCountry<>"" Then
  50. fliterStr=fliterStr&" and cs_country="&Cint(fliterCountry)
  51. urlStr=urlStr&"&fliterCountry="&fliterCountry
  52. End If
  53. If fliterQudao<>"" Then
  54. fliterStr=fliterStr&" and cs_from="&Cint(fliterQudao)
  55. urlStr=urlStr&"&fliterQudao="&fliterQudao
  56. End If
  57. If fliterDeal<>"" Then
  58. fliterStr=fliterStr&" and cs_deal="&Cint(fliterDeal)
  59. urlStr=urlStr&"&fliterDeal="&fliterDeal
  60. End If
  61. If fliterBusiness<>"" Then
  62. fliterStr=fliterStr&" and cs_type="&Cint(fliterBusiness)
  63. urlStr=urlStr&"&fliterBusiness="&fliterBusiness
  64. End If
  65. If fliterContact<>"" Then
  66. Select Case fliterContact
  67. Case "1":fliterStr=fliterStr&" and cs_tel<>''"
  68. Case "2":fliterStr=fliterStr&" and cs_wechat<>''"
  69. Case "3":fliterStr=fliterStr&" and cs_whatsapp<>''"
  70. Case "4":fliterStr=fliterStr&" and cs_email<>''"
  71. Case "5":fliterStr=fliterStr&" and cs_linkedin<>''"
  72. Case "6":fliterStr=fliterStr&" and cs_facebook<>''"
  73. Case Else:fliterStr=fliterStr&" and cs_alibaba<>''"
  74. End Select
  75. urlStr=urlStr&"&fliterContact="&fliterContact
  76. End If
  77. Set Rs=Server.CreateObject("ADODB.RecordSet")
  78. Keys=Server.UrlEnCode(Keys)
  79. hrefstr = "?keys="&Keys
  80. %>
  81. <form id="form1" method="post" action="?act=postchk&Keys=<%=keys%>&Page=<%=Page%>" onSubmit="return false" />
  82. <div class="fastSelect clear">
  83. <H1>搜索条件</H1>
  84. <div class="selectItem">
  85. <label>区域</label>
  86. <select name="fliterCountry" class="filterSearch">
  87. <option value="">请选择国家地区</option>
  88. <%Rs.Open "Select id,countryName from country",conn,1,1
  89. Do while Not Rs.Bof And Not Rs.eof
  90. %>
  91. <option value="<%=Rs("id")%>" <%if StrComp(fliterCountry,Rs("id"))=0 Then response.Write "Selected=""Selected"""%> ><%=Rs("countryName")%></option>
  92. <%
  93. Rs.moveNext
  94. loop
  95. Rs.close
  96. %>
  97. </select>
  98. </div>
  99. <div class="selectItem">
  100. <label>来源渠道</label>
  101. <select name="fliterQudao" class="filterSearch">
  102. <option value="">请选择渠道</option>
  103. <%Rs.Open "Select id,ch_name from qudao",conn,1,1
  104. Do while Not Rs.Bof And Not Rs.eof
  105. %>
  106. <option value="<%=Rs("id")%>" <%if StrComp(fliterQudao,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("ch_name")%></option>
  107. <%
  108. Rs.moveNext
  109. loop
  110. Rs.close
  111. %>
  112. </select>
  113. </div>
  114. <div class="selectItem">
  115. <label>是否成交</label>
  116. <select name="fliterDeal" class="filterSearch">
  117. <option value="">请选择</option>
  118. <option value="0" <%if StrComp(fliterDeal,"0")=0 Then response.Write "Selected=""Selected"""%>>无响应</option>
  119. <option value="1" <%if StrComp(fliterDeal,"1")=0 Then response.Write "Selected=""Selected"""%>>背景调查</option>
  120. <option value="2" <%if StrComp(fliterDeal,"2")=0 Then response.Write "Selected=""Selected"""%>>明确需求</option>
  121. </select>
  122. </div>
  123. <div class="selectItem">
  124. <label>客户类型</label>
  125. <select name="fliterBusiness" class="filterSearch">
  126. <option value="">请选择</option>
  127. <%Rs.Open "Select id,businessType from clientType",conn,1,1
  128. Do while Not Rs.Bof And Not Rs.eof
  129. %>
  130. <option value="<%=Rs("id")%>" <%if StrComp(fliterBusiness,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("businessType")%></option>
  131. <%
  132. Rs.moveNext
  133. loop
  134. Rs.close
  135. %>
  136. </select>
  137. </div>
  138. <div class="selectItem">
  139. <label>联系方式</label>
  140. <select name="fliterContact" class="filterSearch">
  141. <option value="">请选择</option>
  142. <option value="1" <%if StrComp(fliterContact,"1")=0 Then response.Write "Selected=""Selected"""%>>电话</option>
  143. <option value="2" <%if StrComp(fliterContact,"2")=0 Then response.Write "Selected=""Selected"""%>>微信</option>
  144. <option value="3" <%if StrComp(fliterContact,"3")=0 Then response.Write "Selected=""Selected"""%>>WhatsApp</option>
  145. <option value="4" <%if StrComp(fliterContact,"4")=0 Then response.Write "Selected=""Selected"""%>>邮箱</option>
  146. <option value="5" <%if StrComp(fliterContact,"5")=0 Then response.Write "Selected=""Selected"""%>>领英</option>
  147. <option value="6" <%if StrComp(fliterContact,"6")=0 Then response.Write "Selected=""Selected"""%>>Facebook</option>
  148. <option value="7" <%if StrComp(fliterContact,"7")=0 Then response.Write "Selected=""Selected"""%>>阿里巴巴</option>
  149. </select>
  150. </div>
  151. <div class="inputSearch">
  152. <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)" />
  153. </div>
  154. </div>
  155. <div width="100%" border="0" cellpadding="3" cellspacing="1" class="table2">
  156. <div class="theader">
  157. <div class="col1" ><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></div>
  158. <div class="col2" >序号</div>
  159. <div class="col3">客户编号</div>
  160. <div class="col4">渠道来源</div>
  161. <div class="col5">区域</div>
  162. <div class="col6">客户类型</div>
  163. <div class="col6">是否成交</div>
  164. <div class="colmark">颜色标记</div>
  165. <div class="col6">录入时间</div>
  166. <div class="col9">操作</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 From customer Where cs_deal<>3 and DATEDIFF(day,cs_updatetime,getDate())>55 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_tel like '%"&Keyscode&"%' or cs_whatsapp like '%"&Keyscode&"%') "&fliterStr&" Order By cs_state 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="col1" align="center" ><input type="checkbox" name="chkbox" value="<%=Rs(0)%>" /></div>
  187. <div class="col2" ><%=TempNum%></div>
  188. <div class="col3 slidepanel"><%=Rs("cs_code")%></div>
  189. <div class="col4">
  190. <%Rs1.Open "select ch_name from qudao where id="&Rs("cs_from")&"",conn,1,1
  191. IF Not Rs1.bof and Not Rs1.eof Then
  192. Response.write Rs1("ch_name")
  193. Else
  194. Response.write "未填写"
  195. End If
  196. Rs1.Close
  197. %>
  198. </div>
  199. <div class="col5">
  200. <%Rs1.Open "select countryName from country where id="&Rs("cs_country")&"",conn,1,1
  201. IF Not Rs1.bof and Not Rs1.eof Then
  202. Response.write Rs1("countryName")
  203. Else
  204. Response.write "未填写"
  205. End If
  206. Rs1.Close
  207. %>
  208. </div>
  209. <div class="col6">
  210. <%Rs1.Open "select businessType from clientType where id="&Rs("cs_type")&"",conn,1,1
  211. IF Not Rs1.bof and Not Rs1.eof Then
  212. Response.write Rs1("businessType")
  213. Else
  214. Response.write "未填写"
  215. End If
  216. Rs1.Close
  217. %>
  218. </div>
  219. <div class="col6">
  220. <%If 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="colmark colormark">
  230. <ul class="colorlist" data-id="<%=Rs("id")%>">
  231. <li value="1" class="color1"></li>
  232. <li value="2" class="color2"></li>
  233. <li value="3" class="color3"></li>
  234. <li value="4" class="color4"></li>
  235. <li value="0" class="color0"></li>
  236. </ul>
  237. </div>
  238. <div class="col6"><%=Rs("cs_addtime")%></div>
  239. <div class="col9" ><a href="customerEdit.asp?Keys=<%=keys%>&Page=<%=Page%>&act=edit&id=<%=Rs(0)%>" class="ico_edit ico">修改</a></div>
  240. </div>
  241. <div class="notepanel clear">
  242. <div class="noteItem">
  243. 联系方式
  244. </div>
  245. <div class="lx">
  246. <div class="tel"><%=Rs("cs_tel")%></div>
  247. <div class="mail"><a href="mailto:<%=Rs("cs_email")%>"><%=Rs("cs_email")%></a></div>
  248. <div class="whatapp"><%=Rs("cs_whatsapp")%></div>
  249. <div class="wechat"><%=Rs("cs_wechat")%></div>
  250. <div class="linkedin"><%=Rs("cs_linkedin")%></div>
  251. <div class="facebook"><%=Rs("cs_facebook")%></div>
  252. <div class="alibaba"><%=Rs("cs_alibaba")%></div>
  253. </div>
  254. <div class="noteItem2">
  255. 备注
  256. </div>
  257. <div class="notecontent">
  258. <%=HtmlUnCode(Rs("cs_note"))%>
  259. </div>
  260. </div>
  261. <%
  262. Rs.MoveNext
  263. Next
  264. Else
  265. If Keys="" Then
  266. %>
  267. <tr>
  268. <div align="center" colspan="9">Sorry,当前暂无信息</div>
  269. </tr>
  270. <%
  271. Else
  272. %>
  273. <tr>
  274. <div align="center" colspan="9"><a href="?">Sorry,没有找到“<%=Keyscode%>”相关的信息,点击返回</a></div>
  275. </tr>
  276. <%
  277. End If
  278. End If
  279. %>
  280. <div colspan="9">
  281. <div class="showpagebox">
  282. <%
  283. If Rs.PageCount > 1 Then
  284. PageName="?Keys="&Keys&urlStr&"&"
  285. Pagelen=3
  286. If Page>1 Then
  287. Response.Write "<a href="""&PageName&"Page=1"">首页</a>"
  288. Response.Write "<a href="""&PageName&"Page="&Page-1&""">上一页</a>"
  289. End If
  290. If Pagelen*2+1 >= Rs.PageCount Then
  291. StartPage=1:EndPage=Rs.PageCount
  292. Else
  293. If Page<=Pagelen+1 Then
  294. StartPage=1
  295. EndPage=Pagelen*2+1
  296. Else
  297. StartPage=Page-Pagelen
  298. EndPage=Page+Pagelen
  299. End If
  300. If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
  301. End If
  302. For i = StartPage To EndPage
  303. If i = Page Then
  304. Response.Write "<a class=""current"">"&i&"</a>"
  305. Else
  306. Response.Write "<a href="""&PageName&"Page="&i&""">"&i&"</a>"
  307. End If
  308. Next
  309. If Page<Rs.PageCount Then
  310. If Rs.PageCount - Page > Pagelen Then Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
  311. Response.Write "<a href="""&PageName&"Page="&Page+1&""">下一页</a>"
  312. Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">尾页</a>"
  313. End If
  314. 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}"" />"
  315. End If
  316. %> </div>
  317. <!--#include file="postchkbox.asp"-->
  318. </div>
  319. </div>
  320. </form>
  321. <%Rs.Close:Set Rs=Nothing:Set Rs1=Nothing:Conn.Close:Set Conn=Nothing%>
  322. </div>
  323. </body>
  324. </html>