home *** CD-ROM | disk | FTP | other *** search
/ 202.53.64.216 / 202.53.64.216.tar / 202.53.64.216 / janahitha / Admin / AdsAdminViewZones.asp < prev    next >
Text File  |  2004-11-26  |  7KB  |  179 lines

  1. <%
  2.     if session("AdminLogin")="" then Response.Redirect "default.asp"
  3. %>
  4. <!-- #include file="AdsAdminConstants.asp" -->
  5. <!-- #include file="../AdsOpenConn.asp" -->
  6. <%
  7.     if Request.Form.Count=0 then
  8.         sql = "select ZoneId, ZoneName, ZoneDescription, ZoneStatus from ZoneMaster Order by ZoneName"
  9.         set rs = server.CreateObject("adodb.recordset")
  10.         msg = ""
  11.         rs.open sql, con, 3, 3
  12.         if rs.RecordCount=0 then msg = "No Records Found"
  13.         rs.Close 
  14.         if msg<>"" then
  15. %>
  16. <html>
  17.     <head>
  18.         <title> <%=SiteName%> - Welcome </title>
  19.         <meta name="author" content="Jagadish">
  20.     </head>
  21.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  22.         <table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
  23.         <tr height=1>
  24.             <td width="100" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  25.             <td width="290" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  26.             <td width="290" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  27.             <td width="100" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  28.         </tr>
  29.         <tr>
  30.             <td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b>   <%=SiteName%> </b> </font> </td>
  31.             <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>
  32.         </tr>
  33.         <tr>
  34.             <td bgcolor="<%=LeftColor%>">   </td>
  35.             <td colspan=2 align=center height=200 bgcolor="<%=OuterTblBGColor%>">
  36.                 <table cellpadding=2 cellspacing=0 border=0>
  37.                 <tr> <td bgcolor="<%=OuterTblBorderColor%>">
  38.                 <table width="576" bgcolor=<%=OuterTblBGColor%> height=200 border=0 cellpadding=0 cellspacing=0>
  39.                 <tr>
  40.                     <th>
  41.                         <br>
  42.                         <font face=verdana size=2 color="<%=ErrMsgColor%>">
  43.                             <%=msg%> <br> <br>
  44.                             <a href="javascript:history.back();"><font color="<%=ErrMsgColor%>">Back</font></a>
  45.                         </font>
  46.                     </th>
  47.                 </tr>
  48.                 </table>
  49.                 </td> </tr>
  50.                 </table>
  51.             </td>
  52.             <td bgcolor="<%=RightColor%>">   </td>
  53.         </tr>
  54.         <tr>
  55.             <td colspan=2 bgcolor="<%=LeftColor%>">   </td>
  56.             <td colspan=2 bgcolor="<%=RightColor%>">   </td>
  57.         </tr>
  58.         </table>
  59.     </body>
  60. </html>
  61. <%            
  62.             Response.End 
  63.         end if
  64. %>
  65. <html>
  66.     <head>
  67.         <title> <%=SiteName%> - Welcome </title>
  68.         <meta name="author" content="Jagadish">
  69.     </head>
  70.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  71.         <table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
  72.         <tr height=1>
  73.             <td width="50" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  74.             <td width="340" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  75.             <td width="340" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  76.             <td width="50" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  77.         </tr>
  78.         <tr>
  79.             <td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b>   <%=SiteName%> </b> </font> </td>
  80.             <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>
  81.         </tr>
  82.         <tr>
  83.             <td bgcolor="<%=LeftColor%>">   </td>
  84.             <td colspan=2 align=center height=200 bgcolor="<%=OuterTblBGColor%>">
  85.                 <br>
  86.                 <form name="viewbookingform" method=post action="<%=Request.ServerVariables("script_name")%>">
  87.                 <table cellpadding=0 cellspacing=0 border=0>
  88.                 <tr> <td bgcolor="<%=TblBordercolor%>">
  89.                 <table width="600" border=0 cellpadding=3 cellspacing=1>
  90.                 <tr bgcolor="<%=TblHeadBGColor%>">
  91.                     <th>
  92.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>"> SNo </font>
  93.                     </th>
  94.                     <th>
  95.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Zone Name </font>
  96.                     </th>
  97.                     <th>
  98.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Zone Description </font>
  99.                     </th>
  100.                     <th>
  101.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Status </font>
  102.                     </th>
  103.                     <th>
  104.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>">   </font>
  105.                     </th>
  106.                     <th>
  107.                         <font face=verdana size=2 color="<%=TblHeadFGColor%>"> Delete </font>
  108.                     </th>
  109.                 </tr>
  110. <%            
  111.             rs.Open sql, con, 3, 3
  112.             sno = 0
  113.             while not rs.EOF
  114.                 sno = sno + 1
  115.                 if rs("ZoneStatus") then
  116.                     Status = "Active"
  117.                 else
  118.                     Status = "Inactive"
  119.                 end if
  120. %>
  121.                 <tr bgcolor="<%=TblBGColor%>">
  122.                     <td align=right>
  123.                         <font face=verdana size=2 color="<%=TblFGColor%>"> <%=sno%> </font>
  124.                         <input type=hidden name="ids" value="<%=rs("ZoneId")%>">
  125.                     </td>
  126.                     <td>
  127.                         <font face=verdana size=2 color="<%=TblFGColor%>"> <%=rs("ZoneName")%> </font>
  128.                     </td>
  129.                     <td>
  130.                         <font face=verdana size=2 color="<%=TblFGColor%>"> <%=rs("ZoneDescription")%> </font>
  131.                     </td>
  132.                     <td align=center>
  133.                         <font face=verdana size=2 color="<%=TblFGColor%>"> <%=Status%> </font>
  134.                     </td>
  135.                     <td align=center>
  136.                         <a href="AdsAdminUpdateZone.asp?zoneid=<%=rs("ZoneId")%>"><font face=verdana size=2 color="<%=NewLinkColor%>">Update</font></a>
  137.                     </td>
  138.                     <td align=center>
  139.                         <input type=checkbox name="delete<%=rs("ZoneId")%>">
  140.                     </td>
  141.                 </tr>
  142. <%                
  143.                 rs.MoveNext 
  144.             wend
  145.             rs.Close  
  146.             set rs = nothing
  147. %>
  148.                 <tr bgcolor="<%=TblHeadBGColor%>">
  149.                     <th colspan=7>
  150.                         <input type=submit value=" Delete Selected Zones ">
  151.                     </th>
  152.                 </tr>
  153.                 </table>
  154.                 </td> </tr>
  155.                 </table>
  156.                 </form>
  157.             </td>
  158.             <td bgcolor="<%=RightColor%>">   </td>
  159.         </tr>
  160.         <tr>
  161.             <td colspan=2 bgcolor="<%=LeftColor%>">   </td>
  162.             <td colspan=2 bgcolor="<%=RightColor%>">   </td>
  163.         </tr>
  164.         </table>
  165.     </body>
  166. </html>
  167. <%            
  168.     else
  169.         ids = split(Request.Form("ids"), ", ")
  170.         for i = 0 to ubound(ids)
  171.             if Request.Form("delete" + ids(i))="on" then
  172.                 sql = "delete from ZoneMaster where ZoneId=" + ids(i)
  173.                 con.execute sql
  174.             end if
  175.         next
  176.         Response.Redirect Request.ServerVariables("script_name")
  177.     end if
  178. %>
  179. <!-- #include file="../AdsCloseConn.asp" -->