home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
202.53.64.216
/
202.53.64.216.tar
/
202.53.64.216
/
janahitha
/
Admin
/
AdsAdminViewClients.asp
< prev
next >
Wrap
Text File
|
2004-11-26
|
18KB
|
475 lines
<%
if session("AdminLogin")="" then Response.Redirect "default.asp"
%>
<!-- #include file="AdsAdminConstants.asp" -->
<!-- #include file="../AdsOpenConn.asp" -->
<%
if Request.Form.Count=0 then
%>
<html>
<head>
<title> <%=SiteName%> - Welcome </title>
<meta name="author" content="Jagadish">
<script language="javascript" src="../func.js"> </script>
<script language="javascript">
function check()
{
validateform = document.searchclientform;
if((validateform.criteria(1).checked)&&(isempty(validateform.clientname)))
validateform.clientname.focus();
else
if((validateform.criteria(2).checked)&&(!(isemail(validateform.clientemail))))
validateform.clientemail.focus();
else
if((validateform.criteria(3).checked)&&(isempty(validateform.clientloginid)))
validateform.clientloginid.focus();
else
validateform.submit();
}
</script>
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
<tr height=1>
<td width="180" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="210" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="210" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
<td width="180" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b> <%=SiteName%> </b> </font> </td>
<td bgcolor="<%=RightColor%>" colspan=2 align=right valign=top> <font face=verdana size=2> <a href="AdsAdminHome.asp"><font color="<%=TopLinksColor%>">Home</font></a> <a href="AdsAdminHome.asp?lo"><font color="<%=TopLinksColor%>">Logout</font></a> </font> </td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 align=center height=250 bgcolor="<%=OuterTblBGColor%>">
<br>
<form name="searchclientform" method=post action="<%=Request.ServerVariables("script_name")%>">
<table cellpadding=0 cellspacing=0 border=0>
<tr> <td bgcolor="<%=TblBorderColor%>">
<table width="330" border=0 cellpadding=3 cellspacing=1>
<tr bgcolor="<%=TblHeadBGColor%>">
<th colspan=2>
<font face=verdana color="<%=TblHeadFGColor%>"> View/Search Clients </font>
</th>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td colspan=2>
<font face=verdana size=2 color="<%=TblFGColor%>"> <input type="radio" name="criteria" value="all" checked> All The Clients </font>
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td width="50%">
<font face=verdana size=2 color="<%=TblFGColor%>"> <input type="radio" name="criteria" value="name"> Client Name </font>
</td>
<td width="50%">
<input type=text name="clientname">
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td>
<font face=verdana size=2 color="<%=TblFGColor%>"> <input type="radio" name="criteria" value="email"> Client Email </font>
</td>
<td>
<input type=text name="clientemail">
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td>
<font face=verdana size=2 color="<%=TblFGColor%>"> <input type="radio" name="criteria" value="loginid"> Client Login Id </font>
</td>
<td>
<input type=text name="clientloginid">
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td colspan=2 align=center>
<font face=verdana size=2 color="<%=TblFGColor%>">
<input type="radio" name="betweendates" value="yes"> Regd Between The Dates
<input type="radio" name="betweendates" value="no" checked> All
</font>
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td>
<font face="verdana" size=2 color="<%=TblFGColor%>"> From Date </font>
</td>
<td>
<select name="fromdd">
<%
for i = 1 to 31
%>
<option value="<%=i%>" <%if i=datepart("d", dateadd("d", -7, date)) then%>selected<%end if%>> <%=i%>
<%
next
%>
</select>
<select name="frommm">
<%
months=split("Mon~Jan~Feb~Mar~Apr~May~Jun~Jul~Aug~Sep~Oct~Nov~Dec", "~")
for i = 1 to 12
%>
<option value="<%=i%>" <%if i=datepart("m", dateadd("d", -7, date)) then%>selected<%end if%>> <%=months(i)%>
<%
next
%>
</select>
<select name="fromyyyy">
<%
for i = 2002 to datepart("yyyy", date)+1
%>
<option value="<%=i%>" <%if i=datepart("yyyy", dateadd("d", -7, date)) then%>selected<%end if%>> <%=i%>
<%
next
%>
</select>
</td>
</tr>
<tr bgcolor="<%=TblBGColor%>">
<td>
<font face="verdana" size=2 color="<%=TblFGColor%>"> To Date </font>
</td>
<td>
<select name="todd">
<%
for i = 1 to 31
%>
<option value="<%=i%>" <%if i=datepart("d", date) then%>selected<%end if%>> <%=i%>
<%
next
%>
</select>
<select name="tomm">
<%
months=split("Mon~Jan~Feb~Mar~Apr~May~Jun~Jul~Aug~Sep~Oct~Nov~Dec", "~")
for i = 1 to 12
%>
<option value="<%=i%>" <%if i=datepart("m", date) then%>selected<%end if%>> <%=months(i)%>
<%
next
%>
</select>
<select name="toyyyy">
<%
for i = 2002 to datepart("yyyy", date)+1
%>
<option value="<%=i%>" <%if i=datepart("yyyy", date) then%>selected<%end if%>> <%=i%>
<%
next
%>
</select>
</td>
</tr>
<tr bgcolor="<%=TblHeadBGColor%>">
<th colspan=2>
<input type=button value=" Show Results " onclick="javascript:check();">
</th>
</tr>
</table>
</td> </tr>
</table>
</form>
</td>
<td bgcolor="<%=RightColor%>"> </td>
</tr>
<tr>
<td colspan=2 bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 bgcolor="<%=RightColor%>"> </td>
</tr>
</table>
</body>
</html>
<%
else
if Request.Form("criteria")<>"" then
criteria = Request.Form("criteria")
sql = "select ClientId, ClientLoginId, ClientPassword, ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone1,ClientPhone2, ClientFax, ClientEmail, ClientContactPerson, ClientRegDate, ClientStatus from ClientMaster where 1=1"
if criteria="name" then sql = sql + " and ClientName like '%" + replace(trim(Request.Form("clientname")), "'", "''") + "%'"
if criteria="email" then sql = sql + " and ClientEmail like '%" + replace(trim(Request.Form("clientemail")), "'", "''") + "%'"
if criteria="loginid" then sql = sql + " and ClientLoginId like '%" + replace(trim(Request.Form("clientloginid")), "'", "''") + "%'"
msg = ""
if Request.Form("betweendates")="yes" then
fromdate = Request.Form("frommm") + "/" + Request.Form("fromdd") + "/" + Request.Form("fromyyyy")
todate = Request.Form("tomm") + "/" + Request.Form("todd") + "/" + Request.Form("toyyyy")
if (not isdate(fromdate)) or (not isdate(todate)) then msg = "Invalid Dates Entered"
sql = sql + " and ClientRegDate between #" + fromdate + "# and #" + todate + "#"
end if
sql = sql + " order by"
if Request.Form("betweendates")="yes" then sql = sql + " ClientRegDate,"
sql = sql + " ClientLoginId"
set rs = server.CreateObject("adodb.recordset")
rs.CursorLocation=3
if msg="" then
rs.open sql, con, 3, 3
if rs.RecordCount=0 then msg = "No Records Found"
rs.Close
end if
if msg<>"" then
%>
<html>
<head>
<title> <%=SiteName%> - Welcome </title>
<meta name="author" content="Jagadish">
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
<tr height=1>
<td width="100" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="290" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="290" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
<td width="100" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b> <%=SiteName%> </b> </font> </td>
<td bgcolor="<%=RightColor%>" colspan=2 align=right valign=top> <font face=verdana size=2> <a href="AdsAdminHome.asp"><font color="<%=TopLinksColor%>">Home</font></a> <a href="AdsAdminHome.asp?lo"><font color="<%=TopLinksColor%>">Logout</font></a> </font> </td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 align=center height=200 bgcolor="<%=OuterTblBGColor%>">
<table cellpadding=2 cellspacing=0 border=0>
<tr> <td bgcolor="<%=OuterTblBorderColor%>">
<table width="576" bgcolor=<%=OuterTblBGColor%> height=200 border=0 cellpadding=0 cellspacing=0>
<tr>
<th>
<br>
<font face=verdana size=2 color="<%=ErrMsgColor%>">
<%=msg%> <br> <br>
<a href="javascript:history.back();"><font color="<%=ErrMsgColor%>">Back</font></a>
</font>
</th>
</tr>
</table>
</td> </tr>
</table>
</td>
<td bgcolor="<%=RightColor%>"> </td>
</tr>
<tr>
<td colspan=2 bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 bgcolor="<%=RightColor%>"> </td>
</tr>
</table>
</body>
</html>
<%
Response.End
end if
%>
<html>
<head>
<title> <%=SiteName%> - Welcome </title>
<meta name="author" content="Jagadish">
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
<tr height=1>
<td width="50" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="340" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="340" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
<td width="50" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b> <%=SiteName%> </b> </font> </td>
<td bgcolor="<%=RightColor%>" colspan=2 align=right valign=top> <font face=verdana size=2> <a href="AdsAdminHome.asp"><font color="<%=TopLinksColor%>">Home</font></a> <a href="AdsAdminHome.asp?lo"><font color="<%=TopLinksColor%>">Logout</font></a> </font> </td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 align=center height=200 bgcolor="<%=OuterTblBGColor%>">
<br>
<form name="clientresultform" method=post action="<%=Request.ServerVariables("script_name")%>">
<table cellpadding=0 cellspacing=0 border=0>
<tr> <td bgcolor="<%=TblBorderColor%>">
<table width="600" border=0 cellpadding=3 cellspacing=1>
<tr bgcolor="<%=TblHeadBGColor%>">
<th width="30">
<font face=verdana size=2 color="<%=TblHeadFGColor%>"> SNo </font>
</th>
<th width="450">
<font face=verdana size=2 color="<%=TblHeadFGColor%>"> Client Details </font>
</th>
<th width="70">
<font face=verdana size=2 color="<%=TblHeadFGColor%>"> Status </font>
</th>
<th width="50">
<font face=verdana size=2 color="<%=TblHeadFGColor%>"> Delete </font>
</th>
</tr>
<%
rs.Open sql, con, 3, 3
sno = 0
while not rs.EOF
sno = sno + 1
%>
<tr bgcolor="<%=TblBGColor%>">
<td align=right>
<font face=verdana size=2 color="<%=TblFGColor%>"> <%=sno%> </font>
<input type=hidden name="ids" value="<%=rs("ClientId")%>">
</td>
<td>
<table width="100%" cellspacing=1 cellpadding=0>
<tr>
<td width="25%">
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Login Id - </font>
</td>
<td width="35%">
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <b> <%=rs("ClientLoginId")%> </b> </font>
</td>
<td width="20%">
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Password - </font>
</td>
<td width="20%">
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <%=rs("ClientPassword")%> </font>
</td>
</tr>
<tr>
<td colspan=4>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>">
Organization & Address :
<font color="<%=ContentColor%>">
<b> <%=rs("ClientName")%> </b> <br> <%=rs("ClientAddress")%> <br>
<%=rs("ClientCity")%> - <%=rs("ClientPincode")%> <%=rs("ClientState")%>
</font>
</font>
</td>
</tr>
<tr>
<td>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Contact Person - </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <%=rs("ClientContactPerson")%> </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Phone1 - </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <%=rs("ClientPhone1")%> </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Phone2 - </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <%=rs("ClientPhone2")%> </font>
</td>
</tr>
<tr>
<td>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> e-Mail - </font>
</td>
<td>
<a href="mailto:<%=rs("ClientEmail")%>"><font face="ms sans serif" size=1 color="<%=NewLinkColor%>"><%=rs("ClientEmail")%></font></a>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=TblFGColor%>"> Fax - </font>
</td>
<td>
<font face="ms sans serif" size=2 color="<%=ContentColor%>"> <%=rs("ClientFax")%> </font>
</td>
</tr>
</table>
</td>
<td align=center>
<font face="ms sans serif" size=1 color="<%=TblFGColor%>">
<input type="radio" name="status<%=rs("ClientId")%>" value="1" <%if rs("ClientStatus") then%>checked<%end if%>> Active <br>
<input type="radio" name="status<%=rs("ClientId")%>" value="0" <%if not rs("ClientStatus") then%>checked<%end if%>> Inactive
</font>
</td>
<td align=center>
<input type=checkbox name="delete<%=rs("ClientId")%>">
</td>
</tr>
<%
rs.MoveNext
wend
rs.Close
set rs = nothing
%>
<tr bgcolor=#FEFFE1>
<th colspan=4>
<input type=submit value=" Update ">
</th>
</tr>
</table>
</td> </tr>
</table>
</form>
</td>
<td bgcolor="<%=RightColor%>"> </td>
</tr>
<tr>
<td colspan=2 bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 bgcolor="<%=RightColor%>"> </td>
</tr>
</table>
</body>
</html>
<%
else
ids = split(Request.Form("ids"), ", ")
for i = 0 to ubound(ids)
sql = ""
if Request.Form("delete" + ids(i))="on" then
sql = "delete from ClientMaster where ClientId=" + ids(i)
else
if Request.Form("status" + ids(i))="0" then
sql = "update ClientMaster set ClientStatus=0 where ClientId=" + ids(i)
else
sql = "update ClientMaster set ClientStatus=1 where ClientId=" + ids(i)
end if
end if
if sql<>"" then
con.execute sql
end if
next
%>
<html>
<head>
<title> <%=SiteName%> - Welcome </title>
<meta name="author" content="Jagadish">
<meta name="author" content="Gopi Tanguturi">
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
<tr height=1>
<td width="100" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="290" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
<td width="290" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
<td width="100" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b> <%=SiteName%> </b> </font> </td>
<td bgcolor="<%=RightColor%>" colspan=2 align=right valign=top> <font face=verdana size=2> <a href="AdsAdminHome.asp"><font color="<%=TopLinksColor%>">Home</font></a> <a href="AdsAdminHome.asp?lo"><font color="<%=TopLinksColor%>">Logout</font></a> </font> </td>
</tr>
<tr>
<td bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 align=center height=100 bgcolor="<%=OuterTblBGColor%>">
<table cellpadding=2 cellspacing=0 border=0>
<tr> <td bgcolor="<%=OuterTblBorderColor%>">
<table width="576" bgcolor="<%=OuterTblBGColor%>" height=100 border=0 cellpadding=0 cellspacing=0>
<tr>
<th>
<br>
<font face=verdana size=2 color="<%=MsgColor%>">
Clients' Details Updated Successfully <br> <br>
<a href="<%=Request.ServerVariables("script_name")%>"><font color="<%=MsgColor%>">Back</font></a>
</font>
</th>
</tr>
</table>
</td> </tr>
</table>
</td>
<td bgcolor="<%=RightColor%>"> </td>
</tr>
<tr>
<td colspan=2 bgcolor="<%=LeftColor%>"> </td>
<td colspan=2 bgcolor="<%=RightColor%>"> </td>
</tr>
</table>
</body>
</html>
<%
end if
end if
%>
<!-- #include file="../AdsCloseConn.asp" -->