<?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 if(empty($this->empdata)){?>
     <div class="ml-alert-1-info m1-info-set">
				<div class="style-1-icon info"></div>
				<?php if($this->rowexist == 'norows'){?>
						No data found.
				<?php }else{?>
				Employee deleted
				<?php }?>
	</div>

<?php 
}
else
{
	if(!empty($this->employeedata))
	 {
		echo $this->employeedetails($this->employeedata,'myemployees',$this->id); 
	 }
	
?>
<div class="right-block-data right-over-border"> 
	<div id="error_message" style="display:none;"></div>
	
            <input type="hidden" name="tmp_emp_name" id="tmp_emp_name" />
		<?php  echo $this->form->id; ?><?php echo $this->form->user_id; ?>
		<?php 
	$employeeId = $this->form->employeeId->getValue();
	$firstname = $this->form->firstname->getValue();
	$lastname = $this->form->lastname->getValue();
	$modeofEntry = $this->form->modeofentry->getValue();
	$candReferedby = $this->form->candidatereferredby->getValue();
	$rccandidatename = $this->form->rccandidatename->getValue();
	$othermodeOfEntry = $this->form->other_modeofentry->getValue();
	$emprole = $this->form->emprole->getValue();
	$emailaddress = $this->form->emailaddress->getValue();
	$dateOfJoining = $this->form->date_of_joining->getValue();
	$dateOfLeaving = $this->form->date_of_leaving->getValue();
	$years_exp = $this->form->years_exp->getValue();
	$office_number = $this->form->office_number->getValue();
	$extension_number = $this->form->extension_number->getValue();
	$office_faxnumber = $this->form->office_faxnumber->getValue();
				sapp_Helper::viewHeader();
				sapp_Helper::viewBody('nor', $this->form->employeeId->getLabel(),(!empty($employeeId))?$this->form->employeeId->getValue():"...", $this->form->prefix_id->getLabel(),(!empty($this->data['prefix_id']))?$this->data['prefix_id']:"...");
                sapp_Helper::viewBody('alt', $this->form->firstname->getLabel(),(!empty($firstname))?$this->form->firstname->getValue():"...", $this->form->lastname->getLabel(),(!empty($lastname))?$this->form->lastname->getValue():"...");				
				 sapp_Helper::viewBody('nor',$this->form->modeofentry->getLabel(),(!empty($modeofEntry))?$this->form->modeofentry->getValue():"...",'','');
                ?>
				
				<div  id="iddiv_referredby" style="display:none;">
                <?php
                sapp_Helper::viewBody('alt',$this->form->candidatereferredby->getLabel(),(!empty($candReferedby))?$this->form->candidatereferredby->getValue():"...",'','');
 
                ?>				
                 </div> 
                 <div  id="iddiv_canditatename">				 
				<?php
                sapp_Helper::viewBody('nor', $this->form->rccandidatename->getLabel(),(!empty($rccandidatename))?$this->form->rccandidatename->getValue():"...",'','');
 
                ?>					
				</div>
				<div id="iddiv_otherentry" style="display:none">
			    <?php
                sapp_Helper::viewBody('alt',$this->form->other_modeofentry->getLabel(), (!empty($othermodeOfEntry))?$this->form->other_modeofentry->getValue():"...",'','');
 
                ?>	
				 </div>
				 <div id="iddivrequi" style="display:none">
				 <?php
				 if(isset($data['requisition_code']))
                sapp_Helper::viewBody('nor','Requisition code',(!empty($this->data['requisition_code']))?$this->data['requisition_code']:"..." ,'','');
                  
                ?>	
                </div>
                <?php
				sapp_Helper::viewBody('alt',$this->form->emprole->getLabel(), (!empty($emprole))?$this->form->emprole->getValue():"...",$this->form->emailaddress->getLabel(),(!empty($emailaddress))?$this->form->emailaddress->getValue():"...");
		        
					
				sapp_Helper::viewBody('nor','Business Unit',(!empty($this->data['businessunit_id']))?$this->data['businessunit_id']:"...",'Department',(!empty($this->data['department_id']))?$this->data['department_id']:"...");
				sapp_Helper::viewBody('alt','Reporting Manager',(!empty($this->data['reporting_manager']))?$this->data['reporting_manager']:"...",'','');
				
			    sapp_Helper::viewBody('nor','Job Title',(!empty($this->data['jobtitle_id']))?$this->data['jobtitle_id']:"...",'Position ',(!empty($this->data['position_id']))?$this->data['position_id']:"...");
				
				sapp_Helper::viewBody('alt','Employment Status',(!empty($this->data['emp_status_id']))?$this->data['emp_status_id']:"...",'','');
				
				sapp_Helper::viewBody('nor','Date of Joining',(!empty($dateOfJoining))?$this->form->date_of_joining->getValue():"...",'','');
				
				sapp_Helper::viewBody('alt','Date of Leaving',(!empty($dateOfLeaving))?$this->form->date_of_leaving->getValue():"...",'','');
				
				sapp_Helper::viewBody('nor','Years of Experience',(!empty($years_exp))?$this->form->years_exp->getValue():"...",$this->form->office_number->getLabel(),(!empty($office_number))?$this->form->office_number->getValue():"...");
				
				sapp_Helper::viewBody('alt',$this->form->extension_number->getLabel(),(!empty($extension_number))?$this->form->extension_number->getValue():"...",$this->form->office_faxnumber->getLabel(),(!empty($office_faxnumber))?$this->form->office_faxnumber->getValue():"...");
				
				sapp_Helper::viewFooter();
			   ?>
</div>
 </div>    


<script type='text/javascript'>
$(document).ready(function(){

   $("#empdetails").addClass('active');
    $("#empdetails").removeAttr("onclick");
    
 
<?php 
    if($this->form->id->getValue() != '')
    {
?>     
     
        var val = '<?php echo $this->form->modeofentry->getValue();?>';
        if(val == 'Direct')
        {
            $('#iddiv_fullname').show();
            $('#rccandidatename').val('');
            $('#iddiv_canditatename').hide();            
        }
        else if(val == 'Reference')
        {
            $('#iddiv_referredby').show();
            $('#iddiv_fullname').hide();
            //$('#userfullname').val('');
            $('#firstname').val('');
            $('#lastname').val('');
            $('#iddiv_canditatename').show();        
        }
        else if(val == 'Other')
        {
            $('#iddiv_canditatename').show();            
            $('#iddiv_otherentry').show();    
            $('#candidatereferredby').val('');                        
            //$('#userfullname').val('');
            $('#firstname').val('');
            $('#lastname').val('');
            $('#iddiv_referredby').hide();
            $('#iddiv_fullname').hide();            
        }
        else 
        {
            $('#iddiv_canditatename').show();
            $('#candidatereferredby').val('');
            //$('#userfullname').val('');
            $('#firstname').val('');
            $('#lastname').val('');
            $('#iddiv_referredby').hide();
            $('#iddiv_fullname').hide();           
        }
        
<?php         
    }
?>
});//end of ready function
</script>
<?php } ?>