?? adddata.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<!--#include file="Connections/conn.asp" -->
<!--登錄權限判斷,Session和MD5加密判斷-->
<%
Rem Session("CRM_account") 用戶帳號
Rem Session("CRM_name") 用戶名
Rem Session("CRM_level") 用戶等級
If Session("CRM_account") = "" Or Session("CRM_name") = "" Or Session("CRM_level") <= 0 Then Response.Redirect("login.asp")
Dim strNormal,strAdmin,strToPrint
strNormal = strNormal & " <tr>" & VBCrlf
strNormal = strNormal & " <td width=""60"" align=""center"" bgcolor=""menu"">編號</td>" & VBCrlf
strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司名稱</td>" & VBCrlf
strNormal = strNormal & " <td align=""center"" bgcolor=""menu"">公司網址</td>" & VBCrlf
strNormal = strNormal & " <td width=""80"" align=""center"" bgcolor=""menu"">地區</td>" & VBCrlf
strNormal = strNormal & " </tr>" & VBCrlf
strAdmin = strAdmin & " <tr>" & VBCrlf
strAdmin = strAdmin & " <td width=""60"" align=""center"" bgcolor=""menu"">編號</td>" & VBCrlf
strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司名稱</td>" & VBCrlf
strAdmin = strAdmin & " <td align=""center"" bgcolor=""menu"">公司網址</td>" & VBCrlf
strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">地區</td>" & VBCrlf
strAdmin = strAdmin & " <td width=""80"" align=""center"" bgcolor=""menu"">業務員</td>" & VBCrlf
strAdmin = strAdmin & " </tr>" & VBCrlf
Function getGroupName(gId)
If gId = "" Then
getGroupName = ""
Else
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_group Where gId = " & gId,conn,3,1
If rs.RecordCount <> 1 Then
getGroupName = ""
Else
getGroupName = rs("gName")
End If
rs.Close
Set rs = Nothing
End If
End Function
Function getGroup(gName)
If gName = "" Then
getGroup = 0
Else
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_group Where gName = '" & gName & "'",conn,3,1
If rs.RecordCount <> 1 Then
getGroup = 0
Else
getGroup = rs("gId")
End If
rs.Close
Set rs = Nothing
End If
End Function
''生成下拉列表
Function getList(i,sTable,iId,sValue,sName,selfValue)
If i < 1 Or i > 2 Then
getList = ""
Exit Function
End If
Dim strList
Dim rs
If i = 1 Then
strList = "<select name=""" & sName & """ selfValue=""" & selfValue & """>"
strList = strList & "<option value="""">請選擇</option>"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From " & sTable & "",conn,3,1
Do While Not rs.BOF And Not rs.EOF
strList = strList & "<option value=""" & rs(sValue) & """>" & rs(sValue) & "</option>"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
strList = strList & "</select>"
getList = strList
Else
strList = "<select name=""" & sName & """ selfValue=""" & selfValue & """>"
strList = strList & "<option value="""">請選擇</option>"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From " & sTable & "",conn,3,1
Do While Not rs.BOF And Not rs.EOF
strList = strList & "<option value=""" & rs(iId) & """>" & rs(sValue) & "</option>"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
strList = strList & "</select>"
getList = strList
End If
End Function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="http://www.technet.cn">
<meta name="Date" content="2003-08">
<title>客戶資料收集系統</title>
<link href="myStyle.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function showHideHead(strSrc)
{
var strFile = strSrc.substring(strSrc.lastIndexOf("/"),strSrc.length);
if (strFile == "/arrow_up.gif"){
oHead.style.display = "none";
oHeadCtrl.src = "images/arrow_down.gif";
oHeadCtrl.alt = "顯示頭部";
oHeadBar.title = "顯示頭部";
}
else {
oHead.style.display = "block";
oHeadCtrl.src = "images/arrow_up.gif";
oHeadCtrl.alt = "隱藏頭部";
oHeadBar.title = "隱藏頭部";
}
}
if (this.location.href == top.location.href){
top.location.href = "";
}
function checkInput()
{
if(document.all.company.value == ""){
alert("請輸入公司名稱。");
document.all.company.focus();
return false;
}
if(document.all.linkman.value == ""){
alert("請輸入聯系人。");
document.all.linkman.focus();
return false;
}
}
-->
</script>
</head>
<body style="background-color: menu;" onCopy="return false;" onSelectStart="return false;" onCut="return false;" onContextMenu="window.event.returnValue=false;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr id="oHead" style="display: block;">
<td height="1" valign="top">
<table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"><img src="images/null.gif" width="1" height="1"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="menu">
<tr>
<td align="left" background='images/tab_top_background_runner.gif'> <table width="5" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/null.gif" width="1" height="1"></td>
</tr>
</table>
<table onclick="window.location.replace('listAll.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr >
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">查看所有數據</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('addData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_on_left.gif" width="16" height="24"></td>
<td background="images/tab_on_middle.gif">添加數據</td>
<td><img src="images/tab_on_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('advanceSearch.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">高級搜索</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('dataForm.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">數據報表</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('exportData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">數據導出</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<% If Session("CRM_level") = 9 Then %> <table onclick="window.location.replace('transData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">數據轉移</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('manageUser.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">用戶管理</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('system_level.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">系統設置</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<% End If %>
<table onclick="window.location.replace('logout.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">注銷</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.reload();" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">刷新</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><img src="images/null.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="16" align="center" bgcolor="#999999" id="oHeadBar" style="cursor: hand;" title="隱藏頭部" onClick="return showHideHead(document.all.oHeadCtrl.src);">
<img src="images/arrow_up.gif" alt="隱藏頭部" width="16" height="16" align="absmiddle" id="oHeadCtrl"> </td>
</td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF" style="padding: 10px;">
<%
Dim action
action = Trim(Request("action"))
Select Case action
Case "save"
Call saveData()
Case "edit"
Call editForm()
Case "saveEdit"
Call saveEditData()
Case Else
Call addForm()
End Select
Sub addForm()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<form name="addDataForm" action="?action=save" method="post" onSubmit="return checkInput();">
<tr>
<td width="100" align="right">公司名稱:</td>
<td><input name="company" type="text" id="company" size="24" maxlength="36"></td>
<td width="100" align="right">聯系人:</td>
<td><input name="linkman" type="text" id="linkman" size="24" maxlength="48"></td>
</tr>
<tr>
<td width="100" align="right">網址:</td>
<td><input name="homepage" type="text" id="homepage" size="24" maxlength="36"></td>
<td width="100" align="right">聯系電話:</td>
<td><input name="tel" type="text" id="tel" size="24" maxlength="36"></td>
</tr>
<tr>
<td width="100" align="right">電子信箱:</td>
<td><input name="email" type="text" id="email" size="24" maxlength="36"></td>
<td width="100" align="right">公司地址:</td>
<td><input name="address" type="text" id="address" size="36"></td>
</tr>
<tr>
<td width="100" align="right">地區:</td>
<td>
<% = getList(1,"baidu_area","","areaName","area","業務區域") %></td>
<td width="100" align="right">所屬小區:</td>
<td><% = getList(1,"baidu_square","","squareName","square","業務小區") %></td>
</tr>
<tr>
<td width="100" align="right">客戶等級:</td>
<td><% = getList(1,"baidu_clientsType","","clientsType","type","客戶等級") %>
</td>
<td width="100" align="right">行業類型:</td>
<td>
<% = getList(1,"baidu_clientsTrade","","clientsTrade","trade","行業類型") %>
</td>
</tr>
<tr>
<td width="100" align="right">業務員:</td>
<td>
<input name="user" type="text" id="user" value="<% = Session("CRM_name") %>" size="12" maxlength="16" readonly="true"></td>
<td align="right">業務組:</td>
<td><input name="group" type="text" id="group" size="16" maxlength="24" value="<% = getGroupName(Session("CRM_group")) %>" readonly="true"></td>
</tr>
<tr>
<td width="100" align="right">客戶描述:</td>
<td colspan="3"><textarea name="info" rows="4" id="info" style="width: 80%;"></textarea>
</td>
</tr>
<!--<tr>
<td width="100" align="right">拜訪記錄:</td>
<td colspan="3"><textarea name="record" rows="8" id="record" style="width: 80%;"></textarea></td>
</tr>-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -