customersNew.asp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. Keyscode=TextEnCode(Keys)
  41. Page = Request.QueryString("Page")
  42. fliterCountry=Request.QueryString("fliterCountry")
  43. fliterQudao=Request.QueryString("fliterQudao")
  44. fliterDeal=Request.QueryString("fliterDeal")
  45. fliterBusiness=Request.QueryString("fliterBusiness")
  46. fliterContact=Request.QueryString("fliterContact")
  47. fliterStr=""
  48. If fliterCountry<>"" Then
  49. fliterStr=fliterStr&" and cs_country="&Cint(fliterCountry)
  50. urlStr=urlStr&"&fliterCountry="&fliterCountry
  51. End If
  52. If fliterQudao<>"" Then
  53. fliterStr=fliterStr&" and cs_from="&Cint(fliterQudao)
  54. urlStr=urlStr&"&fliterQudao="&fliterQudao
  55. End If
  56. If fliterDeal<>"" Then
  57. fliterStr=fliterStr&" and cs_deal="&Cint(fliterDeal)
  58. urlStr=urlStr&"&fliterDeal="&fliterDeal
  59. End If
  60. If fliterBusiness<>"" Then
  61. fliterStr=fliterStr&" and cs_type="&Cint(fliterBusiness)
  62. urlStr=urlStr&"&fliterBusiness="&fliterBusiness
  63. End If
  64. If fliterContact<>"" Then
  65. Select Case fliterContact
  66. Case "1":fliterStr=fliterStr&" and cs_tel<>''"
  67. Case "2":fliterStr=fliterStr&" and cs_wechat<>''"
  68. Case "3":fliterStr=fliterStr&" and cs_whatsapp<>''"
  69. Case "4":fliterStr=fliterStr&" and cs_email<>''"
  70. Case "5":fliterStr=fliterStr&" and cs_linkedin<>''"
  71. Case "6":fliterStr=fliterStr&" and cs_facebook<>''"
  72. Case Else:fliterStr=fliterStr&" and cs_alibaba<>''"
  73. End Select
  74. urlStr=urlStr&"&fliterContact="&fliterContact
  75. End If
  76. Set Rs=Server.CreateObject("ADODB.RecordSet")
  77. Keys=Server.UrlEnCode(Keys)
  78. hrefstr = "?keys="&Keys
  79. %>
  80. <form id="form1" method="post" action="?act=postchk&Keys=<%=keys%>&Page=<%=Page%>" onSubmit="return false" />
  81. <div class="fastSelect clear">
  82. <H1>当月新增客户</H1>
  83. <div class="selectItem">
  84. <label>区域</label>
  85. <select name="fliterCountry" class="filterSearch">
  86. <option value="">请选择国家地区</option>
  87. <%Rs.Open "Select id,countryName from country",conn,1,1
  88. Do while Not Rs.Bof And Not Rs.eof
  89. %>
  90. <option value="<%=Rs("id")%>" <%if StrComp(fliterCountry,Rs("id"))=0 Then response.Write "Selected=""Selected"""%> ><%=Rs("countryName")%></option>
  91. <%
  92. Rs.moveNext
  93. loop
  94. Rs.close
  95. %>
  96. </select>
  97. </div>
  98. <div class="selectItem">
  99. <label>来源渠道</label>
  100. <select name="fliterQudao" class="filterSearch">
  101. <option value="">请选择渠道</option>
  102. <%Rs.Open "Select id,ch_name from qudao",conn,1,1
  103. Do while Not Rs.Bof And Not Rs.eof
  104. %>
  105. <option value="<%=Rs("id")%>" <%if StrComp(fliterQudao,Rs("id"))=0 Then response.Write "Selected=""Selected"""%>><%=Rs("ch_name")%></option>
  106. <%
  107. Rs.moveNext
  108. loop
  109. Rs.close
  110. %>
  111. </select>
  112. </div>
  113. <div class="selectItem">
  114. <label>跟进阶段</label>
  115. <select name="fliterDeal" class="filterSearch">
  116. <option value="">请选择</option>
  117. <option value="0" <%if StrComp(fliterDeal,"0")=0 Then response.Write "Selected=""Selected"""%>>无响应</option>
  118. <option value="1" <%if StrComp(fliterDeal,"1")=0 Then response.Write "Selected=""Selected"""%>>背景调查</option>
  119. <option value="2" <%if StrComp(fliterDeal,"2")=0 Then response.Write "Selected=""Selected"""%>>明确需求</option>
  120. <option value="3" <%if StrComp(fliterDeal,"3")=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 em<%=Session("employee_id")%>">
  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_belong="&Session("employee_id")&" and dateDiff(mm,cs_addtime,GETDATE())=0 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 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"><%If Rs("cs_deal")=3 then
  220. response.write "<span style='color:red;'>成交</span>"
  221. elseif Rs("cs_deal")=2 then
  222. Response.write "明确需求"
  223. elseif Rs("cs_deal")=1 then
  224. Response.write "背景调查"
  225. else
  226. Response.write "无响应"
  227. End IF
  228. %>
  229. </div>
  230. <div class="colmark colormark">
  231. <ul class="colorlist" data-id="<%=Rs("id")%>">
  232. <li value="1" class="color1"></li>
  233. <li value="2" class="color2"></li>
  234. <li value="3" class="color3"></li>
  235. <li value="4" class="color4"></li>
  236. <li value="0" class="color0"></li>
  237. </ul>
  238. </div>
  239. <div class="col6"><%=Rs("cs_addtime")%></div>
  240. <div class="col9" ><a href="customerEdit.asp?Keys=<%=keys%>&Page=<%=Page%>&act=edit&id=<%=Rs(0)%>" class="ico_edit ico">修改</a></div>
  241. </div>
  242. <div class="notepanel clear">
  243. <div class="noteItem">
  244. 联系方式
  245. </div>
  246. <div class="lx">
  247. <div class="tel"><%=Rs("cs_tel")%></div>
  248. <div class="mail"><a href="mailto:<%=Rs("cs_email")%>"><%=Rs("cs_email")%></a></div>
  249. <div class="whatsapp"><%=Rs("cs_whatsapp")%></div>
  250. <div class="wechat"><%=Rs("cs_wechat")%></div>
  251. <div class="linkedin"><%=Rs("cs_linkedin")%></div>
  252. <div class="facebook"><%=Rs("cs_facebook")%></div>
  253. <div class="alibaba"><%=Rs("cs_alibaba")%></div>
  254. </div>
  255. <div class="noteItem2">
  256. 备注
  257. </div>
  258. <div class="notecontent">
  259. <%=HtmlUnCode(Rs("cs_note"))%>
  260. </div>
  261. </div>
  262. <%
  263. Rs.MoveNext
  264. Next
  265. Else
  266. If Keys="" Then
  267. %>
  268. <tr>
  269. <div align="center" colspan="9">Sorry,当前暂无信息</div>
  270. </tr>
  271. <%
  272. Else
  273. %>
  274. <tr>
  275. <div align="center" colspan="9"><a href="?">Sorry,没有找到“<%=Keyscode%>”相关的信息,点击返回</a></div>
  276. </tr>
  277. <%
  278. End If
  279. End If
  280. %>
  281. <div colspan="9">
  282. <div class="showpagebox">
  283. <%
  284. If Rs.PageCount > 1 Then
  285. PageName="?Keys="&Keys&urlStr&"&"
  286. Pagelen=3
  287. If Page>1 Then
  288. Response.Write "<a href="""&PageName&"Page=1"">首页</a>"
  289. Response.Write "<a href="""&PageName&"Page="&Page-1&""">上一页</a>"
  290. End If
  291. If Pagelen*2+1 >= Rs.PageCount Then
  292. StartPage=1:EndPage=Rs.PageCount
  293. Else
  294. If Page<=Pagelen+1 Then
  295. StartPage=1
  296. EndPage=Pagelen*2+1
  297. Else
  298. StartPage=Page-Pagelen
  299. EndPage=Page+Pagelen
  300. End If
  301. If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount
  302. End If
  303. For i = StartPage To EndPage
  304. If i = Page Then
  305. Response.Write "<a class=""current"">"&i&"</a>"
  306. Else
  307. Response.Write "<a href="""&PageName&"Page="&i&""">"&i&"</a>"
  308. End If
  309. Next
  310. If Page<Rs.PageCount Then
  311. If Rs.PageCount - Page > Pagelen Then Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">..."&Rs.PageCount&"</a>"
  312. Response.Write "<a href="""&PageName&"Page="&Page+1&""">下一页</a>"
  313. Response.Write "<a href="""&PageName&"Page="&Rs.PageCount&""">尾页</a>"
  314. End If
  315. 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}"" />"
  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>