<?php
require './include/common.inc.php';

if(!$_userid) showmessage($LANG['please_login'], '/member/login.php?forward='.urlencode($PHP_URL));

$head['title'] = $LANG['promote_award'];
$head['keywords'] = $LANG['promote_award'];
$head['description'] = $LANG['promote_award'];

$page = $page ? intval($page) : 1;
$pagesize = $HS['pagesize'];
$offset = ($page-1)*$pagesize;
$r = $db->get_one("SELECT count(*) as num FROM ".TABLE_BILL." WHERE userid=$_userid");
$pages = phppages($r['num'], $page, $pagesize);

$bills = array(); 
$result = $db->query("SELECT * FROM ".TABLE_BILL." WHERE userid=$_userid LIMIT $offset,$pagesize");
while($r = $db->fetch_array($result))
{
	$r['addtime'] = date('Y-m-d H:i:s',$r['addtime']);
	$r['tgname'] = changestr($r['tgname']);
	$bills[] = $r;
}
function changestr($str)
{
  $len=strlen($str);
  $mystr1 = substr($str,0,1);
  $mystr2 = substr($str,$len-1,1);
  $mystr = $mystr1."******".$mystr2;
  return $mystr;
}
include template($mod, 'reflink');
?>