<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="edit">
    <h3 style="position:relative;left:-185px;"><?php echo 'MESSAGES'; ?></h3>
	<hr style="margin-left:-190px;">
	  <div id="tabs" class="htabs">
			<a href="#tab-inbox">INBOX</a>
			<a href="#tab-send">SENT</a>
	  </div>
	  
	  
    <div class="content" id="tab-inbox" style="overflow:hidden;">
	<div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;	">
		<span style="position: relative; top: 8px;left:56px;">Date</span>
   </div>
   <div style="	border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px; left:45px;">From</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:300px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">Message</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">Action</span>
   </div>
   
        <?php if ($inboxmessages) { ?>
            <?php foreach ($inboxmessages as $inboxmessage) { ?>
   	<div style="margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:63px;margin-left:-27px;">
		<?php $originalDate = $inboxmessage['creation_date_time']; ?>
		<?php $newDate = date("d-M-Y", strtotime($originalDate)); ?>
		<?php echo $newDate; ?>
		</span>
   </div>
	<div style="margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:49px;"><?php echo $inboxmessage['from_name']; ?></span>
   </div>
	<div style="margin-bottom: 22px;width:300px;float:left;">
		<span style="position: relative; top: 8px;left:24px;"><?php echo $inboxmessage['body']; ?></span>
   </div>
	<div style="margin-bottom: 22px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:24px;">
		<a href="JavaScript:newPopup('http://www.tresorjewellery.com.au/replymessage/sendmessage.php?designer=<?php echo $desin_id; ?>&cust=<?php echo $inboxmessage['from_id']; ?>');"><img width="116px" height="25px" src="catalog/view/theme/default/image/clicktoreply.png"></a>
		</span>
   </div>
       <?php } ?>
            <?php } else { ?>
          <div style="height: 30px;margin-bottom: 5px;width:450px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">No Messages</span>
   </div> 
            <?php } ?>

    </div>
	
	<div class="content" id="tab-send">	

		<div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;	">
		<span style="position: relative; top: 8px;left:56px;">Date</span>
   </div>
   <div style="	border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px; left:45px;">From</span>
   </div>
   <div style="border:1px solid #EDEDED;height: 30px;border-radius:3px;box-shadow: -2px 8px 11px -8px grey;margin-bottom: 5px;width:450px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">Message</span>
   </div>
   
        <?php if ($messages) { ?>
            <?php foreach ($messages as $message) { ?>
   	<div style="margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:63px;margin-left:-27px;">
		<?php $originalDate = $message['creation_date_time']; ?>
		<?php $newDate = date("d-M-Y", strtotime($originalDate)); ?>
		<?php echo $newDate; ?>
		</span>
   </div>
	<div style="margin-bottom: 5px;width:150px;float:left;">
		<span style="position: relative; top: 8px;left:49px;"><?php echo $message['from_name']; ?></span>
   </div>
	<div style="margin-bottom: 22px;width:450px;float:left;">
		<span style="position: relative; top: 8px;left:24px;"><?php echo $message['body']; ?></span>
   </div>
       <?php } ?>
            <?php } else { ?>
          <div style="height: 30px;margin-bottom: 5px;width:450px;float:left;">
		<span style="position: relative; top: 8px;left:25px;">No Messages</span>
   </div> 
            <?php } ?>
	
	</div>
	

  </form>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 
<script type="text/javascript">
// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=300,width=500,left=260,top=160,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>