home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
202.53.64.216
/
202.53.64.216.tar
/
202.53.64.216
/
janahitha
/
Admin
/
AdsAdminUpdateAccount.asp
< prev
next >
Wrap
Text File
|
2004-11-26
|
6KB
|
146 lines
<!-- #include file="../AdsOpenConn.asp" -->
<%
if session("AdminLogin")="" then Response.Redirect "default.asp"
%>
<%
dim accid
accid=Request.Form("accid")
name=Request.Form("name")
'if request.form.count=0 then
if accid <> "" and name <> "" then
set objrs = server.CreateObject("adodb.recordset")
objrs.Open "select ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone, ClientEmail, ClientFax, ClientContactPerson from AccClientDetails where accid="+ accid +" and clientname='"+name+"'", con, 3, 3
%>
<html>
<head>
<title> Janahitha Ads - Update Account </title>
<meta name="author" content="Jagadish">
<script language="javascript" src="../func.js"></script>
<script language="javascript">
function check()
{
validateform = document.updateprofileform;
if(isempty(validateform.name))
validateform.name.focus();
else
if(isempty(validateform.address))
validateform.address.focus();
else
if(isempty(validateform.city))
validateform.city.focus();
else
if(isempty(validateform.state))
validateform.state.focus();
else
if(isempty(validateform.pincode))
validateform.pincode.focus();
else
if(!(ispin(validateform.pincode)))
validateform.pincode.focus();
else
if(isempty(validateform.phone))
validateform.phone.focus();
else
if(!(isemail(validateform.email)))
validateform.email.focus();
else
validateform.submit();
}
</script>
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<!-- #include file="AdsTop.asp" -->
<center>
<table width=780 cellpadding=0 cellspacing=0 border=0 height=340>
<tr>
<td width=150 align=center valign=top bgcolor="#f2D197">
<!-- #include file="AdsLeft.asp" -->
</td>
<td width=630 align=center valign=top bgcolor="#ffffff">
<br>
<form name="updateprofileform" method=post action="<%=request.servervariables("script_name")%>">
<font face="verdana" color="#99603E"> <b> Update Profile </b> </font> <br> <br>
<table cellpadding=0 cellspacing=0 border=0>
<tr> <td bgcolor="#47AF59">
<table cellspacing=1 cellpadding=3 border=0 width=300>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Login Id </font> </td>
<td> <font face="verdana" size=2> <b> <%=session("ClientLoginId")%> </b> </font> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Name </font> </td>
<td> <input type=text name="name" size="15" maxlength=50 value="<%=objrs("ClientName")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Address </font> </td>
<td> <input type=text name="address" size="15" maxlength=200 value="<%=objrs("ClientAddress")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> City </font> </td>
<td> <input type=text name="city" size="15" maxlength=50 value="<%=objrs("ClientCity")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> State </font> </td>
<td> <input type=text name="state" size="15" maxlength=50 value="<%=objrs("ClientState")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Pin </font> </td>
<td> <input type=text name="pincode" size="15" maxlength=6 value="<%=objrs("ClientPincode")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Phone </font> </td>
<td> <input type=text name="phone" size="15" maxlength=30 value="<%=objrs("ClientPhone")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Fax </font> </td>
<td> <input type=text name="fax" size="15" maxlength=30 value="<%=objrs("ClientFax")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Email </font> </td>
<td> <input type=text name="email" size="15" maxlength=50 value="<%=objrs("ClientEmail")%>"> </td>
</tr>
<tr bgcolor="#ffffff">
<td> <font face="verdana" size=2> Contact Person Name </font> </td>
<td> <input type=text name="contactperson" size="15" maxlength=50 value="<%=objrs("ClientContactPerson")%>"> </td>
</tr>
</table>
</td> </tr>
</table>
<br>
<input type=button onclick="javascript:check()" value=" Update " id=button1 name=button1>
</form>
</td>
</tr>
</table>
</center>
<!-- #include file="AdsBottom.asp" -->
</body>
</html>
<%
objrs.Close
set objrs = nothing
else
name = replace(trim(request.form("name")), "'", "''")
address = replace(trim(request.form("address")), "'", "''")
city = replace(trim(request.form("city")), "'", "''")
state = replace(trim(request.form("state")), "'", "''")
pincode = replace(trim(request.form("pincode")), "'", "''")
phone = replace(trim(request.form("phone")), "'", "''")
fax = replace(trim(request.form("fax")), "'", "''")
email = replace(trim(request.form("email")), "'", "''")
contactperson = replace(trim(request.form("contactperson")), "'", "''")
sql = "update ClientMaster set ClientName='" + name + "', ClientAddress='" + address + "', ClientCity='" + city + "', ClientState='" + state + "', ClientPincode='" + pincode + "', ClientPhone='" + phone + "', ClientEmail='" + email + "'"
if fax<>"" then
sql = sql + ", ClientFax='" + fax + "'"
end if
if contactperson<>"" then
sql = sql + ", ClientContactPerson='" + contactperson + "'"
end if
sql = sql + " where ClientLoginId='" + replace(session("ClientLoginId"), "'", "''") + "'"
con.execute sql
response.redirect "AdsMyPage.asp?msg=up"
end if
%>
<!-- #include file="../AdsCloseConn.asp" -->