<?php
require('path.inc.php');
$member_id = $member->getAuthInfo('id');
$member_username = $member->getAuthInfo('username');

$innernote = new Innernote($query);

if($page->action == 'fromDel'){
	//删除
	$ids = $_POST['ids'];
	if(!is_array($ids) || empty($ids)){
		$page->back('没有选择删除条目');
	}
	array_walk($ids,'intval');
	try{
		$innernote->fromDel($ids);
		$page->goto('msgSend.php','删除成功');
	}catch (Exception $e){
		$page->back("删除失败，请重试");
	}
	exit;
}else{
	$page->name = 'msgSend';
	$where = " msg_from = '".$member_username."'";
	$where .=" and from_del = 0 ";
	
	require($cfg['path']['lib'] . 'classes/Pages.class.php');
	$pages = new Pages($innernote->getCount($where),15,'pages_g.tpl');
	$pageLimit = $pages->getLimit();
	$dataList = $innernote->getList($pageLimit,'*',$where,' order by add_time desc ');
	$page->tpl->assign('to_url', $_SERVER['REQUEST_URI']);
	$page->tpl->assign('dataList', $dataList);
	$page->tpl->assign('pagePanel', $pages->showCtrlPanel_g(5));//分页条
}
$page->show();
?>