home *** CD-ROM | disk | FTP | other *** search
/ 202.53.64.216 / 202.53.64.216.tar / 202.53.64.216 / janahitha / Admin / AdsAdminUpdateZone.asp < prev    next >
Text File  |  2004-11-26  |  5KB  |  133 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.         zoneid = Request.querystring("zoneid")
  9.         msg = ""
  10.         set rs = server.CreateObject("adodb.recordset")
  11.         sql = "select ZoneName, ZoneDescription,Zoneimage, ZoneStatus from ZoneMaster where ZoneId=" + zoneid
  12.         rs.open sql, con, 3, 3
  13.         zonename = rs("ZoneName")
  14.         zonedescription = rs("ZoneDescription")
  15.         zonestatus = rs("ZoneStatus")
  16.         Zoneimage=rs("Zoneimage")
  17.         rs.close
  18. %>
  19. <html>
  20.     <head>
  21.         <title> <%=SiteName%> - Welcome </title>
  22.         <meta name="author" content="Jagadish">
  23.         <script language="javascript" src="../func.js"></script>
  24.         <script language="javascript">
  25.             function check()
  26.             {
  27.                 validateform = document.updatezoneform;
  28.                 if(isempty(validateform.zonename))
  29.                     validateform.zonename.focus();
  30.                 else
  31.                 if(isempty(validateform.zonedescription))
  32.                     validateform.zonedescription.focus();
  33.                 else
  34.                     validateform.submit();
  35.             }
  36.         </script>
  37.     </head>
  38.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  39.         <table cellpadding=0 cellspacing=0 border=0 width=780 height=450>
  40.         <tr height=1>
  41.             <td width="100" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  42.             <td width="290" bgcolor="<%=LeftColor%>"><font face=verdana size=1> </font></td>
  43.             <td width="290" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  44.             <td width="100" bgcolor="<%=RightColor%>"><font face=verdana size=1> </font></td>
  45.         </tr>
  46.         <tr>
  47.             <td bgcolor="<%=LeftColor%>" colspan=2 valign=top > <font face="courier new" size=6 color="<%=SiteNameColor%>"> <b>   <%=SiteName%> </b> </font> </td>
  48.             <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>
  49.         </tr>
  50.         <tr>
  51.             <td bgcolor="<%=LeftColor%>">   </td>
  52.             <td colspan=2 align=center height=100 bgcolor="<%=OuterTblBGColor%>">
  53.                 <br>
  54.                 <form name="updatezoneform" method=post action="<%=Request.ServerVariables("script_name")%>">
  55.                 <table cellpadding=0 cellspacing=0 border=0>
  56.                 <tr> <td bgcolor="<%=TblBorderColor%>">
  57.                 <table cellspacing=1 cellpadding=3 border=0 width=350>
  58.                 <tr bgcolor="<%=TblHeadBGColor%>">
  59.                     <th colspan=2> 
  60.                         <font face=verdana color="<%=TblHeadFGColor%>"> Update A Zone </font>
  61.                     </td>
  62.                 </tr>
  63.                 <tr bgcolor="<%=TblBGColor%>">
  64.                     <td width="50%"> 
  65.                         <font face="verdana" size=2 color="<%=TblFGColor%>"> Zone Name </font> 
  66.                     </td>
  67.                     <td width="50%"> 
  68.                         <input type=text name="zonename" maxlength="50" value="<%=zonename%>">
  69.                     </td>
  70.                 </tr>
  71.                 <tr bgcolor="<%=TblBGColor%>">
  72.                     <td> 
  73.                         <font face="verdana" size=2 color="<%=TblFGColor%>"> Description </font> 
  74.                     </td>
  75.                     <td> 
  76.                         <input type=text name="zonedescription" maxlength="250" value="<%=zonedescription%>">
  77.                     </td>
  78.                 </tr>
  79.                 <tr bgcolor="<%=TblBGColor%>">
  80.                     <td> 
  81.                         <font face="verdana" size=2 color="<%=TblFGColor%>"> Active Or Not? </font> 
  82.                     </td>
  83.                     <td>
  84.                         <font face=verdana size=2 color="<%=RadioColor%>">
  85.                         <input type=radio name="zonestatus" value="1" <%if zonestatus then%>checked<%end if%>> Yes
  86.                         <input type=radio name="zonestatus" value="0" <%if not zonestatus then%>checked<%end if%>> No
  87.                         </font>
  88.                     </td>
  89.                 </tr>
  90.                 </table>
  91.                 </td> </tr>
  92.                 </table>
  93.                 <br>
  94.                 <input type=hidden name="zoneid" value="<%=zoneid%>">
  95.                 <input type=button value="Update The Zone" onclick="javascript:check();" id=button1 name=button1>
  96.                 </form><br>
  97.                 
  98.                 
  99.                 <image src="../mapimages/<%=Zoneimage%>" width=200 height=200>
  100.                 <font face=verdana size=2 color="<%=ContentColor%>"> Do you want to update the image </br>
  101.                 <form enctype="multipart/form-data" name="form" method=post action="AdsAdminUpdateZoneImage.asp">
  102.                         Select The Image</font> <input type=file name=YourFile>
  103.                         <input type=hidden name=hid value=<%=zoneid%>><br>
  104.                         <input type=submit value="Upload" id=submit1 name=submit1>
  105.                         
  106.                         </form>
  107.                         </td>
  108.                 
  109.             <td bgcolor="<%=RightColor%>">  </td>
  110.             
  111.         </tr>
  112.         
  113.         <tr>
  114.             <td colspan=2 bgcolor="<%=LeftColor%>">   </td>
  115.             <td colspan=2 bgcolor="<%=RightColor%>">   </td>
  116.         </tr>
  117.         
  118.             </table>
  119.     </body>
  120. </html>
  121. <%
  122.         set rs = nothing
  123.     else
  124.         zoneid = Request.Form("zoneid")
  125.         zonename = replace(trim(Request.Form("zonename")), "'", "''")
  126.         zonedescription = replace(trim(Request.Form("zonedescription")), "'", "''")
  127.         zonestatus = Request.Form("zonestatus")
  128.         sql = "update ZoneMaster set ZoneName='" + zonename + "', ZoneDescription='" + zonedescription + "', ZoneStatus=" + zonestatus + " where ZoneId=" + zoneid
  129.         con.execute sql
  130.         Response.Redirect "AdsAdminViewZones.asp"
  131.     end if
  132. %>
  133. <!-- #include file="../AdsCloseConn.asp" -->