Initial commit as release 1.1.0
This commit is contained in:
84
boilerplate.php
Normal file
84
boilerplate.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*
|
||||
boilerplate.php
|
||||
OpenDRS Online Discrepancy Reporting System
|
||||
Copyright (C) 2018 Rod Wright
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
include("common.php");
|
||||
|
||||
// redirect to index.php on cancel button press
|
||||
if ($_REQUEST['cancel']) {
|
||||
header("Cache-Control:no-cache, must-revalidate");
|
||||
header("Pragma:no-cache");
|
||||
header("Location:index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
// import session variables
|
||||
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
|
||||
|
||||
// import incoming arrays
|
||||
$print=$_REQUEST['print'];
|
||||
if ($print) {
|
||||
// if printer friendly was clicked, values will be passed in serialized
|
||||
// form as "all_parameters" so we need to load those into $incoming
|
||||
$incoming=unserialize($_REQUEST['all_parameters']);
|
||||
} else {
|
||||
// copy $_REQUEST to $incoming
|
||||
$incoming=arrayCopy($_REQUEST);
|
||||
}
|
||||
|
||||
// load variables from incoming array
|
||||
|
||||
|
||||
// define local functions
|
||||
|
||||
|
||||
// assign variables from constants
|
||||
$appname=APP_NAME;
|
||||
|
||||
if ($print=="Printer Friendly") {
|
||||
$sbcolor=P_SIDEBAR_COLOR;
|
||||
$mbgcolor=P_MENUBG_COLOR;
|
||||
} else {
|
||||
$sbcolor=SIDEBAR_COLOR;
|
||||
$mbgcolor=MENUBG_COLOR;
|
||||
}
|
||||
|
||||
$role=dblookup($mts_db,"users","id","role",$userid);
|
||||
|
||||
framework("begin","$appname","Boilerplate Page",$print);
|
||||
|
||||
//var_dump($_REQUEST);
|
||||
//var_dump($incoming);
|
||||
|
||||
// ******** begin database manipulation ********
|
||||
|
||||
|
||||
// ******** end database manipulation ********
|
||||
|
||||
pagetable("begin");
|
||||
if (!$print) {
|
||||
pageblock("left","begin");
|
||||
sidemenu();
|
||||
pageblock("left","end");
|
||||
}
|
||||
pageblock("right","begin");
|
||||
banner($print);
|
||||
echo "<br>";
|
||||
|
||||
|
||||
echo "<center><b><font size=\"+1\">This is the standard template used for all pages in the application.</font></b></center>";
|
||||
|
||||
|
||||
echo "<br>";
|
||||
banner($print);
|
||||
pageblock("right","end");
|
||||
pagetable("end");
|
||||
|
||||
framework("end","","",$print);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user