<?php

	require_once 'processes/config.php';
	require_once 'processes/dbh.inc.php';
	require_once 'processes/checkLogin.php';
	include_once 'header.php';

?>
		
	<!-- START OF newExperienceP1.php -->
	<body>
	
		<header id="main-header">
        	<a id="logo" href=".">TANIA</a>
        	<div id="account">
        	    <a class="nav-link" href="./questionnaires.php">Questionnaire Collection</a>
        	    <a class="sign-out" href="./processes/logout.php">Sign Out</a>
        	</div>
    	</header>
		
		<div class='container' style="margin-top: 12vh;">
		
			<br>
		
			<div class='row'>
				<div class='col-sm-10'>
					<h2>Brand New Experience <small>(Basic Info)</small></h2>
					<h3><small>Start creating a new experience by first adding its basic info.</small></h3>
				</div>
			</div><!--row-->
			
			<hr>
<!-- 			<div class='row'><div class='col'><br><hr><br></div></div> -->
		
			<form class='form-horizontal' method='POST' action='processes/insertExperience.php'>
				
				<!-- TITLE -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_title'>Title:</label>
					<div class='col-sm-9'>
						<input type='text' class='form-control text-center' id='e_title' name='title' placeholder='New Experience Title' required>
					</div>
				</div>
				
				<!-- DESCRIPTION -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_description'>Description:</label>
					<div class='col-sm-9'>
						<textarea class='form-control text-center' id='e_description' name='description' rows='1' style='resize:vertical;' placeholder='New Experience Description' required></textarea>
					</div>
				</div>
				
				<!-- TYPE -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_description'>Type:</label>
					<div class='col-sm-9'>
						<input type='text' class='form-control text-center' id='e_description' name='type' placeholder='New Experience Type' required>
					</div>
				</div>
				
				<!-- DURATION -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_description'>Duration:</label>
					<div class='col-sm-9'>
						<input type='number' class='form-control text-center' id='e_description' name='duration' placeholder='New Experience Duration' required>
					</div>
				</div>
				
				<!-- START DATE -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_start'>Start Date:</label>
					<div class='col-sm-9'>
						<input type='date' class='form-control text-center' id='e_start' name='start' placeholder='New Experience Start Date' required>
					</div>
				</div>
				
				<!-- END DATE -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_end'>End Date:</label>
					<div class='col-sm-9'>
						<input type='date' class='form-control text-center' id='e_end' name='end' placeholder='New Experience End Date' required>
					</div>
				</div>
				
				<!-- INSTITUTION -->
				<div class='form-group'>
					<label class='control-label col-sm-2' for='e_institution'>Institution:</label>
					<div class='col-sm-9'>
						<select id='e_institution' name='institution' style='width:100%;' required>
							<option disabled selected>Select an Institution</option>
							<?php
								$query = "SELECT * FROM `institution`;";
								$result = mysqli_query($connection, $query);
								while($row = mysqli_fetch_assoc($result)):
							?>
							<option value='<?php echo $row['id']; ?>'><?php echo $row['name']; ?></option>
							<?php endwhile; ?>
						</select>
					</div>
				</div>
				
				<!-- SUBMIT -->
				<br><br>
				<div class='form-group text-center'>
					<div class='col-sm-offset-10 col-sm-2'>
						<button id='adding' type='submit' class='btn btn-default' name='submitExperience'>Create Experience</button>
					</div>
				</div>
								
			</form>
		</div>
	<!-- END OF newExperienceP1.php -->
	
	<!-- INSTITUTION, EXPERIENCE_QUESTIONNAIR, SUBQUESTIONNAIR, EXPERIENCE_SUBQUESTIONNAIR, REMINDER_SUBQUESTIONNAIR?, SCHEDULE?, REMINDER_STUDENT_SUBQUESTIONNAIR?-->
	
<?php include_once 'footer.php'; ?>