Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (39 sloc) 2.54 KB
<?php
// notes
//steamid base =76561197960265728
//
require_once 'config.php';
require_once 'sql.php';
require_once 'functions.php';
require_once 'opensession.php';
StripWWW();
OpenSession();
AdminCheckpoint( ADMFLAG_FSU );
PrintHeader( 'admin center' );
?>
<h1>database operations</h1>
<a href="admin_createtables.php?create">create tables</a><br>
<a href="admin_createtables.php?dropall">drop all tables (holy FUCK do not click this lol)<br></a>
<br>
<?php
function CreateTables() {
$sql = GetSQL();
$sql->safequery( "CREATE TABLE IF NOT EXISTS CAPTURES ( ID INT NOT NULL AUTO_INCREMENT, ACCOUNT INT NOT NULL, TARGET INT NOT NULL, TIME BIGINT UNSIGNED NOT NULL, NICKNAME VARCHAR(64) NOT NULL, PRIMARY KEY (ID) )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS INFO ( ACCOUNT INT NOT NULL PRIMARY KEY, TYPE VARCHAR(64), ELEMENT VARCHAR(64), LENGTH SMALLINT, WEIGHT MEDIUMINT, HABITAT VARCHAR(64), DESCRIPTION TEXT )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS INVENTORY ( ACCOUNT INT NOT NULL, ITEMID INT NOT NULL, AMOUNT INT NOT NULL DEFAULT 0, PRIMARY KEY (ACCOUNT,ITEMID) )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS STOCK ( ITEMID INT NOT NULL PRIMARY KEY, AMOUNT INT NOT NULL DEFAULT 0 )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS USER ( ACCOUNT INT NOT NULL PRIMARY KEY, FREEBALLTIME INT, CREDIT INT DEFAULT 0, INGAME BIGINT DEFAULT 0 )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS RECEIPTS ( ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, DATE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, TYPE VARCHAR(16) NOT NULL , STATE VARCHAR(16) NOT NULL DEFAULT 'OKAY', STEAM BIGINT NOT NULL, TOTAL INT , PPSALEID VARCHAR(32), PAYPAL INT , FEES INT , SETTLE INT , CASH INT, TRANSACTION TEXT NOT NULL, NOTE TEXT )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS ITEMINFO ( ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(256) NOT NULL, PLURAL VARCHAR(256) NOT NULL, ITEM VARCHAR(64) NOT NULL UNIQUE, BUYABLE BOOL NOT NULL, PRICE INT NOT NULL, SERVERS VARCHAR(64) NOT NULL) " );
$sql->safequery( "CREATE TABLE IF NOT EXISTS SAVEDLOGIN ( ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, CODE INT NOT NULL, EXPIRES INT UNSIGNED NOT NULL, REMOTEADDR VARCHAR(64), ACCOUNT INT )" );
$sql->safequery( "CREATE TABLE IF NOT EXISTS BBS ( ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, DATE INT NOT NULL, ACCOUNT INT NOT NULL, NAME VARCHAR(64), CONTENT VARCHAR(1024) )" );
}
$created = 0;
if( isset($_GET['create']) ) {
CreateTables();
echo "OKAY.";
} else if( isset($_GET['dropall']) ) {
echo '<p>error: why would you click that lol</p>';
}
PrintFooter();
?>