<?php
if(!defined('DEDEINC')) exit('Request Error!');

if(!empty($_COOKIE['GUEST_BOOK_POS'])) $GUEST_BOOK_POS = $_COOKIE['GUEST_BOOK_POS'];
else $GUEST_BOOK_POS = "guestbook.php";

$id = intval($id);
if(empty($job)) $job='view';

if($job=='del')
{
	$dsql->ExecuteNoneQuery(" Delete From `#@__guestbook` where id='$id' ");
	ShowMsg("成功删除一条留言！",$GUEST_BOOK_POS);
	exit();
}
else if($job=='check' && $g_isadmin)
{
	$dsql->ExecuteNoneQuery(" update `#@__guestbook` set ischeck=1 where id='$id' ");
	ShowMsg("成功审核一条留言！",$GUEST_BOOK_POS);
	exit();
}
else if($job=='editok')
{

	$dsql->ExecuteNoneQuery("update `#@__guestbook` set `msg`='$msg',content='$content',ischeck='$ischeck',`posttime`='".time()."' where id='$id' ");
	//die("update `#@__guestbook` set `msg`='$msg',content='$content',ischeck='$ischeck',`posttime`='".time()."' where id='$id' ");
	ShowMsg("成功更改或回复一条留言！",$GUEST_BOOK_POS);
	exit();
}

	$row = $dsql->GetOne("select * from `#@__guestbook` where id='$id'");
	require_once('templets/guestbook-user.htm');

?>