if(is_array($tables)){
foreach($tables as $key => $value){
$rows[$key]['id'] = $value->id;
$rows[$key]['tablename'] = $value->tablename;
$rows[$key]['descriptions'] = $value->descriptions;
$account = user_load($value->author);
$rows[$key]['author'] = $account->name;
$rows[$key]['create'] = date('Y-m-d H:i:s',$value->author);
$rows[$key]['caozuo'] = "<a href='".base_path()."show/tableinfo/".$value->tablename."'>查看详情</a>";
}
$header = array('序号','表名','描述','创建人','创建时间','查看详情');
$table = theme('table', array('header' => $header,'rows' => $rows ,'attributes' => array('class' => array('private-table'))));
return $table;
}else{
return $tables;
}