Example #1
0
        $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
        mysql_query($changeJobStatusQuery);
    }
}
//make query to
//$query = "SELECT `jobs`.id, `jobs`.name as jobname, `description`, `status`, `points`, `claimedby`, `jobstatus`.id, `jobstatus`.name FROM `jobs`, `jobstatus` WHERE jobs.status=jobstatus.id and jobstatus.id=3";
$query = "SELECT a.id, a.name, a.description, a.skillcatid, a.status, a.points, a.repeatable, a.limitone, a.claimedby, a.priority, a.bypassLimit, b.name as studentname FROM jobs a, students b WHERE a.status=3 and b.id=a.claimedby";
$result = mysql_query($query);
if (!$result) {
    die('Invalid query: ' . mysql_error());
}
echo "<table border=1>";
echo "\n\t<tr>\n\t\t<td>Name</td>\n\t\t<td>Description</td>\n\t\t<td>Points</td>\n\t\t<td>Who thought they finished it</td>\n\t\t<td>What do you want to do?</td>\n\t</tr>\n\t";
while ($row = mysql_fetch_assoc($result)) {
    // TODO format to look better
    echo "\n\t<tr>\n\t\t<td>" . $row['name'] . "</td>\n\t\t<td>" . $row['description'] . "</td>\n\t\t<td>" . $row['points'] . "</td>\n\t\t<td>" . $row['studentname'] . "</td>\n\t\t<td>\n\t\t\t<form method='post' name='dostuffbutts'>\n\t\t\t\t<center>\n\t\t\t\t<textarea name='whatsWrong' placeholder='whats wrong with the job?' style='margin:15px 0 0 0;'></textarea>\n\t\t\t\t<button type='submit' name='jobsToList' value='1'>Job isn't finished</button><br>\n\t\t\t\t<button type='submit' name='jobsToList' value='2'>They finished it</button>\n\t\t\t\t<input type='hidden' name='formIdentifier' value='" . $row['id'] . "'>\n\t\t\t\t</center>\n\t\t\t</form>\n\t\t</td>\n\t</tr>\n\t";
}
mysql_close($g_link);
makeFooter("&#169; Copyright Cherokee Washington Highschool <a href='index.php'> Home Page<a/><a href='' onclick='initIt()'>About us</a> <style>#footer a{color:black; margin-left:3px;}#footer p{color:black; text-decoration:underlined;}</style>", 0, "true");
Example #2
0
        echo "Class: " . $this->classs . "<br>";
        echo "Favorite Class: " . $this->favoriteClass . "<br><br>";
    }
    //do anything when object is shutdown/deleted
    function __destruct()
    {
        echo $this->firstName . " has been obliterated<br><br>";
    }
    //this is a fail safe to prevent a error if it is printed i think
    function __toString()
    {
        return "This is the student object not some text to be just printed<br><br>";
    }
}
echo "<h2>Create a new object from the student class</h2><br>";
$cat = new student("Max", "DeVos", "867-5309", 348, 11, 2017, "Chemistry");
echo "<h2>Run a test method</h2><br>";
$cat->test();
echo "<h2>Run a printall method for a student</h2><br>";
$cat->printall();
echo "<h2>Try to print the student object as text</h2><br>";
echo $cat;
echo "<h2>Activate the destruct function by giving the object the text value of 'dog'</h2><br>";
$cat = "dog";
?>
</div>
</center>

<?php 
makeFooter("Programing is Fun", 0, "True");
Example #3
0
}
# Start running File Thingie #
session_start();
header("Content-Type: text/html; charset=ISO-8859-1");
$str = "";
if (checklogin()) {
    // Run initializing functions.
    sanitizeREQUEST();
    doAction();
    $str = makeHeader();
    $str .= makeSidebar();
    $str .= makeBody();
} else {
    $str .= makeLogin();
}
$str .= makeFooter();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<?php 
require "../includes/globals.php";
session_start();
//$id = $_SESSION['valid_admin'];
//$pw = $_SESSION['pw'];
$error = '<font color="#0000FF"><strong>You must be logged in to view this page</strong></font>';
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Example #4
0
    $jobQueryResult = mysql_query($jobQuery);
    //make a table
    echo "\n\t<center>\n\t\t<table style='width:100%;margin-bottom:10px;'>\n\t\t<tr>\n\t\t\t<form method='post' name='sortButtons'>\n\t\t\t\t<td><button class='sortRowButts' type='submit' name='sortButt' value='1'>Job Name</button></td>\n\t\t\t\t<td><button class='sortRowButts' type='submit' name='sortButt' value='2'>Job Description</button></td>\n\t\t\t\t<td><button class='sortRowButts' type='submit' name='sortButt' value='3'>Job Points</button></td>\n\t\t\t\t<td><button class='sortRowButts' type='submit' name='sortButt' value='4'>Job Category</button></td>\n\t\t\t\t<td><button class='sortRowButts' type='submit' name='sortButt' value='5'>Claim Status</button></td>\n\t\t\t</form>\n\t\t</tr>";
    //create an object for every job
    while ($jobdata = mysql_fetch_assoc($jobQueryResult)) {
        $job[$jobdata['id']] = new jobs($jobdata['id'], $jobdata['name'], $jobdata['description'], $jobdata['skillcatid'], $jobdata['status'], $jobdata['points'], $jobdata['repeatable'], $jobdata['limitone'], $jobdata['claimedby'], $jobdata['priority'], $jobdata['bypassLimit']);
        $job[$jobdata['id']]->printJob();
        //print the row for a job
        echo "<script>jobCount++;</script>";
    }
    //print the job count to the screen
    if ($formCheck == "False") {
        echo "\n\t\t<script>\n\t\t\tdocument.getElementById('status').innerHTML = 'Status: '+(jobCount - ignoreCount)+' Jobs were retrieved!';\n\t\t</script>\n\t\t";
    }
    //finish the table
    echo "</table></center>";
    if (isset($_SESSION['showIgnoredJobs']) && $_SESSION['showIgnoredJobs'] == "False" && $_SESSION['jobsection'] != "3") {
        echo "\n\t<form name='ignoreShow' method='POST'>\n\t<button type='submit' name='showIgnored' value='1'>Show Ignored Jobs</button>\n\t</form>\n\t";
    } else {
        if (isset($_SESSION['showIgnoredJobs']) && $_SESSION['showIgnoredJobs'] == "True" && $_SESSION['jobsection'] != "3") {
            echo "\n\t\t\n\t<form name='ignoreShow' method='POST'>\n\t<button type='submit' name='showIgnored' value='2'>Hide Ignored Jobs</button>\n\t</form>\n\t";
        }
    }
}
//end of main function
//call main function
main();
//add the footer html
makeFooter("&#169; Copyright Cherokee Washington Highschool <a href='index.php'> Home Page</a> <a href='create_jobs.php'>Create Job</a> <style>#footer a{color:black; margin-left:3px;}#footer p{color:black; text-decoration:underlined;}</style>", 0, "True");
//end connection
mysql_close($conn);
Example #5
0
function auth()
{
    // Globals
    global $DB;
    global $TIMEMARK;
    global $IGB;
    // Handle possible logouts, activations et all.
    include_once './functions/login/preAuth.php';
    // Trust, INC.
    $alert = getConfig("trustSetting");
    if ($IGB && $alert == 2) {
        // So we are an IGB call and we want passwordless logins.
        // Check for a previous "Login"
        $MySelf = authKeyIsValid();
        // Now we check if MySelf is "true" if it is, we have a valid login.
        if ($MySelf == false) {
            /*
             * Okay here we want passwordless logins. We also have no previous active login.
             * This means we now have to search the database for a matching username.
             */
            global $EVE_Charname;
            $MySelf = authVerify(sanitize($EVE_Charname), false, true);
            /*
             * If we were successfull $MySelf does now contain a userrecord, or is false on failure.
             */
            if ($MySelf == false) {
                /*
                 * No such user found. To avoid a login loop we will now break the cycle and
                 * present the user with the request account form.
                 */
                makeNotice("You do not belong here. Leave at once!", "warning", "ACCESS DENIED");
                die;
                global $page;
                $page = makeRequestAccountPage(true) . makeFooter();
                print $page;
            } else {
                /*
                 * Here we found a matching user. What we do now is to create an auth key
                 * for this user, drop other logins from the database and store the login time.
                 */
                createAuthKey($MySelf);
                $DB->query("update users set lastlogin = '******' where username = '******'");
                $_SESSION['MySelf'] = base64_encode(serialize($MySelf));
                // Beta Warning.
                global $IS_BETA;
                if ($IS_BETA && $_SESSION[betawarning] != $MySelf->getLastlogin()) {
                    $_SESSION[betawarning] = $MySelf->getLastlogin();
                    makeNotice("You are using a beta version of MiningBuddy. Be aware that some functions may not " . "be ready for production servers, and that there may be bugs around. You have been warned.", "warning", "Beta Warning");
                }
            }
        }
    } else {
        /*
         * Lets see wether there is a login request, this has priority over
         * anything else. We dont want to create a login loop.
         */
        if (isset($_POST['login'])) {
            /*
             * So we have a login post. We will now check the username and
             * password combination against the database. Lets see if it is
             * a legit user or a fraud^wtypo.
             */
            // The dynamical banning module.
            checkBan();
            $SUPPLIED_USERNAME = strtolower(sanitize($_POST['username']));
            // Check for validity.
            if (!ctypeAlnum($SUPPLIED_USERNAME)) {
                makeNotice("Invalid username. Only characters a-z, A-Z and 0-9 are allowed.", "error", "Invalid Username");
            }
            if (!isset($_SESSION['testauth'])) {
                $SUPPLIED_PASSWORD = sha1($_POST['password']);
                // Lets check the password.
                $MySelf = authVerify($SUPPLIED_USERNAME, $SUPPLIED_PASSWORD);
            } else {
                $MySelf = authVerify($SUPPLIED_USERNAME, false);
            }
            if ($MySelf == false) {
                // Lets try again, shall we?
                makeLoginPage($SUPPLIED_USERNAME);
            } else {
                if ($MySelf->isValid()) {
                    // storing the new login time.
                    $DB->query("update users set lastlogin = '******' where username = '******'");
                    // Create the auth-key.
                    createAuthKey($MySelf);
                }
            }
            // We are done here.
            $_SESSION['MySelf'] = base64_encode(serialize($MySelf));
            // Beta Warning.
            global $IS_BETA;
            if ($IS_BETA && $_SESSION['betawarning'] != $MySelf->getLastlogin()) {
                $_SESSION[betawarning] = $MySelf->getLastlogin();
                makeNotice("You are using a beta version of MiningBuddy. Be aware that some functions may not " . "be ready for production servers, and that there may be bugs around. You have been warned.", "warning", "Beta Warning");
            } else {
                header("Location: index.php?{$_SERVER['QUERY_STRING']}");
                die;
            }
        }
        /*
         * This is to check wether the user still has a valid login ticket.
         */
        $MySelf = authKeyIsValid();
        if ($MySelf == false) {
            $_SESSION['lastModDisplay'] = false;
            session_destroy();
            makeLoginPage();
            die;
        }
    }
    /*
     * Print motd. (Only on login) - and only if set.
     */
    $MOTD = getTemplate("motd", "announce");
    if (!$_SESSION['seenMotd'] && !empty($MOTD)) {
        $_SESSION['seenMotd'] = true;
        makeNotice(nl2br(stripslashes($MOTD)), "notice", "Announcement");
    }
    return $MySelf;
}
Example #6
0
function ShowReport(){
	
	global $GroupCostCenter;
	global $GroupPersonType;
	
	?>
	<html>
	<head>
		<META http-equiv=Content-Type content="text/html; charset=UTF-8" >
		<style>
			.header {
				background-color: #D9EBFF;
				font-weight: bold;
				font-size: 10px !important;
			}
			.header td{
				font-size: 11px !important;
			}
			/*-----------------------*/
			#outer table {
				border : 0px;
				border-collapse: collapse;
				width : 100%;
			}
			#outer tr {
				border : 1px solid black;
				border-bottom: 0px;
			}
			#outer td {
				font-family: tahoma;
				font-size: 10px;
				height : 21px;
			}
			/*-----------------------*/
			#inner table {
				border : 0px;
				border-collapse: collapse;
				width : 100%;
			}
			#inner td {
				font-family: tahoma;
				padding-right : 3px;
				font-size: 10px;
				height : 21px;
				border-collapse: collapse;
				border : 1px solid black;
			}
		</style>
	</head>
		<body dir=rtl>
	<?	
	
	$person_count;
	$salaryItems = array();
	global $MainQuery;
	$MainRows = PrepareData($person_count,$_GET['RepType']);
				
	$currentGroup = "";
	for($i=0; $i < count($MainRows); $i++)
	{
		$row = $MainRows[$i];
		
		$group = $GroupCostCenter ? $row["cost_center_id"] . "_" : "ALL_";
		$group .= $GroupPersonType ? $row["person_type"] : "ALL";
		
		if($currentGroup != $group)
		{
			if($currentGroup != "")
			{				
				makeBody($salaryItems);
				makeFooter();
			}
			makeHeader($row, $person_count);
			$currentGroup = $group;
			$i--;
			$salaryItems = array();
			continue;			
		}
		
		$salaryItems[ $row["salary_item_type_id"] ] = $row;
		$salaryItems[ $row["salary_item_type_id"] ]["value"] = ($row["effect_type"] == "1") ? $row["pay_sum"] : $row["get_sum"];
		
		$salaryItems[ $row["salary_item_type_id"] ]["diff_value"] = ($row["effect_type"] == "1") ? $row["diff_pay_sum"] : $row["diff_get_sum"];
	}	
	
	//--------- for last costcenter --------------
	makeBody($salaryItems);
	makeFooter();
?>
	<div style="display:none"><?= $MainQuery ?></div>
	</body>		
</html>		
<?
}
Example #7
0
    }
}
// create document header ...
makeHeader(isset($_GET['act']) ? $_GET['act'] : "Установка");
// show navi bar ...
makeNavi();
// show fav tables ...
if (isset($_GET['act'])) {
    if ($_GET['act'] === "fav") {
        if (($chanXml = $kartAPI->getChannelListXml()) !== FALSE && ($favXml = $kartAPI->getFavoritesXML()) !== FALSE) {
            echo "<table>\n<tr>\n<td style='vertical-align: top;'>\n";
            makeFavTab($favXml, $chanXml);
            echo "</td>\n<td>\n";
            makeChanTab($favXml, $chanXml);
            echo "</td>\n</tr>\n</table>\n";
        }
    } else {
        if ($_GET['act'] === "acc") {
            makeAccForm();
        } else {
            if ($_GET['act'] === "timestuff") {
                makeTZForm();
            }
        }
    }
} else {
    echo "Kartina Config Panel: Choose from actions above!";
}
// close document ...
makeFooter();
Example #8
0
<?php

require_once 'functions.php';
echo makePageStart("Review it!", "review.css");
echo makeHeader("My New Header");
echo makeNavMenu("Categories", array("index.php" => "Home", "book.php" => "Books", "dvd.php" => "DVD", "games.php" => "Games"));
// echo makeMainArea();
echo startMain();
?>
 
<h2>Add your reviews of the following and more</h2>
<h3>Jamie's America</h3>
<p>Jamie will try real American food and meet the most interesting cooks and producers that this vast country has to offer. His epic journey will take him to the heart of America: its people, culture, music and, most importantly, its food. As well as being a visually stunning journey, "Jamie's America" is a practical cookbook, with each chapter focusing on the food and recipes of a different state. Add review</p>
<?php 
echo endMain();
echo makeFooter("Product details taken from the whsmith web site");
echo makePageEnd();
?>


Example #9
0
$formularAction = "index.php";
$cssdatei = "MyIndexCSS.css";
$usr = "******";
$pw = "12345";
if (!isset($_SESSION['logged'])) {
    $_SESSION['logged'] = false;
    $_SESSION['username'] = "******";
    $_SESSION['pw'] = "12345";
    $usr = $_SESSION['username'];
    $pw = $_SESSION['pw'];
}
// --- integrate internal datas  -------------------
include "/mytools/my_tools_inc.php";
// integration of my_tools
require "/mytools/my_formular_inc.php";
// integration of the formular data
require "/mytools/my_content_req.php";
// integrate the contentalso w
require "/mytools/my_db_func.php";
// Integrate the database functions
// --- Begin of declaration of functions / methods / modules  -----------------
// --- End Declaration of functions / methods / modules -------------------
// ---- Start of flowchart diagram  ----------------------------
makeHeader($titel, $cssdatei);
makeMenue();
MakeMain();
isLogged();
makeContent($usr, $pw);
MakeProgressbar(60);
makeFooter($autor, $version);
//--- End Start of flowchart diagram  ------------------------------
Example #10
0
e.	The following links:

<li><a href="about.php">About</a></li>
<li><a href="products.php">Products</a></li>
<li><a href="extras.php">Extras</a></li>
<li><a href="order.php">Ordering</a></li>


f.	The main area of the page should have 
i.	The h2 heading <h2>Current products</h2>
ii.	Two paragraphs of made up product text

g.	Footer text: Copyright 2014

 -->
 <?php 
require_once 'functions.php';
echo makePageStart("Newcastle Sports  - Products", "sports.css");
echo makeHeader("Newcastle Sports");
echo makeNavMenu("Menu", array("about.php" => "About", "products.php" => "products", "extras.php" => "Extras", "order.php" => "Ordering"));
// echo makeMainArea();
echo startMain();
?>
 
<h2>Current products</h2>
<h3>Lorem Ipsum</h3>
<p>Jamie will try real American food and meet the most interesting cooks and producers that this vast country has to offer. His epic journey will take him to the heart of America: its people, culture, music and, most importantly, its food. As well as being a visually stunning journey, "Jamie's America" is a practical cookbook, with each chapter focusing on the food and recipes of a different state. Add review</p>
<?php 
echo endMain();
echo makeFooter("Copyright 2014");
echo makePageEnd();
Example #11
0
<?php

require_once 'functions.php';
echo makePageStart("Review it! Books Page", "review.css");
echo makeHeader("Review it!");
echo makeNavMenu("Categories", array("index.php" => "Home", "book.php" => "Books", "dvd.php" => "DVD", "games.php" => "Games"));
echo startMain();
?>
<h2>Books</h2>
<h3>A book title</h3>
<p>Info about a book...</p>
<?php 
echo endMain();
echo makeFooter("Product details are made up");
echo makePageEnd();