<?php

/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */
if (!defined('__CORE_DIR')) {
    exit("Access Denied");
}

class Ctl_Ucenter_Message extends Ctl_Ucenter {


    public function index($page = 1) 
    {
        $this->tmpl = 'ucenter/msg/index.html';
    }
    public function msglist($page = 1)
    {
    	$filter = $pager = array();
    	$page = max((int) $this->GP('page'), 1);
    	$pager['limit'] = $limit = 10;
    	$filter['uid'] = $this->uid;
    	if (!$items = K::M('message/message')->items($filter, null, $page, $limit, $count)) {
    		$items= array();
    	}else{
    		foreach($items as $k => $v){
                $items[$k]['dateline'] = date('Y-m-d',$v['dateline']);
            }
    	}
    	 $this->pagedata['items'] = $items;
    	 $this->msgbox->set_data('data', array('items' => array_values($items)));
    }
}