@ 2014-03-01T21:36:10Z <?php
include(__DIR__ . '/config.php');
global $_CONFIG;
if(!array_key_exists('code', $_GET) || $_GET['code'] != $_CONFIG['code'])
exit;
define("MONO_ON", 1);
require(__DIR__ . '/class/class_db_'.$_CONFIG['driver'].'.php');
$db = new database;
$db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']);
$db->connect();
$c = $db->connection_id;
include(__DIR__ . '/global_funcs.php');
$db->query("UPDATE `fedjail` SET `fed_days` = `fed_days` - 1");
$q = $db->query("SELECT * FROM `fedjail` WHERE `fed_days` = 0");
$ids = array();
while($r = $db->fetch_row($q))
array_push($ids, $r['fed_userid']);
if(count($ids) > 0)
$db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
$db->query("DELETE FROM `fedjail` WHERE `fed_days` = 0");
$db->query("UPDATE `users` SET " .
"`daysingang` = IF(`gang` > 0, `daysingang` + 1, 0), " .
"`daysold` = `daysold` + 1, " .
"`boxes_opened` = 0, " .
"`mailban` = IF(`mailban` > 0, `mailban` - 1, 0), " .
"`donatordays` = IF(`donatordays` > 0, `donatordays` - 1, 0), " .
"`cdays` = IF(`course` > 0, `cdays` - 1, 0), " .
"`bankmoney` = IF(`bankmoney` > 0, `bankmoney` + (`bankmoney` * .2), 0) " .
"`cybermoney` + IF(`cybermoney` > 0, (`cybermoney` * 0.7), 0)"
);
$q = $db->query("SELECT `userid`, `course` FROM `users` WHERE `cdays` = 0 AND `course` > 0");
while($r = $db->fetch_row($q)) {
$db->query("INSERT INTO `coursesdone` VALUES(".$r['userid'].", ".$r['course'].")");
$cd = $db->query("SELECT * FROM `courses` WHERE `crID` = ".$r['course']);
if($db->num_rows($cd)) {
$coud = $db->fetch_row($cd);
$upd = "";
$ev = "";
if($coud['crSTR']) {
$upd .= ", `strength` = `strength` + ".$coud['crSTR'];
$ev .= ", ".number_format($coud['crSTR'])." strength";
}
if($coud['crGUARD']) {
$upd .= ", `guard` = `guard` + ".$coud['crGUARD'];
$ev .= ", ".number_format($coud['crGUARD'])." guard";
}
if($coud['crLABOUR']) {
$upd .= ", `labour` = `labour` + ".$coud['crLABOUR'];
$ev .= ", ".number_format($coud['crLABOUR'])." labour";
}
if($coud['crAGIL']) {
$upd .= ", `agility` = `agility` + ".$coud['crAGIL'];
$ev .= ", ".number_format($coud['crAGIL'])." agility";
}
if($coud['crIQ']) {
$upd .= ", `IQ` = `IQ` + ".$coud['crIQ'];
$ev .= ", ".number_format($coud['crIQ'])." IQ";
}
$ev = substr($ev, 1);
if($upd)
$db->query("UPDATE userstats SET `userid` = `userid` ".$upd." WHERE `userid` = ".$r['userid']);
event_add($r['userid'], "Congratulations, you completed the ".$coud['crNAME']." and gained ".$ev."!");
} else
event_add($r['userid'], "Unfortunately, the course you were taking was removed from the School's curriculum. Your course has been ended at no extra cost to you");
}
$db->query("UPDATE `users` SET `course` = 0 WHERE `cdays` = 0");
$db->query("TRUNCATE TABLE `votes`");
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for git.master , git.master_jit , rfc.property-hooks Warning: include(/in/config.php): Failed to open stream: No such file or directory in /in/CH8Tl on line 2
Warning: include(): Failed opening '/in/config.php' for inclusion (include_path='.:') in /in/CH8Tl on line 2
This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches Archived branches Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:dark mode live preview
35.32 ms | 401 KiB | 8 Q