Esempio n. 1
0
    $query = mysqli_query($con, "SELECT * FROM Question ORDER BY questionID DESC LIMIT 1");
    while ($row = mysqli_fetch_array($query)) {
        $temp = $row['questionID'] + $questionIdCount;
        $questionIdCount++;
        return $temp;
    }
}
function getSurveyID()
{
    global $con;
    $query = mysqli_query($con, "SELECT * FROM Question ORDER BY surveyID DESC LIMIT 1");
    while ($row = mysqli_fetch_array($query)) {
        return $row['surveyID'] + 1;
    }
}
writeToDB();
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Polley</title>

    <!-- Bootstrap core CSS -->
Esempio n. 2
0
        writeToDB(0, 1);
        break;
    }
    if ($t->getHP() > $t->getMultiplier()) {
        $t->pas();
        $t->doDamage($m);
        if ($m->getHP() <= 0) {
            $m->death();
            writeToDB(0, 1);
            break;
        }
        $t->Heal();
        echo "<br>";
    } else {
        $t->death();
        writeToDB(1, 0);
        break;
    }
}
//Display stats
displayDB();
?>
<div id="stat">
    <br>
    <br>
    <input type="submit" value="Try again !" onclick='window.location.reload()'/>
    <br>
    <br>
    <!--<input type="button" value="Reset stats" onclick=/>-->
</div>
Esempio n. 3
0
// Default
// Start the output and conversion here
startOutput();
$settingsFile = dirname(realpath(__FILE__)) . "/../includes/settings.php";
showInfoBox('We are attempting to open and reads your settings.php file.', 'Reading Settings');
if (!file_exists($settingsFile)) {
    showInfoBox('<span style="color: #ff0000;font-weight: bold;">There was an error trying to read the settings.php file...\\nPlease make sure that you have created your settings.php file already...\\nAttempting to read file: $settingsFile</span>', 'ERROR');
    die;
}
$contents = file_get_contents($settingsFile);
showInfoBox('Successfully opened and read the settings.php file, we are attempting to parse now....', 'Parsing');
if (!isConverted()) {
    $keyval = parseSettings($contents);
    showInfoBox('Populating database.....', 'Database');
    //populateDatabase($keyval);
    writeToDB($keyval);
    if (createFile()) {
        showInfoBox('All done.. Please replace settings.php with the settings-new.php file that was created.');
    }
} else {
    showInfoBox("You appear to already be converted.  Congratulations.\nIf your settings are not working, please try to run the DB Fix tool.");
}
endOutput();
//-------------------------------------------------------------------------------------------//
/**
 * writeToDb writes the OBJECT to the database
 * @param Array $data
 */
function writeToDB($data)
{
    //    echo print_r(array_keys($data), true);