<?php require_once 'config.php'; require_once 'functions.php'; promptLogin(1); makeHeader("Finished Jobs", "Finished Jobs", 2, "CompleteJobs.php", "<style>td{color:white;}</style>"); $g_link = mysql_connect('localhost', $g_username, $g_password); //TODO use a persistant database connections mysql_select_db('stt', $g_link); //check if any buttons were pressed if (isset($_POST['jobsToList'])) { //job is done if ($_POST['jobsToList'] == 2) { $changeJobStatusQuery = "UPDATE `jobs` SET `status`=4 WHERE id=" . $_POST['formIdentifier']; //commence query $result = mysql_query($changeJobStatusQuery); } //job is not done if ($_POST['jobsToList'] == 1) { $modifyPointsQuery = "DELETE FROM `points` WHERE job_id=" . $_POST['formIdentifier']; //commence query mysql_query($modifyPointsQuery); $resultz = mysql_query("SELECT * FROM `jobs` WHERE id=" . $_POST['formIdentifier']); //make a error message $jobDesc = mysql_fetch_assoc($resultz); $newDesc = $jobDesc['description']; if (isset($_POST['whatsWrong']) != "") { echo $newDesc = $jobDesc['description'] . " ERROR: " . $_POST['whatsWrong']; } $changeJobStatusQuery = "UPDATE `jobs` SET `description`='" . $newDesc . "', `status`=2 WHERE id=" . $_POST['formIdentifier']; //commence query
<?php //add the all page to show even ignored jobs and add check boxes for ignoring multiple jobs at once //get access to proper files require_once 'config.php'; require_once "functions.php"; require_once "Classes/jobsClass.php"; //check for login promptLogin(); //start a connection $conn = mysql_connect('localhost', $g_username, $g_password); //TODO use a persistant database connections //select a correct database mysql_select_db('stt', $conn); //set up the base of the page makeHeader('Jobs List', 'Jobs List', 2, "jobs2.php", "<link href='css_files/jobs.css' rel='stylesheet'>"); //do stuff in here function main() { //check for any forms submitted echo "<script> ignoreCount = 0;</script>"; echo "<script>jobCount = 0;</script>"; $formMessage = ""; $formCheck = "False"; //check if any of the forms were submitted if (isset($_POST['formIdentifier'])) { //logic for job claim,unclaim, and resolve logic if ($_POST['claimStatButt'] == 1) { $viewerInfoQuery = ""; //get info for processing $jobInfoQuery = "SELECT * FROM `jobs` WHERE id=" . $_POST['formIdentifier'];