<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[23]!=1)
  jump("jump.php?id=25&jump=main.php");
$phpcolor->table="user_code";
if(isset($_GET['action']) and $_GET['action'] == "del" and isset($_GET['id']))
{
  $phpcolor->field="*";
  $phpcolor->where="id='".$_GET['id']."'";
  $phpcolor->delete();
  jump("jump.php?id=24&jump=user_code.php");
}
if(!isset($_GET['page']))
  $_GET['page']=0;
$phpcolor->field="*";
$phpcolor->where="1=1";
$count = $phpcolor->exist(2);
$phpcolor->where="1=1 order by time desc limit ".($_GET['page']*30).",30";
$usercode=$phpcolor->assignment();
$page=pages($count,'30',$_GET['page'],'user_code','','','0');
for ($count=0;$count<count($usercode);$count++)
{
  if($usercode[$count]['uid']!="0")
  {
    $phpcolor->table="user";
    $phpcolor->field="username";
    $phpcolor->where="id='".$usercode[$count]['uid']."'";
    $user=$phpcolor->exist(1);
	$usercode[$count]['username']=$user['username'];
  }
  else
    $usercode[$count]['username']="ÉÐÎ´Ê¹ÓÃ";
}
$tpl -> assign("usercode", $usercode);
$tpl -> assign("page", $page);
$tpl -> display("user_code.htm");
?>