26,11 → 26,11 |
if (!$this->drawnHeader) |
{ |
write('<!DOCTYPE html>'); |
write('<html>'); |
write('<html lang="en">'); |
write('<head>'); |
write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8">'); |
write('<title>Tim32 · ' . $this->title . '</title>'); |
write('<link href="' . $this->url . 'styles.css" rel="stylesheet" type="text/css" media="screen" />'); |
write('<link href="' . $this->url . 'styles.css" rel="stylesheet" type="text/css" media="all" />'); |
write('<link rel="shortcut icon" href="' . $this->url . 'data/favicon.png" />'); |
write('<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script>'); |
write('<script type="text/javascript" src="' . $this->url . 'tcp.js"></script>'); |
111,8 → 111,7 |
|
write('<h4 style="color: red;">Error: ' . $text . '</h4>'); |
|
if ($die) |
{ |
if ($die) { |
$this->drawFooter(); |
die(); |
} |
335,11 → 334,11 |
return $statement->fetchAll(); |
} |
|
function findIDs($table, $query = '') |
function findIDs($table, $query = '', $args = array()) |
{ |
$array = array(); |
|
$results = $this->query('SELECT ID FROM ' . $table . ' ' . $query); |
$results = $this->query('SELECT ID FROM ' . $table . ' ' . $query, $args); |
foreach ($results as $row) { |
array_push($array, $row['ID']); |
} |
349,9 → 348,8 |
|
function getUserByID($id) |
{ |
$results = $this->query('SELECT * FROM Users WHERE ID = "' . $id . '"'); |
foreach ($results as $row) { |
$user = new User; |
foreach ($this->query("SELECT * FROM Users WHERE ID = ?", array($id)) as $row) { |
$user = new User(); |
$user->ID = $row['ID']; |
$user->accessID = $row['AccessID']; |
$user->username = $row['Username']; |
366,10 → 364,8 |
return false; |
} |
|
function getUserByUsername($username) |
{ |
$results = $this->query('SELECT * FROM Users WHERE Username = "' . $username . '"'); |
foreach ($results as $row) { |
function getUserByUsername($username) { |
foreach ($this->query("SELECT * FROM Users WHERE Username = ?", array($username)) as $row) { |
return $this->getUserByID($row['ID']); |
} |
|