403Webshell
Server IP : 51.89.169.208  /  Your IP : 3.135.190.163
Web Server : Apache
System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64
User : yellowleaf ( 1019)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/yellowleaf/public_html/members/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yellowleaf/public_html/members/postbusiness1.html
<?php
$path  = $_SERVER['DOCUMENT_ROOT'];
include_once $path . '/connect_db.php';
include 'accesscontrol.php';
// css for menu
$styleSubmit = 'color:#ff6131;background-color:#fff;border-top:1px solid #c9c9c9;font-weight:bold;';
if (isset($_POST['submit'])) {
	$vaild = true;
	$companyname = addslashes($_POST['companyname']);
	$address1 = addslashes($_POST['address1']);
	$address2 = addslashes($_POST['address2']);
	$countys = addslashes($_POST['county']);
	$countyDetails = explode("||", $countys);
	$county = $countyDetails[0];
	$county_name = $countyDetails[2];
	$town = addslashes($_POST['town']);
	$townDetails = explode("|", $town);
	$longitude = $townDetails[0];
	$latitude = $townDetails[1];
	$town_name = $townDetails[2];

	$postcode = addslashes($_POST['postcode']);
	$telephone = str_replace(' ', '', $_POST['telephone']);
	$btype = addslashes($_POST['btype']);
	$bcategory = addslashes($_POST['mcategory']);
	$fax = addslashes($_POST['fax']);
	$email = addslashes($_POST['email']);
	$url = str_replace("http://", "", addslashes($_POST['url']));
	$time = time();
	// if website url is "http://" only make field blank
	if ($url == "http://") {
		$url = str_replace("http://", "", $url);
	}

	if (!$companyname) {
		$vaild = false;
		$errorcompanyname = 'error-message';
	}
	if (!$address1) {
		$vaild = false;
		$erroraddress1 = 'error-message';
	}
	if (!$countys) {
		$vaild = false;
		$errorcounty = 'error-message';
	}
	if (!$town) {
		$vaild = false;
		$errortown = 'error-message';
	}
	if (!$postcode) {
		$vaild = false;
		$errorpostcode = 'error-message';
	}
	if (!$telephone) {
		$vaild = false;
		$errortelephone = 'error-message';
	}
	if (!$email) {
		$vaild = false;
		$erroremail = 'error-message';
	}
	if (!$btype) {
		$vaild = false;
		$errorbtype = 'error-message';
	}


	if ($vaild == true) {

		$query = $connect->query("SELECT tel FROM ads WHERE tel='{$telephone}'");
		$tel_exist = $query->num_rows;
		if ($tel_exist > 0) {
			$postbusiness_error = '<div class="alert alert-error">The business that you have specified already exists in our database. If this is your business please <a href="/support/">click here to contact us.</a></div>';
		} else {
			$q3 = "INSERT INTO ads SET
				   memberid = '{$memberid}',
				   companyname = '$companyname',
				   street1 = '$address1',
				   street2 = '$address2',
				   county_name = '$county_name',
				   town_name = '$town_name',
				   postcode = '$postcode',
				   tel = '$telephone',
				   fax = '$fax',
				   email = '$email',
				   url = '$url',
				   business_type = '$btype',
				   mcategory = '$bcategory',
				   postdate = '$time',
				   longitude = '$longitude',
				   latitude = '$latitude'";

			$r3 = $connect->query($q3) or die($connect->error);
			if ($r3) {
				$adid = $connect->insert_id;
				$r4 = $connect->query("UPDATE main_cats SET pop=pop+1 WHERE main_cats_id='{$bcategory}'") or die($connect->error);
				echo "<script>location.href = 'postbusiness2.html?adid=" . $adid . "'</script>";
				exit;
			} else {
				echo "<script>location.href = 'postbusiness1.html'</script>";
				exit;
			}
		}
	}
}

?>
<!DOCTYPE html>
<html lang="en">

<head>
	<title>YellowLeaf - Submit Advert</title>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
	<link rel="stylesheet" href="/header-footer/global.css">
	<link rel="stylesheet" href="index.css">
	<style>
		.form-group .select,
		.form-group input {
			border-radius: 4px;
			padding: 0 16px;
		}
		.form-group textarea {
			border-radius: 4px;
			padding: 12px 16px;
		}
	</style>
</head>
<body>

	<? include 'member_menu.php'; ?>

	<!-- NAVBAR -->
	<section id="content">
		<!-- NAVBAR -->
		<nav>
			<i class='bx bx-menu toggle-sidebar'></i>
			<a href="/members/logout.html" class="logout">
				<i class='bx bx-log-out'></i>
				Logout
			</a>
		</nav>
		<!-- NAVBAR -->

		<!-- MAIN -->
		<main>
			<div class="container">
				<h1 class="title">Submit Advert</h1>
				<!-- <ul class="breadcrumbs">
			<li><a href="#">Home</a></li>
			<li class="divider">/</li>
			<li><a href="#" class="active">Dashboard</a></li>
			</ul> -->
				<div class="main-content">
					<div class="main-box">
						<?= $postbusiness_error ?>
						<form action="" method="post" enctype="multipart/form-data">
							<div class="form-box">
								<div class="form-description">Please enter your business name.</div>
								<div class="form-group">
									<input type="text" value="<?= $companyname ?>" name="companyname" id="companyname" placeholder="Business name">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please select the county of where your business is located.</div>
								<div class="form-group">
									<div class="select">
										<input type="hidden" name="county">
										<div class="selected">Select a County</div>
										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option">
											<li data-value="" data-selected="">Select a County</li>
											<?
											$get = $connect->query("SELECT * FROM `county` WHERE `county_id`!='999' ORDER BY county_name ASC");
											$county = '';

											while ($row_county = $get->fetch_assoc()) {
												// sort($county_name);
												foreach ($row_county as $key => $val) {
													$$key = stripslashes(strip_tags($val));
												}
												// if ($county_name == "Bedfordshire") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="England">'; $newcat=1; }
												// if ($county_name == "County Antrim") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Northern Ireland">'; $newcat=1; }
												// if ($county_name == "Aberdeen") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Scotland">'; $newcat=1; }
												// if ($county_name == "Blaenau Gwent") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Wales">'; $newcat=1; }
												// if ($county_name == "Channel Islands") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Channel Islands">'; $newcat=1; }
												// $sel = $county_id.'||'.$divide_country.'||'.$county_name==$countys ? 'selected' : ''  ;
													
												$county .= '<li class="get-town" data-value="' . $county_id . '||' . $divide_country . '||' . $county_name . '">' . $county_name . '</li>';
											}
											echo $county;
											?>
										</ul>
									</div>
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please select the town of where your business is located.</div>
								<div class="form-group">
									<div class="select">
										<input type="hidden" name="town">
										<div class="selected">Select a Town</div>
										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option" id="town-list">
										</ul>
									</div>
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter the address of your business.</div>
								<div class="form-group">
									<textarea cols="30" rows="5" name="address1" id="address1"><?= $address1 ?></textarea>
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter your business postcode.</div>
								<div class="form-group">
									<input type="text" id="postcode" name="postcode" placeholder="Postcode" value="<?= $postcode ?>">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter your business telephone number.</div>
								<div class="form-group">
									<input type="text" id="telephone" name="telephone" placeholder="Telephone" value="<?= $telephone ?>">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter your business FAX number.</div>
								<div class="form-group">
									<input type="text" id="fax" name="fax" placeholder="FAX (optional)" value="<?= $fax ?>">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter your business email address. This will be kept confidential.</div>
								<div class="form-group">
									<input type="email" id="email" name="email" placeholder="Email" value="<?= $email ?>">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please enter your business website URL.</div>
								<div class="form-group">
									<input type="url" id="url" name="url" placeholder="Website URL (optional)" value="<?= $url ?>">
								</div>
							</div>
							<div class="form-box">
								<div class="form-description">Please choose a type of business.</div>
								<div class="form-group">
									<div class="select">
										<input type="hidden" name="btype">
										<div class="selected">Type of business</div>
										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option">
											<li data-value="" data-selected="">Please select</li>
											<li data-value="Offering Services" <?= $btype == 'Offering Services' ? 'data-selected=""' : '' ?>>Offering Services</li>
											<li data-value="Selling Products" <?= $btype == 'Selling Products' ? 'data-selected=""' : '' ?>>Selling Products</li>
										</ul>
									</div>
								</div>
							</div>
							<!-- <div class="form-box">
								<div class="form-description">PLEASE NOTE: You can only choose one relevant category.</div>
								<div class="form-group">
									<div class="select">
										<input type="hidden" name="btype">
										<div class="selected">Please select</div>
										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option">
											<li data-value="" data-selected="">Please select</li>


													
											<li data-value="Offering Services" <?= $btype == 'Offering Services' ? 'data-selected=""' : '' ?>>
												Offering Services



											</li>
										
										</ul>
									</div>
								</div>
							</div> -->

							
							<div class="form-box">
								<div class="form-description">PLEASE NOTE: You can only choose one relevant category.</div>
								<div class="form-group">
									<div class="select">
										<input type="hidden" name="mcategory">
										<div class="selected">Select a Category</div>
										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option">
											<li data-value="" data-selected="">Select a Category</li>
											<?
											$get = $connect->query("SELECT * FROM `main_cats` ORDER BY main_cats ASC");
											$category = '';

											while ($row_category = $get->fetch_assoc()) {
												foreach ($row_category as $key => $val) {
													$key = stripslashes(strip_tags($val));

												}
											
													
												$category .= '<li class="get-town" data-value="' . $row_category['main_cats_id'] . '">' . $row_category['main_cats'] . '</li>';
											}
											echo $category;
											?>
										</ul>
									</div>
								</div>
							</div>
							<!-- <div class="form-box">
								<div class="form-description">PLEASE NOTE: You can only choose one relevant category</div>
								<div class="form-group">
									<input type="hidden" name="bcat">
									<input type="text" id="business-category" placeholder="Please select a category for your business">
									<ul class="select-option">
										<li data-value="" data-selected="">Please select</li>

										<i class='bx bx-chevron-down' ></i>
										<ul class="select-option">
											<li data-value="" data-selected="">Please select</li>
											<li data-value="Offering Services" <?= $btype == 'Offering Services' ? 'data-selected=""' : '' ?>>Offering Services</li>
											<li data-value="Selling Products" <?= $btype == 'Selling Products' ? 'data-selected=""' : '' ?>>Selling Products</li>
										</ul>
												<?php
													$get = $connect->query("SELECT * FROM `main_cats` ORDER BY `main_cats` ASC LIMIT 100");
													$cats = array();

													while ($row = $get->fetch_assoc()) {
														foreach ($row as $key => $val) {
															$$key = stripslashes(strip_tags($val));
														}
														// $display = preg_replace('/(' . $value . ')/i', '<b class="ls_hghlight">\1</b>', $main_cats);
														// $sel = $bcategory == $main_cats_id ? 'selected' : '';
														$cats[] = ['keyword' => $main_cats, 'value' => $main_cats_id, 'html' => '
														<li data-keyword="' . $main_cats . '" data-value="' . $main_cats_id . '">' . $main_cats . '</li>'];
													}

													$jsonCats = json_encode($cats) ;
													?> 
												
									</ul>
								</div>
							</div>  -->
							<button type="submit" name="submit" class="button button-yellow">Next</button>
						</form>
					</div>
				</div>
			</div>
		</main>
		<!-- MAIN -->
	</section>
	<!-- NAVBAR -->

		<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
		<script>
			var categoryStringify = JSON.stringify(<?= $jsonCats ?>)
			var jsonCategory = JSON.parse(categoryStringify)
			var country = '<?= $countys ?>';
			var town = '<?= $town ?>';

			// start: Get town
			function get_town_drop(value, town) {
				$.ajax({
					url: "ajax/get_town.ajax.php?value=" + value + '&town=' + town,
					success: function(result) {
						$('#town-list').html(result)
					}
				})
			}

			get_town_drop(country, town)
			// end: Get town



			// start: Category autocomplete
			categoryAutocomplete($('#business-category'), $('#cat'))

			function categoryAutocomplete(inp, inpCat) {
				var selected = -1

				inp.on('input', function() {
					if(!inp.val()) return

					var filtered = jsonCategory.filter(function(i) {
						return i.keyword.toLowerCase().substring(0, inp.val().length) === inp.val().toLowerCase()
					})

					renderAutocomplete(filtered)
				})
				
				function renderAutocomplete(arr) {
					inp.parent().find('.autocomplete').remove()
					
					var template = '<ul class="autocomplete">'
					arr.forEach(function(i) {
						template += i.html
					})
					template += '</ul>'

					inp.parent().append(template)

					autocompeleteAction()
				}

				function autocompeleteAction() {
					inp.siblings('.autocomplete').find('li').on('mousedown click', function() {
						inp.val($(this).attr('data-keyword'))
						inpCat.val($(this).attr('data-value'))
					})
				}

				inp.keydown(function(e) {
					var arr = inp.siblings('.autocomplete').find('li')

					if(!arr.length) return

					switch (e.key) {
						case 'ArrowDown':
							selected++
							setActive(arr)
							break;
						case 'ArrowUp':
							selected--
							setActive(arr)
							break;
						case 'Enter':
							e.preventDefault()
							if(selected > -1) {
								arr.eq(selected).click()
								inp.blur()
							} 
							break;
						default:
							break;
					}
				})

				function setActive(arr) {
					arr.removeClass('selected')

					if (selected >= arr.length) selected = 0;
					if (selected < 0) selected = (arr.length - 1);

					arr.eq(selected).addClass('selected')
				}

				inp.blur(function() {
					$('.autocomplete').remove()
				})
			}
			// end: Category autocomplete
		</script>
		<script src="script.js"></script>
</body>
</html>







<!-- <section>
  <div class="container">
    <div class="advert-wrapper">
	<? die(); ?>
      <div class="advert-main">
        <div class="advert-main-title">Submit Advert</div>
        <div class="submit-advert-tab">
          <span class="active">1</span>
          <span>2</span>
          <span>3</span>
          <span>4</span>
          <span>5</span>
          <span>6</span>
        </div>
        <form class="submit-advert-form" action="" method="POST" enctype="multipart/form-data">
          <?= $postbusiness_error ?>
          <div class="submit-advert-form-group">
            <label for="name">Business Name:</label>
            <p class="submit-advert-label-description <?= $errorcompanyname ?>">Please enter your business
              name.</p>
            <input value="<?= $companyname ?>" type="text" name="companyname" id="companyname"
              class="form-control">

          </div>
          <div class="submit-advert-form-group">
            <label for="county">Business County:</label>
            <p class="submit-advert-label-description <?= $errorcounty ?>">Please select the county of where your business is located.</p>
            <div class="select">
              <input type="hidden" class="select-value" id="county" name="county">
              <input type="text" class="select-selected" value="" readonly>
              <svg class="select-icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>
              <div class="option-wrapper">
                <span class="option" data-value="" data-selected="true">Select a County</span>
                <?
				$get = $connect->query("SELECT * FROM `county` WHERE `county_id`!='999' ORDER BY divide_country ASC, county_name ASC");
				$county = '';

				while ($row_county = $get->fetch_assoc()) {
					foreach ($row_county as $key => $val) {
						$$key = stripslashes(strip_tags($val));
					}
					// if ($county_name == "Bedfordshire") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="England">'; $newcat=1; }
					// if ($county_name == "County Antrim") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Northern Ireland">'; $newcat=1; }
					// if ($county_name == "Aberdeen") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Scotland">'; $newcat=1; }
					// if ($county_name == "Blaenau Gwent") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Wales">'; $newcat=1; }
					// if ($county_name == "Channel Islands") { if ($newcat) { $county.='</optgroup>'; } $county.='<optgroup label="Channel Islands">'; $newcat=1; }
					// $sel = $county_id.'||'.$divide_country.'||'.$county_name==$countys ? 'selected' : ''  ;

					$county .= '<span onclick="get_town_drop(this.dataset.value,\'\')"  class="option" data-value="' . $county_id . '||' . $divide_country . '||' . $county_name . '">' . $county_name . '</span>';
				}
				echo $county;
				?>
              </div>
            </div>
          </div>

          <div class="submit-advert-form-group">
            <label for="county">Business Town / Area:</label>
            <p class="submit-advert-label-description <?= $errortown ?>">Please select the town of where your
              business is located.</p>
            <div class="select">
              <input type="hidden" class="select-value" id="town" name="town">
              <input type="text" class="select-selected" value="" readonly>
              <svg class="select-icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>
              <div class="option-wrapper" id="town-list">
                <span class="option" data-value="" data-selected="true">Select a Town</span>
              </div>
            </div>
          </div>


          <div class="submit-advert-form-group">
            <label for="address">Business Address:</label>
            <p class="submit-advert-label-description <?= $erroraddress1 ?>">Please enter the address of your
              business.</p>
            <textarea id="address1" name="address1" cols="30" rows="5"
              class="form-control-textarea"><?= $address1 ?></textarea>
          </div>
          <div class="submit-advert-form-group">
            <label for="postcode">Postcode:</label>
            <p class="submit-advert-label-description <?= $errorpostcode ?>">Please enter your business
              postcode.</p>
            <input value="<?= $postcode ?>" name="postcode" type="text" id="postcode"
              class="form-control">
          </div>
          <div class="submit-advert-form-group">
            <label for="phone">Telephone:</label>
            <p class="submit-advert-label-description <?= $errortelephone ?>">Please enter your business
              telephone number.</p>
            <input value="<?= $telephone ?>" name="telephone" type="tel" id="phone"
              class="form-control">
          </div>
          <div class="submit-advert-form-group">
            <label for="fax">FAX (optional):</label>
            <p class="submit-advert-label-description">Please enter your business FAX number.</p>
            <input value="<?= $fax ?>" type="text" name="fax" id="fax"
              class="form-control">
          </div>
          <div class="submit-advert-form-group">
            <label for="email">Email:</label>
            <p class="submit-advert-label-description <?= $erroremail ?>">Please enter your business email
              address. This will be kept confidential.</p>
            <input value="<?= $email ?>" type="email" id="email" name="email"
              class="form-control">
          </div>
          <div class="submit-advert-form-group">
            <label for="website">Website URL (optional):</label>
            <p class="submit-advert-label-description">Please enter your business website URL.</p>
            <input value="<?= $url ?>" type="url" id="url" name="url"
              class="form-control">
          </div>
          <div class="submit-advert-form-group">
            <label for="type">Type of Business:</label>
            <p class="submit-advert-label-description <?= $errorbtype ?>">Please choose a type of business.
            </p>
            <div class="select">
              <input type="hidden" class="select-value" id="btype" name="btype">
              <input type="text" class="select-selected" value="" readonly>
              <svg class="select-icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>
              <div class="option-wrapper">
                <span class="option" data-value="" data-selected="true">Please select</span>
                <span class="option" data-value="Offering Services" <?= $btype == 'Offering Services' ? 'data-selected="true"' : '' ?>>Offering Services</span>
                <span class="option" data-value="Selling Products" <?= $btype == 'Selling Products' ? 'data-selected="true"' : '' ?>>Selling Products</span>
              </div>
            </div>
          </div>
          <div class="submit-advert-form-group">
            <label for="category">Please select a category for your business</label>
            <p class="submit-advert-label-description">PLEASE NOTE: You can only choose one relevant
              category</p>
            <div class="form-control-autocomplete">
              <input type="hidden" id="category-id" name="bcat">
              <input type="text" class="form-control form-control-autocomplete-input" id="category" name="bcat" autocomplete="off">
            </div>
            <?php
			$get = $connect->query("SELECT * FROM `main_cats` ORDER BY `main_cats` ASC LIMIT 100");
			$cats = array();

			while ($row = $get->fetch_assoc()) {
				foreach ($row as $key => $val) {
					$$key = stripslashes(strip_tags($val));
				}
				// $display = preg_replace('/(' . $value . ')/i', '<b class="ls_hghlight">\1</b>', $main_cats);
				// $sel = $bcategory == $main_cats_id ? 'selected' : '';
				$cats[] = ['keyword' => $main_cats, 'value' => $main_cats_id, 'html' => '<li data-keyword="' . $main_cats . '" data-value="' . $main_cats_id . '">' . $main_cats . '</li>'];
			}

			$jsonCats = json_encode($cats)
			?>
          </div>
          <button type="submit" name="submit" class="btn btn-yellow">Next</button>
        </form>
      </div>
    </div>
  </div>
</section> -->

Youez - 2016 - github.com/yon3zu
LinuXploit