Various reformats. Changed boolean variables from 1/0 to TRUE/FALSE in multiple files.

This commit is contained in:
2026-02-19 14:08:40 -05:00
parent 9122040863
commit 01fd47814b
22 changed files with 3502 additions and 3150 deletions

View File

@@ -9,56 +9,55 @@
include("functions.php");
$print=$_REQUEST['print'];
$tech=$_REQUEST['tech'];
$pass=$_REQUEST['pass'];
$login=$_REQUEST['login'];
$cancel=$_REQUEST['cancel'];
$print = $_REQUEST['print'];
$tech = $_REQUEST['tech'];
$pass = $_REQUEST['pass'];
$login = $_REQUEST['login'];
$cancel = $_REQUEST['cancel'];
if ($cancel) {
session_destroy();
}
$techalpha=TECH_ALPHA;
$logname=LOG_NAME;
$techalpha = TECH_ALPHA;
$logname = LOG_NAME;
if ($print) {
$sbcolor=P_SIDEBAR_COLOR;
$mbgcolor=P_MENUBG_COLOR;
$sbcolor = P_SIDEBAR_COLOR;
$mbgcolor = P_MENUBG_COLOR;
} else {
$sbcolor=SIDEBAR_COLOR;
$mbgcolor=MENUBG_COLOR;
$sbcolor = SIDEBAR_COLOR;
$mbgcolor = MENUBG_COLOR;
}
framework("begin","$logname","Login Page",$print);
framework("begin", "$logname", "Login Page", $print);
pagetable("begin");
if(!$print){
pageblock("left","begin");
if (!$print) {
pageblock("left", "begin");
sidemenu("no print");
pageblock("left","end");
pageblock("left", "end");
}
pageblock("right","begin");
pageblock("right", "begin");
if ($login) {
// log me in
$pwhash=mysqli_fetch_row(mysqli_query($db,"select techpass from techs where techid=\"$tech\""))[0];
$pwhash = mysqli_fetch_row(mysqli_query($db, "select techpass from techs where techid=\"$tech\""))[0];
if (password_verify($pass, $pwhash)) {
$_SESSION['login']=$tech;
$techname=dblookup($db,"techs","techid","techname",$tech);
$_SESSION['login'] = $tech;
$techname = dblookup($db, "techs", "techid", "techname", $tech);
echo "
Welcome $techname. Please select a menu option at the left to continue.
";
} else {
$adminqry=mysqli_query($db,"select techname from techs where admin=1 and status=1");
$adminqry = mysqli_query($db, "select techname from techs where admin=1 and status=1");
echo "
Incorrect password. Please <a href=\"login.php\">try again</a>.<br><br>
Forgot your password? Contact an administrator:<br><br>
";
while ($admintech=mysqli_fetch_row($adminqry)[0]) {
while ($admintech = mysqli_fetch_row($adminqry)[0]) {
echo "$admintech <br>";
}
}
} else if ($cancel) {
echo "
@@ -72,11 +71,12 @@ if ($login) {
<b>Tech: </b>&nbsp;
<select name=\"tech\">
";
if ($techalpha) $torder="techname"; else $torder="techid";
$techrow=mysqli_query($db,"select * from techs order by $torder asc");
while ($techitem=mysqli_fetch_assoc($techrow)) {
if ($techitem["status"]==1) {
printf("<option value=\"%s\">%s</option>",$techitem["techid"],$techitem["techname"]);
if ($techalpha) $torder = "techname";
else $torder = "techid";
$techrow = mysqli_query($db, "select * from techs order by $torder asc");
while ($techitem = mysqli_fetch_assoc($techrow)) {
if ($techitem["status"] == 1) {
printf("<option value=\"%s\">%s</option>", $techitem["techid"], $techitem["techname"]);
}
}
echo "</select><br><br>
@@ -87,16 +87,14 @@ if ($login) {
<br><hr>
";
} else {
$loginid=$_SESSION['login'];
$loggedinas=mysqli_fetch_row(mysqli_query($db,"select techname from techs where techid=\"$loginid\""))[0];
$loginid = $_SESSION['login'];
$loggedinas = mysqli_fetch_row(mysqli_query($db, "select techname from techs where techid=\"$loginid\""))[0];
echo "
You are already logged in as $loggedinas. Please select a menu option at the left to continue.<br><hr>
";
}
}
pageblock("right","end");
pageblock("right", "end");
pagetable("end");
framework("end","","",$print);
?>
framework("end", "", "", $print);