📄 editact.asp
字号:
<!--#include file="../function/connect.asp"-->
<!--#include file="../function/function.asp"-->
<%
act_id=request("act_id")
if act_id="" then
response.write "参数错误"
response.end
end if
close=request("close")
strsql="select * from acts where act_id=" & act_id
Set objRs1 = Server.CreateObject("adodb.recordset")
objRs1.Open strsql,objConn,1,1
if not objRs1.eof then
client_id=objrs1.fields("act_client")
act_title=objrs1.fields("act_title")
act_type=objrs1.fields("act_type")
act_client=objrs1.fields("act_client")
act_contact=objrs1.fields("act_contact")
act_chance=objrs1.fields("act_chance")
act_priority=objrs1.fields("act_priority")
act_priority=objrs1.fields("act_priority")
act_begin_date=objrs1.fields("act_begin_date")
act_end_date=objrs1.fields("act_end_date")
if act_end_date & "" = "" then
act_end_date=date()
end if
act_notice=objrs1.fields("act_notice")
act_desc=objrs1.fields("act_desc")
IsPublic=objrs1.fields("IsPublic")
end if
%>
<html>
<head>
<title>添加联系活动</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../cssD.css" rel=stylesheet>
<script language = "javascript" src="../function/date-picker.js"></script>
<script>
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
function fnDo(strTable,strFIdName,strIdName,strIDValue,strShowName)
{
var xmlDom = new ActiveXObject("Msxml2.DOMDocument");
var strURL = "GetCity.asp?strIDValue=" + strIDValue + "&strIdName="+strIdName+"&strTable="+strTable+"&strShowName="+strShowName+"&strFIdName="+strFIdName;
//alert(strURL);
xmlhttp.Open("POST",strURL , true);
xmlhttp.onreadystatechange = fnRun;
xmlhttp.Send(xmlDom);
}
//--------------------------------------------------------
function fnRun()
{
var state = xmlhttp.readyState;
var xmlDom = new ActiveXObject("Msxml2.DOMDocument");
if (state == 4)
{
xmlDom.loadXML(xmlhttp.responseXML.xml);
//alert(xmlDom.documentElement.selectSingleNode("//objXML").text)
var getInfo = xmlDom.documentElement.selectSingleNode("//objXML").text;
//document.write(getInfo);
subcat = new Array();
eval(getInfo);
changelocation(subcat)
}
}
function changelocation(subcat)
{
document.form1.act_contact.length = 0;
var i;
document.form1.act_contact.options[0] = new Option('====选择====','');
for (i=0;i <subcat.length; i++)
{
document.form1.act_contact.options[document.form1.act_contact.length] = new Option(subcat[i][0], subcat[i][1]);
if(subcat[i][1]=='<%=act_contact%>')
{
document.form1.act_contact.options[i+1].selected=true;
}
}
}
xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
function fnDo1(strTable,strFIdName,strIdName,strIDValue,strShowName)
{
var xmlDom1 = new ActiveXObject("Msxml2.DOMDocument");
var strURL = "GetCity.asp?strIDValue=" + strIDValue + "&strIdName="+strIdName+"&strTable="+strTable+"&strShowName="+strShowName+"&strFIdName="+strFIdName;
//alert(strURL);
xmlhttp1.Open("POST",strURL , true);
xmlhttp1.onreadystatechange = fnRun1;
xmlhttp1.Send(xmlDom1);
}
//--------------------------------------------------------
function fnRun1()
{
var state = xmlhttp1.readyState;
var xmlDom = new ActiveXObject("Msxml2.DOMDocument");
if (state == 4)
{
xmlDom.loadXML(xmlhttp1.responseXML.xml);
//alert(xmlDom.documentElement.selectSingleNode("//objXML").text)
var getInfo = xmlDom.documentElement.selectSingleNode("//objXML").text;
//document.write(getInfo);
subcat = new Array();
eval(getInfo);
changelocation1(subcat)
}
}
function changelocation1(subcat)
{
document.form1.act_chance.length = 0;
var i;
document.form1.act_chance.options[0] = new Option('====选择====','');
for (i=0;i <subcat.length; i++)
{
document.form1.act_chance.options[document.form1.act_chance.length] = new Option(subcat[i][0], subcat[i][1]);
if(subcat[i][1]=='<%=act_chance%>')
{
document.form1.act_chance.options[i+1].selected=true;
}
}
}
function check()
{
if(document.form1.act_title.value==""){
alert("活动主题不能为空");
document.form1.act_title.focus();
return false;
}
if(document.form1.act_client.value==""){
alert("相关客户不能为空");
document.form1.act_client.focus();
return false;
}
if(document.form1.act_contact.value==""){
alert("相关联系人不能为空");
document.form1.act_contact.focus();
return false;
}
}
</script>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="2" bordercolorlight='#000000' bordercolordark='#FFFFFF'>
<form name="form1" method="post" action="editact_ok.asp" onsubmit="return check();">
<tr class="tablehead">
<td height="22" colspan="4"><div align="center">修改联系活动</div></td>
</tr>
<tr>
<td width="119" height="22" nowrap>
<div align="right">活动主题:</div></td>
<td width="193" height="22">
<input name="act_title" type="text" id="act_title" size="30" maxlength="100" class="input" value="<%=act_title%>"></td>
<td width="89" height="22" nowrap>
<div align="right">活动类型:</div></td>
<td width="179" height="22">
<select name="act_type" id="act_type" style="width:70">
<option value="电话" <%if act_type="电话" then response.write "selected"%>>电话</option>
<option value="会面" <%if act_type="会面" then response.write "selected"%>>会面</option>
<option value="事务" <%if act_type="事务" then response.write "selected"%>>事务</option>
</select></td>
</tr>
<tr>
<td width="119" height="22" nowrap>
<div align="right">相关客户:</div></td>
<td width="193" height="22">
<select name="act_client" style='width:188;' onchange="fnDo('Contacts','client_ID','Contact_ID',this.value,'Contact_Name');fnDo1('chances','chance_client','chance_id',this.value,'chance_title');">
<option value="">====选择====</option>
<%
strsql="select * from clients"
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
if not objrs.eof then
do while not objrs.eof
if client_id & "" =objrs.fields("client_id") & "" then
response.write "<option value=" & objrs.fields("client_id") & " selected>" & objrs.fields("client_name") & "</option>"
else
response.write "<option value=" & objrs.fields("client_id") & ">" & objrs.fields("client_name") & "</option>"
end if
objrs.movenext
loop
end if
%>
</select>
</td>
<td width="89" height="22" nowrap>
<div align="right">相关联系人:</div></td>
<td width="179" height="22">
<select name="act_contact" style="width:100">
<option value="">====选择====</option>
</select>
</td>
</tr>
<tr>
<td width="119" height="22">
<div align="right">相关机会:</div></td>
<td width="193" height="22">
<select name="act_chance" style='width:188;'>
<option value="">====选择====</option>
<%
strsql="select * from chances"
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
if not objrs.eof then
do while not objrs.eof
if act_chance= objrs.fields("chance_id") then
response.write "<option value=" & objrs.fields("chance_id") & " selected>" & objrs.fields("chance_title") & "</option>"
else
response.write "<option value=" & objrs.fields("chance_id") & ">" & objrs.fields("chance_title") & "</option>"
end if
objrs.movenext
loop
end if
%>
</select>
</td>
<td width="89" height="22">
<div align="right">优先级:</div></td>
<td width="179" height="22">
<select name="act_priority">
<option value="3" <%if act_priority & "" ="3" then response.write "selected"%>>高</option>
<option value="2" <%if act_priority & "" ="2" then response.write "selected"%>>中</option>
<option value="1" <%if act_priority & "" ="1" then response.write "selected"%>>低</option>
</select>
</td>
</tr>
<tr>
<td width="119" height="22">
<div align="right">开始时间:</div></td>
<td width="193" height="22">
<input type="text" size="10" class=input name="act_begin_date" maxlength="20" onclick="show_calendar('form1.act_begin_date',null,null,'MM/DD/YYYY')" onmouseover="window.status='选择时间';return true;" onmouseout="window.status='';return true;" value="<%=year(act_begin_date)%>-<%=month(act_begin_date)%>-<%=day(act_begin_date)%>"><input type="button" class=button value="..." onclick="show_calendar('form1.act_begin_date',null,null,'YYYY-MM-DD')">
<select name="dayhour">
<%getDaySelected 15,act_begin_date%>
</select>
</td>
<td width="89" height="22">
<div align="right">结束时间:</div></td>
<td width="179" height="22" nowrap>
<input type="text" size="10" class=input name="act_end_date" maxlength="20" onclick="show_calendar('form1.act_end_date',null,null,'MM/DD/YYYY')" onmouseover="window.status='选择时间';return true;" onmouseout="window.status='';return true;" value="<%=year(act_end_date)%>-<%=month(act_end_date)%>-<%=day(act_end_date)%>"><input type="button" class=button value="..." onclick="show_calendar('form1.act_end_date',null,null,'YYYY-MM-DD')">
<select name="dayhourend">
<%getDaySelected 15,act_end_date%>
</select>
</td>
</tr>
<tr>
<td width="119" height="22" nowrap>
<div align="right">设定提醒,提前:</div></td>
<td width="193" height="22">
<select name="act_notice">
<option value="0" <%if act_notice & "" ="0" then response.write "selected"%>></option>
<option value="5" <%if act_notice & "" ="5" then response.write "selected"%>>5分钟</option>
<option value="10" <%if act_notice & "" ="10" then response.write "selected"%>>10分钟</option>
<option value="15" <%if act_notice & "" ="15" then response.write "selected"%>>15分钟</option>
<option value="30" <%if act_notice & "" ="30" then response.write "selected"%>>30分钟</option>
<option value="45" <%if act_notice & "" ="45" then response.write "selected"%>>45分钟</option>
<option value="60" <%if act_notice & "" ="60" then response.write "selected"%>>60分钟</option>
<option value="120" <%if act_notice & "" ="120" then response.write "selected"%>>2小时</option>
<option value="180" <%if act_notice & "" ="180" then response.write "selected"%>>3小时</option>
</select>
分钟</td>
<td width="89" height="22"> </td>
<td width="179" height="22"> </td>
</tr>
<tr>
<td height="22"><div align="right">描述:</div></td>
<td height="22" colspan="3"><textarea name="act_desc" cols="55" rows="5" id="act_desc" class="input"><%=act_desc%></textarea></td>
</tr>
<tr>
<td colspan="6" height="22">
<input type="checkbox" name="IsPublic" value="1" <%if IsPublic & ""="1" then%>checked<%end if%>>公开此条纪录
</td>
</tr>
<tr>
<td height="22"> </td>
<td height="22" colspan="3">
<input type="hidden" name="act_id" value="<%=act_id%>"><input type="hidden" name="close" value="<%=close%>">
<input type="submit" name="submit" value=" 确 定 " class="button">
<input type="reset" value=" 重 设 " class="button">
<input type="button" value=" 关 闭 " class="button" onclick="top.close();">
</td>
</tr>
</form>
</table>
</body>
</html>
<script>
if(document.form1.act_client.options[document.form1.act_client.selectedIndex].value!=""){
fnDo('Contacts','client_ID','Contact_ID',document.form1.act_client.options[document.form1.act_client.selectedIndex].value,'Contact_Name');
fnDo1('chances','chance_client','chance_id',document.form1.act_client.options[document.form1.act_client.selectedIndex].value,'chance_title');
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -