Location: PHPKode > scripts > HackerTrap > hackertrap/db/mssql-odbc.php
<?php class SQLdb { var $connection_id; var $result; var $next_id; var $num_rows = array(); var $current_row = array(); var $field_names = array(); var $field_types = array(); var $result_rowset = array(); function SQLdb($PQ8377, $O0A40, $J24K, $N390R4TMS, $X274 = true) { $this->persistent = $X274; $this->server = $PQ8377; $this->user = $O0A40; $this->password = $J24K; $this->dbname = $N390R4TMS;
$this->connection_id = ($this->persistent) ? odbc_pconnect($this->server, $this->user, $this->password) : odbc_connect($this->server, $this->user, $this->password); return ( $this->connection_id ) ? $this->connection_id : false; } function sql_close() { if($this->connection_id) { if( $this->in_transaction ) { @odbc_commit($this->connection_id); } if( count($this->result_rowset) ) { unset($this->result_rowset);
unset($this->field_names); unset($this->field_types); unset($this->num_rows); unset($this->current_row); } return @odbc_close($this->connection_id); } else { return false; } } function sql_query($RJ0Z92, $AFPSI9C = TRANSACTION_NONE) { if( $RJ0Z92 != "" ) { if( $AFPSI9C == TRANSACTION_BEGIN && !$this->in_transaction ) { if( !odbc_autocommit($this->connection_id, false) ) { return false;
} $this->in_transaction = TRUE; } if( preg_match("/^".base64_decode ("U0VMRUNU")."(.*?)(".str_rot13 ("YVZVG")." ([0-9]+)[, ]*([0-9]+)*)?$/".base64_decode ("cw==")."", $RJ0Z92, $N9336O9P2E) ) { $RJ0Z92 = $N9336O9P2E[1]; if( !empty($N9336O9P2E[2]) ) { $NAVI4CV = ( $N9336O9P2E[4] ) ? $N9336O9P2E[3] : ""; $IGP11I = ( $N9336O9P2E[4] ) ? $N9336O9P2E[4] : $N9336O9P2E[3]; $RJ0Z92 = str_rot13 ("GBC ") . ( $NAVI4CV + $IGP11I ) . $RJ0Z92; } $this->result = odbc_exec($this->connection_id, "".base64_decode ("U0VMRUNU")." $RJ0Z92"); 
 if( $this->result ) { if( empty($this->field_names[$this->result]) ) { for($G06C = 1; $G06C < odbc_num_fields($this->result) + 1; $G06C++) { $this->field_names[$this->result][] = odbc_field_name($this->result, $G06C); $this->field_types[$this->result][] = odbc_field_type($this->result, $G06C); } } $this->current_row[$this->result] = 0; $this->result_rowset[$this->result] = array(); $T43C9LH35S = ( isset($NAVI4CV) ) ? $NAVI4CV + 1 : 1;
$T8695487 = ( isset($IGP11I) ) ? $NAVI4CV + $IGP11I + 1 : 1E9; $NH4C = 0; while( odbc_fetch_row($this->result, $T43C9LH35S) && $T43C9LH35S < $T8695487 ) { for($CI6L8K = 0; $CI6L8K < count($this->field_names[$this->result]); $CI6L8K++) { $this->result_rowset[$this->result][$NH4C][$this->field_names[$this->result][$CI6L8K]] = stripslashes(odbc_result($this->result, $CI6L8K + 1)); } $T43C9LH35S++;
$NH4C++; } $this->num_rows[$this->result] = count($this->result_rowset[$this->result]); } } else if( eregi(base64_decode ("XklOU0VSVCA="), $RJ0Z92) ) { $this->result = odbc_exec($this->connection_id, $RJ0Z92); if( $this->result ) { $P14A9 = odbc_exec($this->connection_id, base64_decode ("U0VMRUNUIEBASURFTlRJ").str_rot13 ("GL")); if( $P14A9 ) { if( odbc_fetch_row($P14A9) ) { $this->next_id[$this->connection_id] = odbc_result($P14A9, 1); $this->affected_rows[$this->connection_id] = odbc_num_rows($this->result);
} } } } else { $this->result = odbc_exec($this->connection_id, $RJ0Z92); if( $this->result ) { $this->affected_rows[$this->connection_id] = odbc_num_rows($this->result); } } if( !$this->result ) { if( $this->in_transaction ) { odbc_rollback($this->connection_id); odbc_autocommit($this->connection_id, true); $this->in_transaction = FALSE; } return false; } if( $AFPSI9C == TRANSACTION_END && $this->in_transaction )
 { $this->in_transaction = FALSE; if ( !odbc_commit($this->connection_id) ) { odbc_rollback($this->connection_id); odbc_autocommit($this->connection_id, true); return false; } odbc_autocommit($this->connection_id, true); } odbc_free_result($this->result); return $this->result; } else { if( $AFPSI9C == TRANSACTION_END && $this->in_transaction ) { $this->in_transaction = FALSE; if ( !@odbc_commit($this->connection_id) )
 { odbc_rollback($this->connection_id); odbc_autocommit($this->connection_id, true); return false; } odbc_autocommit($this->connection_id, true); } return true; } } function escape_string ($EBR5) { return addslashes ($EBR5); } function sql_limit ($WVC8A8, $KOA0X16) { $IQ20 = ""; if ($KOA0X16 > 0) $IQ20 .= " ".strrev ("TIMIL")." {$KOA0X16} "; if ($WVC8A8 > 0) $IQ20 .= " ".base64_decode ("T0ZGU0VU")." {$WVC8A8} "; return $IQ20;
 } function sql_numrows($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } return ( $A57FQ ) ? $this->num_rows[$A57FQ] : false; } function sql_numfields($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } return ( $A57FQ ) ? count($this->field_names[$A57FQ]) : false; } function sql_fieldname($WVC8A8, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } return ( $A57FQ ) ? $this->field_names[$A57FQ][$WVC8A8] : false;
} function sql_fieldtype($WVC8A8, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } return ( $A57FQ ) ? $this->field_types[$A57FQ][$WVC8A8] : false; } function sql_fetchrow($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } if( $A57FQ ) { return ( $this->num_rows[$A57FQ] && $this->current_row[$A57FQ] < $this->num_rows[$A57FQ] ) ? $this->result_rowset[$A57FQ][$this->current_row[$A57FQ]++] : false;
} else { return false; } } function sql_fetchrowset($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } if( $A57FQ ) { return ( $this->num_rows[$A57FQ] ) ? $this->result_rowset[$A57FQ] : false; } else { return false; } } function sql_fetchfield($W8CND, $HDCK = -1, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } if( $A57FQ ) { if( $HDCK < $this->num_rows[$A57FQ] ) { $WZ90L = ( $HDCK == -1 ) ? $this->current_row[$A57FQ] - 1 : $HDCK;
return $this->result_rowset[$A57FQ][$WZ90L][$this->field_names[$A57FQ][$W8CND]]; } else { return false; } } else { return false; } } function sql_rowseek($WVC8A8, $A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } if( $A57FQ ) { $this->current_row[$A57FQ] = $WVC8A8 - 1; return true; } else { return false; } } function sql_nextid() { return ( $this->next_id[$this->connection_id] ) ? $this->next_id[$this->connection_id] : false;
} function sql_affectedrows() { return ( $this->affected_rows[$this->connection_id] ) ? $this->affected_rows[$this->connection_id] : false; } function sql_freeresult($A57FQ = 0) { if( !$A57FQ ) { $A57FQ = $this->result; } unset($this->num_rows[$A57FQ]); unset($this->current_row[$A57FQ]); unset($this->result_rowset[$A57FQ]); unset($this->field_names[$A57FQ]); unset($this->field_types[$A57FQ]);
return true; } function sql_error() { $N329[str_rot13 ('pbqr')] = odbc_error($this->connection_id); $N329[base64_decode ('bWVzc2FnZQ==')] = odbc_errormsg($this->connection_id); return $N329; } } ?>
Return current item: HackerTrap