detail.php 2.09 KB
<?php 
require "function.php";

$url_img = "http://localhost/study-project/trunk/Message/attachment/";

$url = "http://localhost.vchangyi.org/E92B06237F00000150F5A2266E14186D/Message/Apicp/Message/Message/detail";
$message_id = $_GET['message_id'];


$postData = [
	'message_id'=>$message_id,
];

$message = curlPost($url,$postData);

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>留言列表</title>
    <style type="text/css">
    	table{
    		width: 500px;
    		margin: 50px auto;
    		border-spacing: 0px;
    		border-collapse: 0px;
    		border: solid #fff 1px
    	}
    	table tr td{
    		border: solid #000 1px
    	}
		
    </style>
</head>
<body>
	<h4 align="center">留言详情</h4>
    <table>
    	<tbody>
			
			<thead>
				<tr> <td>ID</td> <td>标题</td><td>内容</td> <td>留言者</td><td>接收人</td> </tr>
			</thead>
	    	<?php
	    		echo "<tr> <td>{$message['message_id']}</td> <td>{$message['title']}</td> <td>{$message['message']}</td><td>{$message['from']}</td><td>{$message['to']}</td></tr>";
	    	?>
	    </tbody>
    </table>

    <!-- <h4 align="center">留言附件信息</h4> -->
    <table>
    		<thead>
				<tr> <td>留言附件</td> </tr>
			</thead>
    		<tbody>
			
	    	<?php
	    		if (isset($message['attachment']) && $message['attachment']) {

	    			foreach ($message['attachment'] as $key => $img) {
	    				echo "<tr> <td><img src=\"" . $url_img . $img['path'] . "\"/></td></tr>";
	    			}
	    		}
	    	?>
	    	</tbody>
    </table>
	
	<!-- <h4 align="center">留言评论信息</h4> -->
    <table>
    	<tbody>
			
			<thead>
				<tr> <td>评论内容</td><td>评论用户</td> <td>时       间</td></tr>
			</thead>
	    	<?php
	    		if (isset($message['comment']) && $message['comment']) {

	    			foreach ($message['comment'] as $key => $comment) {
	    				$create_time = $comment['created']/1000;
	    				$create_time_str = date("Y-m-d H:i:s");

	    				echo "<td>{$comment['comment']}</td><td>{$comment['commenter']}</td><td>{$create_time_str}</td></tr>";
	    			}
	    		}
	    	?>
	    </tbody>
    </table>

</body>
</html>