
<?php  
$owner_profileId = $this->Session->read('owner_profileId');
?>
<div class="blocktitle"> Profile <?php //echo ucwords($profiles['Profile']['fullname']);?></div>
<?php if($owner_profileId==$profiles['Profile']['id']){
	?>

<?php }else{?>
<div>
    <div class="" style="padding:2px 1px; display:block; float:right;"><?php echo $this->Html->link("Edit",array('action'=>'edit',base64_encode($profiles['Profile']['id'])),array('style'=>'display:block;','class'=>'btn btn-mini'))?></div>
</div>
<?php }?>
<hr style="margin-top: 36px;"/>
<?php echo $this->Html->script(array('site_js/searchfriend')); ?>
<?php 
	 if(!empty($frReqInfo)): 
	 	if($frReqInfo[0]['FR']['requestFrom'] == $profiles['Profile']['id']){ 
	 	$FRrequestFrom = $frReqInfo[0]['FR']['requestFrom'];
	 	$FRrequestTo = $frReqInfo[0]['FR']['requestTo'];
	 	$FRid = $frReqInfo[0]['FR']['id'];   
	 	$fun = "<div id='data_".$FRid."'><div class='btn btn-mini' style='margin-left:20px;margin-right: 5px;margin-top:10px;' onclick='acptR(". $FRrequestFrom .",". $FRrequestTo .",". $FRid . ")'><b>Accept</b></div><div class='btn btn-mini' style='width: 54px; margin-top:10px;'><b onclick='dd(" . $FRid .")'>Deny</b></div></div>";
	 	}else{ 
	 		$fun = "<div class='btn btn-small' style=' width:164px; padding:3px 0px; display:block;margin-top:10px;margin-left:10px;'>Friend Request Sent</div>";
	 	}
	 	
	 elseif (!empty($friendInfo)):
	 	
	 	$fun = "<div class='btn btn-small' id='df' onclick ='removeFriend(".$profiles['Profile']['id'].");' style='width:164px; padding:3px 0px; display:block; margin-top:10px;margin-left:10px;'>Delete Friend</div>";
	
	 else:
		 $fun = "<div class='btn btn-small' id='rf' onclick='friendrequest(".$profiles['Profile']['id'].");'style='width:164px; padding:3px 0px; display:block; margin-top:10px;margin-left:10px;'>Add Friend</div>";
	 endif;
?>



<div class="w97p pdl10 profile-display">
    
<div class="row-fluid">
	<div class="span3 mrt20">
		
		<div id="files">
			<?php if(!empty($profiles['Profile']['link1'])){?>			
			<img src="<?php echo $profiles['Profile']['link1'];?>" width="164px" style="margin-left:10px;">
			<?php }else {
				echo $this->Html->image('profile.jpg',array('style'=>'width:164px; margin-left: 7px;'));
			}?>			
		</div>
		<?php 
			if(!empty($owner_profileId)){
				echo $fun
				?>
		<?php }else {?>
			<!-- <div id="me" class="btn btn-small">Upload Picture</div> -->
			
			<?php }?>
	</div>
	<div class="span9 tbltxtcol mrt10">
		 <?php //$counties=mysql_fetch_array($result)
               //	pr($profiles);
               	?>
		<table class="table" style="font-size:14px; border: none;">
                    <tr style="border: none;">
				<td style="border: none;">Name</td><td style="border: none;">:</td><td style="border: none;"><?php echo ucwords($profiles['Profile']['fullname']);?></td>
			</tr>
			<?php if (!empty($friendInfo) || $profiles['User']['id']==$loggedUser['id']){?>
			<tr style="border: none;">
				<td style="border: none;">Email</td><td style="border: none;">:</td><td style="border: none;"><?php echo $profiles['User']['username']?></td>
				
			</tr>
			
			<tr style="border: none;">
				<td style="border: none;">Phone </td><td style="border: none;">:</td><td style="border: none;"><?php echo $profiles['Profile']['phone']?></td>
			</tr>
			<?php }?>
			<tr style="border: none;">
				<td style="border: none;">Gender </td><td style="border: none;">:</td><td style="border: none;"><?php echo (isset($gender[$profiles['Profile']['gender']]) ? $gender[$profiles['Profile']['gender']] : '');?></td> 
			</tr>
			<?php if (!empty($friendInfo) || $profiles['User']['id']==$loggedUser['id']){?>
			<tr style="border: none;">
				<td style="border: none;">Date of Birth </td><td style="border: none;">:</td><td style="border: none;">
					<?php echo $profiles['Profile']['dob'] ? date('m-d-Y',strtotime($profiles['Profile']['dob'])) : '' ?>
				</td>
			</tr>
			<?php }?>
			<tr style="border: none;">
				<td style="border: none;">Country </td><td style="border: none;">:</td><td style="border: none;"><?php echo $countries[$profiles['Profile']['country_id']]?></td>
			</tr>
			<tr style="border: none;">
				<td style="border: none;">About me </td><td style="border: none;">:</td><td style="text-align: justify; border: none;"><?php echo $profiles['Profile']['aboutMe']?></td>
			</tr>
		</table>
		
		
	</div>
</div>
</div>





