?? huiyuan_add.asp
字號:
<%
if session("yida_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<html>
<head>
<title><%=dianming%> - 添加會員</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
</style>
</HEAD>
<BODY>
<%
if fla35="0" and session("shiwei_id")<>"1" then
%>
<br><center><img src="../images/note.gif" align="absmiddle"> <font color="#FF0000">你不具備此權限,請與管理員聯系!</font></center>
<%
response.end
end if
%>
<%if request("hid1")="" then%>
<script language="javascript">
function check()
{
if (document.form1.username.value==""||document.form1.card.value=="")
{
alert("有*號的必須填寫!");
return false;
}
}
</script>
<form name="form1">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td> 添加會員(帶*號的為必填項)</td>
<td align="right"> </td>
</tr>
</table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr>
<td width="25%" height="30" align="right">會員組:</td>
<td width="75%" class="category">
<%
sql="select * from zu_huiyuan order by id"
set rs_zu=conn.execute(sql)
if rs_zu.eof then
%>
<script language="javascript">
alert("請先添加會員組!")
window.location.href="zu_add.asp"
</script>
<%
response.end
end if
%>
<select name="id_zu">
<%
do while rs_zu.eof=false
%>
<option value="<%=rs_zu("id")%>"><%=rs_zu("zu")%></option>
<%
rs_zu.movenext
loop
%>
</select>
</td>
</tr>
<tr>
<td align="right" height="30">會員卡號:</td>
<td class="category"><input type="text" name="card" style="width:300px"> <font color="#ff0000">*</font></td>
</tr>
<tr>
<td height="30" align="right">會員姓名:</td>
<td class="category"><input type="text" name="username" style="width:200px">
<font color="#ff0000">*</font></td>
</tr>
<tr>
<td align="right" height="30">會員性別:</td>
<td class="category">
<input type="radio" name="xinbie" value="女" checked="checked">
女
<input type="radio" name="xinbie" value="男">
男 </td>
</tr>
<tr>
<td align="right" height="30">聯系電話:</td>
<td class="category"><input type="text" name="tel" style="width:200px"></td>
</tr>
<tr>
<td align="right" height="30">QQ:</td>
<td class="category"><input type="text" name="qq" style="width:200px" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"></td>
</tr>
<tr>
<td align="right" height="30">Email:</td>
<td class="category"><input type="text" name="email" style="width:200px"></td>
</tr>
<tr>
<td align="right" height="30">家庭住址:</td>
<td class="category"><input type="text" name="address" style="width:300px"></td>
</tr>
<tr>
<td align="right" height="30">身份證號:</td>
<td class="category"><input type="text" name="sfz" style="width:300px"></td>
</tr>
<tr>
<td align="right" height="30">介紹人:</td>
<td class="category">
<input name="huiyuan2" readonly onClick="JavaScript:window.open('huiyuan.asp?form=form1&field=jieshao&field2=huiyuan2&field3=huiyuan3','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');" style="width:90px" value="單擊選擇會員"> <input type="text" name="huiyuan3" style="width:150px" readonly><input type="hidden" name="jieshao"></td>
</tr>
<tr>
<td align="right" height="30">經辦人:</td>
<td class="category">
<%
if session("shiwei_id")=1 then
sql="select * from login order by id_zu,id"
set rs_login=conn.execute(sql)
else
sql="select * from login where id="&session("shiwei_id")
set rs_login=conn.execute(sql)
end if
if rs_login.eof then
%>
<script language="javascript">
alert("請先添加員工!")
window.location.href="../system/user_add.asp"
</script>
<%
response.end
else
%>
<select name="id_login">
<%
do while rs_login.eof=false
%>
<option value="<%=rs_login("id")%>"<%if trim(cstr(rs_login("id")))=trim(cstr(session("shiwei_id"))) then%> selected="selected"<%end if%>><%=rs_login("username")%> (<%=rs_login("bianhao")%>)</option>
<%
rs_login.movenext
loop
%>
</select>
<%
end if
%> </td>
</tr>
<tr>
<td align="right" height="30">會員生日:</td>
<td class="category">
<select name="shenri1">
<%for x=1930 to 2006%>
<option value="<%=x%>"<%if x=1970 then%> selected="selected"<%end if%>><%=x%></option>
<%next%>
</select> 年
<select name="shenri2">
<%for x=1 to 12%>
<option value="<%=x%>"><%=x%></option>
<%next%>
</select> 月
<select name="shenri3">
<%for x=1 to 31%>
<option value="<%=x%>"><%=x%></option>
<%next%>
</select> 日
<select name="yinyan">
<option value="陰">陰歷</option>
<option value="陽">陽歷</option>
</select></td>
</tr>
<tr>
<td align="right" height="30">入會時間:</td>
<td class="category"><input name="startdate" value="<%=date()%>" readonly style="width:150px">
<img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form1&field=startdate&oldDate='+startdate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=500,left=520');"> </td>
</tr>
<tr>
<td align="right" height="30">備注:</td>
<td class="category"><textarea name="beizhu" cols="70" rows="4"></textarea></td>
</tr>
<tr>
<td height="30"> </td>
<td class="category">
<input type="submit" value=" 確認添加 " onClick="return check()" class="button">
<input type="hidden" name="hid1" value="ok">
<input type="reset" value=" 重新填寫 " class="button"> </td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</form>
<%
else
nowqq=request("qq")
nowemail=request("email")
nowid_zu=request("id_zu")
nowusername=request("username")
nowxinbie=request("xinbie")
nowtel=request("tel")
nowaddress=request("address")
nowsfz=request("sfz")
nowjieshao=request("jieshao")
nowcard=request("card")
nowid_login=request("id_login")
nowstartdate=request("startdate")
nowshenri1=request("shenri1")
nowshenri2=request("shenri2")
nowshenri3=request("shenri3")
nowyinyan=request("yinyan")
nowshenri=nowshenri1&"-"&nowshenri2&"-"&nowshenri3
nowenddate=cdate(nowstartdate)+365
nowbeizhu=request("beizhu")
sql="select * from huiyuan where card='"&nowcard&"'"
set rs=conn.execute(sql)
if rs.eof=false then
%>
<script language="javascript">
alert("您輸入的會員卡號已經存在,請重新輸入!")
window.history.go(-1)
</script>
<%
response.end
end if
if nowjieshao="" then
nowjieshao=0
else
sql="update huiyuan set jifen=jifen+"&jieshaojifen&" where id="&nowjieshao
conn.execute(sql)
end if
set rs_login=conn.execute("select * from login where id="&nowid_login)
nowlogin=rs_login("username")
sql="insert into huiyuan(username,xinbie,tel,address,sfz,jieshao,card,id_login,login,startdate,shenri,enddate,beizhu,yinyan,qq,email,id_zu) values('"&nowusername&"','"&nowxinbie&"','"&nowtel&"','"&nowaddress&"','"&nowsfz&"',"&nowjieshao&",'"&nowcard&"',"&nowid_login&",'"&nowlogin&"',#"&nowstartdate&"#,#"&nowshenri&"#,#"&nowenddate&"#,'"&nowbeizhu&"','"&nowyinyan&"','"&nowqq&"','"&nowemail&"',"&nowid_zu&")"
conn.execute(sql)
%>
<script language="javascript">
alert("會員添加成功!")
window.location.href="huiyuan.asp"
</script>
<%
end if
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -