';
include_once ('header.php'); // Include the HTML header file.
loginCheck();
?>
Add a Listing
";
//exit;
$rent_note = mysqli_real_escape_string($dbcrent,trim($_POST['rent_note']));
$address = mysqli_real_escape_string($dbcrent,trim($_POST['address']));
$city = mysqli_real_escape_string($dbcrent,trim($_POST['city']));
$state = mysqli_real_escape_string($dbcrent,trim($_POST['state']));
$zip = mysqli_real_escape_string($dbcrent,trim($_POST['zip']));
$beds = mysqli_real_escape_string($dbcrent,trim($_POST['beds']));
if (empty($beds)) {
$beds = "NULL";
}
$baths = mysqli_real_escape_string($dbcrent,trim($_POST['baths']));
if (empty($baths)) {
$baths = "NULL";
}
$half_baths = mysqli_real_escape_string($dbcrent,trim($_POST['half_baths']));
if (empty($half_baths)) {
$half_baths = "NULL";
}
$latitude = mysqli_real_escape_string($dbcrent,trim($_POST['latitude']));
if (empty($latitude)) {
$latitude = "NULL";
}
$longitude = mysqli_real_escape_string($dbcrent,trim($_POST['longitude']));
if (empty($longitude)) {
$longitude = "NULL";
}
$prop_desc = mysqli_real_escape_string($dbcrent,trim($_POST['prop_desc']));
/*
echo $rental_rate;
echo "";
print_r($_POST);
echo "
";
*/
$insertquery = "
INSERT INTO rentals (
rental_type, rental_rate, rent_note, address,
city, state, zip, beds, baths,
half_baths, latitude, longitude, prop_desc
) VALUES (
'$rental_type', $rental_rate, '$rent_note', '$address',
'$city', '$state', '$zip', '$beds', '$baths',
$half_baths, $latitude, $longitude, '$prop_desc'
)";
// $to = 'mulliganaddrental@tropworks.com';
// $subj = 'mulligan addrental query';
// $msg = $insertquery;
// mail($to, $subj, $msg);
$insert = mysqli_query($dbcrent,$insertquery) or trigger_error("Bad insert: " . mysqli_error($dbcrent));
if ($insert) {
$listing_id = mysqli_insert_id($dbcrent);
echo "The property has been added.
";
echo "