?>
</td></tr>			
			
			 

			<tr><td></td><td><div align="right"><button class="btn btn-sm btn-primary" type="submit" value=" Send" id="submit" >Save</button></div> <br><?php 
ctrl_submit('Save');
?>
</td></tr>

		
		</tbody>
		</table>
		</form>
		<?php 
if (isset($_POST['submit'])) {
    require 'includes/functions/validate.php';
    validateText($errors, $_POST, 'address');
    if (!$errors) {
        // echo "The number of rooms is *". $_POST['description'].'*';
        db_addProperty($_POST['numOfRooms'], $_POST['numberofBaths'], $_POST['numberOfCarParks'], $_POST['defaultRent'], $_POST['defaultPeriod'], $_POST['buyingPrice'], $_POST['address'], $_POST['description'], $_POST['suburb'], $_POST['state'], $_POST['postcode'], $_FILES['userfile']);
        header("location: http://{$_SERVER['HTTP_HOST']}/property-Management-application/searchProperties.php");
        exit;
    }
}
?>
	</div>
	</div>
</div></div>
</body>
</html>
<?php

include 'includes/functions/db.php';
include 'includes/functions/formControls.php';
include 'includes/accountSessions.php';
$errors = array();
//may later use login to enforce security one which staff members can edit
$loginId = $_SESSION['idLogin'];
if (isset($_POST['submit'])) {
    require 'includes/functions/validate.php';
    validateText($errors, $_POST, 'address');
    if (!$errors) {
        // echo "The number of rooms is *". $_POST['description'].'*';
        db_addProperty($_POST['numOfRooms'], $_POST['defaultRent'], $_POST['defaultPeriod'], $_POST['buyingPrice'], $_POST['address'], $_POST['description']);
        header("location: http://{$_SERVER['HTTP_HOST']}/property-Management-application/searchProperties.php");
        exit;
    }
}
?>
<html>
<head>
<title>Add Whole House </title>
</head>
<body>
<?php 
include '/includes/content/topNav.php';
?>
<form class= 'editForm' action = "addProperty.php" method = "POST" name = "addWHouse">
<?php 
ctrl_input_field($errors, 'number', 'REQUIRED', 'defaultRent', 'Default Rent (Weekly)', 'txtDefaultRent');
ctrl_input_field($errors, 'number', 'REQUIRED', 'numOfRooms', 'Number of Rooms', 'txtNumRooms');