<?php
session_start();
if(!isset($_SESSION['adm1n']) || $_SESSION['adm1n']['Nbr'] == ''){
  
       header("Location: ../misc/default.php");
       exit;
       
}
require_once("../../includes/php/defines.php");
require_once("../../includes/php/classes/mainClass.php");
require_once("../../includes/php/classes/staffClass.php");

$s = new StaffClass;
$info = $s->getStaffMemberInfo($_GET['Id']);

?>
<section>
	<div class="container-fluid">
		<div class="container">
			<div class="col-md-12 result-heading">
				<div class="rh-form">		
				<?php
				if(isset($_GET['ReturnPage']) && $_GET['ReturnPage'] != ''){                                        

						echo '<form>';
						echo '<div class="form-group">';
						echo '<div class="return-div"><span onclick="contentChanger(\''.$_GET['ReturnPage'].'\');"><< RETURN TO STAFF PAGE MANAGER</span></div>';
						echo '</div>';       
						echo '</form>';  

				}             
				?>		
					<h1>Edit Staff Member Info</h1>					
					<form class="a-r-form" id="Admin_Form">
						<div id="Animation">
							<div class="blockG" id="rotateG_01"></div>
							<div class="blockG" id="rotateG_02"></div>
							<div class="blockG" id="rotateG_03"></div>
							<div class="blockG" id="rotateG_04"></div>
							<div class="blockG" id="rotateG_05"></div>
							<div class="blockG" id="rotateG_06"></div>
							<div class="blockG" id="rotateG_07"></div>
							<div class="blockG" id="rotateG_08"></div>                                            
						</div>
						<div id="Result"></div>                         
						<div class="form-group">
							<label>Staff Member Name</label>
							<input type="text" class="col-md-12" id="Name" name="Name" value="<?php echo $info['Name']; ?>">
						</div>						
						<div class="form-group">
							<label>Title</label>
							<input type="text" class="col-md-12" id="Title" name="Title" value="<?php echo $info['Title']; ?>">
						</div>	
						<div class="form-group">
							<label>Phone Number</label>
							<input type="text" class="col-md-12" id="Phone" name="Phone" value="<?php echo $info['Phone']; ?>">
						</div>	
						<div class="form-group">
							<label>Email Address</label>
							<input type="text" class="col-md-12" id="Email" name="Email" value="<?php echo $info['Email']; ?>">
						</div>
						<div class="form-group">
              				<p class="label-p">Staff Bio</p>
							<textarea class="col-md-12" rows="5" id="Bio" name="Bio"><?php echo $info['Bio']; ?></textarea>
						</div>
						<?php 
						echo '<div class="form-group" id="Thumb_Img_Area" name="Thumb_Img_Area">';
						if($info['Img'] != ''){
							
							echo '<img src="'.WEBSITE_ADDY.'/images/staff/'.$info['Img'].'" style="border-radius:10px; width: 100px;" id="Thumb_Img" name="Thumb_Img"/>';							

						}
						echo '</div>';
						?>            	                                    
						<div class="form-group dropzone" id="DropZone" name="DropZone" style="background-color:#e6e6e6; border:dashed 1px #ccc; border-radius:10px; text-align:center;">														
							<label><strong>Profile Image ( Only jpg. jpeg and png files )</strong></label>
							<input type="file" name="Files[]" id="Files[]" multiple class="inputFile">
							<p style="text-align:left; padding: 10px;">Images need to be a minimum of 400px wide and 500 pixels tall. Images will be cropped and resized to 400X500 upon upload to maintain consistency on the page.</p>											
						</div>							
						<div id="PreviewContainer" name="PreviewContainer" class="dropzone-previews"></div>
						<div class="form-group" id="Submit_Paragraph">
							<input type="hidden" id="Option" name="Option" value="Edit-Staff"/>
							<input type="hidden" id="Clear" name="Clear" value="No_Clear"/>
              <input type="hidden" id="Id" name="Id" value="<?php  echo $info['Nbr']; ?>"/>
              <input type="hidden" id="Img" name="Img" value="<?php  echo $info['Img']; ?>"/>
							<input type="button" value="submit" onclick="processForm('Edit-Staff','No_Clear');">
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</section>
<script type="text/javascript" src="js/dropzone.js"/>
<script type="text/javascript" src="includes/ajax/dropzone_form_processor.js"/>