<%

Dim Page 
Page = "47"

Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Application("conn_string")

Dim State, Country


If Trim(Request("State")) <> "" Then
	State = Request("State")
Else
	State = "FL"
End If

If Trim(Request("Country")) <> "" Then
	Country = Request("Country")
Else
	Country="US"
End If


If (UCase(Request.ServerVariables("REQUEST_METHOD")) = "POST" And Request.Form("page") = Page) Then


	'@Package_ID int = Null,
	'@Package_Name varchar(150) = Null,
	'@Package_Type_ID int = Null,
	'- @Package_Headline nvarchar(250) = Null,
	'- @Package_Desc nvarchar(500) = Null,
	'- @Package_Desc_Detail nvarchar(800) = Null,
	'@Num_Adults tinyint = Null,
	'@Num_Children tinyint = Null,
	'@Lodging bit = Null,
	'@Food_Bev bit = Null,
	'@Transportation bit = Null,
	'- @Disabled bit = Null
	
	'If Not Request("Package_Name") = "" Then
	'	Dim SQLPack

	'	SQLPack = "[Avante].[dbo].[Update_Package] "
		'SQLPack = SQLPack & "@Package_ID='" & Request("Package_ID") & "', "
	'	SQLPack = SQLPack & "@Package_Name='" & Request("Package_Name") & "', "
	'	SQLPack = SQLPack & "@Package_Type_ID='" & Request("Package_Type_ID") & "', "
	'	SQLPack = SQLPack & "@Package_Duration_ID='" & Request("Package_Duration_ID") & "', "
		'SQLPack = SQLPack & "@Package_Headline='" & Request("Package_Headline") & "',"
		'SQLPack = SQLPack & "@Package_Desc='" & Request("Package_Desc") & "', "
		'SQLPack = SQLPack & "@Package_Desc_Detail='" & Request("Package_Desc_Detail") & "', "
	'	SQLPack = SQLPack & "@Num_Adults='" & Request("Num_Adults") & "', "
	'	SQLPack = SQLPack & "@Num_Children='" & Request("Num_Children") & "', "
	'	SQLPack = SQLPack & "@Lodging='" & Request("Lodging") & "', "
	'	SQLPack = SQLPack & "@Food_Bev='" & Request("Food_Bev") & "', "
	'	SQLPack = SQLPack & "@Transportation='" & Request("Transportation") & "' "
		'SQLPack = SQLPack & "@Disabled='" & Request("Disabled") & "'"
		
		'Response.Write SQLPack
		'Response.End
	'	Set RSPack = Conn.Execute(SQLPack)
	'	Package_ID = RSPack("Package_ID")
	
	'End If

    'If Request.Form("cont") = "1" Then Response.Redirect "default.asp"
	'If Request.Form("cont") = "2" Then Response.Redirect "package-create-2.asp?City=" & Request("City") & "Package_ID=" & Package_ID

End If

Function PCase(strInput)
    Dim iPosition 
    Dim iSpace 
    Dim strOutput 

    iPosition = 1

    Do While InStr(iPosition, strInput, " ", 1) <> 0
            iSpace = InStr(iPosition, strInput, " ", 1)
            strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
            strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition))
            iPosition = iSpace + 1
    Loop

    strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
    strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))

    PCase = strOutput
End Function

%>
<html>
<STYLE>
BODY {SCROLLBAR-FACE-COLOR: #5e5ebe; SCROLLBAR-HIGHLIGHT-COLOR: #5e5ebe; SCROLLBAR-SHADOW-COLOR: #5e5ebe; SCROLLBAR-3DLIGHT-COLOR: #5e5ebe; SCROLLBAR-ARROW-COLOR:  #6666CC; SCROLLBAR-TRACK-COLOR: #E3E3E3; SCROLLBAR-DARKSHADOW-COLOR: #666666; }
</STYLE>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function State_onchange()
{
  form1.action = "package-create-1.asp"
  form1.cont.value='3'
  form1.submit();
}

function Country_onchange()
{
  form1.action = "package-create-1.asp"
  form1.cont.value='4'
  form1.submit();
}

function Sub_Form (cont)
{

var errMsg='';

if (document.form1.City.value=='') {errMsg+='Please Specify a City\n';}
if (document.form1.State.value=='') {errMsg+='Please Specify a State\n';}
if (document.form1.Country.value=='') {errMsg+='Please Specify a Country\n';}
if (document.form1.Package_Name.value=='') {errMsg+='Please Specify a Package Name\n';}
if (document.form1.Package_Type_ID.value=='') {errMsg+='Please Specify a Package Type\n';}
if (document.form1.Package_Duration_ID.value=='') {errMsg+='Please Specify a Package Duration\n';}
if (document.form1.Num_Adults.value=='') {errMsg+='Please Specify a Number of Adults\n';}
if (document.form1.Num_Children.value=='') {errMsg+='Please Specify a Number of Children\n';}
if (document.form1.Lodging.value=='' && document.form1.Tickets.value=='' && document.form1.Food_Bev.value=='' && document.form1.Transport.value=='') {errMsg+='Please sekect an item to work with.\n';}

if (errMsg) alert(errMsg);
else {
  form1.action = "package-create-2.asp"
  form1.cont.value=cont
  form1.submit();
}
}
//-->
</script>
<link rel="stylesheet" href="/Style-sheets/headline.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/icon-return-to-main-2.gif','images/icon-submit-changes-2.gif','images/icon-continue-wizard-2.gif')">
<form name="form1" method="post" action="">
<INPUT type="hidden" id=page name=page value="<%=Page%>">
<INPUT type="hidden" id=cont name=cont value="">
<table width="525" border="0" cellspacing="0" cellpadding="2" align="center">
  <tr bgcolor="#FFFFFF"> 
    <td width="467">&nbsp;</td>
    <td align="right" width="58">&nbsp;</td>
  </tr>
  <tr bgcolor="#5e5ebe">
    <td width="467" align="center" class="headline-ffffff">Define Package Display</td>
    <td bgcolor="#5e5ebe" align="right" width="58"><a href="javascript:;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/icon-return-to-main-2.gif',1)" onClick="MM_goToURL('content','default-attractions.asp');return document.MM_returnValue"><img src="images/icon-return-to-main.gif" width="75" height="17" usemap="#returntomain" border="0" name="Image1"></a></td>
  </tr>
  <tr> 
    <td width="467">&nbsp;</td>
    <td width="58">&nbsp;</td>
  </tr>
</table>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr><td colspan="3" align="center"><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="10%">&nbsp;</td>		
      <td width="40%" class="manage-menu-bold" height="25">Choose your Country:</td>
      <td >&nbsp;</td>		
      <td class="manage-menu-bold"><select name="Country" onchange="return Country_onchange()" id="Country" Language="JAVASCRIPT">
<%
	Dim RSCountry
   Set RSCountry = Conn.Execute("Select * from Countries;")

   If Not RSCountry.EOF Then
	Do Until RSCountry.EOF
       Response.Write "<option value=""" & RSCountry("Country_Abbr") & """"
       If RSCountry("Country_Abbr") = Country Then Response.Write " selected"
       Response.Write ">" & RSCountry("Country_Name") & "</option>" & Chr(13)
       RSCountry.MoveNext
    Loop
   End If 
%>        
		</select></td>
    </tr>

    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>

    <tr> 
      <td width="10%">&nbsp;</td>		
      <td width="40%" class="manage-menu-bold" height="25">Choose your State:</td>
      <td width="10%" height="25">&nbsp;</td>
      <td width="40%" height="25" class="manage-menu-bold">Choose your City:</td>
    </tr>
    <tr>
      <td>&nbsp;</td>		    
      <td class="manage-menu-bold"><select name="State" onchange="return State_onchange()" id="State" Language="JAVASCRIPT">
<%
	Dim RSState
   Set RSState = Conn.Execute("Select * from States S Inner Join Countries C On S.Country_ID = C.Country_ID Where C.Country_Abbr='" & Country & "';")

   If Not RSState.EOF Then
	Do Until RSState.EOF
       Response.Write "<option value=""" & RSState("State_Abbr") & """"
       If RSState("State_Abbr") = State Then Response.Write " selected"
       Response.Write ">" & RSState("State_Name") & "</option>" & Chr(13)
       RSState.MoveNext
    Loop
   End If 
%>        
		</select></td>
      <td>&nbsp;</td>		
      <td><select name="City">
<%
	Dim RSCities
   Set RSCities = Conn.Execute("Get_Cities @State_Abbr='" & State & "', @Country_Abbr = '" & Country & "', @Realm_ID = '" & Session("Admin_Realm") & "', @Parent_Lookup='1'")

   If Not RSCities.EOF Then
	Do Until RSCities.EOF
       Response.Write "<option value=""" & RSCities("City") & """>" & RSCities("City") & "</option>" & Chr(13)
       RSCities.MoveNext
    Loop
   End If       
%>        
      </select></td>

    </tr></table></td></tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177" class="manage-menu-bold" height="25">Package Name:</td>
      <td width="302" height="25"> 
        <input type="text" name="Package_Name" class="input-box" size="30">
      </td>
      <td width="21" height="25">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177" class="manage-menu-bold">Package Type:</td>
      <td width="302"> 
        <select name="Package_Type_ID" class="input-box">
		  <option value="" selected>Package Type</option>
		  <% 	Add_to_it = ""
			Set RSType = Conn.Execute("Select * from Package_Type")
			 Do While Not RSType.EOF
			    Response.Write "<option value=""" & RSType("Package_Type_ID") & """>" & RSType("Type_Name") & "</option>" & chr(13)
			    Add_to_it = Add_to_it & "<input type=""hidden"" name=""ptypename" & RSType("Package_Type_ID") & """ value=""" & RSType("Type_Name") & """>"
			    RSType.MoveNext
			 Loop
			Set RSType = Nothing
		  %>
        </select>
      </td>
      <td width="21"><%= Add_to_it %>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177" class="manage-menu-bold">Package Duration:</td>
      <td width="302"> 
        <select name="Package_Duration_ID" class="input-box">
          <option selected>Select</option>
		  <% 	Add_to_it = ""
			Set RSDuration = Conn.Execute("Select * from Package_Duration Order by Num_Nights")
			 Do While Not RSDuration.EOF
			    Response.Write "<option value=""" & RSDuration("Package_Duration_ID") & """>" & RSDuration("Duration_Name") & "</option>" & chr(13)
			    Add_to_it = Add_to_it & "<input type=""hidden"" name=""pdurname" & RSDuration("Package_Duration_ID") & """ value=""" & RSDuration("Duration_Name") & """>"
			    RSDuration.MoveNext
			 Loop
			Set RSDuration = Nothing
		  %>
        </select>
      </td>
      <td width="21"><%= Add_to_it %> &nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177" class="manage-menu-bold">Number of Adults:</td>
      <td width="302">
        <select name="Num_Adults" class="input-box">
          <option value="" selected>Select</option>
          <option value="0">No Adults</option>
          <option value="1">1 Adult</option>
          <option value="2">2 Adults</option>
          <option value="3">3 Adults</option>
          <option value="4">4 Adults</option>
          <option value="5">5 Adults</option>
          <option value="6">6 Adults</option>
        </select>
      </td>
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td width="177" class="manage-menu-bold">Number of Children:</td>
      <td width="302">
        <select name="Num_Children" class="input-box">
          <option value="" selected>Select</option>
          <option value="0">No Children</option>
          <option value="1">1 Child</option>
          <option value="2">2 Children</option>
          <option value="3">3 Children</option>
          <option value="4">4 Children</option>
          <option value="5">5 Children</option>
          <option value="6">6 Children</option>
        </select>
      </td>
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td width="177" class="manage-menu-bold">Number of Rooms:</td>
      <td width="302">
        <select name="Num_Rooms" class="input-box">
          <option value="1">1 Room</option>
          <option value="2">2 Rooms</option>
          <option value="3">3 Rooms</option>
          <option value="4">4 Rooms</option>
          <option value="5">5 Rooms</option>
          <option value="6">6 Rooms</option>
        </select>
      </td>
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177" class="manage-menu-bold">Package Includes:</td>
      <td width="302" class="manage-menu"> 
        <input type="checkbox" name="Lodging" value="1" checked>
        Lodging 
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177">&nbsp;</td>
      <td width="302" class="manage-menu"> 
        <input type="checkbox" name="Tickets" value="1">
        Attraction/Excursion Tickets</td>
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177">&nbsp;</td>
      <td width="302" class="manage-menu"> 
        <input type="checkbox" name="Merchandise" value="1">
        Merchandise</td>
      <td width="21">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177">&nbsp;</td>
      <td width="302" class="manage-menu"> 
        <input type="checkbox" name="Food_Bev" value="1">
        Food &amp; Beverage</td>
      <td width="21">&nbsp;</td>
    </tr>
<!--    <tr> 
      <td width="177">&nbsp;</td>
      <td width="302" class="manage-menu"> 
        <input type="hidden" name="Transport" value="1">
        Transportation </td>
      <td width="21">&nbsp;</td>
    </tr>
-->
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td width="177">&nbsp;</td>
      <td width="302" class="manage-menu"> 
        <input type="checkbox" name="Time_Share" value="1" onClick="alert('Are you sure?');">
        Time Share Package <b>only</b>?</td>
      <td width="21">&nbsp;</td>
    </tr>    
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="4">&nbsp;</td>
    </tr>
  </table>
<table width="525" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr bgcolor="#5e5ebe">
    <td align="right" width="49%" height="18"><a href="javascript:Sub_Form('1');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('submitchanges','','images/icon-submit-changes-2.gif',1)"><img src="images/icon-submit-changes.gif" width="200" height="15" name="submitchanges" border="0"></a></td>
    <td width="51%" height="18"><a href="javascript:Sub_Form('2');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','images/icon-continue-wizard-2.gif',1)" target="content"><img src="images/icon-continue-wizard.gif" width="150" height="15" usemap="#continue" border="0" name="Image2"></a></td>
  </tr>
  <tr> 
    <td width="49%">&nbsp;</td>
    <td width="51%">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
