Ejemplo n.º 1
0
function selectDB($table)
{
    $sql = "SELECT * ";
    $sql .= "FROM {$table};";
    $db = new DbUtilities();
    $employeeCollection = $db->getDataset($sql);
    return $employeeCollection;
}
Ejemplo n.º 2
0
$wisdom = $_POST["wisdom"];
$HP = $_POST["HP"];
$MP = $_POST["MP"];
$stamina = $_POST["stamina"];
$will = $_POST["will"];
$item1ID = $_POST["item1ID"];
$item2ID = $_POST["item2ID"];
$item3ID = $_POST["item3ID"];
$item4ID = $_POST["item4ID"];
$item5ID = $_POST["item5ID"];
$sql = "INSERT INTO srp63.character";
$sql .= "(characterID,FK_placeID,FK_userID,name,gender,agility,strength,";
$sql .= "intellect,wisdom,maxHP,curHP,maxMP,curMP,maxStamina,curStamina,";
$sql .= "maxWill,curWill,experience,level) ";
$sql .= "VALUES (?,'55a4ccfd-5c33-4ddc-9445-1a4af176099b',?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,1);";
$db1 = new DbUtilities();
$db1->executeQuery($sql, "ssssiiiiiiiiiiii", array($guid, $userID, $name, $gender, $agility, $strength, $intellect, $wisdom, $HP, $HP, $MP, $MP, $stamina, $stamina, $will, $will));
$sql1 = "INSERT INTO srp63.item (itemID, FK_characterID, type, itemName, ";
$sql1 .= "defence, weight, durability, isEquipped, equipSlot) VALUES ";
$sql1 .= "(?,?,?,?,?,?,?,?,?);";
$db2 = new DbUtilities();
$db2->executeQuery($sql1, "ssssiiiss", array($item1ID, $guid, "clothing", "Peasant Clothes", 1, 2, 100, "true", "body"));
echo $item1ID . "," . $userID . "," . "clothing" . "," . "Peasant Clothes" . "," . 1 . "," . 2 . "," . 100 . "," . "true" . "," . "body";
$sql2 = "INSERT INTO srp63.item (itemID, FK_characterID, type, itemName, ";
$sql2 .= "defence, weight, durability, isEquipped, equipSlot) VALUES ";
$sql2 .= "(?,?,?,?,?,?,?,?,?);";
$db3 = new DbUtilities();
$db3->executeQuery($sql2, "ssssiiiss", array($item2ID, $guid, "clothing", "Simple Shoes", 0, 1, 100, "true", "body"));
?>

Ejemplo n.º 3
0
<?php

define("IN_KEKE", TRUE);
include '../app_comm.php';
require S_ROOT . 'update/file/kppw.php';
require S_ROOT . 'update/DbUtilities.php';
$DbUtilities = new DbUtilities();
$DbUtilities->dbUpdate($dbArr);
foreach ($dbArr as $table => $fields) {
    $filepath = S_ROOT . 'update/sqldata/' . $table . '.php';
    if (file_exists($filepath)) {
        require $filepath;
    }
}
unset($dbArr);
unset($DbUtilities);
$file_obj = new keke_file_class();
$file_obj->delete_files(S_ROOT . "/data/data_cache/");
$file_obj->delete_files(S_ROOT . "/data/tpl_c/");
header('Refresh: 3; url=../index.php?do=index');
echo '升级成功...<br />';
echo '页面跳转中...<br />';
Ejemplo n.º 4
0
<?php

require "classes/dbutils.php";
$email = $_POST["email"];
$password = $_POST["password"];
$displayName = $_POST["displayName"];
$sendNews = $_POST["sendNews"];
$age = $_POST["age"];
$userID = $_POST["userID"];
$hashPass = md5($password);
$sql = "INSERT INTO user (userID,email,displayName,passW,sendNews,age,timeS) ";
$sql .= "VALUES (?,?,?,?,?,?, NOW());";
$db = new DbUtilities();
$db->executeQuery($sql, "sssssi", array($userID, $email, $displayName, $hashPass, $sendNews, $age));
?>
 
Ejemplo n.º 5
0
<?php

session_start();
if (!isset($_SESSION["userID"]) or $_SESSION["userID"] == null or $_SESSION["userID"] == "" or $_SESSION["userID"] == "INVALID") {
    //No session data
} else {
    //logged in!
    require "../classes/dbutils.php";
    $userID = $_SESSION["userID"];
    $sql = "SELECT * ";
    $sql .= "FROM srp63.character WHERE FK_userID = '" . $userID . "';";
    $db = new DbUtilities();
    $charCollection = $db->getDataset($sql);
    $charData = '"character" : ' . json_encode($charCollection);
    echo '{' . $charData . '}';
}
?>

Ejemplo n.º 6
0
<?php

require "../classes/dbutils.php";
$stuff = $_POST["sendThis"];
$sql = "SELECT * ";
$sql .= "FROM Applicant;";
//. "WHERE attemptID = '" . $attemptID . "' AND userID = '" . $userID . "';";
$db = new DbUtilities();
$dataCollection = $db->getDataset($sql);
$appData = '"applicant" : ' . json_encode($dataCollection);
Ejemplo n.º 7
0
                    <td class="postsCountCell">
                        Posts
                    </td>
                </tr>

                <?php 
    $threadArray = array();
    $postArray = array();
    $threadCount = 0;
    $postCountArray;
    $style = 0;
    $sql = "SELECT * FROM topic";
    $db = new DbUtilities();
    $collectionList = $db->getDataset($sql);
    $newSql = "SELECT * FROM topic JOIN thread ON topic.topicID = thread.FK_topicID JOIN post on thread.threadID = post.FK_threadID;";
    $db2 = new DbUtilities();
    $tCollectionList = $db2->getDataset($newSql);
    foreach ($tCollectionList as &$row2) {
        if (!in_array($row['threadID'], $threadArray)) {
            //returns the index of the first substring found. if no index then return -1
            array_push($threadArray, $row['threadID']);
            $threadCount += 1;
        }
    }
    foreach ($collectionList as &$row) {
        if ($style == 0) {
            echo '<tr class="rowStyle1">';
            $style = 1;
        } else {
            echo '<tr class="rowStyle2">';
            $style = 0;
Ejemplo n.º 8
0
<?php

require "../classes/dbutils.php";
$placeID = $_POST["placeID"];
$sql = "SELECT * FROM point WHERE FK_placeID = '{$placeID}';";
$db = new DbUtilities();
$pointCollection = $db->getDataset($sql);
$pointData = '"point" : ' . json_encode($pointCollection);
echo '{' . $pointData . '}';
?>

Ejemplo n.º 9
0
<?php

require "../classes/dbutils.php";
$eventID = $_POST["eventID"];
$sql = "SELECT * FROM message WHERE FK_eventID = '" . $eventID . "';";
$db = new DbUtilities();
$messCollection = $db->getDataset($sql);
$messData = '"message" : ' . json_encode($messCollection);
echo '{' . $messData . '}';
Ejemplo n.º 10
0
<?php

session_start();
include "base.php";
require "classes/dbutils.php";
$email = $_POST["email"];
$password = $_POST["password"];
$hashPass = md5($password);
$sql = "SELECT userID,email,displayName,type FROM user WHERE email='{$email}' AND passW='{$hashPass}';";
$db = new DbUtilities();
//$db->getDatasetWithParams($sql, "ss", array($email, $hashPass));
//echo($db->getDataset($sql));
$collectionList = $db->getDataset($sql);
if (count($collectionList) > 0) {
    foreach ($collectionList as &$row) {
        $_SESSION["userID"] = $row["userID"];
        $_SESSION["email"] = $row["email"];
        $_SESSION["displayName"] = $row["displayName"];
        $_SESSION["type"] = $row["type"];
        echo "VALID";
    }
    // print_r($_SESSION);
    // Change this to redirect to whatever page is the first landing page for the application
} else {
    $_SESSION["userID"] = "INVALID";
    $_SESSION["email"] = "INVALID";
    $_SESSION["displayName"] = "INVALID";
    $_SESSION["type"] = "INVALID";
    echo "INVALID";
    // Authentication failed - redirect to auth failed page
    // You need to update that page
Ejemplo n.º 11
0
<?php

require "../classes/dbutils.php";
$FK_placeID = $_POST["FK_placeID"];
$sql = "SELECT * ";
$sql .= "FROM srp63.places WHERE placeID = '" . $FK_placeID . "';";
$db = new DbUtilities();
$placeCollection = $db->getDataset($sql);
$placeData = '"places" : ' . json_encode($placeCollection);
echo '{' . $placeData . '}';
?>

Ejemplo n.º 12
0
        }
        echo '</div>';
        echo '<div class="col-md-1">';
        if ($param6 != "") {
            echo $row[$param6];
        }
        echo '</div>';
        echo '<div class="col-md-1">';
        if ($param7 != "") {
            echo $row[$param7];
        }
        echo '</div>';
        echo '</div>';
    }
}
$db = new DbUtilities();
$result = $db->getDataset($sql);
?>
                    </div>
                </div>

                <footer><a href="../homework.html">Back</a></footer>
            </article>
            <nav class="leftPane">
                <!-- For my reference: leave blank or insert navbar -->
            </nav>
            <aside class="rightPane">
                <!-- For my reference: leave blank or content can go here -->
            </aside>
        </div>
Ejemplo n.º 13
0
<?php

session_start();
require "../classes/dbutils.php";
$userID = $_SESSION["userID"];
$guid = $_POST["guid"];
$content = $_POST["content"];
$threadID = $_POST["threadID"];
$sql = "INSERT INTO post (postID,FK_userID,FK_threadID,content,timeS) ";
$sql .= "VALUES (?,?,?,?,NOW());";
$db = new DbUtilities();
$db->executeQuery($sql, "ssss", array($guid, $userID, $threadID, $content));
$sql = "INSERT INTO post (postID,FK_userID,FK_threadID,content,timeS) ";
$sql .= "VALUES ({$guid},{$userID},{$threadID},{$content},NOW());";
echo $sql;
Ejemplo n.º 14
0
  } else {
  //$userID = $_SESSION["drupalUserID"];
  //$attemptID = $_SESSION["gameAttemptID"];
  //$levelAccess = "level1.php";
  }

  function insertData($table) {
  $sql = "INSERT INTO $table (userID,attemptID,levelAccess) ";
  $sql .= "VALUES (?,?,?);";

  $db = new DbUtilities;
  $db->executeQuery($sql, "sss", array($userID, $attemptID, $levelAccess));
  } */
//if (isset($_POST["firstName"])){
require "../classes/dbutils.php";
$firstName = $_POST["fName"];
$lastName = $_POST["lName"];
$dateSubmitted = $_POST["dateSubmitted"];
$WorkExperience = $_POST["workExpSE"];
$Appearance = $_POST["appearanceSE"];
$Education = $_POST["educationSE"];
$Enthusiasm = $_POST["enthusiasmSE"];
$whyWork = $_POST["whyWork"];
$strengths = $_POST["majorStrengths"];
$language = $_POST["languages"];
$other = $_POST["other"];
$sql = "INSERT INTO Applicant (fName,lName,dateSubmitted,workExpSE,appearanceSE,educationSE,enthusiasmSE,whyWork,majorStrengths,languages,other) ";
$sql .= "VALUES (?,?,?,?,?,?,?,?,?,?,?);";
$db = new DbUtilities();
$db->executeQuery($sql, "sssssssssss", array($firstName, $lastName, $dateSubmitted, $WorkExperience, $Appearance, $Education, $Enthusiasm, $whyWork, $strengths, $language, $other));
//}
Ejemplo n.º 15
0
<?php

require "../classes/dbutils.php";
$itemID = $_POST["itemID"];
$isEquipped = $_POST["isEquipped"];
$sql = "UPDATE srp63.item SET isEquipped = ? WHERE itemID = ?;";
$db = new DbUtilities();
$db->executeQuery($sql, "ss", array($isEquipped, $itemID));
?>

Ejemplo n.º 16
0
  } else {
  //$userID = $_SESSION["drupalUserID"];
  //$attemptID = $_SESSION["gameAttemptID"];
  //$levelAccess = "level1.php";
  }

  function insertData($table) {
  $sql = "INSERT INTO $table (userID,attemptID,levelAccess) ";
  $sql .= "VALUES (?,?,?);";

  $db = new DbUtilities;
  $db->executeQuery($sql, "sss", array($userID, $attemptID, $levelAccess));
  } */
//if (isset($_POST["firstName"])){
require "../classes/dbutils.php";
$firstName = $_POST["fName"];
$lastName = $_POST["lName"];
$dateSubmitted = $_POST["dateSubmitted"];
$Happiness = $_POST["happinessSE"];
$Appearance = $_POST["appearanceSE"];
$Education = $_POST["educationSE"];
$Enthusiasm = $_POST["enthusiasmSE"];
$whyDate = $_POST["whyDate"];
$greatGF = $_POST["greatGF"];
$phone = $_POST["phone"];
echo "stuff";
$sql = "INSERT INTO GFapplicants (fName,lName,dateSubmitted,happiness,appearance,education,enthusiasm,whyDate,greatGF,phone) ";
$sql .= "VALUES (?,?,?,?,?,?,?,?,?,?);";
$db = new DbUtilities();
$db->executeQuery($sql, "ssssssssss", array($firstName, $lastName, $dateSubmitted, $Happiness, $Appearance, $Education, $Enthusiasm, $whyDate, $greatGF, $phone));
//}