<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnSiteData.Asp" -->
<!--#include file="../CheckAdmin.Asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>联系人名片</title>
<link rel="stylesheet" href="../Images/Admin_style.css">
<script language="javascript" src="../JavaScript/Admin.js"></script>
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
<%
'If InStr(session("GroupPurview"), "|2,") = 0 Then
    'response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    'response.End
'End If
Response.Buffer=True    
Response.ExpiresAbsolute =Now()-1    
Response.Expires=0    
Response.CacheControl="no-cache"    
Response.AddHeader "Pragma","No-Cache"
Dim Result,reResult
Result = request.QueryString("Result")
reResult = request.QueryString("reResult")
Dim ID,showid,mCp_ID,mMemName,mRealName,mCp_name,mCp_code,mCo_ID,mCo_Code,mCp_education,mCp_position,mCp_tel,mCp_mobile,mCp_email,mCp_QQ,mCp_msn,mCp_homepage,mCp_address,mCp_zipcode
Dim mCo_name
Dim KehuReID,rekehu,Restatus
ID = request.QueryString("ID")
'初始tab
showid=request.QueryString("showid")
 response.Write "<script language='javascript' for='window' event='onload'>ShowTabs("&showid&");</script>"
Call MyKehuView()
%>
<br />
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  
    
	<tr>
      <td class="forumRowHighlight" align="center" valign="top">
	  <table width="100%" border="0">
  <tr>
    <td width="70" valign="top">
	<img src="../Images/peploe_1.png" />
	</td>
    <td valign="top"><font style="font-size:18px; font-weight:bold;">
	  <%=mCp_name%>
	</font>
	<div style="padding:10px 0px">
	<%=mCp_position%> － <a href="My_Companies_KehuView.Asp?Result=Modify&ID=<%=mCo_ID%>&showid=0"><font color="#4579b9"><%=mCo_name%></font></a><br />
	
	
	<font color="#FF6600"><%'=SortName%></font>
	</div>
	
	</td>
  </tr>
</table>

	  </td>
      <td width="250" rowspan="3" bgcolor="#E5E5E5" valign="top">
<script language="javascript">
//点击显示添加任务        2012-3-7 by qijun zhang
function Show_tasksadd(ID){
	if (ID==1)
	{
         document.getElementById("addtasks").style.display="";
		 document.getElementById("bt_tasksadd").style.display="none";
	}
	else
	{
		document.getElementById("addtasks").style.display="none";
		document.getElementById("bt_tasksadd").style.display="";
	}
 }

function show_d241() //显示及隐藏设置任务时间
{
	if (document.getElementById("Task_frame").value=="calendar"){
	document.getElementById("d241").style.display="";
	}
	else
	{
		document.getElementById("d241").style.display="none";
		}
	
}
</script>
      <div style="padding-bottom:10px" id="bt_tasksadd"><a href="javascript:Show_tasksadd(1)"><img src="../Images/tasks_make.png" /></a></div>
<form action="My_Kehu_Taskseadd.asp?Result=Modify&ID=<%=ID%>&showid=0" method="post" name="taskadd">
      <div style="border-width:5px; border-color:#CACFD5; border-style:solid; margin:5px; float:left; width:98%;display:none;" id="addtasks">
      <table width="100%" border="0" align="center" cellspacing="5" style="background-color:#F0F5F8; ">
  <tr>
    <td><font style="font-weight:bold;font-size:14px">添加一个计划</font>
    <input name="TKehuID" type="hidden" value="<%=ID%>">
    </td>
  </tr>
  
  <tr>
    <td class="fontdan">计划时间?</td>
  </tr>
  <tr>
    <td><select name="Task_frame" onchange="javascript:show_d241()">
     <option value="today" <%if Task_frame="today" then response.Write"selected"%>>今天</option>
     <option value="tomorrow" <%if Task_frame="tomorrow" then response.Write"selected"%>>明天</option>
     <option value="aftertomorrow" <%if Task_frame="aftertomorrow" then response.Write"selected"%>>后天</option>
     <option value="calendar" <%if Task_frame="calendar" then response.Write"selected"%>>设置时间 ...</option>
	   
	 </select>
     <input name="d241" type="text" class="Wdate" id="d241" style="width:150px;
	 <%if Task_frame="calendar" then 
	      response.Write " display:"
	   else
	      response.Write " display:none"
	   end if	  
	 %>
     " onFocus="WdatePicker({skin:'blueFresh'})" value="<%=TEtime%>"/>
     </td>
  </tr>
  <tr>
    <td class="fontdan">选择一个分类</td>
  </tr>
  <tr><td>
  
     <select name="PlanSort">
     <option value="电话">电话</option>
	  <option value="拜访">拜访</option>
      <option value="其它">其它</option>
	 </select>
  </td></tr>
  <tr>
    <td><hr />
</td>
  </tr>
  <tr>
    <td>&nbsp;<input name="submitSavetasks" type="submit" id="submitSavetasks" value="添加这个计划"> <font class="fontdan">或</font> <a href="javascript:Show_tasksadd(0)">取消</a></td>
  </tr>
</table>
      </div>
      </form>
      <table width="96%" border="0" align="center" cellspacing="5" style="background-color:#F0F5F8; ">
  <tr>
    <td>
	<% Plan_list(ID) %>
    
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</td>
	</tr>
	<tr>
      <td class="forumRowHighlight" valign="top">
  <script language="javascript">
var tID=0;
var rID=1;
function ShowTabs(ID){
  if(ID!=tID){
    TabTitle[tID].className="title5";
    TabTitle[ID].className="title6";
    Tabs[tID].style.display="none";
    Tabs[ID].style.display="";
    tID=ID;
  }
  if(ID==2 || ID==3 || ID==4)
    {
     document.getElementById("gback").style.display="none";
     document.getElementById("submitSaveEdit").style.display="none";  
    }
  else
    {
     document.getElementById("gback").style.display="";
     document.getElementById("submitSaveEdit").style.display="";
	 document.getElementById("showid").value=ID;
    }
}
//点击修改按钮跳转至对应的Tab 2012-1-6 add by qiJun zhang
function goview(){
    var showid=document.getElementById("showid").value;
	<%if Kclass=1 then%>
	window.location.href="My_Companies_KehuEdit.Asp?Result=Modify&ID=<%=ID%>&showid="+showid;
	<%else%>
	window.location.href="My_people_KehuEdit.Asp?Result=Modify&ID=<%=ID%>&showid="+showid;
	<%end if%>
}
//点击显示隐藏添加修改          2012-1-12 by qijun zhang
function Showre(){
    if(rID==1)
	   {
         document.getElementById("rekehuSaveEdit").style.display="";
	     document.getElementById("rekehu").style.display="";
		 document.getElementById("Restatus").style.display="";
		 document.getElementById("ddla").style.display="";
		 rID=rID-1;
		} 
     else
	    {
         document.getElementById("rekehuSaveEdit").style.display="none";
	     document.getElementById("rekehu").style.display="none";
		 document.getElementById("Restatus").style.display="none";
		 document.getElementById("ddla").style.display="none";
		 rID=rID+1;
		}
 }
function checkreedit(){
if (document.reform1.rekehu.value.replace(/^\s*/g,"")=="") {
    alert("请认真填写!事件可以保存日常工作中的点点滴滴。比如每一次电话，会议或者任何想法。");
    document.reform1.rekehu.focus();
    return false;
 }
 var ors=document.reform1.Restatus.value;
   if (ors.replace(/^\s*/g,"")!=""){
	   if (ors!="D" && ors!="C" && ors!="B" && ors!="A" &&ors!="O"){
		   alert("订单状态标识非法!请输入[D]或[C]或[B]或[A]或[O]");
	       document.reform1.Restatus.focus();
	       return false;
		   }
	   }
}
</script>
        <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr align="center">
            <td id="TabTitle" class="title6" onclick="ShowTabs(0)">基本信息</td>
            
            <td id="TabTitle" class="title5" onclick="ShowTabs(1)">其它</td>
            <td id="TabTitle" class="title5" onclick="ShowTabs(2)">履历(<font color="#FF0000"><%Career(ID)%></font>)</td>
            <td id="TabTitle" class="title5" onclick="ShowTabs(3)">事件(<font color="#FF0000"><%KHRe(ID)%></font>)</td> 
            
            <td>&nbsp;</td>
          </tr>
  </table>
  <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" class="border"><tr class="tdbg"><td valign="top">
    <table width="100%" align="center" cellpadding="2" cellspacing="1">
      <tbody id="Tabs" style="display:">
        <tr style="display:none">
          <td align="right" class="forumRow">联系人code：</td>
          <td class="forumRowHighlight"><%=mCp_code%></td>
          </tr>
        <tr>
          <td width="20%" align="right" class="forumRow">学 历：</td>
          <td width="80%" class="forumRowHighlight"><%=mCp_education%></td>
          </tr>
        <tr>
          <td align="right" class="forumRow">电 话：</td>
          <td class="forumRowHighlight"><%=mCp_tel%></td>
          </tr>
          
        <tr>
          <td align="right" class="forumRow">手机号码：</td>
          <td class="forumRowHighlight">
            <%=mCp_mobile%></td>
          </tr>
        <tr>
          <td align="right" class="forumRow">电子信箱：</td>
          <td class="forumRowHighlight"><%=mCp_email%></td>
          </tr>
        <tr>
          <td align="right" class="forumRow">Q Q：</td>
          <td class="forumRowHighlight"><%=mCp_QQ%></td>
          </tr>
          <tr>
          <td align="right" class="forumRow">MSN：</td>
          <td class="forumRowHighlight"><%=mCp_msn%></td>
          </tr>
         <tr>
          <td align="right" class="forumRow">个人主页(微博)：</td>
          <td class="forumRowHighlight"><%=mCp_homepage%></td>
          </tr> 
        <tr>
          <td align="right" class="forumRow">地 址：</td>
          <td class="forumRowHighlight"><%=mCp_address%></td>
          </tr>
        
        <tr>
          <td align="right" class="forumRow">邮政编码：</td>
          <td class="forumRowHighlight">
            <%=mCp_zipcode%>	 </td>
          </tr>
        
        </tbody>
      
      <tbody id="Tabs" style="display:none">
        <tr>
          <td width="20%" align="right" class="forumRow">&nbsp;</td>
          <td width="80%" class="forumRowHighlight">&nbsp;</td>
          </tr>
        <tr>
          <td width="20%" align="right" class="forumRow">&nbsp;</td>
          <td width="80%" class="forumRowHighlight">&nbsp;</td>
          </tr>
        </tbody>
      <tbody id="Tabs" style="display:none">
        <tr>
          <td width="100%" class="forumRowHighlight" colspan="2">
            
            <form action="#" method="post" name="formDel">
             <table border="0" align="center" cellpadding="0" cellspacing="0" width="98%" class="bordergj">
        <tr valign="top" bgcolor="#F8F8FA" >
          <td align="left" bgcolor="#D7E4F7">
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="25" align="center" width="150" bgcolor="#FFFFFF"><img src="../Images/add_1.png" /> 履历动态</td>
                <td align="left">&nbsp;</td>
                <td width="50" align="center">&nbsp;</td>
                </tr>
              </table> </td>
          </tr>
        <tr bgcolor="#F8F8FA" >
          <td align="center">
            <% CareerList(ID)%> 
            <table width="100%" border="0">
              <tr>
                <td></td>
                <td>&nbsp;</td>
                </tr>
  </table>
  </td>
          </tr>
  </table>
              </form>
            </td>
          </tr>
        </tbody>
  <tbody id="Tabs" style="display:none">
    <tr>
      <td colspan="2" class="forumRowHighlight">
        <form action="?reAction=SaveEdit&Result=Modify&ID=<%=ID%>&showid=3" method="post" name="reform1" onSubmit="return checkreedit()">
          <table border="0" align="center" cellpadding="0" cellspacing="0" width="98%" class="bordergj">
            <tr valign="top" bgcolor="#F8F8FA" >
              <td align="left" bgcolor="#D7E4F7">
                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="25" align="center" width="150" bgcolor="#FFFFFF"><img src="../Images/add_1.png" /> <a href="javascript:Showre()">添加修改当天事件</a></td>
                    <td align="left">&nbsp;</td>
                    <td width="50" align="center"><input name="rekehuSaveEdit" type="submit" id="rekehuSaveEdit" value="保存" style="display:none"></td>
                    </tr>
                  </table> </td>
              </tr>
            <tr bgcolor="#F8F8FA" >
              <td align="left">&nbsp;
              <input name="ReID" type="hidden" id="ReID" value="<%=KehuReID%>" maxlength="16">
              <textarea name="rekehu" rows="8" style="width:97%; margin-bottom:8px;display:none"><%=rekehu%></textarea><br />
              &nbsp; <label name="ddla" id="ddla" style="display:none">订单状态：</label>
              <input name="Restatus" type="text" id="Restatus" value="<%=Restatus%>" size="4" maxlength="2" title="订单状态只能输入D、C、B、A、O" style=" border-color:#F00; border-width:1px; border-style:solid; text-align:center;display:none"> </td>
              </tr>
  </table>
          </form>
        <form action="#" method="post" name="formDel">
          <% KehuReList(ID) %>
          </form>
        
        </td>
      </tr>
    </tbody>
      
      </table>
  </td>
  </tr>
  </table>
      </td>
    </tr>
    	
    <tr>
      <td class="forumRowHighlight" align="center"><input type="hidden" id="showid" value="0" />
      <input name="submitSaveEdit" type="button" id="submitSaveEdit" value="修改信息" onClick="goview()" style="display:"> <input type="button" id="gback" onclick="history.back(-1)" value="返回上一页" style="display:"></td>
    </tr>
</table>
<%

Sub MyKehuView()
    Dim Action, rs, sql
    Action = request.QueryString("Action")
	reAction=request.QueryString("reAction")
        If Result = "Modify" Then
            Set rs = server.CreateObject("adodb.recordset")
            sql = "select * from Zqj_Contactperson where MemName='"&session("UserName")&"' and Cp_ID="& ID
            rs.Open sql, conn, 1, 1
			if rs.bof and rs.eof then
			response.Write "<script language='javascript'>alert('参数错误！');history.back(-1);</script>"
			response.End
			else
			
            mMemName = rs("MemName")
            mRealName = rs("RealName")
			mCp_ID=rs("Cp_ID")
			mCp_code=rs("Cp_code")
            mCp_name = rs("Cp_name")
            mCo_ID = rs("Co_ID")
			mCo_Code=rs("Co_Serialnumber")
			call Kehucname(mCo_ID)
            mCp_position = rs("Cp_position")
			mCp_education=rs("Cp_education")
			mCp_tel=rs("Cp_tel")
			mCp_mobile=rs("Cp_mobile")
            mCp_email = rs("Cp_email")
            mCp_QQ = rs("Cp_QQ")
			mCp_msn=rs("Cp_msn")
            mCp_homepage = rs("Cp_homepage")
            mCp_address = rs("Cp_address")
            mCp_zipcode = rs("Cp_zipcode")
			end if
            rs.Close
            Set rs = Nothing
			'--------------------保存跟进及读取跟进记录开始------------------------------
			if reAction="SaveEdit" then '保存跟进记录
			   if trim(Request.Form("ReID"))="" or Not IsNumeric(Request.Form("ReID")) then
			   KehuReID=0
			   else
			   KehuReID=trim(Request.Form("ReID"))
			   end if
			   Set rs = server.CreateObject("adodb.recordset")
			   sql = "select * from Zqj_Records where Re_ID="&KehuReID
               rs.Open sql, conn, 1, 3
			   if rs.bof and rs.eof then
			      rs.addnew
				  rs("MemName")=mMemName
				  rs("RealName")=mRealName
				  rs("Re_Content")=Request.Form("rekehu")
				  rs("Re_status")=Request.Form("Restatus")
				  rs("Re_time")=now()
				  rs("Re_Contactname")=mCp_name
				  rs("Cp_Code")=mCp_Code
				  rs("Re_company")=mCo_name
				  rs("Co_Code")=mCo_Code
				  rs("Cp_ID")=ID
				  rs("Co_ID")=mCo_ID
			   else
			      rs("Re_Content")=Request.Form("rekehu")
				  rs("Re_status")=Request.Form("Restatus")
				  rs("Re_Contactname")=mCp_name
				  rs("Re_time")=now()
				  rs("Co_ID")=mCo_ID
				  rs("Co_Code")=mCo_Code
				  rs("Re_company")=mCo_name
				  rs("RealName")=mRealName
			   end if
			   rs.update
			   rs.close
			   set rs=nothing
			   response.Redirect("?Result=Modify&ID="&ID&"&showid="&showid)
			else '读取当天跟进记录
			   Set rs = server.CreateObject("adodb.recordset")
			   sql = "select top 1 * from Zqj_Records where Cp_ID="&ID&" and DATEDIFF('d',Re_time,'"&date()&"')=0 order by Re_time Desc"
               rs.Open sql, conn, 1, 1
			   if rs.bof and rs.eof then
			   else
			       rekehu=rs("Re_Content")
				   Restatus=rs("Re_status")
				   KehuReID=rs("Re_ID")
			   end if
			end if
			'-------------------保存跟进及读取跟进记录结束------------------------------
        End If
End Sub


Function SortText(ID)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From Zqj_KehuSort where ID="& ID
    rs.Open sql, conn, 1, 1
	if rs.bof and rs.eof then
	SortText="未分类"
	else
    SortText = rs("SortName")
	end if
    rs.Close
    Set rs = Nothing
End Function

Function genjinText(MemName)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From Zqj_Members where MemName='"&MemName&"'"
    rs.Open sql, conn, 1, 1
	if rs.bof and rs.eof then
	genjinText="无跟进人"
	else
    genjinText = rs("RealName")
	end if
    rs.Close
    Set rs = Nothing
End Function

'客户跟进记录
Function KehuReList(Cp_Code)
    Dim idCount
    Dim pages
    pages = 20
    Dim pagec
    Dim page
    page = CLng(request("Page"))
    Dim pagenc
    pagenc = 2
    Dim pagenmax
    Dim pagenmin
    Dim datafrom
    datafrom = "Zqj_Records"
    Dim datawhere
	       datawhere = "where Cp_ID="&Cp_Code&" "
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")'
    If QUERY_STRING = "" Or InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?Result=Modify&ID="&mCp_ID&"&showid=3&"
    Else
        Myself = Left(PATH_INFO & "?" & QUERY_STRING, InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") -1)
    End If
    Dim taxis
    taxis = "order by Re_time desc"
    Dim i
    Dim rs, sql
    sql = "select count(Re_ID) as idCount from ["& datafrom &"]" & datawhere
    Set rs = server.CreateObject("adodb.recordset")
    rs.Open sql, conn, 0, 1
    idCount = rs("idCount")
    If(idcount>0) Then
    If(idcount Mod pages = 0)Then
    pagec = Int(idcount / pages)
Else
    pagec = Int(idcount / pages) + 1
End If
sql = "select Re_ID from ["& datafrom &"] " & datawhere & taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 1, 1
rs.pagesize = pages
If page < 1 Then page = 1
If page > pagec Then page = pagec
If pagec > 0 Then rs.absolutepage = page
For i = 1 To rs.pagesize
    If rs.EOF Then Exit For
    If(i = 1)Then
    sqlid = rs("Re_ID")
Else
    sqlid = sqlid &","&rs("Re_ID")
End If
rs.movenext
Next
End If
If(idcount>0 And sqlid<>"") Then
sql = "select * from ["& datafrom &"] where Re_ID in("& sqlid &") "&taxis
Set rs = server.CreateObject("adodb.recordset")
rs.Open sql, conn, 0, 1
noli=1
While(Not rs.EOF)
%>
<table border="0" align="center" cellpadding="3" cellspacing="0" width="98%" class="bordergj">
  <tr valign="top" bgcolor="#F8F8FA" >
    <td align="left" bgcolor="#d5e9ff">
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="50" height="25" align="center"><img src="../Images/bag_2.png" /></td>
              <td> 
			  <%=rs("RealName")%> 添加 于 <font class="gjtime"><%=rs("Re_time")%></font></td>
              <td width="30">
              <%
			  Select Case rs("Re_status")
			    Case "D"
				     response.Write "<div class=""chances_d"">D</div>"
                Case "C"
				     response.Write "<div class=""chances_c"">C</div>"
				Case "B"
				     response.Write "<div class=""chances_b"">B</div>"
				Case "A"
				      response.Write "<div class=""chances_a"">A</div>"
				Case "O"
				      response.Write "<div class=""chances_o"">O</div>"
				Case else
			  End Select		 
			  %>
              
              </td>
              <td width="50" align="center"> <input name="selectID" type="checkbox" value="<%=rs("Re_ID")%>"></td>
            </tr>
          </table> </td>
  </tr>
  <tr bgcolor="#F8F8FA" >
    <td align="left">
      <div class="gjlist"><%=rs("Re_Content")%></div>
	  </td>
  </tr>
</table>

<%
noli=noli+1
rs.movenext
Wend
Response.Write "<table width=""98%"" align=""center"" cellpadding=""5"" cellspacing=""1"" style=""margin-top:20px;"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td nowrap align=""right"" class=""forumRow""> <input onClick=""CheckAll(this.form)"" name=""buttonAllSelect"" type=""button"" id=""submitAllSearch"" value=""全选""> <input onClick=""CheckOthers(this.form)"" name=""buttonOtherSelect"" type=""button"" id=""submitOtherSelect"" value=""反选""> <input name='batch' type='submit' value='删除所选' onClick=""return test();"" disabled></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Else
Response.Write "<table border=""0"" align=""center"" cellpadding=""3"" cellspacing=""0"" width=""98%"" class=""bordergj"" style=""margin-bottom:20px;"">" & vbCrLf
Response.Write "  <tr valign=""top"" bgcolor=""#F8F8FA"" >" & vbCrLf
Response.Write "    <td align=""left"" bgcolor=""#d5e9ff"">" & vbCrLf
Response.Write "          <table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbCrLf
Response.Write "            <tr>" & vbCrLf
Response.Write "              <td width=""100"" height=""25"" align=""center"">&nbsp;</td>" & vbCrLf
Response.Write "              <td>&nbsp;</td>" & vbCrLf
Response.Write "              <td width=""50"" align=""center"">&nbsp;</td>" & vbCrLf
Response.Write "            </tr>" & vbCrLf
Response.Write "          </table> </td>" & vbCrLf
Response.Write "  </tr>" & vbCrLf
Response.Write "  <tr bgcolor=""#F8F8FA"" >" & vbCrLf
Response.Write "    <td align=""left"">" & vbCrLf
Response.Write "      <div class=""gjlist""><font color='#999999'>什么是事件？ 事件可以保存日常工作中的点点滴滴。比如每一次电话，会议或者任何想法。</font></div>" & vbCrLf
Response.Write "    </td>" & vbCrLf
Response.Write "  </tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
End If
Response.Write "<table width='98%' border='0' align='center' cellpadding='5' cellspacing='1' style=""margin-bottom:20px;"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td class=""forumRow"">&nbsp; 共计：<font color='red'>"&idcount&"</font>条记录 页次：<font color='red'>"&page&"</font></strong>/"&pagec&" 每页：<font color='red'>"&pages&"</font>条</td>" & vbCrLf
Response.Write "<td align='right' class=""forumRow"">" & vbCrLf
pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If(page>1) Then response.Write ("<a href='"& myself &"Page=1'><font style='font-size: 14px; font-family: Webdings'>9</font></a> ")
If(pagenmin>1) Then response.Write ("<a href='"& myself &"Page="& page - (pagenc * 2 + 1) &"'><font style='font-size: 14px; font-family: Webdings'>7</font></a> ")
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    response.Write (" <font color='red'>"& i &"</font> ")
Else
    response.Write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
End If
Next
If(pagenmax<pagec) Then response.Write (" <a href='"& myself &"Page="& page+(pagenc * 2 + 1) &"'><font style='font-size: 14px; font-family: Webdings'>8</font></a> ")
If(page<pagec) Then response.Write ("<a href='"& myself &"Page="& pagec &"'><font style='font-size: 14px; font-family: Webdings'>:</font></a> ")
Response.Write "第<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/\D/.test(this.value)){alert('请输入需要跳转到的页数并且必须为整数！');this.value='"&Page&"';}"" style='width: 28px;' type='text' value='"&Page&"'>页" & vbCrLf
Response.Write "<input name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
Response.Write " </td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
rs.Close
Set rs = Nothing
End Function

Function KHRe(mCp_code)
    Dim rs,sql
    Set rs = server.CreateObject("adodb.recordset")
	sql = "select * from Zqj_Records where Cp_ID="&mCp_code
    rs.Open sql,conn,1,1
    max=rs.recordcount
	Response.Write max
    rs.Close
    Set rs = Nothing
End Function

Function Career(ID) '履历条数
    Dim rs,sql
    Set rs = server.CreateObject("adodb.recordset")
	sql = "select * from Zqj_Career where Cp_ID="&ID
    rs.Open sql,conn,1,1
    Careernum=rs.recordcount
	Response.Write Careernum
    rs.Close
    Set rs = Nothing
End Function


Function Kehucname(mCo_Code) '公司名
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From Zqj_Company where Co_ID="&mCo_Code
    rs.Open sql, conn, 1, 1
	if rs.bof and rs.eof then
	mCo_name=""
	else
    mCo_name = rs("Co_name")
	mCo_ID=rs("Co_ID")
	end if
    rs.Close
    Set rs = Nothing
End Function

Function CareerList(ID) '联系人履历列表
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from Zqj_Career where Cp_ID="&ID&" order by Ca_time desc"
    rs.Open sql,conn,1,1
    if rs.eof and rs.bof then
		response.Write "<font color=red></li>"
	else
	While(Not rs.Eof)
	  AutoLink = ""
	Response.Write "<div class=""peoplelist""><img src=""../Images/connet_1.png"" /> " & vbCrLf
	Response.Write " <font class=""peoplelist_f14"">"&rs("Ca_company")&"</font>&nbsp; " & vbCrLf
	Response.Write " <font color=""#999999"">"&rs("Ca_position")&"</font>" & vbCrLf
	Response.Write "<font color=""#999999"">&nbsp; "&rs("Ca_time")&"</font>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	 rs.MoveNext
	 Wend
	end if
    rs.Close
    Set rs = Nothing
End Function

Function Plan_list(TKehuID)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
	if TKehuID<>"" and IsNumeric(TKehuID) then
        sql = "select * from Zqj_Plan where MemName='"&session("UserName")&"' and PL_viewflag and Cp_ID="&TKehuID&" and PL_time is not null and DATEDIFF('d',PL_time,'"&date()&"')<=0 order by PL_time desc"
	end if
    rs.Open sql, conn, 1, 1
    If not(rs.bof And rs.EOF) Then
	response.Write " <div class=""dashed_line"">销售计划</div>"
	response.Write "<table width=""80%"" border=""0"" cellspacing=""3"">"
    While Not rs.EOF
	    response.Write "<tr><td>"
		delc="<a href=""../DelContent.Asp?Result=Plan&fromID="&rs("PL_ID")&""" onClick=""return confirm('您确定要删除吗？删除后不能再恢复。')"" title=""删除""><img src=""../Images/del_1.png"" width=""13"" height=""12""></a>"
		response.Write " "&delc&" <font color=""#000099"">"&rs("PL_SortName")&"</font>  &nbsp;"&rs("PL_time")&""
	    response.Write " </td></tr>"
        rs.movenext
    Wend
	response.Write "</table>"
	End If
    rs.Close
    Set rs = Nothing
End Function
%>