<?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($this->hrEmail == 'false' && $this->mngmntEmail == 'false'){?>
		<div class="ml-alert-1-info m1-info-set"><div class="style-1-icon info"></div>Emails will not work as the HR and Management group emails are not configured.</div>
	<?php }else if($this->hrEmail == 'false'){?>
		<div class="ml-alert-1-info m1-info-set"><div class="style-1-icon info"></div>Email will not work as the HR group email is not configured.</div>
	<?php }else if($this->mngmntEmail == 'false') { ?>
		<div class="ml-alert-1-info m1-info-set"><div class="style-1-icon info"></div>Email will not work as the Management email is not configured.</div>
	<?php } ?>
<div class="all-bg-ctrl">
	<div class="emp-screen-view">
        <div class="display-img-div" id='displayimg' style="display:none;">
            <div class="employee-pic chg-img">
                <img id="userImage" src="<?php echo DOMAIN; ?>public/media/images/employee-deafult-pic.jpg" />				
            </div>
			<div id="loaderimg" style="display:none; clear:both; margin:0 auto; text-align: center; width:100%;">
            	<img src="<?php echo $this->baseUrl("public/media/images/loaderwhite_21X21.gif");?>" style="width:21px; height: 21px; float: none; "/></div>			
	        </div>

       <div id="personalDetailsDiv">

		<?php if(!empty($this->personalData)) 
		{ 
			$pfimage = '';
			if(isset($this->personalData[0]['profileImage'])) $pfimage = $this->personalData[0]['profileImage'];
			if($pfimage != '')
			{
				echo "<script type='text/javascript'>
				  $('#userImage').attr('src','".$this->baseUrl()."/public/uploads/profile/$pfimage');
				  $('#displayimg').css('display','block');</script>";
			}else{
				echo "<script type='text/javascript'>
				  $('#displayimg').css('display','block');</script>";
			}
			if(isset($this->personalData[0]['name'])) echo '<p><b>Name <i>:</i></b><span class="emp-name-span">'.$this->personalData[0]['name'].'</span></p>';
			if(isset($this->personalData[0]['email'])) echo '<p><b>Email Id <i>:</i></b><span><a>'.$this->personalData[0]['email'].'</a></span></p>';
			if(isset($this->personalData[0]['contactnumber'])) echo '<p><b>Contact Number <i>:</i></b><span>'.$this->personalData[0]['contactnumber'].'</span></p>';
			if(!empty($this->addressData))
			{
				if(isset($this->addressData[0]['location']))echo '<p><b>Address <i>:</i></b><span><u>'.htmlspecialchars($this->addressData[0]['location']).',</u>';
				if(isset($this->addressData[0]['ccity'])) echo '<u>'.$this->addressData[0]['ccity'].',</u>';				
				if(isset($this->addressData[0]['cstate'])) echo '<u>'.$this->addressData[0]['cstate'].',</u>';
				if(isset($this->addressData[0]['ccountry'])) echo '<u>'.$this->addressData[0]['ccountry'].'</u>';
				if(isset($this->addressData[0]['pincode'])) echo '<u> - '.$this->addressData[0]['pincode'].'</u></span></p>';
			}
			if(isset($this->personalData[0]['ustatus']))
			{
				if($this->personalData[0]['ustatus'] == 'Active')
					echo '<p><b>Status <i>:</i></b><span class="emp-name-span">'.$this->personalData[0]['ustatus'].'</span></p>';
				else
					echo '<p><b>Status <i>:</i></b><span style="color:red;" class="emp-name-span">'.$this->personalData[0]['ustatus'].'</span></p>';
			}
		} ?>
		</div>
	</div>
	<?php if(!empty($this->personalData) && !empty($this->companyData)) { ?>
	<div id="compDetailsDiv" style="padding-top:10px;"><!--<span id="Compseparator" style="display:none;" class="separetor-heading">Current Company Details</span>-->
		<div class="all-grid-control mrgebtm">
			  <div class="table-header"><span>Previous Company Details</span></div>
				<div class="details_data_display_block newtablegrid"  id='process_table' style="overflow: hidden; height: auto; background: none repeat scroll 0% 0% rgb(204, 204, 204); padding-bottom: 10px; width: 250px;">
				<table width="100%" cellspacing="0" cellpadding="4" border="0" align="center" class="grid">
						<thead>
							<tr>
								<th style="cursor:default;">Company Name</th>
								<th style="cursor:default;">Website</th>
								<th style="cursor:default;">Designation</th>
								<th	style="cursor:default;">From Date</th>
								<th style="cursor:default;">To Date </th>
							</tr>
						</thead>
						<tbody>
							<?php
								for($i=0; $i < sizeof($this->companyData) ; $i++)
								{
									$divid = $i+1;
									echo "<tr id='company".$divid."' class='row1'>";
									echo '<td>'.$this->companyData[$i]['companyname'].'</td>';
									echo '<td>'.$this->companyData[$i]['companywebsite'].'</td>';
									echo '<td>'.$this->companyData[$i]['designation'].'</td>';
									echo '<td>'.$this->companyData[$i]['fromdate'].'</td>';
									echo '<td>'.$this->companyData[$i]['todate'].'</td>';								
									echo "</tr>";
								}
							?>
						</tbody>
				</table>				
			   </div>
		</div>
	</div>
	<?php } ?>
</div>