home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / asp / POSTCARD.ZIP / admin / postcard.asp < prev    next >
Encoding:
Text File  |  2000-02-16  |  6.7 KB  |  185 lines

  1. <!--#include file="includelogin.asp"-->
  2. <!--#include file="menu.inc"-->
  3. <!--#include file="../inccard.asp"-->
  4. <%
  5.     Dim oConn
  6.     Set oConn = Postcard_GetDatabaseConn()
  7.     Dim oRS
  8.     
  9.     
  10.     If Request.QueryString("save")="yes" Then
  11.         Set oRS = Server.CreateObject("ADODB.Recordset")
  12.         
  13.         Dim sID
  14.         sID = Request.QueryString("fldAuto")
  15.         If sID = "" Then
  16.             sID = 0
  17.         Else
  18.             sID = CInt( sID)
  19.         End If
  20.         oRS.Open "select * from card where fldAuto = " & sID, oConn, 1, 3
  21.         Select Case Request.QueryString("action")
  22.             Case "new"
  23.                 oRS.AddNew
  24.                 oRS("gifurl").Value = Request.Form("gifurl")
  25.                 oRS("gifurlsmall").Value = Request.Form("gifurlsmall")
  26.                 oRS("catid").Value = Request.Form("catid")
  27.                 oRS("sendcount").Value = Request.Form("sendcount")
  28.             Case "edit"
  29.                 oRS("gifurl").Value = Request.Form("gifurl")
  30.                 oRS("gifurlsmall").Value = Request.Form("gifurlsmall")
  31.                 oRS("catid").Value = Request.Form("catid")
  32. oRS("sendcount").Value = Request.Form("sendcount")
  33.  
  34.             Case "del"
  35.                 oRS.Delete
  36.         End Select
  37.         oRS.Update
  38.         oRS.Close
  39. Set oRS = Nothing
  40. oConn.Close
  41. Set oConn = Nothing
  42.         Response.Redirect "postcards.asp"
  43.     End If
  44. %>
  45.  
  46. <html>
  47.  
  48. <head>
  49. <%
  50. '''''''''''  (C) Stefan Holmberg 1999  
  51. '''''''''''  Free to use if these sourcecode lines is not deleted 
  52. '''''''''''  Contact me at webmaster@sqlexperts.com
  53. '''''''''''  http://www.sqlexperts.com
  54. '''''''''''  AdMentor homepage at http://www.create-a-webshop.com
  55. Dim sGifUrl, sGifUrlSmall, nSelectedCat, nSendCount
  56.  
  57. If Request.QueryString("action") = "edit" Then
  58.     Dim oRS2
  59.     Set oRS2 = oConn.Execute( "select * from card where fldAuto = " & Request.QueryString("fldAuto") )
  60.     sGifUrl = oRS2("gifurl").Value
  61.     sGifUrlSmall = oRS2("gifurlsmall").Value
  62.     nSelectedCat = oRS2("catid").Value
  63. nSendCount = oRS2("sendcount").Value
  64.     oRS2.Close
  65. Else
  66.     nSelectedCat = -1
  67.     nSelectedCat = Request.QueryString("cat_fldAuto")
  68.     If nSelectedCat = "" Then
  69.         nSelectedCat = Request.Form("cat_fldAuto")
  70.     End If
  71.  nSendCount = 0
  72. End If
  73.     
  74. %>
  75.  
  76.  
  77. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  78. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  79. <meta name="ProgId" content="FrontPage.Editor.Document">
  80. <title>PostcardMentor - Admin interface</title>
  81. <style type="text/css">
  82. <!--
  83.      body {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
  84.      td {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
  85.      th {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
  86.      A:link {text-decoration: none;}
  87.      A:visited {text-decoration: none;}
  88.      A:hover {text-decoration: underline;}
  89. -->
  90. </style>
  91. </head>
  92.  
  93. <body>
  94.  
  95. <table align="center" bgColor="#003399" border="0" cellPadding="3" cellSpacing="0" height="100%" width="100%">
  96.   <tbody>
  97.     <tr>
  98.       <td vAlign="top" width="50%" height="60">
  99.       <b><a href="http://www.aspcode.net"><font color="#ECECD9" face="verdana,arial,helvetica" size="1">http://www.aspcode.net</font></a></b>
  100.       </td>
  101.       <td vAlign="top" width="468" height="60">
  102.       <b><font color="#FFFFFF" face="verdana,arial,helvetica" size="+2">Admin
  103.       interface</font></b>
  104.       <table border="0" width="100%">
  105.         <tr>
  106.                             <td width="50%">
  107.                             </td>
  108.         </tr>
  109.       </table>
  110.       </td>
  111.     </tr>
  112.     <tr>
  113.       <td height="100%" vAlign="top" width="100%" colspan="2">
  114.         <table align="center" bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
  115.           <tbody>
  116.             <tr>
  117.               <td height="100%" vAlign="top" width="85%">
  118.                 <table bgColor="#ffffff" border="0" cellPadding="10" cellSpacing="0" height="100%" width="100%">
  119.                   <tbody>
  120.                     <tr>
  121.                       <td align="left" height="100%" vAlign="top" width="65%">
  122.                         <table border="0" width="100%">
  123.                           <tr>
  124.                             <td width="50%"><b><font color="#aa3333" face="verdana,arial,helvetica" size="4">PostcardMentor <%=Session("fullname")%></font></b>
  125.                              
  126.                             </td>
  127.                             <td width="50%">
  128.                             <b>Categories</b>
  129.                             </td>
  130.                           </tr>
  131.                         </table>
  132.                         <font color="#aa3333" face="verdana,arial,helvetica" size="+2">
  133.                         <hr color="#000066" noShade SIZE="1">
  134.                              
  135.                         </font>
  136.                              
  137.                         <table border="0" width="100%">
  138.                           <tr>
  139.                             <td width="120" valign="top">
  140.                               <%AdAdminWriteMenu%></td>
  141.                             <td width="70%">
  142.                              
  143.                         <p align="left"><br>
  144.                         <%
  145.                         Dim sURL
  146.                         sURL = "postcard.asp?save=yes&action=" & Request.QueryString("action")
  147.                         If Request.QueryString("action") <> "new" Then
  148.                             sURL = sURL & "&fldAuto=" & Request.QueryString("fldAuto") 
  149.                         End If
  150.                         %>
  151.                         <form method="POST" action="<%=sURL%>">
  152.                           <p align="left">Gifurl: <input type="text" name="gifurl" size="40" value="<%=sGifUrl%>"></p>
  153.                           <p align="left">Thumbnail url: <input type="text" name="gifurlsmall" size="40" value="<%=sGifUrlSmall%>"><br>
  154. </p>
  155.                           <p align="left">Sendcount:<input type="text" name="sendcount" size="40" value="<%=nSendCount%>"></p>
  156.                           <p align="left">Category: <select size="1" name="catid">
  157.                           <%ListAllCategoriesInList nSelectedCat%>
  158.                           </select></p>
  159.                           <p align="left"><input type="submit" value="Submit" name="B1"></p>
  160.                         </form>
  161.                              
  162.                         <p> 
  163.                              
  164.                         <p><font face="helvetica, arial" size="2">PostcardMentor is
  165.                         developed by <a href="mailto:webmaster@sqlexperts.com">Stefan
  166.                         Holmberg</a>. Usage of it is totally free.</font></td>
  167.                           </tr>
  168.                         </table>
  169.                       </td>
  170.                     </tr>
  171.                   </tbody>
  172.                 </table>
  173.               </td>
  174.             </tr>
  175.           </tbody>
  176.         </table>
  177.       </td>
  178.     </tr>
  179.   </tbody>
  180. </table>
  181.  
  182. </body>
  183.  
  184. </html>
  185.