<?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 $msgtitle = $this->controllername.'_delete';
sapp_Helper::editdeleteForView(EMPSCREENING,$this->controllername,$this->id,$msgtitle);?>
<?php if($this->ermsg == 'nodata') { ?>
<div class="ml-alert-1-info m1-info-set"><div class="style-1-icon info"></div>No data found.</div>
<?php } else  { ?>
<?php if(isset($this->messages['msgtype']) && isset($this->messages['message']))
{ ?>
	<div id="dispscreeningtype" class="settingssuccess">
		<?php 
				$flag = $this->messages['msgtype'];
				echo "<div id='messageData' class='ml-alert-1-$flag'><div style='display:block;'><span class='style-1-icon $flag'></span>";
				echo $this->messages['message'];
				echo "</div></div>";
		?>
	</div>	
	
<?php } 
 if(isset($_SESSION['emp_status']))
 {
	$back_str = '/con/'.$_SESSION['emp_status'];
	unset($_SESSION['emp_status']);
 }
 else 
 {
	$back_str = '';
	unset($_SESSION['emp_status']);
 }?>
<!--  <div id="error_message" style="display:none;"></div>-->

<div class="total-form-controller">
	<?php if(!empty($this->personalData)) 
	{ ?>
	<div class="new-form-ui inputheight">
		<label>Background Check Status</label>
		<div class="division new-division">			
			<select disabled>
				<option value="<?php echo $this->personalData[0]['backgroundchk_status'];?>"><?php echo $this->personalData[0]['backgroundchk_status'];?></option>
			</select>
		</div>
	</div>	
	<!--  <div class="new-form-ui-submit empedit-submit-setup">		
		<button onclick="window.location.href='<?php //echo BASE_URL; ?>empscreening<?php //echo $back_str;?>';" type="button" id="Cancel" name="Cancel">Cancel</button>
	</div>-->
<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
				$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 
	} ?>
	
     <?php if(!empty($this->personalData) && !empty($this->companyData)) { ?>
    
    <div class="all-grid-control mrgebtm mrgetop10">
          <div class="table-header"><span>Previous Company Details</span></div>
            <div class="details_data_display_block newtablegrid" 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 if(!empty($this->companyData)) 
                        { 
                            echo "<script type='text/javascript'>$('#compDetailsDiv').css('display','block');</script>";
							
                            for($i=0; $i < sizeof($this->companyData) ; $i++)
                            {
  							    $divid = $i+1;   
								echo ' <tr class="row1" id="company'.$divid.'">';                                                       
                                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>
	<?php } ?>
</div>

</div>
<?php 
if(sizeof($this->dataArray[0]['tablecontent'])>0) { 
if($this->call == 'ajaxcall'){
	$div = ''; $endDiv = ''; 
} else { 
	$div = '<div id="grid_'.$this->dataArray[0]['objectname'].'" class="all-grid-control">'; $endDiv = '</div>';
}
	echo $div.'<div id="msg" style="display:none;font-style: oblique; font-weight: bold; color: green;""></div>'.$this->grid($this->dataArray[0]).$endDiv;
}
?>

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

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

</div>

<div id="inprocessContainer"  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="statusinprocess" class="business_units_iframe" frameborder="0"></iframe>

</div>
<?php } ?>
<script type='text/javascript'>
$(document).ready(function() { 
 $('#process_table').slimScrollHorizontal({
	  alwaysVisible: false,
	  start: 'left',
	  position: 'bottom',
	 
	}).css({ background: '#ccc', paddingBottom: '10px' });
	
	
var spanText = $('.select2-choice > span').text();
if(spanText == 'Complete')
{
	$('.select2-choice > span').addClass('greendataClass');
}
/* Making window responsive*/
 	var complete_width = $('.emp-screen-view').width();
	$('#displayimg').css("width", "150");
	$('#personalDetailsDiv').css("width", (complete_width-(152)));	
		
	 function checkWidth() {
        var complete_width = $('.emp-screen-view').width();		
		$('#displayimg').css("width", "150");
		$('#personalDetailsDiv').css("width", (complete_width-(152)));		
    }
	$(window).resize(function() {
		checkWidth();
	}); 
/* END */
<?php if($this->inprocess == 'yes') { ?>
	$("body").append('<div id="blockingdiv" class="ui-widget-overlay ui-front"></div>');	
	$('#inprocessContainer').css('display','block');
	$('#statusinprocess').attr('src', <?php echo BASE_URL;?>+'empscreening/forcedfullupdate/specimenId/'+<?php echo $this->specimenId; ?>+'/empFlag/'+<?php echo $this->empFlag;?>);
	$(".closeAttachPopup").remove();
	window.parent.$('#inprocessContainer').dialog({
						close: function() {
						 $('#blockingdiv').remove(); 
						},
						title: 'Explanation'
					});
<?php } else if($this->inprocess == 'samebgstatus') {?>
	$('#error_message').css('display','block');
	$('#error_message').html('Please select different option');
<?php } ?>
});
</script>
