<?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->messages)) {
?>
<div id="dispmsgemp" class="settingssuccess">
<?php
	$flag = array();				
	foreach ($this->messages as $message)
	{
		$flag = array_keys($message);
		echo "<div id='messageData' class='ml-alert-1-$flag[0]'><div style='display:block;'><span class='style-1-icon $flag[0]'></span>";
		echo $message[$flag[0]];
		echo "</div></div>";
	}
?>
</div>	
<?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 {
	echo $this->employeedetails($this->employeedata,'mydetails',$this->id);
?>

<script type="text/javascript" src="<?php echo MEDIA_PATH;?>js/jquery.uploadfile.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo MEDIA_PATH; ?>css/uploadfile.css" />
    
    <script type="text/javascript" src="<?php echo MEDIA_PATH;?>js/jquery.prettyPhoto.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo MEDIA_PATH; ?>css/prettyPhoto.css" />
	<div class="right-block-data no_selection">
			<div id="error_message" style="display:none;"></div>
	<div style="margin-left: 0px; padding-top: 0px; padding-bottom: 20px;  float: none;" class="cofig_title"> Assets
			<div style="margin-top: 0px; float: right; width: auto;" class="new-form-ui-submit ">
			</div>
    </div>
         <div class="newtablegrid">
	 <table width="20%" cellspacing="0" cellpadding="0" border="0" class="grid">
      <?php 
		 if(count($this->userassetdata) > 0){
		 	$i = 0;
		 	?>   
       <thead>
       	<tr>
         <th align="center" >Asset Name</th>
         <th align="center" >Allocated date</th>
       </tr>
       </thead>  
         <tbody>
         <?php 
		 	foreach($this->userassetdata as $user_asset){
    	  ?>
    	  <tr class="row1">
          <td align="right" ><?php echo $user_asset['name'];?></td>
		  <td align="right" ><?php echo sapp_Global::change_date($user_asset['created'],'assetdetailsview');?></td>
		  
        </tr>
         <?php }?> 
		 <?php 
		 $i++;
 		}else{	
 		?>
 		 <div class="ml-alert-1-info m1-info-set">
				<div class="style-1-icon info"></div>
 					Assets not assigned yet.
 	     </div>				
        <?php }?> 
 	
         
      </tbody>
  </table>
  </div>
</div>
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
  
    $("#assetdetails").addClass('active');
	$("#assetdetails").removeAttr("onclick");

});//end of ready function

</script>
	
  <?php } ?>

