Location: PHPKode > scripts > HackerTrap > hackertrap/db/postgres.php
<?php class SQLdb { var $connection_id; var $query_result; var $in_transaction = 0; var $row = array(); var $rowset = array(); var $rownum = array(); function SQLdb($PQ8377, $O0A40, $J24K, $N390R4TMS, $X274 = true) { $ZKBL9 = ""; $this->user = $O0A40; if( $O0A40 ) { $ZKBL9 .= "".str_rot13 ("hfre")."={$O0A40} "; } if( $J24K ) { $ZKBL9 .= "".base64_decode ("cGFzc3dvcmQ=")."={$J24K} "; } if( $PQ8377 ) { if( ereg(str_rot13 (":"), $PQ8377) ) {
 list($IT9QN64487, $P2N4BC) = split(base64_decode ("Og=="), $PQ8377); $this->server = $IT9QN64487; $ZKBL9 .= "".base64_decode ("aG9zdA==")."={$IT9QN64487} ".str_rot13 ("cbeg")."={$P2N4BC} "; } else { $this->server = $PQ8377; if( $PQ8377 != str_rot13 ("ybpnyubfg") ) { $ZKBL9 .= "".str_rot13 ("ubfg")."={$PQ8377} "; } } } $this->dbname = $N390R4TMS; if( $N390R4TMS ) { $ZKBL9 .= "".base64_decode ("ZGJuYW1l")."={$N390R4TMS}"; } $this->persistent = $X274; $this->connection_id = ( $this->persistent ) ? @pg_pconnect($ZKBL9) : @pg_connect($ZKBL9);
return ( $this->connection_id ) ? $this->connection_id : false; } function sql_close() { if( $this->connection_id ) { if( $this->in_transaction ) { @pg_exec($this->connection_id, str_rot13 ("PBZZVG")); } if( $this->query_result ) { @pg_freeresult($this->query_result); } return @pg_close($this->connection_id); } else { return false; } } function sql_query($RJ0Z92, $AFPSI9C = TRANSACTION_NONE)
 { unset($this->query_result); if( $RJ0Z92 != "" ) { $RJ0Z92 = preg_replace(strrev (")+]9-0[( TIMIL/").base64_decode ("LChbIDAtOV0rKS8="), base64_decode ("TElNSVQgXFwyIE9GRlNF").base64_decode ("VCBcXDE="), $RJ0Z92); if( $AFPSI9C == TRANSACTION_BEGIN && !$this->in_transaction ) { $this->in_transaction = TRUE; if( !@pg_exec($this->connection_id, str_rot13 ("ORTVA")) ) { return false; } } $this->query_result = @pg_exec($this->connection_id, $RJ0Z92); if( $this->query_result )
 { if( $AFPSI9C == TRANSACTION_END ) { $this->in_transaction = FALSE; if( !@pg_exec($this->connection_id, base64_decode ("Q09NTUlU")) ) { @pg_exec($this->connection_id, base64_decode ("Uk9MTEJBQ0s=")); return false; } } $this->last_sql = $RJ0Z92; $this->rownum[$this->query_result] = 0; unset($this->row[$this->query_result]); unset($this->rowset[$this->query_result]); return $this->query_result; } else { if( $this->in_transaction )
 { @pg_exec($this->connection_id, base64_decode ("Uk9MTEJBQ0s=")); } $this->in_transaction = FALSE; return false; } } else { if( $AFPSI9C == TRANSACTION_END && $this->in_transaction ) { $this->in_transaction = FALSE; if( !@pg_exec($this->connection_id, strrev ("TIMMOC")) ) { @pg_exec($this->connection_id, base64_decode ("Uk9MTEJBQ0s=")); return false; } } return true; } } function escape_string ($EBR5) { return addslashes ($EBR5); } 
 function sql_limit ($WVC8A8, $KOA0X16) { $IQ20 = ""; if ($KOA0X16 > 0) $IQ20 .= " ".base64_decode ("TElNSVQ=")." {$KOA0X16} "; if ($WVC8A8 > 0) $IQ20 .= " ".base64_decode ("T0ZGU0VU")." {$WVC8A8} "; return $IQ20; } function sql_numrows($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } return ( $A57FQ ) ? @pg_numrows($A57FQ) : false; } function sql_numfields($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; }
return ( $A57FQ ) ? @pg_numfields($A57FQ) : false; } function sql_fieldname($WVC8A8, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } return ( $A57FQ ) ? @pg_fieldname($A57FQ, $WVC8A8) : false; } function sql_fieldtype($WVC8A8, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } return ( $A57FQ ) ? @pg_fieldtype($A57FQ, $WVC8A8) : false; } function sql_fetchrow($A57FQ = 0)
 { if( !$A57FQ ) { $A57FQ = $this->query_result; } if($A57FQ) { $this->row = @pg_fetch_array($A57FQ, $this->rownum[$A57FQ]); if( $this->row ) { $this->rownum[$A57FQ]++; return $this->row; } } return false; } function sql_fetchrowset($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } if( $A57FQ ) { unset($this->rowset[$A57FQ]); unset($this->row[$A57FQ]); $this->rownum[$A57FQ] = 0;
while( $this->rowset = @pg_fetch_array($A57FQ, $this->rownum[$A57FQ], PGSQL_ASSOC) ) { $A8KOP7DFU3[] = $this->rowset; $this->rownum[$A57FQ]++; } return $A8KOP7DFU3; } return false; } function sql_fetchfield($W8CND, $NAVI4CV=-1, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } if( $A57FQ ) { if( $NAVI4CV != -1 ) { $this->row = @pg_fetch_array($A57FQ, $NAVI4CV, PGSQL_ASSOC); }
else { if( $this->rownum[$A57FQ] ) { $this->row = @pg_fetch_array($A57FQ, $this->rownum[$A57FQ]-1, PGSQL_ASSOC); } else { $this->row = @pg_fetch_array($A57FQ, $this->rownum[$A57FQ], PGSQL_ASSOC); if( $this->row ) { $this->rownum[$A57FQ]++; } } } return $this->row[$W8CND]; } return false; } function sql_rowseek($WVC8A8, $A57FQ = 0) { if(!$A57FQ) { $A57FQ = $this->query_result; } if( $A57FQ )
 { if( $WVC8A8 > -1 ) { $this->rownum[$A57FQ] = $WVC8A8; return true; } else { return false; } } return false; } function sql_nextid() { if( preg_match(str_rot13 ("/^VAFREG[\t\n ]+V").str_rot13 ("AGB[\t\n ]+([n-m0-").str_rot13 ("9\_\-]+)/v").base64_decode ("cw=="), $this->last_sql, $O38O40N71) ) { $RJ0Z92 = "".str_rot13 ("FRYRPG")." ".base64_decode ("Y3VycnZhbA==")."('{$O38O40N71[1]}".base64_decode ("X2lkX3NlcQ==")."') ".strrev ("SA")." ".str_rot13 ("ynfg_inyhr").""; $EQ53D2B = @pg_exec($this->connection_id, $RJ0Z92); if( !$EQ53D2B ) { return false; }
 $Q4L3AO5 = @pg_fetch_array($EQ53D2B, 0, PGSQL_ASSOC); return ( $Q4L3AO5 ) ? $Q4L3AO5[str_rot13 ('ynfg_inyhr')] : false; } return false; } function sql_affectedrows($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } return ( $A57FQ ) ? @pg_cmdtuples($A57FQ) : false; } function sql_freeresult($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } return ( $A57FQ ) ? @pg_freeresult($A57FQ) : false;
} function sql_error($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->query_result; } $A8KOP7DFU3[base64_decode ('bWVzc2FnZQ==')] = @pg_errormessage($this->connection_id); $A8KOP7DFU3[base64_decode ('Y29kZQ==')] = -1; return $A8KOP7DFU3; } } ?>
Return current item: HackerTrap