01-25-2014, 09:20 PM
<!DOCTYPE html>
<html>
<head>
<title>Credit ToXiC L33T</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<?PHP
error_reporting(E_ALL);
ini_set(display_errors, 1);
if ($_SERVER[REMOTE_ADDR] == "127.0.0.1"){ ?>
function Timer(id, minLimit, callback){
var thisTimer = this;
this.limit = minLimit * 60;
this.callback = callback;
this.timer = 0;
this.addEvent(window, load, function(){
thisTimer.el = document.getElementById(id);
thisTimer.txt = thisTimer.el.firstChild;
thisTimer.intv = setInterval(function(){thisTimer.intvFunc();}, 1000);
});
}
Timer.prototype = {
intvFunc: function(){
this.txt.nodeValue = this.formatTime(++this.timer);
if(this.timer === this.limit){
clearInterval(this.intv);
this.callback.call(this);
}
},
formatNum: function(n){
return n < 10? 0 + n : n;
},
formatTime: function (n, m, s){
s = n % 60;
m = (n - s) / 60;
return [this.formatNum(m), :, this.formatNum(s)].join();
},
addEvent: (function(){return window.addEventListener? function(el, ev, f){
el.addEventListener(ev, f, false);
}:window.attachEvent? function(el, ev, f){
el.attachEvent(on + ev, f);
}:function(){return;};
})()
};
// Usage: new Timer(id_of_counting_element, #_of_mins, callback_function(){});
new Timer(timer1, 5, function(){this.el.parentNode.style.color = red});
</script>
</head>
<body bgcolor="#C7C7C9">
<?php
// Mysql IP
$dbset["host"] = 127.0.0.1; // dns or ip
// Mysql Login
$dbset["username"] = root; // Mysql username
$dbset["password"] = password; // Mysql password
// Mysql Databases
$dbset["lc_auth"] = newproject_db_auth; // auth database
$dbset["lc_authORdb"] = newproject_db_user; // user database
try {
$conn234 = new PDO(mysql:host=.$dbset["host"]., $dbset["username"], $dbset["password"]);
} catch(PDOException $e) {
echo ERROR: . $e->getMessage();
}
echo "<b><font size=6>Online Time by ToXiC L33T</font></b><br /><font color=red>KEEP THIS FILE HIDDEN, ONLY RUN ON ROOT</font><br/>";
$query = sprintf("SELECT a_portal_index from %s.t_users WHERE a_zone_num > -1", $dbset["lc_authORdb"] );
$dbh = $conn234->prepare( $query );
$dbh->execute();
$query1 = sprintf("SELECT count(a_index) from %s.t_users WHERE a_zone_num > -1", $dbset["lc_authORdb"] );
$dbh1 = $conn234->prepare( $query1 );
$dbh1->execute();
$r1a = $dbh1->fetch();
$Effected = $r1a[0];
while( $r1 = $dbh->fetch() ){
$UID = $r1[a_portal_index];
$query2 = sprintf("UPDATE %s.bg_user SET cash = cash + 3 WHERE user_code = ". $UID ."", $dbset["lc_auth"] );
$dbh2 = $conn234->prepare( $query2 );
$dbh2->execute();
}
?>
<hr/><br/>
Effected Accounts: <font color=green><?PHP print $Effected; ?></font>
<div>Next OLT in 5 minutes: <font color=orange><span id="timer1">00:00</span></font></div>
<meta http-equiv="refresh" content="300; url=onlinetime.php">
</body>
<?php
} else {
echo "</head><body>Please run this from 127.0.0.1 on your root server</body></html>";
}
?>

