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

	if(!isset($_SESSION)){
        session_start();
	} 
	
	//define('MAX_FILE_SIZE',10121200);
	if(isset($_POST['d'])){
        $subdeptID = $_POST['d'];
        $deptname = $_POST['dn'];
	}

 ?>

<!-- <div class="col-md-9 data-area"> -->
	<div class="data-area-wrap">
       
		<div class="form-wrapper"> 
			<h3><?php echo $deptname; ?></h3>
			<form id="new-sub-unit">
			  	<fieldset>
			  		<legend>Add Unit</legend>
			  		<div class="form-group">
					    <label for="name">Unit</label>
					    <input type="text" name="subsubdeptname" class="form-control" id="name" >
				  	</div>

				  	<!-- <div class="form-group">
					    <label for="gist">Gist</label>
					    <input type="text" name="gist" class="form-control" id="gist" placeholder="Gist">
				  	</div> -->

				  	<div class="form-group">
					    <label for="subsubdeptfunctions">Department Functions</label>
					  <textarea name="subsubdeptfunctions" class="tinymce" cols="" rows="" id="subsubdeptfunctions"></textarea>
				  	</div>

				</fieldset>

				<fieldset>
				<legend>Contact Details</legend>
					<div class="form-group">
					    <label for="phone">Telephone</label>
					    <input type="text" name="phone" class="form-control" id="phone" >
				  	</div>

					<div class="form-group">
					    <label for="email">E-Mail</label>
					    <input type="text" name="email" class="form-control" id="email" >
				  	</div>

			  	</fieldset>
				
				<hr>
			  <button type="submit" id="add-sub-unit" class="btn btn-success">Submit</button>
			  <input type="hidden" name="MM_insert" value="add-new-sub-unit" />
			  <input type="hidden" name="subdeptID" value="<?php echo $subdeptID; ?>" />
			  <div class="error_msg"></div>
			</form>
		</div><!-- End .form-wrapper-->
	</div><!-- End .data-area-wrap-->	
<!--</div>-->	<!-- End .data-area -->

<!-- TinyMCE -->
        
<script type="text/javascript" src="_/js/tinymce/jquery.tinymce.min.js"></script> 
<script type="text/javascript" src="_/js/tinymce/tinymce.min.js"></script>           
<script type="text/javascript">
		$(function(){
			tinymce.init({
			selector: 'textarea#subsubdeptfunctions',
			height: 500,
			content_css: [
			'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
			'//www.tiny.cloud/css/codepen.min.css'
			]
		});
		});
	</script>
<!-- /TinyMCE -->