Incorporated changes for release 1.1.1

This commit is contained in:
2026-02-14 11:26:01 -05:00
parent a6331f7fed
commit 16d1ff9bb8
45 changed files with 459 additions and 155 deletions

View File

@@ -2,7 +2,7 @@
/*
search.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -42,9 +42,12 @@ $s_action_by=$incoming['s_action_by'];
$s_action_reason=$incoming['s_action_reason'];
$s_action_text=$incoming['s_action_text'];
$s_subsystem=$incoming['s_subsystem'];
$s_id=$incoming['s_id'];
$s_discrepancy_text=$incoming['s_discrepancy_text'];
$s_status=$incoming['s_status'];
$s_group=$incoming['s_group'];
$sort=$incoming['sort'];
$order=$incoming['order'];
// assign variables from constants
$appname=APP_NAME;
@@ -79,6 +82,7 @@ if ($search) {
$s_reported_by=trim($s_reported_by);
$s_action_text=trim($s_action_text);
$s_discrepancy_text=trim($s_discrepancy_text);
$s_id=trim($s_id);
// build the query string
$query_string="";
@@ -114,6 +118,16 @@ if ($search) {
$query_string="{$query_string})";
$query_string="{$query_string} and ";
}
// id
if ($s_id) {
$query_string="{$query_string}(";
$query_string="{$query_string}id={$s_id}";
$query_string="{$query_string})";
$query_string="{$query_string} and ";
$id_param="ID: {$s_id}";
} else {
$id_param="ID: any";
}
// period
if ($s_period) {
$query_string="{$query_string}(";
@@ -265,7 +279,7 @@ if ($search) {
}
$query_string=rtrim($query_string," and ");
$query_string="select * from writeups where {$query_string} order by report_date asc";
$query_string="select * from writeups where {$query_string} order by $sort $order";
// group membership
if ($s_group) {
@@ -301,6 +315,16 @@ if (!$print) {
<tr>
<td align=\"left\">
";
// ID cell *****************
echo "
ID<br>
<input type=\"text\" name=\"s_id\" size=\"10\" value=\"$s_id\">
";
// **********************************
echo "
</td>
<td align=\"left\">
";
// Device cell *********************
echo "
Device<br>
@@ -340,7 +364,7 @@ if (!$print) {
";
// **********************************
echo "
</td><td></td>
</td>
";
echo "
</tr>
@@ -566,6 +590,44 @@ if (!$print) {
} else {
$summarystat="checked";
}
$idsort=$statussort=$datesort=$periodsort=$devicesort=$subsyssort=$repbysort=$discrepsort=$effsort="";
switch ($sort) {
case "id":
$idsort="checked";
break;
case "status":
$statussort="checked";
break;
case "report_date":
$datesort="checked";
break;
case "period":
$periodsort="checked";
break;
case "device":
$devicesort="checked";
break;
case "subsystem":
$subsyssort="checked";
break;
case "reported_by":
$repbysort="checked";
break;
case "discrepancy_text":
$discrepsort="checked";
break;
case "period_effective":
$effsort="checked";
break;
default:
$datesort="checked";
}
$ascsort=$descsort="";
if ($order=="desc") {
$descsort="checked";
} else {
$ascsort="checked";
}
echo "</td>
</tr>
</table>
@@ -573,6 +635,20 @@ if (!$print) {
<input type=\"radio\" $summarystat name=\"viewtype\" value=\"summary\" id=\"summaryview\" ><label for=\"summaryview\" title=\"Show one writeup per line with minimal detail.\">Results in summary view</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $detailstat name=\"viewtype\" value=\"detail\" id=\"detailview\"><label for=\"detailview\" title=\"Show each writeup's full details.\">Results in detail view</label>
<br><br>
Sort Field:<br>
<input type=\"radio\" $idsort name=\"sort\" value=\"id\" id=\"idview\" ><label for=\"idview\" title=\"Sort by ID.\">ID</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $statussort name=\"sort\" value=\"status\" id=\"statusview\" ><label for=\"statusview\" title=\"Sort by Status.\">Status</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $datesort name=\"sort\" value=\"report_date\" id=\"dateview\" ><label for=\"dateview\" title=\"Sort by Report Date.\">Date</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $periodsort name=\"sort\" value=\"period\" id=\"periodview\" ><label for=\"periodview\" title=\"Sort by Period.\">Period</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $devicesort name=\"sort\" value=\"device\" id=\"deviceview\" ><label for=\"deviceview\" title=\"Sort by Device.\">Device</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $subsyssort name=\"sort\" value=\"subsystem\" id=\"subsysview\" ><label for=\"subsysview\" title=\"Sort by Subsystem.\">Subsystem</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $repbysort name=\"sort\" value=\"reported_by\" id=\"repbyview\" ><label for=\"repbyview\" title=\"Sort by Reported by.\">Reported by</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $discrepsort name=\"sort\" value=\"discrepancy_text\" id=\"discrepview\" ><label for=\"discrepview\" title=\"Sort by Discrepancy.\">Discrepancy</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $effsort name=\"sort\" value=\"period_effective\" id=\"effview\" ><label for=\"effview\" title=\"Sort by Mission Effective.\">Msn Eff</label>&nbsp;&nbsp;&nbsp;
<br>Sort Order:<br>
<input type=\"radio\" $ascsort name=\"order\" value=\"asc\" id=\"ascview\" ><label for=\"ascview\" title=\"Sort results in ascending order.\">Ascending</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $descsort name=\"order\" value=\"desc\" id=\"descview\" ><label for=\"descview\" title=\"Sort results in descending order.\">Descending</label>&nbsp;&nbsp;&nbsp;
<br><br>
<input type=\"submit\" name=\"search\" value=\"Search\">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"cancel\" value=\"Start New Search\">
@@ -602,6 +678,7 @@ if ($search) {
<td><b>$status_param</b></td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$device_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$subsystem_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$id_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border=\"0\">