<?php
	require_once('Connections/conn_ama.php');

	if(!isset($_SESSION)){
        session_start();
	}

		//Retrieve Sub Metros
		$query_rsSubMetros = "SELECT submetroID, `name`, dateadded  FROM v_submetros GROUP BY submetroID  ORDER BY `name` ASC";
		$rsSubMetros = mysqli_query($conn_ama, $query_rsSubMetros ) or die(mysqli_error($conn_ama));
		$row_rsSubMetros = mysqli_fetch_assoc($rsSubMetros);
		$totalRows_rsSubMetros = mysqli_num_rows($rsSubMetros);/**/

	define('MAX_FILE_SIZE',10121200);

 ?>

<!-- <div class="col-md-9 data-area"> -->
	<div class="data-area-wrap">
		<div class="form-wrapper">
			<form id="new-assembly-member">
			  	<fieldset>
			  		<legend>Add Assembly Member <?php //print_r($_SESSION); ?></legend>
			  		<div class="form-group">
					    <label for="fname">First Name</label>
					    <input type="text" name="fname" class="form-control" id="fname" >
					</div>

					<div class="form-group">
						<label for="mname">Middle Name</label>
						<input type="text" name="mname" class="form-control" id="mname" >
					</div>

					<div class="form-group">
						<label for="lname">Last Name</label>
						<input type="text" name="lname" class="form-control" id="lname" >
					</div>
				</fieldset>

				<fieldset>
					<legend>Electoral Area Details</legend>
					<div class="form-group">
						<label for="electoralarea">Electoral Area</label>
						<input type="text" name="electoralarea" class="form-control" id="electoralarea" >
					</div>

					<div class="form-group">
					    <label for="submetroID">Sub Metro</label>
						<select name="submetroID" class="form-control">
							<option value="">-Select-</option>
							<?php do{ ?>
								<option value="<?php echo $row_rsSubMetros['submetroID'];?>" ><?php echo $row_rsSubMetros['name'];?></option>
							<?php } while($row_rsSubMetros = mysqli_fetch_assoc($rsSubMetros)) ?>
						</select>
				  	</div>
			  	</fieldset>
				<fieldset>
					<legend>Upload Image <?php //print_r($_SESSION); ?></legend>
					<div class="form-group">
						<!-- <label for="mapUpload">Map</label> -->
							<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" />
							<input type="file" id="mapUpload" class="form-control" name="image">
						<!--<div id="image-holder"></div>-->
					</div>
				</fieldset>
				<hr>
			  <button type="submit" id="add-assembly-member" class="btn btn-success">Submit</button>
			  <input type="hidden" name="MM_insert" value="add-new-assembly-member" />
			  <div class="error_msg"></div>
			</form>
		</div><!-- End .form-wrapper-->
	</div><!-- End .data-area-wrap-->
<!--</div>-->	<!-- End .data-area -->
