<?php 
/********************************************************************************* 
 *  This file is part of Sentrifugo.
 *  Copyright (C) 2014 Sapplica
 *   
 *  Sentrifugo is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Sentrifugo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Sentrifugo.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Sentrifugo Support <support@sentrifugo.com>
 ********************************************************************************/
?>



<?php sapp_Global::generateClientValidations($this->form);
	  $user_id = $this->user_id;	
?>

<div class="total-form-controller">
<div id="error_message" style="display:none;"></div>

<form name="<?php echo $this->form->getName(); ?>" id="<?php echo $this->form->getId(); ?>" action="<?php echo $this->form->getAction(); ?>" method="<?php echo $this->form->getMethod(); ?>" enctype="multipart/form-data" >
		<?php echo $this->form->id; ?>
    <input type="hidden" name="user_id" value="<?php echo isset($user_id)? $user_id:'';?>" />
	
		<div class="separetor-heading"><span class="">Management Details</span></div>
<!-- start of organisation head details -->
	
	<div class="new-form-ui">
        <label class="required"><?php echo $this->form->employeeId->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->employeeId; ?>                   
        <?php if(isset($this->msgarray['employeeId'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->employeeId->getId(); ?>"><?php echo $this->msgarray['employeeId'];?></span>
        <?php }?>
        
        </div>
    </div>
	
	<!-- <div class="new-form-ui">
	  <label class="required">Organization Head </label>
		<div class="division"><?php //echo $this->form->orghead; ?>			
			<?php // if(isset($this->msgarray['orghead'])){?>
				<span class="errors" id="errors-<?php //echo $this->form->orghead->getId(); ?>"><?php //echo $this->msgarray['orghead'];?></span>
			<?php // }?>			
		</div>	   
	</div>-->
	<div class="new-form-ui">
	  <label class="required">First Name </label>
		<div class="division"><?php echo $this->form->firstname_orghead; ?>			
			<?php if(isset($this->msgarray['firstname_orghead'])){?>
				<span class="errors" id="errors-<?php echo $this->form->firstname_orghead->getId(); ?>"><?php echo $this->msgarray['firstname_orghead'];?></span>
			<?php }?>			
		</div>	   
	</div>
	<div class="new-form-ui">
	  <label class="required">Last Name </label>
		<div class="division"><?php echo $this->form->lastname_orghead; ?>			
			<?php if(isset($this->msgarray['lastname_orghead'])){?>
				<span class="errors" id="errors-<?php echo $this->form->lastname_orghead->getId(); ?>"><?php echo $this->msgarray['lastname_orghead'];?></span>
			<?php }?>			
		</div>	   
	</div>
	
    <div class="new-form-ui">
        <label><?php echo $this->form->prefix_id->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->prefix_id; ?>
                <?php if(isset($this->msgarray['prefix_id'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->prefix_id->getId(); ?>"><?php echo $this->msgarray['prefix_id'];?></span>
        <?php }?>        
        </div>
    </div>
	
    <div class="new-form-ui">
        <label class="required"><?php echo $this->form->emprole->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->emprole; ?></div>
        <?php if(isset($this->msgarray['emprole'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->emprole->getId(); ?>"><?php echo $this->msgarray['emprole'];?></span>
        <?php }?>
      </div>
      
      <div class="new-form-ui">
        <label class="required"><?php echo $this->form->emailaddress->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->emailaddress; ?></div>
        <?php if(isset($this->msgarray['emailaddress'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->emailaddress->getId(); ?>"><?php echo $this->msgarray['emailaddress'];?></span>
        <?php }?>
    </div>
    <div class="new-form-ui">
        <label><?php echo $this->form->jobtitle_id->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->jobtitle_id; ?>
                <?php if(isset($this->msgarray['jobtitle_id'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->jobtitle_id->getId(); ?>"><?php echo $this->msgarray['jobtitle_id'];?></span>
        <?php }?>      
        </div>
    </div>
    <div class="new-form-ui">
        <label><?php echo $this->form->position_id->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->position_id; ?>
                <?php if(isset($this->msgarray['position_id'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->position_id->getId(); ?>"><?php echo $this->msgarray['position_id'];?></span>
        <?php }?>
        
        </div>
    </div>
    <div class="new-form-ui">
        <label class="required"><?php echo $this->form->date_of_joining_head->getLabel(); ;?> </label>
        <div class="division"><?php echo $this->form->date_of_joining_head; ?></div>
        <?php if(isset($this->msgarray['date_of_joining_head'])){?>
                 <span class="errors" id="errors-<?php echo $this->form->date_of_joining_head->getId(); ?>"><?php echo $this->msgarray['date_of_joining_head'];?></span>
        <?php }?>
    </div>

	<div class="new-form-ui textareaheight">
	  <label>Management Description </label>
	<div class="division"><?php echo $this->form->description; ?></div>
	  <?php if(isset($this->msgarray['description'])){?>
		   <span class="errors" id="errors-<?php echo $this->form->description->getId(); ?>"><?php echo $this->msgarray['description'];?></span>
	  <?php }?>
	</div>
		
<!-- end of organisation head details -->		
        
        
        
        
        
        <div class="new-form-ui-submit">
		<?php echo $this->form->submit; ?>
		<button onclick="closeiframepopup('organisationinfo','cancel');" type="button" >Cancel</button>
		</div>
</form>
</div>
<div id="countriesContainer"  style="display: none; overflow: auto;">
		<div class="heading">
			<a href="javascript:void(0)">
			<img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right"
				border="0" hspace="3" vspace="5" class="closeAttachPopup"
				style="margin: -24px 8px 0 0;"> </a>
		</div>

			<iframe id="countriesCont" class="business_units_iframe" frameborder="0"></iframe>

	</div>
<div id="prefixContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="prefixCont" class="business_units_iframe" frameborder="0"></iframe>
</div>

<div id="employmentstatusContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="employmentstatusCont" class="business_units_iframe" frameborder="0"></iframe>
</div>

<div id="jobtitlesContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="jobtitlesCont" class="business_units_iframe" frameborder="0"></iframe>
</div>

<div id="positionsContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="positionsCont" class="business_units_iframe" frameborder="0"></iframe>
</div>

<div id="statesContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="statesCont" class="business_units_iframe" frameborder="0"></iframe>
</div>  

<div id="citiesContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
	    <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> </a>
	</div>

	<iframe id="citiesCont" class="business_units_iframe" frameborder="0"></iframe>
</div>  
<div id="identitycodesContainer"  style="display: none; overflow: auto;">
    <div class="heading">
        <a href="javascript:void(0)">
            <img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right" border="0" hspace="3" vspace="5" class="closeAttachPopup" style="margin: -24px 8px 0 0;"> 
        </a>
    </div>
    <iframe id="identitycodesCont" name="identitycodesCont" class="business_units_iframe" frameborder="0"></iframe>
</div>  
<div id="organisationinfoContainer"  style="display: none; overflow: auto;">
	<div class="heading">
		<a href="javascript:void(0)">
		<img src="<?php echo $this->baseUrl().'/public/media/';?>images/close.png" name="" align="right"
			border="0" hspace="3" vspace="5" class="closeAttachPopup"
			style="margin: -24px 8px 0 0;"> </a>
	</div>

		<iframe id="organisationinfoCont" class="business_units_iframe" frameborder="0"></iframe>

</div>      
<script type="text/javascript">
    $(document).ready(function(){
      
    	var yearrange = <?php echo "'".YEAR.':'.(date('Y')+1)."'"; ?>;
		$('#date_of_joining_head').datepicker({
				showOn:'both',
				maxDate: new Date, 
				yearRange: yearrange,
				dateFormat: '<?php echo DATEFORMAT_JS;?>',
				buttonImage: "<?php echo $this->baseUrl("public/media/images/cal.jpg");?>",
				buttonImageOnly: true,
				buttonText: "",
				changeMonth: true,
				changeYear: true, 
                showButtonPanel: true ,
				onClose:function(){
                            from_to_date_validation_org('org_startdate','date_of_joining_head',this,'Date of joining should be greater than organization started on.');
					$('#date_of_joining_head').trigger('blur');
                    }
		});
	});//end of ready function			
</script>
