customers.asp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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_code=Replace(cs_code,'-','/'+(select em_code from employee where id="&replace(chkact,"t","")&")+'-'), cs_belong="&replace(chkact,"t","")&",cs_chain=cs_chain+',"&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="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. <option value="3" <%if StrComp(fliterDeal,"3")=0 Then response.Write "Selected=""Selected"""%>>已成交</option>
  122. </select>
  123. </div>
  124. <div class="selectItem">
  125. <label>客户类型</label>
  126. <select name="fliterBusiness" class="filterSearch">
  127. <option value="">请选择</option>
  128. <%Rs.Open "Select id,businessType from clientType",conn,1,1
  129. Do while Not Rs.Bof And Not Rs.eof
  130. %>
  131. <option value="<%=Rs("id")%>" <%if StrComp(fliterBusiness,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("businessType")%></option>
  132. <%
  133. Rs.moveNext
  134. loop
  135. Rs.close
  136. %>
  137. </select>
  138. </div>
  139. <div class="selectItem">
  140. <label>联系方式</label>
  141. <select name="fliterContact" class="filterSearch">
  142. <option value="">请选择</option>
  143. <option value="1" <%if StrComp(fliterContact,"1")=0 Then response.Write "Selected=""Selected"""%>>电话</option>
  144. <option value="2" <%if StrComp(fliterContact,"2")=0 Then response.Write "Selected=""Selected"""%>>微信</option>
  145. <option value="3" <%if StrComp(fliterContact,"3")=0 Then response.Write "Selected=""Selected"""%>>WhatsApp</option>
  146. <option value="4" <%if StrComp(fliterContact,"4")=0 Then response.Write "Selected=""Selected"""%>>邮箱</option>
  147. <option value="5" <%if StrComp(fliterContact,"5")=0 Then response.Write "Selected=""Selected"""%>>领英</option>
  148. <option value="6" <%if StrComp(fliterContact,"6")=0 Then response.Write "Selected=""Selected"""%>>Facebook</option>
  149. <option value="7" <%if StrComp(fliterContact,"7")=0 Then response.Write "Selected=""Selected"""%>>阿里巴巴</option>
  150. </select>
  151. </div>
  152. <div class="inputSearch">
  153. <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)" />
  154. </div>
  155. </div>
  156. <div width="100%" border="0" cellpadding="3" cellspacing="1" class="table2 em<%=Session("employee_id")%>">
  157. <div class="theader">
  158. <div class="col1" ><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></div>
  159. <div class="col2" >序号</div>
  160. <div class="col3">客户编号</div>
  161. <div class="col4">渠道来源</div>
  162. <div class="col5">区域</div>
  163. <div class="col6">客户类型</div>
  164. <div class="col6">跟进阶段</div>
  165. <div class="colmark">颜色标记</div>
  166. <div class="col6">录入时间</div>
  167. <div class="col9">操作</div>
  168. </div>
  169. <%
  170. 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 From customer Where is_silent=0 and 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"
  171. Rs.Open sqlStr ,Conn,1,1
  172. If Not Rs.Bof And Not Rs.Eof Then
  173. Rs.PageSize = 20
  174. If Page = "" Then Page = 1
  175. If Page = "end" Then Page = Rs.PageCount
  176. If Not IsNumeric(Page) Or Page < 1 Then Page = 1
  177. Page = Cint(Page)
  178. If Page > Rs.PageCount Then Page = Rs.PageCount
  179. Rs.AbsolutePage = Page
  180. TempNum = Rs.PageSize * (Page - 1)
  181. Set Rs1=Server.CreateObject("ADODB.RecordSet")
  182. For i=1 To Rs.PageSize
  183. If Rs.Bof Or Rs.Eof Then Exit For
  184. TempNum=TempNum+1:classid=Rs(1)
  185. %>
  186. <div class="tline color<%=Rs("colorTag")%>">
  187. <div class="col1" align="center" ><input type="checkbox" name="chkbox" value="<%=Rs(0)%>" /></div>
  188. <div class="col2" ><%=TempNum%></div>
  189. <div class="col3 slidepanel"><%=Rs("cs_code")%><%If Rs("cs_claimFrom")>0 Then%><img src="../images/yijiao.png" class="handover" title="来自认领"><%End If%></div>
  190. <div class="col4">
  191. <%Rs1.Open "select ch_name from qudao where id="&Rs("cs_from")&"",conn,1,1
  192. IF Not Rs1.bof and Not Rs1.eof Then
  193. Response.write Rs1("ch_name")
  194. Else
  195. Response.write "未填写"
  196. End If
  197. Rs1.Close
  198. %>
  199. </div>
  200. <div class="col5">
  201. <%Rs1.Open "select countryName from country where id="&Rs("cs_country")&"",conn,1,1
  202. IF Not Rs1.bof and Not Rs1.eof Then
  203. Response.write Rs1("countryName")
  204. Else
  205. Response.write "未填写"
  206. End If
  207. Rs1.Close
  208. %>
  209. </div>
  210. <div class="col6">
  211. <%Rs1.Open "select businessType from clientType where id="&Rs("cs_type")&"",conn,1,1
  212. IF Not Rs1.bof and Not Rs1.eof Then
  213. Response.write Rs1("businessType")
  214. Else
  215. Response.write "未填写"
  216. End If
  217. Rs1.Close
  218. %>
  219. </div>
  220. <div class="col6"><%If Rs("cs_deal")=3 then
  221. response.write "<span style='color:red;'>成交</span>"
  222. elseif Rs("cs_deal")=2 then
  223. Response.write "明确需求"
  224. elseif Rs("cs_deal")=1 then
  225. Response.write "背景调查"
  226. else
  227. Response.write "无响应"
  228. End IF
  229. %>
  230. </div>
  231. <div class="colmark colormark">
  232. <ul class="colorlist" data-id="<%=Rs("id")%>">
  233. <li value="1" class="color1"></li>
  234. <li value="2" class="color2"></li>
  235. <li value="3" class="color3"></li>
  236. <li value="4" class="color4"></li>
  237. <li value="0" class="color0"></li>
  238. </ul>
  239. </div>
  240. <div class="col6"><%=Rs("cs_addtime")%></div>
  241. <div class="col9" ><a href="customerEdit.asp?Keys=<%=keys%>&fliterDeal=<%=fliterDeal%>&fliterBusiness=<%=fliterBusiness%>&Page=<%=Page%>&act=edit&id=<%=Rs(0)%>" class="ico_edit ico">修改</a></div>
  242. </div>
  243. <div class="notepanel clear">
  244. <div class="noteItem">
  245. 联系方式
  246. </div>
  247. <div class="lx">
  248. <div class="tel"><%=Rs("cs_tel")%></div>
  249. <div class="mail"><a href="mailto:<%=Rs("cs_email")%>"><%=Rs("cs_email")%></a></div>
  250. <div class="whatsapp"><%=Rs("cs_whatsapp")%></div>
  251. <div class="wechat"><%=Rs("cs_wechat")%></div>
  252. <div class="linkedin"><%=Rs("cs_linkedin")%></div>
  253. <div class="facebook"><%=Rs("cs_facebook")%></div>
  254. <div class="alibaba"><%=Rs("cs_alibaba")%></div>
  255. </div>
  256. <div class="noteItem2">
  257. 备注
  258. </div>
  259. <div class="notecontent">
  260. <%=HtmlUnCode(Rs("cs_note"))%>
  261. </div>
  262. </div>
  263. <%
  264. Rs.MoveNext
  265. Next
  266. Else
  267. If Keys="" Then
  268. %>
  269. <tr>
  270. <div align="center" colspan="9">Sorry,当前暂无信息</div>
  271. </tr>
  272. <%
  273. Else
  274. %>
  275. <tr>
  276. <div align="center" colspan="9"><a href="?">Sorry,没有找到“<%=Keyscode%>”相关的信息,点击返回</a></div>
  277. </tr>
  278. <%
  279. End If
  280. End If
  281. %>
  282. <div colspan="9">
  283. <div class="showpagebox">
  284. <%
  285. If Rs.PageCount > 1 Then
  286. PageName="?Keys="&Keys&urlStr&"&"
  287. Pagelen=3
  288. If Page>1 Then
  289. Response.Write "<a href="""&PageName&"Page=1"">首页</a>"
  290. Response.Write "<a href="""&PageName&"Page="&Page-1&""">上一页</a>"
  291. End If
  292. If Pagelen*2+1 >= Rs.PageCount Then
  293. StartPage=1:EndPage=Rs.PageCount
  294. Else
  295. If Page<=Pagelen+1 Then
  296. StartPage=1
  297. EndPage=Pagelen*2+1
  298. Else
  299. StartPage=Page-Pagelen
  300. EndPage=Page+Pagelen
  301. End If
  302. If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
  303. End If
  304. For i = StartPage To EndPage
  305. If i = Page Then
  306. Response.Write "<a class=""current"">"&i&"</a>"
  307. Else
  308. Response.Write "<a href="""&PageName&"Page="&i&""">"&i&"</a>"
  309. End If
  310. Next
  311. If Page<Rs.PageCount Then
  312. If Rs.PageCount - Page > Pagelen Then Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
  313. Response.Write "<a href="""&PageName&"Page="&Page+1&""">下一页</a>"
  314. Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">尾页</a>"
  315. End If
  316. End If
  317. %> </div>
  318. <!--#include file="postchkbox.asp"-->
  319. </div>
  320. </div>
  321. </form>
  322. <%Rs.Close:Set Rs=Nothing:Set Rs1=Nothing:Conn.Close:Set Conn=Nothing%>
  323. </div>
  324. </body>
  325. </html>