Incorporate changes for 1.2.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
writeupdetail.php
|
||||
OpenDRS Online Discrepancy Reporting System
|
||||
Copyright (C) 2020 Rod Wright
|
||||
Copyright (C) 2021 Rod Wright
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
@@ -39,8 +39,8 @@ $useredit=$incoming['useredit'];
|
||||
$techedit=$incoming['techedit'];
|
||||
$id=$incoming['id'];
|
||||
$device=$incoming['device'];
|
||||
$period=$incoming['period'];
|
||||
$period_effective=$incoming['period_effective'];
|
||||
$discovered=$incoming['discovered'];
|
||||
$functional=$incoming['functional'];
|
||||
$reported_by=$incoming['reported_by'];
|
||||
$report_date=$incoming['report_date'];
|
||||
$report_time=$incoming['report_time'];
|
||||
@@ -66,6 +66,9 @@ $role=dblookup($drs_db,"users","id","role",$userid);
|
||||
|
||||
framework("begin","$appname","Writeup Detail",$print);
|
||||
|
||||
//echo "_REQUEST array <br>";
|
||||
//var_dump($_REQUEST);
|
||||
//echo "<br><hr> incoming array <br>";
|
||||
//var_dump($incoming);
|
||||
|
||||
// ******** begin database manipulation ********
|
||||
@@ -89,7 +92,7 @@ if ($usersave) {
|
||||
$clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by);
|
||||
|
||||
// update the record in writeups
|
||||
mysqli_query($drs_db,"update writeups set device=\"$device\",period=\"$period\",period_effective=\"$period_effective\",reported_by=\"$clean_reported_by\",report_date=\"$report_date\",report_time=\"$report_time\",subsystem=\"$subsystem\",discrepancy_text=\"$clean_discrepancy_text\" where id=\"$id\"");
|
||||
mysqli_query($drs_db,"update writeups set device=\"$device\",discovered=\"$discovered\",functional=\"$functional\",reported_by=\"$clean_reported_by\",report_date=\"$report_date\",report_time=\"$report_time\",subsystem=\"$subsystem\",discrepancy_text=\"$clean_discrepancy_text\" where id=\"$id\"");
|
||||
}
|
||||
}
|
||||
elseif ($techsave) {
|
||||
@@ -115,8 +118,8 @@ elseif ($techsave) {
|
||||
// get current writeup data from database to populate fields
|
||||
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\""));
|
||||
$device=$writeupdata['device'];
|
||||
$period=$writeupdata['period'];
|
||||
$period_effective=$writeupdata['period_effective'];
|
||||
$discovered=$writeupdata['discovered'];
|
||||
$functional=$writeupdata['functional'];
|
||||
$reported_by=$writeupdata['reported_by'];
|
||||
$report_date=$writeupdata['report_date'];
|
||||
$report_time=$writeupdata['report_time'];
|
||||
@@ -195,7 +198,7 @@ echo "
|
||||
<td align=\"left\">Writeup ID<br>
|
||||
<table border=\"1\" width=\"100%\"><tr><td><center>$id</center></td></tr></table>
|
||||
</td>
|
||||
<td align=\"left\">Device<br>
|
||||
<td align=\"left\">$device_term<br>
|
||||
";
|
||||
if ($useredit) {
|
||||
echo "
|
||||
@@ -248,41 +251,49 @@ echo "
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=\"left\">Period<br>
|
||||
<td align=\"left\">$discovered_term<br>
|
||||
";
|
||||
if ($useredit) {
|
||||
echo "
|
||||
<select name=\"period\" id=\"period\">
|
||||
<select name=\"discovered\" id=\"discoveredselect\">
|
||||
";
|
||||
$prow=mysqli_query($drs_db,"select * from periods where active is true order by times asc");
|
||||
while ($pitem=mysqli_fetch_assoc($prow)) {
|
||||
if ($period==$pitem["id"]) {
|
||||
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]);
|
||||
if ($disc_drop_data=="Name") {
|
||||
$discddtitle="whendiscovereddesc";
|
||||
$discddtext="whendiscoveredname";
|
||||
} else if ($disc_drop_data=="Desc") {
|
||||
$discddtitle="whendiscoveredname";
|
||||
$discddtext="whendiscovereddesc";
|
||||
}
|
||||
$discrow=mysqli_query($drs_db,"select * from discovered where active is true order by whendiscoveredname asc");
|
||||
while ($discitem=mysqli_fetch_assoc($discrow)) {
|
||||
if ($discovered==$discitem["id"]) {
|
||||
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
|
||||
} else {
|
||||
printf("<option value=\"%s\" title=\"%s\">%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]);
|
||||
printf("<option value=\"%s\" title=\"%s\">%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
|
||||
}
|
||||
}
|
||||
echo "
|
||||
</select>
|
||||
";
|
||||
} else {
|
||||
$pertimes=dblookup($drs_db,"periods","id","times",$period);
|
||||
$discname=dblookup($drs_db,"discovered","id","whendiscoveredname",$discovered);
|
||||
$discdesc=dblookup($drs_db,"discovered","id","whendiscovereddesc",$discovered);
|
||||
echo "
|
||||
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$pertimes\">$period</font></td></tr></table>
|
||||
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$discdesc\">$discname</font></td></tr></table>
|
||||
";
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
";
|
||||
|
||||
$effstate=$nefstate="";
|
||||
if($period_effective==1) {
|
||||
$effstate="checked";
|
||||
$eff_ind="Effective";
|
||||
$funcyesstate=$funcnostate="";
|
||||
if($functional==1) {
|
||||
$funcyesstate="checked";
|
||||
$func_ind="$functional_yes";
|
||||
}
|
||||
if($period_effective==0) {
|
||||
$nefstate="checked";
|
||||
$eff_ind="Non-Effective";
|
||||
if($functional==0) {
|
||||
$funcnostate="checked";
|
||||
$func_ind="$functional_no";
|
||||
}
|
||||
|
||||
$openstate=$closedstate=$deferredstate="";
|
||||
@@ -340,16 +351,16 @@ if ($useredit) {
|
||||
";
|
||||
}
|
||||
echo "
|
||||
<td align=\"left\">Sim period effective? <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br>
|
||||
<td align=\"left\">$functional_term? <img src=\"icons/question.png\" title=\"" . FUNCTIONAL_HELP_TXT . "\"><br>
|
||||
";
|
||||
if ($useredit) {
|
||||
echo "
|
||||
<input type=\"radio\" name=\"period_effective\" value=\"1\" $effstate> Yes
|
||||
<input type=\"radio\" name=\"period_effective\" value=\"0\" $nefstate> No
|
||||
<input type=\"radio\" name=\"functional\" value=\"1\" $funcyesstate> Yes
|
||||
<input type=\"radio\" name=\"functional\" value=\"0\" $funcnostate> No
|
||||
";
|
||||
} else {
|
||||
echo "
|
||||
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$eff_title\">$eff_ind</font></td></tr></table>
|
||||
<table border=\"1\" width=\"100%\"><tr><td><font title=\"" . FUNCTIONAL_HELP_TXT . "\">$func_ind</font></td></tr></table>
|
||||
";
|
||||
}
|
||||
echo "
|
||||
|
||||
Reference in New Issue
Block a user