<?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->employessunderEmpId))
{ 
    $ishead = $this->ishead;
?>
<div>
    <div id="successmessagediv" style="display:none;"></div>
    <div class="ml-alert-1-info"><div class="style-1-icon info"></div>If a new reporting manager for <b><?php echo ucfirst($this->empName);?></b>'s team is not listed, please add him in HR > Employee > Add screen.</div>
    <div class="emp-position-set">
        <b class="emp-te">
            <?php 
            if($ishead == 1)
            {
                echo "Organisation head/Reaporting manager";
            }
            else 
            {
            ?>
            Reporting Manager
            <?php }?>
        </b>
        <select id="reporting_managerId" name="reporting_managerId">
            <option value=''>Select Employee</option>
<?php 	
            if(!empty($this->reportingmanagersList)) 
            { 
                foreach($this->reportingmanagersList as $opt)
                {
?>
                    <option value="<?php echo $opt['id'];?>" title="<?php echo $opt['profileimg'];?>" ><?php echo $opt['name'];?></option>
<?php 		} 
            }	?>
        </select>
		<span class="errors" id="errors-reporting_manager"></span>
    </div>
	<div class="employee-pic-popup-frame">
	<?php if(!empty($this->employessunderEmpId)) { 
		foreach($this->employessunderEmpId as $employee) { ?>
			<div class="employee-pic-popup-ctrl">
				<div class="employee-pic-popup">
					<?php
						if(empty($employee['profileimg'])) $employee['profileimg'] = "default-profile-pic.jpg";
					?>
					<img onerror="this.src='<?php echo DOMAIN."public/media/images/"; ?>default-profile-pic.jpg'" src="<?php echo DOMAIN."public/uploads/profile/".$employee['profileimg'];?>" id="userImage">
					<span title="<?php echo ucfirst($employee['userfullname']);?>">
                                            <?php echo strlen($employee['userfullname'])> 10?substr(ucfirst($employee['userfullname']),0,10)."...":ucfirst($employee['userfullname']);?>
                                        </span> 
				</div>
				
			</div>
	<?php }
		} 
	?>
	</div>
	<div class="new-form-ui-submit">
		<input id="rmchangebtn" name="rmchangebtn" type="button" value="Change" onclick="changereportingmanager('<?php echo $this->emp_id; ?>','<?php echo $this->status; ?>','<?php echo $this->ishead; ?>');"/>
	</div>
</div>
<?php 
} ?>