<?php
if(!defined('IN_ADMIN')) exit('Access Denied');
if($_SESSION["admin"]!="NewsTeng")showmessage('ÇëµÇÂ½', SCRIPT_NAME.'?file=login');
@set_time_limit(0);
require_once TM_ROOT.'include/order.class.php';
$order = new order();
if(!isset($action)) $action = 'list';
switch ($action){
    case 'list':
    	$page = max(intval($page), 1);
    	$page_size = 15;
    	$r = $db->get_one("SELECT count(*) as num FROM ".DB_PRE."guestbook");
    	$mpurl =SCRIPT_NAME.'?file=guest&action=list&';
    	$dispage =  page($r['num'],$page_size,$page,$mpurl);
      	$n = $order->listinfo('', 'id DESC', $page, $page_size);
        include admin_tpl('order');
	break;
	case 'look':
        	$ns = $order->get(intval($id)); 
            include admin_tpl('order');
	break;
	case 'del':
		$u = $order->del(intval($id));
	    if(!$u){
	    	showmessage('É¾³ýÊ§°Ü£¡', 'goback');
	    }
	    showmessage('É¾³ý³É¹¦£¡', 'goback');
	break;
}
?>