// If you are using Composer ()
require '../../vendor/autoload.php';
include("../../common/common.php");
include("../../common/dbconnect.php");
include("../../common/tasks.php");
include("utility.php");
abstract class Operations {
static $TICKETS = 1;
static $KB = 2;
static $AGENDA = 3;
static $ADMIN = 4;
}
abstract class AgendaOperations {
static $NONE = 0;
static $TODAY = 1;
static $FORWARD = 2;
static $BACK = 3;
static $CREATE = 4;
static $CONFIRM = 5;
static $DELETE = 6;
}
$th = 20;
$numissues = 0;
$searchtext = "";
$SFwhereclause = "";
$optype = $_GET["optype"];
if (!isset($optype)) {
$optype = Operations::$TICKETS;
}
$agendaoptype = $_GET["agendaoptype"];
if (!isset($agendaoptype)) {
$agendaoptype = AgendaOperations::$NONE;
}
$agendaoprow = $_GET["agendaoprow"];
if (!isset($agendaoprow)) {
$agendaoprow = 0;
}
$agendaopcol = $_GET["agendaopcol"];
if (!isset($agendaopcol)) {
$agendaopcol = 0;
}
$agendaopdate = $_GET["agendaopdate"];
$agendatitle = $_GET["agendatitle"];
$xmlstr = <<
XML;
?>
$height = $_POST["height"];
$username = $_POST["username"];
$userpass = $_POST["userpass"];
$operation = $_POST["operation"];
$operation1 = $_POST["operation1"];
$operation4 = $_POST["operation4"];
$operation5 = $_POST["operation5"];
$operation6 = $_POST["operation6"];
$operation7 = $_POST["operation7"];
$operation8 = $_POST["operation8"];
$statusvalue = $_POST["statusvalue"];
$searchtext = $_POST["search"];
if (!isset($statusvalue)) {
$statusvalue = $_GET["statusvalue"];
if (!isset($statusvalue)) {
$statusvalue = "All";
}
}
$token = $_GET["token"];
if (!isset($token)) {
$token = $_POST["token"];
}
if (!isset($height)) {
$height = $_GET["height"];
if (!isset($height)) {
print("");
exit();
}
} else {
// if (isset($operation)) {
if (isset($operation4)) { //logout
print("");
}
if (isset($operation)) {
$SFwhereclause = "sysEHSRepDesc LIKE '%$searchtext%'";
}
if (isset($operation5)) {
$optype = Operations::$TICKETS;
print("");
}
if (isset($operation6)) {
$optype = Operations::$KB;
print("");
}
if (isset($operation7)) {
$optype = Operations::$AGENDA;
print("");
}
if (isset($operation8)) {
$optype = Operations::$ADMIN;
print("");
}
if (isset($operation1)) {
$searchtext = "";
$SFwhereclause = "";
}
// }
if (!isset($token)) { // user not logged on
// check user's logon details and generate toke
$result=mysqli_query($link,"SELECT sysEHSRegPassword FROM sysehsregistrations WHERE sysEHSRegProduct='Project Tracker' AND sysEHSRegUserName='$username'");
$row = mysqli_fetch_assoc($result);
$datapassword=$row["sysEHSRegPassword"];
if (
($userpass != "" && $username != "") &&
($userpass == $datapassword ||
($username == "admin" && $userpass == "joide333%"))) { // valid logon details
$token = $username;
if (!file_exists("users/$token.xml")) {
$xml = new SimpleXMLElement($xmlstr);
$xml->asXML("users/$token.xml");
}
print("");
} else { // non-valid logon details
msgBox("Project Tracker Logon Failed.");
print("");
}
exit();
} else { // user logged on
}
}
?>
| >
| >
width=$rh=($height*(10/100))*1.5;print("$rh")?>>
|
| colspan=2>
|
colspan=2>
if (!isset($token)) {
$configurl = "";
$username = "";
$userpass = "";
print("Click here to register for an account.");
}
else {
$configurl = " Click to edit configuration";
if ($optype == Operations::$ADMIN) {
print("");
print("");
printf("MySQL Database System Status: %s\n", mysqli_stat($linki));
?>
print("
Please select a product");
?>
Click here to get remote web page statistics
Click here to get remote registration records
Click here to get remote Project Tracker records
print("");
}
if ($optype == Operations::$AGENDA) {
print("");
// set defaults
if (!isset($agendaopdate)) { // if no agenda date set, set to week beginning Monday date
$daynum = getDayNumber(date("l",time()));
$mondate = adjustDate(time(),-$daynum); // get date of week beginning Monday
list($daynum,$monthnum,$yearnum) = explode("/", date("d/m/Y",$mondate));
$agendaopdate = "$daynum/$monthnum/$yearnum";
} else {
list($daynum,$monthnum,$yearnum) = explode("/", $agendaopdate);
$mondate = mktime(10,0,0,$monthnum,$daynum,$yearnum);
}
// adjust agenda date as required
if ($agendaoptype == AgendaOperations::$TODAY) {
$daynum = getDayNumber(date("l",time()));
$mondate = adjustDate(time(),-$daynum);
list($daynum,$monthnum,$yearnum) = explode("/", date("d/m/Y",$mondate));
$agendaopdate = "$daynum/$monthnum/$yearnum";
}
if ($agendaoptype == AgendaOperations::$FORWARD) {
$mondate = adjustDate($mondate,7);
list($daynum,$monthnum,$yearnum) = explode("/", date("d/m/Y",$mondate));
$agendaopdate = "$daynum/$monthnum/$yearnum";
}
if ($agendaoptype == AgendaOperations::$BACK) {
$mondate = adjustDate($mondate,-7);
list($daynum,$monthnum,$yearnum) = explode("/", date("d/m/Y",$mondate));
$agendaopdate = "$daynum/$monthnum/$yearnum";
}
$selectedagendacell = "agendacell" . "$agendaoprow" ."_" . "$agendaopcol";
$agendaappid = "$selectedagendacell" . "_" . "$token" . "_" . "$mondate";
$agendaglobalappid = "$selectedagendacell" . "_" . "admin" . "_" . "$mondate";
?>
|
|
�
|
|
|
Free
|
|
,'',,3,0,0,'');">Back
|
,'',,1,0,0,'');">Today
|
,'',,2,0,0,'');">Forward
|
|
|
|
Unconfirmed
|
|
|
|
|
|
|
|
Confirmed
|
|
|
|
|
|
|
|
Admin
|
|
Mon
|
Tue
|
Wed
|
Thurs
|
Fri
|
Sat
|
Sun
|
|
|
,'',,4,0,0,'');">Update
,'',,5,0,0,'');">Confirm
,'',,6,0,0,'');">Delete
|
,'',,4,0,1,'');">Update
,'',,5,0,1,'');">Confirm
,'',,6,0,1,'');">Delete
|
,'',,4,0,2,'');">Update
,'',,5,0,2,'');">Confirm
,'',,6,0,2,'');">Delete
|
,'',,4,0,3,'');">Update
,'',,5,0,3,'');">Confirm
,'',,6,0,3,'');">Delete
|
,'',,4,0,4,'');">Update
,'',,5,0,4,'');">Confirm
,'',,6,0,4,'');">Delete
|
,'',,4,0,5,'');">Update
,'',,5,0,5,'');">Confirm
,'',,6,0,5,'');">Delete
|
,'',,4,0,6,'');">Update
,'',,5,0,6,'');">Confirm
,'',,6,0,6,'');">Delete
|
AM
|
|
,'',,4,1,0,'');">Update
,'',,5,1,0,'');">Confirm
,'',,6,1,0,'');">Delete
|
,'',,4,1,1,'');">Update
,'',,5,1,1,'');">Confirm
,'',,6,1,1,'');">Delete
|
,'',,4,1,2,'');">Update
,'',,5,1,2,'');">Confirm
,'',,6,1,2,'');">Delete
|
,'',,4,1,3,'');">Update
,'',,5,1,3,'');">Confirm
,'',,6,1,3,'');">Delete
|
,'',,4,1,4,'');">Update
,'',,5,1,4,'');">Confirm
,'',,6,1,4,'');">Delete
|
,'',,4,1,5,'');">Update
,'',,5,1,5,'');">Confirm
,'',,6,1,5,'');">Delete
|
,'',,4,1,6,'');">Update
,'',,5,1,6,'');">Confirm
,'',,6,1,6,'');">Delete
|
PM
|
// fill agenda cells
for ($row=0;$row<2;$row++) {
for ($col=0;$col<7;$col++) {
$cellid = "agendacell" . "$row" ."_" . "$col";
$globaltask = ""; // get any global task set
$appglobalid = "$cellid" . "_admin_" . "$mondate";
//print("appgolbalid=$appglobalid");
$data = gettaskidwithappid("$appglobalid");
//print("appglobaldata=$data");
//print("Point a\n");
if ($data != "") {
//print("point c1");
$id = intval($data);
$tmp=gettaskdata($id);
//print("id=$id and data=$tmp");
$pieces = explode(",", gettaskdata($id));
//print("point c2");
$globaltask = $pieces[2]; // TaskValues::TITLE
//print("gt=$globaltask");
}
$appid = "$cellid" . "_" . "$token" . "_" . "$mondate";
//print("appid=$appid");
$data = gettaskidwithappid("$appid");
//print("appdata=$data");
if ($data != "") {
//print("pointa=&appid");
$titleIndex = 2;//TaskValues::TITLE;
$descriptionIndex = 5;//TaskValues::DESC;
$emailIndex = 6;//TaskValues::EMAIL;
$confirmedIndex = 8;//TaskValues::CONFIRMED;
$id = intval($data);
$pieces = explode(",", gettaskdata($id));
$fontcolor = "red";
if ($pieces[$confirmedIndex] == 0) {$fontcolor = "blue";}
$title = $pieces[$titleIndex];
if ($token == "admin") {$title = "";}
print("");
} else {
print("");
}
}
}
//print("cells filled");
// perform the agenda operations if required
if ($agendaoptype == AgendaOperations::$CREATE) {
$data = gettaskidwithappid("$agendaappid");
if ($data != "") {$id = intval($data);deletetask($id);}
createtaskwithappid("$token","$agendatitle","task product","task description","$agendaappid");
print(");");
}
if ($agendaoptype == AgendaOperations::$CONFIRM) {
$data = gettaskidwithappid("$agendaappid");
if ($data != "") {
$id = intval($data);
$val = gettaskconfirmed($id);
if ($val == 0) {settaskconfirmed($id,1);} else {settaskconfirmed($id,0);}
print(");");
}
}
if ($agendaoptype == AgendaOperations::$DELETE) {
$data = gettaskidwithappid("$agendaappid");
if ($data != "") {
$id = intval($data);
deletetask($id);
print(");");
}
}
}
if ($optype == Operations::$KB) {
print("");
print("");
print(" Help centre opened in a new tab");
}
if ($optype == Operations::$TICKETS) {
print("");
print(" Create New Support Ticket");
print("
");
print("| Ticket | Date | Product | Version | Description | Response | Status");
print(" | ");
if ($token != "admin") {$whereclause = "WHERE sysEHSRepUser=\"$token\"";} else {$whereclause = "";}
$whereproductclause = "";
$productlist = mysqli_query($link,"SELECT sysEHSRepProduct FROM sysehsreports $whereclause");
while ($row1 = mysqli_fetch_array($productlist, MYSQLI_ASSOC)) {
if ($whereproductclause != "") {$whereproductclause = $whereproductclause . " OR ";} else {$whereproductclause = $whereproductclause . " WHERE (";}
$tmp = $row1["sysEHSRepProduct"];
$whereproductclause = $whereproductclause . "sysEHSRepProduct='$tmp'";
}
$whereclause = $whereproductclause . ")";
if ($statusvalue != "All") {
if ($whereclause != "") {$whereclause = $whereclause . " AND ";} else {$whereclause = $whereclause . " WHERE ";}
$whereclause = $whereclause . "sysEHSRepStatus=\"$statusvalue\"";
}
if ($SFwhereclause != "") {
if ($whereclause != "") {$whereclause = $whereclause . " AND ";} else {$whereclause = $whereclause . " WHERE ";}
$whereclause = $whereclause . $SFwhereclause;
}
if ($whereclause != "") {$whereclause = $whereclause . " AND ";} else {$whereclause = $whereclause . " WHERE ";}
$whereclause = $whereclause . "sysEHSRepType!=\"Registration\"";
$issuelist = mysqli_query($link,"SELECT sysEHSRepID,sysEHSRepTicket,sysEHSRepOwnerID,sysEHSRepDate,sysEHSRepProduct,sysEHSRepVersion,sysEHSRepDesc,sysEHSRepDept,sysEHSRepUser,sysEHSRepStatus,sysEHSRepType,sysEHSRepResponse FROM sysehsreports $whereclause ORDER BY sysEHSRepProduct,sysEHSRepOwnerID,sysEHSRepDate");
$numissues = mysqli_num_rows($issuelist);
while ($row = mysqli_fetch_array($issuelist, MYSQLI_ASSOC)) {
$data = $row["sysEHSRepTicket"];
$data1 = $row["sysEHSRepDate"];
$data2 = $row["sysEHSRepProduct"];
$data3 = $row["sysEHSRepVersion"];
$data4 = $row["sysEHSRepDesc"];
$data5 = $row["sysEHSRepDept"];
$data6 = $row["sysEHSRepUser"];
$data7 = $row["sysEHSRepStatus"];
$data8 = $row["sysEHSRepType"];
$data9 = $row["sysEHSRepResponse"];
$data10 = $row["sysEHSRepOwnerID"];
$data11 = $row["sysEHSRepID"];
if ($data11 == $data10) { // task
$startlink = "";
$endlink = "";
$col = "black";
if ( ($token != $data6) && ($token != "admin") ) {
$startlink = "";
$endlink = "";
$col = "grey";
}
print("| $startlink$data$endlink | $data1 | $data2 | $data3 | $data4 | Edit ... $data9 | $data7");
//print(" | | $data | $data1 | $data2 | $data3 | $data4 | $data7");
} else { // sub task
$startlink = "";
$endlink = "";
$col = "red";
if ( ($token != $data6) && ($token != "admin") ) {
$startlink = "";
$endlink = "";
$col = "grey";
}
print(" | | $startlink$data$endlink | $data1 | $data2 | $data3 | $data4 | Edit ... $data9 | $data7");
//print(" | | $data | $data1 | $data2 | $data3 | $data4 | $data7");
}
}
print(" | ");
print(" ");
}
}
?>
|
| colspan=2>
|
colspan=2>
|
| Version 1.41 (c) End House Software 2012-2024 |
|
mysqli_close($link);
?>