📄 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
%>
<link href="myStyle.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="images/test.css" 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.address.value == ""){
alert("请输入公司地址。");
document.all.address.focus();
return false;
}
if(document.all.zip.value == ""){
alert("请输入邮政编码。");
document.all.trade.focus();
return false;
}
if(document.all.linkman.value == ""){
alert("请输入负责人。");
document.all.linkman.focus();
return false;
}
if(document.all.tel.value == ""){
alert("请输入联系电话。");
document.all.tel.focus();
return false;
}
if(document.all.type.value == ""){
alert("请输入客户类型。");
document.all.trade.focus();
return false;
}
}
-->
</script>
<style type="text/css">
<!--
a:link {
font-family: "宋体";
font-size: 12px;
color: #005288;
text-decoration: none;
}
a:visited {
font-family: "宋体";
font-size: 12px;
color: #005288;
text-decoration: none;
}
a:hover {
font-family: "宋体";
font-size: 12px;
color: #005288;
text-decoration: underline;
}
a:active {
font-family: "宋体";
font-size: 12px;
color: #005288;
text-decoration: none;
}
-->
</style>
</head>
<body style="background-color: menu;">
<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 height="20"><img src="images/icon-default.gif" width="16" height="15" class="button" onclick="javascript:window.parent.testframeset.cols = '110,*';" vspace="2" hspace="1" alt="恢复左栏默认宽度"></td>
<td height="15" width=40> </td>
</tr>
</table>
<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="#1E75CF" 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()
%>
<div align="center">
<table border="1" width="95%" id="table1" cellspacing="5" cellpadding="0" style="border-collapse: collapse" bordercolordark="#000000">
<form name="addDataForm" action="?action=save" method="post" onSubmit="return checkInput();" autocomplete="off">
<tr>
<td width="74%" height="25" colspan="6"><font color="#137BB9"><b>
客户资源管理系统</b></font></td>
<td width="9%" height="25">
<p align="center"><font size="2">录入时间</font></td>
<td width="3%" height="25">:</td>
<td height="25"><input name="date" type="text" id="date" size="17" maxlength="10" value=" <% = Date() %>" onfocus="javascript:{this.value='';}"></td>
</tr>
<tr>
<td width="9%" height="25">
<p align="center"><font size="2">公司名称</font></td>
<td width="3%" height="25">
<p align="center"><font size="2">:</font></td>
<td width="30%" height="25">
<p align="left"><input name="company" type="text" id="company" size="27" maxlength="36" onChange="callServer();" ></td>
<td width="9%" height="25">
<p align="center"><font size="2">联 系 人</font></td>
<td width="3%" height="25">
<p align="center"><font size="2">:</font></td>
<td width="15%" height="25">
<p align="left"><input name="linkman" type="text" id="linkman" size="12" maxlength="48"></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -