!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/home/wwwroot/frames/   drwxrwxr-x
Free 83.3 GB of 96.73 GB (86.12%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     RatingManager.inc.php (8.32 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
error_reporting
(E_ALL);


/*
 * mysql database wrapper class for start rating
 *@package AJAXRATING
 *@access public
 *@abstract Database
 *@author Sudhir Chauhan ([email protected][email protected])
 *@return string
 *@version 1.0.0;
 */
//database host name or IP
define('DATABASEHOST','localhost');
//database user name
define('DATABASEUSERNAME','papyr225_phpb1');
// database user password
define('DATABASEPASSWORD','bJ8V1vmDPkHZ');
//database name
define('DATABASENAME','papyr225_papyre');
// single start width
define('STARWIDTH',20);
// total number of starts
// NOTE: This is not working complately. If you want to increase of decrease stars you have to modify css also
define('TOTALSTARS',5);

//mysql extention must be loaded
// Abstact class for rating
abstract class Database {
    public 
$databaseHost DATABASEHOST;
    public 
$databaseUser DATABASEUSERNAME;
    public 
$databasePassword DATABASEPASSWORD;
    public 
$databaseName DATABASENAME;
    public 
$connection null//  database connection
    
protected $recordsSelected 0;
    protected 
$recordsUpdated 0;
    
    
    protected function 
connect() {
    
        
$this->connection mysql_connect($this->databaseHost$this->databaseUser$this->databasePassword);
        if (!
$this->connection) {
            
$this->connection null;
               
trigger_error(mysql_error());
        }
        
mysql_select_db($this->databaseName);
    }
    
    protected function 
querySelect($query) {
        
        if (
strlen(trim($query)) < ) {
            
trigger_error("Database encountered empty query string in querySelect function"E_USER_ERROR);
            return 
false;
        }
        
        if (
$this->connection === null ) {
            
$this->connect();
        }

        
$result mysql_query($query$this->connection) or die(mysql_error());
        if (!
$result) {
            return array();
        }

        
$this->recordsSelected mysql_num_rows($result);
        return 
$this->getData($result); 
    }
    
    protected function 
queryExecute($query) {
        
        if (
strlen(trim($query)) < ) {
            
trigger_error("Database encountered empty query string in queryExecute function"E_ERROR);
        }
        
        if (
$this->connection === null ) {
            
$this->connect();
        }
        
        
$res mysql_query($query$this->connection);
        if(
$res) {
            
$this->recordsUpdated mysql_affected_rows($this->connection);
        }
    }
    
    protected function 
getData($result) {
        
$data = array();
        
$i 0;
        while (
$row mysql_fetch_assoc($result)) {
            foreach (
$row as $key => $value) {
                
$data[$i][$key] = stripslashes($value);        
            }
            
$i++;
        }
        return 
$data;
    }    
    
}

/**
 * Ajax start rating
 *@package AJAXRATING
 *@access public
 *@abstract Database
 *@author Sudhir Chauhan ([email protected][email protected])
 *@return string
 *@version 1.0.0;
 * TODO:: 
 *    for optimisation we can get all values from rating table in the constructer
 *     and avoid multiple select queries.
 *     IP base check: restrict users how have already voted. (cookie or ip address0
 */
class RatingManager extends Database {
    public static 
$instance 0;
    
    public function 
__construct() {
        
    }
    
    public static function 
getInstance() {
        if (
self::$instance == ) {
            
self::$instance = new RatingManager();
        }
        return 
self::$instance;
    }
    
    
/**
     * Draw stars
     * TODO: add IP restriction check to avoid person to vote again
     * COOKIE can also be used for this
     */
    
public function drawStars($id) {
        
        if (!
is_numeric($id)) {
            
trigger_error("RatingManager encountered problem in drawStars() parameter. Passed parameter must be numeric.");
            exit;
        }
        
        
$query "SELECT total_votes, total_value, used_ips FROM ratings WHERE id='".$id."'";
        
$result $this->querySelect($query);
        
        if (
is_array($result) && count($result) > ) {
            
$totalVotes $result[0]['total_votes'];    //how many total votes
            
$totalValues $result[0]['total_value'];  //total number of rating added together and stored
            
$oldIPs unserialize($result[0]['used_ips']);
        }
        else {
            
$totalVotes 1;
            
$totalValues 0;
            
$oldIPs = Array();        
        }
        
        
$currentRating = @number_format($totalValues $totalVotes2) * STARWIDTH ;
        
        
// allow single submit for userid
        //$ipAddress = $_SERVER['REMOTE_ADDR'];    
        
$control= new control();  
        
$ipAddress $control->usuario;
        
        if (
in_array($ipAddress$oldIPs)) {
            
$this->drawPrintedStars($currentRating$id); 
            return;
        }
        
        
$ratingString '<div id="unit_long'.$id.'">
                            <ul class="unit-rating">
                            <li class="current-rating" style="width:'
.$currentRating.'px;">Currently '.$currentRating.'; ?>/ TOTALSTARS </li>';
        
            for (
$ncount 1$ncount <= TOTALSTARS$ncount++) { 
                
$ratingString .= '<li><a href="javascript:void(0);" title="'.$ncount.' out of '.TOTALSTARS.'" class="r'.$ncount.'-unit" onclick="javascript:sndRequest(\''.$ncount.'\','.$id.',\''.$ipAddress.'\')">'.$ncount.'</a></li>';
            }

            
$ncount 0// resets the count
            
            
$query="SELECT total_votes, round( SUM( total_value ) /  total_votes, 2 ) AS media
FROM ratings
WHERE id =
$id";
    
$res2 $this->querySelect($query);  
    
//print_r($res2);
        
            
            
$ratingString .= "</ul><small><b>{$res2[0]['media']} </b>- {$res2[0]['total_votes']} votos</small>
                            </div>"
;
            
        echo 
$ratingString;    
        
    }
    
    
/**
     * update votes for id
     */
    
public function updateVote($numberofVotesSent$voteForWitchId$userIPAddress) {
        
$numberOfVotes $numberofVotesSent;
        
$voteForID $voteForWitchId
        
$ipAddress $userIPAddress

        
$query "SELECT total_votes, total_value, used_ips FROM ratings WHERE id='".$voteForID."'";
        
$result $this->querySelect($query);
        
        
$sum 0;
        
$oldIPAddress = Array();
        if (
is_array($result) && count($result) > 0) {
            
$totalVotes $result[0]['total_votes'];            //how many votes total
            
$totalValues $result[0]['total_value'];  //total number of rating added together and stored
            
$oldIPAddress unserialize($result[0]['used_ips']);
            
$sum $numberOfVotes $totalValues;        // add together current vote value and the total vote value
        
}
        
        if (
$sum == 0) {
            
$addedVotes 1//checking to see if the first vote has been voted
            
$sum $numberOfVotes ;
        }
        else {
            
$addedVotes $totalVotes 1;//increment the current number of votes
        
}

        if (
is_array($oldIPAddress)) {
            
array_push($oldIPAddress$ipAddress);//if it is an array i.e. already has entries the push in another value
        
}
        else {
            
$oldIPAddress = array($ipAddress);//for the first entry
        
}
        
        
$serializeIPList serialize($oldIPAddress);
        
        
//Check existing IDs
        
$query "SELECT count(*) as total FROM ratings WHERE id='".$voteForID."'";
        
$result $this->querySelect($query);
            
        if (
is_array($result) && count($result) > && $result[0]['total'] > ) {
            
$query "UPDATE ratings SET total_votes = '".$addedVotes."', total_value='".$sum."', used_ips='".$serializeIPList."' WHERE id='".$voteForID."'";            
            
$this->queryExecute($query);
        }
        else {
            
$query "INSERT INTO ratings (id, total_votes, total_value, used_ips) VALUES ($voteForID$addedVotes$sum, '".$serializeIPList."')";
            
$this->queryExecute($query);
        }
        
$puntuacion= @$addedVotes/
        
    
        
$currentRating = @number_format($sum $addedVotes2) * STARWIDTH ;
        
// a�adimos aqui el update a libros
       
$query="update libros set votos=$addedVotes,puntuacion=". @number_format($sum $addedVotes2)."  where id = $voteForID;
       
$this->queryExecute($query);
        
$this->drawPrintedStars($currentRating$voteForIDtrue);
    }
    
    public static function 
votedByUser($userID) {
        
$query "SELECT ";
    }
    
    public function 
drawPrintedStars($currentRating$voteForID$addDivID false) {
        
ob_start();
        
header("Cache-Control: no-cache");
        
header("Pragma: nocache");        
        
$ratingString "<ul class=\"unit-rating\">\n" .
                        
"<li class=\"current-rating\" style=\"width:"$currentRating ."px;\">Currently $currentRating</li>\n";
            
            for (
$ncount 1$ncount <= TOTALSTARS$ncount++) { 
                
$ratingString .= "<li class=\"r$ncount-unit\">$ncount</li>\n";
            }
            
$query="SELECT total_votes, round( SUM( total_value ) /  total_votes, 2 ) AS media
FROM ratings
WHERE id =
$voteForID";
    
$res2 $this->querySelect($query);  
    
//print_r($res2);
        
$ratingString .= "</ul><small><b>{$res2[0]['media']} </b>- {$res2[0]['total_votes']} votos</small>";//show the updated value of the vote
        
        //mostramos los votos totales y el valor
        
        
        //name of the div id to be updated | the html that needs to be changed
        
if ($addDivID === false) {
            
$output $ratingString;
        }
        else {
            
$output "unit_long$voteForID|$ratingString";
        }
        
        echo 
$output;
    }
    
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.005 ]--