Example #1
0
 /**
  * [__call description]
  * @param  [string] $name [virtual function name]
  * @param  [array] $args [arguments of virtual function]
  * @return [type]       [description]
  */
 public function __call($name, $args)
 {
     $syntax = str_replace("String", '', $name) . "Caller";
     if (method_exists($this, $syntax)) {
         $string = $this->{$syntax}($args);
     }
     if (preg_match("/^(insert|delete|update|select)(String)?\$/", $name)) {
         if (class_exists('\\cls\\sql') && method_exists('\\cls\\sql', "call")) {
             sql_cls::call($this->maker, $name);
         }
         $this->groupby($string);
         $this->order($string);
         $string .= count($this->maker->limit) > 0 ? " LIMIT " . join($this->maker->limit, ', ') : '';
         // echo "\n<pre>\n";
         // echo($string)."\n\n";
         // echo "\n</pre>\n";
         if (preg_match("/String\$/", $name)) {
             return $string;
         } else {
             $connection = new dbconnection();
             $result = $connection->query($string);
             return $result;
         }
     } else {
         return $string;
     }
 }
Example #2
0
<?php

SESSION_START();
include_once 'sql_cls.php';
$profile_feilds = array("firstName" => "First Name:", "lastName" => "Last Name:");
$sql = new sql_cls();
$sql->update("users", array_search($_POST["name"], $profile_feilds), $_POST["value"], "userID = " . $_SESSION["User"]);
Example #3
0
<?php

include_once 'sql_cls.php';
$sql = new sql_cls();
$where = array();
$w = "";
foreach ($_POST["Search_restrictions"] as $key => $val) {
    if ($key == "Platform") {
        if ($val != "NA") {
            ARRAY_PUSH($where, " b.consolePcName = '" . $val . "' ");
        }
    }
}
if (!empty($where)) {
    $w = "WHERE ";
    foreach ($where as $val) {
        $w .= $val;
    }
}
$result = $sql->query("\n\t\tSELECT count(l.gameName) AS 'Game Count'\n\t\tFROM gameName l\n\t\tINNER JOIN consolePc b\n\t\tON l.gameId = b.gameId\n\t\t{$w}\n\t");
if ($result != NULL && $result->num_rows > 0) {
    while ($row = mysqli_fetch_assoc($result)) {
        echo ceil(intval($row["Game Count"]) / 10);
    }
}
Example #4
0
<?php

SESSION_START();
include_once 'php/sql_cls.php';
$error = FALSE;
if (ARRAY_KEY_EXISTS('User', $_SESSION)) {
    unset($_SESSION["User"]);
    HEADER("location: index.php");
} else {
    if (ARRAY_KEY_EXISTS("userName", $_POST) && ARRAY_KEY_EXISTS("password", $_POST)) {
        $sql_Check = new sql_cls();
        $check = $sql_Check->loginCheck($_POST["userName"], $_POST["password"]);
        if ($check["Access"]) {
            $_SESSION["User"] = $check["Info"];
            HEADER("location: index.php");
        } else {
            $error = TRUE;
        }
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="css/gameStyle.css" media="screen" />
        <title>gameInterface</title>
    </head>
    <body>
		<div class='pageHeader'>
			Game Library
Example #5
0
<?php

include_once 'sql_cls.php';
$sql = new sql_cls();
$where = array();
$w = "";
foreach ($_POST["Search_restrictions"] as $key => $val) {
    if ($key == "Platform") {
        if ($val != "NA") {
            ARRAY_PUSH($where, " b.consolePcName = '" . $val . "' ");
        }
    }
}
if (!empty($where)) {
    $w = "WHERE ";
    foreach ($where as $val) {
        $w .= $val;
    }
}
$result = $sql->query("\n\t\tSELECT l.gameName AS 'Game Name', b.consolePcName AS 'Console'\n\t\tFROM gameName l\n\t\tINNER JOIN consolePc b\n\t\tON l.gameId = b.gameId\n\t\t{$w}\n\t\tORDER BY l." . str_replace(" ", "", $_POST["Order_By"]["Feild"]) . " " . $_POST["Order_By"]["Order"] . "\n\t\tLIMIT " . INTVAL($_POST["Page_Size"]) * (INTVAL($_POST["Page"]) - 1) . " , " . $_POST["Page_Size"] . ";\n\t\t\n\t");
if ($result != NULL && $result->num_rows > 0) {
    while ($row = mysqli_fetch_assoc($result)) {
        echo "<tr class='feild_find'>\n\t\t\t\t<td class='game_name'>\n\t\t\t\t\t" . $row["Game Name"] . "\n\t\t\t\t</td>\n\t\t\t\t<td class='game_platform'>\n\t\t\t\t\t" . $row["Console"] . "\n\t\t\t\t</td>\t\t\t\t\t\t\n\t\t\t</tr>";
    }
}
Example #6
0
<?php

SESSION_START();
include_once 'php/sql_cls.php';
$ADMIN = FALSE;
if (isset($_SESSION["User"])) {
    $sql = new sql_cls();
    if ($sql->getUserPrivilage($_SESSION["User"]) == "ADMIN") {
        $ADMIN = TRUE;
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="css/gameStyle.css" media="screen" />
        <title>gameInterface</title>
    </head>
    <body>
		<div class='pageHeader'>
			Game Library
			
			<div class='login'>
				<?php 
echo "<a class='login_txt' href='login.php'>";
if (!isset($_SESSION["User"])) {
    echo "Log In";
} else {
    echo "Log Off";
}
Example #7
0
<?php

SESSION_START();
include_once 'php/sql_cls.php';
$ADMIN = FALSE;
if (isset($_SESSION["User"])) {
    $sql = new sql_cls();
    if ($sql->getUserPrivilage($_SESSION["User"]) == "ADMIN") {
        $ADMIN = TRUE;
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="css/gameStyle.css" media="screen" />
        <title>gameInterface</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
		<script src="js/profile.js"></script>
    </head>
    <body>
		<div class='pageHeader'>
			Game Library
			
			<div class='login'>
				<?php 
echo "<a class='login_txt' href='login.php'>";
if (!isset($_SESSION["User"])) {
    echo "Log In";
} else {
Example #8
0
<?php

SESSION_START();
include_once 'php/sql_cls.php';
$ADMIN = FALSE;
if (isset($_SESSION["User"])) {
    $sql = new sql_cls();
    if ($sql->getUserPrivilage($_SESSION["User"]) == "ADMIN") {
        $ADMIN = TRUE;
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="css/gameStyle.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/gameSearch.css" media="screen" />
        <title>Game List</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    </head>
    <body>
		<div class='pageHeader'>Game Library</div>
		<div id='navBar'>
			<div id='btnContainer'>
				<div class='menuBtn'><a href='index.php' class='menuSel'>Home</a></div>
				<div class='menuBtn'><a href='returnGame.php' class='menuSel'>Search Games</a></div>
				<?php 
if ($ADMIN) {
    echo "<div class='menuBtn'><a href='insertGame.php' class='menuSel'>Add Game</a></div>";
    echo "<div class='menuBtn'><a href='' class='menuSel'>Edit Game</a></div>";