<?php require_once "../framework.php"; if (isset($_POST["type"])) { $type = $_POST["type"]; if ($type == "order") { getLastNum(); } else { if ($type == "getpin") { getPin(); } else { if ($type == "load") { loadNote(); } else { if ($type != "lecturecourse") { header("HTTP/1.1 400 Invalid Request"); die("HTTP/1.1 400 Invalid Request - you passed in a wrong type parameter."); } } } } } else { if (isset($_POST["lecturecourse"])) { if (isset($_POST["lecturenumber"])) { if (isset($_POST["page"])) { loadimage(); } else { pageList(); } } else { lectureList();
$databaseMaxRecords = $databaseMaxRecords * 10; //set random number and concatenate } $databaseMaxRecords = $databaseMaxRecords - $databaseMaxRecordsWeigh; // calculate the maximum amout of database records if ($showDevWorking == 1) { echo "<p>Max amount of database records: " . $databaseMaxRecords . "</p>"; echo "<hr />"; } if (empty($_POST['run'])) { echo "<p>Plese use the buttons to display a new PIN Number</p>"; } else { $pincheckArray = queryPinNumbers(); // run queryPinNumbers function to pull all used PIN numbers into an array // run getPin function carrying arguments across $attemptPin = getPin($randomNumberLength, $randomNumberTolerance, $pincheckArray, $showDevWorking); if ($showDevWorking == 1) { echo "<p>PIN Number: " . $attemptPin . "</p>"; } $pinNumber = $attemptPin; // Set PIN Number updateDatabase($pinNumber, $databaseMaxRecords, $showDevWorking); // Update database with new pin number and display results echo "<a name='pin'></a>"; echo "<hr/><div id='pin'><h2><span class='radius success label'>PIN: " . $pinNumber . "</span></h2></div>"; } // database connection function function dbconnect() { # LOCAL $username = "******";