<%@ Page Language="vb" %>
<%@ Import Namespace="TourEx.BLL" %>
<%@ Import Namespace="System.data" %>
<%@ Import Namespace="System.data.SqlClient" %>
<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Response.ClearContent()
        Response.ContentType = "text/xml"
        Dim SID As String = FilterStr(Request.QueryString("SID"))
        SID = Regex.Replace(SID, "([^\d,])", "", RegexOptions.IgnoreCase)
        While InStr(SID, ",,") > 0
            SID = Replace(SID, ",,", ",")
        End While
        If SID.StartsWith(",") Then
            SID = Mid(SID, 2)
        End If
        If SID.EndsWith(",") Then
            SID = Left(SID, Len(SID) - 1)
        End If
        If SID = "" Then
            Exit Sub
        End If
        Dim Dr As SqlDataReader = Procedure.DataList("Select T_ID,t_sceneryid,T_Name,T_Price,T_RackRate,T_Bonus,T_DiscountPrice From [" & TablePrefix & "Tickets] Where T_SceneryID In (" & SID & ") Order By T_OrderID")
        Response.Write("<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?><ticketss>")
        With Response
            While Dr.Read
                Response.Write("<tickets ")
                .Write(" t_sceneryid=""" & Dr("t_sceneryid"))
                .Write(""" t_id=""")
                .Write(Dr("t_id"))
                .Write(""" t_name=""")
                .Write(Dr("T_Name"))
                .Write(""" t_price=""")
                .Write(Dr("T_Price"))
                .Write(""" t_rackrate=""")
                .Write(Dr("T_RackRate"))
                .Write(""" t_bonus=""")
                .Write(Dr("T_Bonus"))
                .Write(""" t_discountprice=""")
                .Write(Dr("T_DiscountPrice"))
                .Write(""" />")
            End While
        End With
        Dr.Close()
        Response.Write("</ticketss>")
    End Sub
</script>