SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    please help me in my last step in my website...

    Hi there,

    I have built a web site with asp and I used MS access data base..
    I have one problem that I did not know how to do it to finish my website..
    so my code is as:

    <!-- #include file="LALib.asp" -->
    <%


    Dim iBidNeeded

    sCMD = "" & Ucase(RequestValue("CMD"))
    sUserName = "" & RequestValue("UserName")
    sPassword = "" & RequestValue("Password")
    iBidPlaced = FVal(RequestValue("Bid"))
    lItemID = FVal(RequestValue("ItemID"))
    'lAucID = FVal(RequestValue("AucID"))

    DoPageHeader
    OpenDBConn


    gsSQL = "SELECT aucEnded,aucEmailsSent,aucItemOwner,aucItemTitle,a ucCategoryID,aucImageURL," & _
    "aucAvailDate,aucCloseDate,aucStartingBid,aucMinimu mIncrement,aucCurrentBid,aucCurrentBidder,aucDescr iption," & _
    "regUserName, regEmail, regCity, regState, regCountry " & _
    "FROM tblLAwaittoconfirm LEFT JOIN tblLARegistration on tblLAwaittoconfirm.aucItemOwner = tblLARegistration.regID " & _
    "WHERE aucID = " & SQLVal(lItemID)
    Set rs = gobjConnect.Execute(gsSQL)

    If not rs.EOF then
    ShowDetail
    Select Case sCmd
    Case "DELETE"
    'ShowDetail
    DeleteItem
    'Case "ADD"
    'AddItem
    'Case Else
    ' ShowDetail
    End Select
    'ShowDetail
    Else
    TableHead(GLS_ItemDetail)
    Response.Write "<P align=""CENTER"">" & gsErrorTextOpen & GLS_InvalidItem & gsErrorTextClose & "</P>"
    End If

    Select Case sCmd
    Case "DELETE"
    DeleteItem
    'Case "ADD"
    'AddItem
    'Case Else
    End Select



    rs.Close
    set rs = nothing
    'TableFoot
    DoPageFooter
    CloseDBConn

    Sub AddItem
    'Sub InsertAd

    Set rsAuc = Server.CreateObject("ADODB.RecordSet")
    rsAuc.Open "tblLAAuctions", gobjConnect, 1, 3, &H0002 'adOpenKeyset, adLockOptimistic, adCmdTable
    rsAuc.AddNew


    rsAuc("aucItemOwner") = rs.Fields("aucItemOwner")
    rsAuc("aucItemTitle") = rs.Fields("aucItemTitle")
    rsAuc("aucCategoryID") = rs.Fields("aucCategoryID")
    rsAuc("aucImageURL") = rs.Fields("aucImageURL")
    rsAuc("aucEnded") = "N"
    rsAuc("aucEmailsSent") = "N"
    rsAuc("aucAvailDate") = rs.Fields("aucAvailDate")
    rsAuc("aucCloseDate") = rs.Fields("aucCloseDate")
    rsAuc("aucStartingBid") = rs.Fields("aucStartingBid")
    rsAuc("aucMinimumIncrement") = rs.Fields("aucMinimumIncrement")
    rsAuc("aucCurrentBid") = rs.Fields("aucCurrentBid")
    rsAuc("aucCurrentBidder") = rs.Fields("aucCurrentBidder")
    rsAuc("aucDescription") = rs.Fields("aucDescription")
    rsAuc.Update

    lAucID = rsAuc("aucID")
    rsAuc.Close
    set rsAuc = Nothing

    'Response.Write "<BR>" & gsAuctionTextOpen & GLS_SuccessfulPost & "<BR>"
    Response.Write "<BR>" & "Item is approved and submitted" & "<BR>"

    DeleteItem

    'Response.Write GLS_PostView & "<A HREF=""LAViewItem.asp?ItemID=" & lAucID & """>" & gsAucURL & "LAViewItem.asp?ItemID=" & lAucID & "</A>" & gsAuctionTextClose &"<BR><BR>"

    End Sub

    Sub DeleteItem
    sSQL = "DELETE from tblLAwaittoconfirm WHERE aucID=" & SQLVal(lItemID)
    gobjConnect.Execute sSQL
    Response.Write gsAuctionTextOpen & GLS_AdmDADeleteSuccess & gsAuctionTextClose
    End Sub

    Sub ShowDetail
    Response.Write "<FORM METHOD=""POST"" ACTION=""LAAdmViewItem.asp"">"

    Response.Write "<INPUT TYPE=""HIDDEN"" NAME=""CMD"" VALUE=""DELETE"">"

    Response.Write "<INPUT TYPE=""HIDDEN"" NAME=""CMD"" VALUE=""DELETE"">"





    Response.Write gsAuctionTitleOpen & rs.Fields("aucItemTitle") & "<BR>" & gsAuctionTextOpen & GLS_AuctionID & "&nbsp;" & lItemID & gsAuctionTextClose & gsAuctionTitleClose
    TableHead(GLS_ItemDetail)
    If rs.Fields("aucCloseDate") < NOW Then
    Response.Write gsLabelOpen & "<FONT COLOR=""RED"">" & GLS_BiddingClosed & "</CENTER>" & gsLabelClose & "<BR>"
    bEmailsSent = EvalBool(rs.Fields("aucEmailsSent"))
    Call CloseAuction(lItemID, bEmailsSent)
    End If

    Response.Write "<TABLE BORDER=""0"" WIDTH=""100%"" CELLSPACING=""0"" CELLPADDING=""3"">"

    'Headings
    Response.Write "<TR><TD>" & gsLabelOpen & GLS_StartBidDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen & FCurrency(rs.Fields("aucStartingBid")) & gsAuctionTextClose & "</TD>"
    Response.Write "<TD>&nbsp;</TD></TR>"
    Response.Write "<TR><TD>" & gsLabelOpen & GLS_StartDateDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen & DispShortDateTime(rs.Fields("aucAvailDate")) & gsAuctionTextClose & "</TD></TR>"

    Response.Write "<TR><TD>" & gsLabelOpen & GLS_CurrentBidDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen
    If FVal(rs.Fields("aucCurrentBid")) > 0 then
    Response.Write FCurrency(rs.Fields("aucCurrentBid"))
    Else
    Response.Write GLS_NA
    End If
    Response.Write gsAuctionTextClose & "</TD>"
    Response.Write "<TD>&nbsp;</TD></TR>"

    Response.Write "<TR><TD>" & gsLabelOpen & GLS_LocationDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen & rs.Fields("regCity") & ", " & rs.Fields("regState") & " " & rs.Fields("regCountry") & gsAuctionTextClose & "</TD></TR>"

    Response.Write "<TR><TD>" & gsLabelOpen & GLS_ClosesDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen & DispShortDateTime(rs.Fields("aucCloseDate")) & gsAuctionTextClose & gsAuctionTextCloses & "</TD>"

    Response.Write "<TD>&nbsp;</TD></TR>"

    Response.Write "<TR><TD>" & gsLabelOpen & GLS_OwnerDet & gsLabelClose & "</TD>"
    Response.Write "<TD>" & gsAuctionTextOpen & "<A HREF = ""mailto:" & rs.fields("regEmail") & chr(34) & ">" & rs.Fields("regUserName") & "</A>"
    Response.Write gsAuctionTextClose & "</TD>"
    Response.Write "</TR>"

    'Response.Write "<TR BGCOLOR=""" & gsLineColor & """><TD COLSPAN=""5""></TD></TR>"

    'Description
    Response.Write "<TR><TD>" & gsSubHeadOpen & GLS_DescriptionDet & gsSubHeadClose & "<BR>"
    Response.Write gsAuctionTextOpen & rs.Fields("aucDescription") & gsAuctionTextClose & "</TD></TR>"

    'Check for image
    If LEN(TRIM(rs.Fields("aucImageURL"))) <> 0 Then
    Response.Write "<TR><TD colspan=""5""><CENTER><IMG BORDER=""0"" SRC=""" & rs.Fields("aucImageURL") & """></CENTER></TD></TR>"
    End If

    'Response.Write "</TABLE>"
    Response.Write "</TD></TR>"

    Response.Write "</TABLE>"

    '
    Response.Write "<INPUT TYPE=""HIDDEN"" NAME=""CMD"" VALUE=""ADD"">" 'Response.Write "<INPUT TYPE=""SUBMIT"" VALUE=""ADD"">" Response.Write "<INPUT TYPE=""SUBMIT"" VALUE=""DELETE"">"

    Response.Write "<INPUT TYPE=""HIDDEN"" NAME=""CMD"" VALUE=""ADD"">" 'Response.Write "<INPUT TYPE=""SUBMIT"" VALUE=""ADD"">" Response.Write "<INPUT TYPE=""SUBMIT"" VALUE=""DELETE"">"






    Response. Write "</FORM>"

    End Sub


    %>

    I have highlighted the thing that I want..
    I want to add two buttuns one for add and one for delete.. but I have tried to change their posions in this code, but nothing success with me..
    so, can you help me in making pressing the add button call the ADDITEM and pressing the delete button call the DELETEITEM..

    Waiting for your help..

    Thanks so much..

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •