|
|
|
@@ -40,7 +40,7 @@ $uids = $_POST['uids'] ?? [];
|
|
|
|
$partnums = $_POST['partnums'] ?? [];
|
|
|
|
$partnums = $_POST['partnums'] ?? [];
|
|
|
|
$sernums = $_POST['sernums'] ?? [];
|
|
|
|
$sernums = $_POST['sernums'] ?? [];
|
|
|
|
$actions = $_POST['actions'] ?? [];
|
|
|
|
$actions = $_POST['actions'] ?? [];
|
|
|
|
$mfreqs = $_POST['mfreqs'] ?? [];
|
|
|
|
$mfreqs = $_POST['mfreqs'] ?? ["off"];
|
|
|
|
$schedmaintcomplete = $_REQUEST['schedmaintcomplete'] ?? NULL;
|
|
|
|
$schedmaintcomplete = $_REQUEST['schedmaintcomplete'] ?? NULL;
|
|
|
|
$partview = $_REQUEST['partview'] ?? NULL;
|
|
|
|
$partview = $_REQUEST['partview'] ?? NULL;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -199,7 +199,7 @@ if ($add) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -217,7 +217,7 @@ if ($add) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -235,7 +235,7 @@ if ($add) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$newnoteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@@ -364,7 +364,7 @@ if ($edit) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -382,7 +382,7 @@ if ($edit) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -400,7 +400,7 @@ if ($edit) {
|
|
|
|
// add it to logparts table
|
|
|
|
// add it to logparts table
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
|
|
|
// create a maintenance form if required
|
|
|
|
// create a maintenance form if required
|
|
|
|
if ($mfreqs[$plidx] == "on") {
|
|
|
|
if (array_key_exists($plidx,$mfreqs) && $mfreqs[$plidx] == "on") {
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
mysqli_query($db, "insert into maintforms(mfdate,mftech,mfpart,pending,lognoteid) values(\"$date\",\"$techid\",\"$lpid\",1,\"$noteid\")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@@ -619,7 +619,6 @@ $flagcount = 1;
|
|
|
|
|
|
|
|
|
|
|
|
// display checkboxes for all the flags, selecting the ones that are set for this note/template
|
|
|
|
// display checkboxes for all the flags, selecting the ones that are set for this note/template
|
|
|
|
while ($flagcheckbox = mysqli_fetch_assoc($flagslist)) {
|
|
|
|
while ($flagcheckbox = mysqli_fetch_assoc($flagslist)) {
|
|
|
|
|
|
|
|
|
|
|
|
if (in_array($flagcheckbox["flagid"], $theseflags)) {
|
|
|
|
if (in_array($flagcheckbox["flagid"], $theseflags)) {
|
|
|
|
printf(
|
|
|
|
printf(
|
|
|
|
"<input type=\"checkbox\" name=\"flags[]\" value=\"%s\" checked><font color=\"%s\" title=\"%s\">%s</font>",
|
|
|
|
"<input type=\"checkbox\" name=\"flags[]\" value=\"%s\" checked><font color=\"%s\" title=\"%s\">%s</font>",
|
|
|
|
@@ -648,9 +647,15 @@ while ($flagcheckbox = mysqli_fetch_assoc($flagslist)) {
|
|
|
|
$flagcount = 1;
|
|
|
|
$flagcount = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "
|
|
|
|
if (mysqli_num_rows($flagslist)) {
|
|
|
|
<br><input type=\"checkbox\" name=\"syncflags\" value=\"1\"><font title=\"Set the selected flags on the other notes in the reference chain\">Set flags on reference chain</font>
|
|
|
|
echo "
|
|
|
|
";
|
|
|
|
<br><input type=\"checkbox\" name=\"syncflags\" value=\"1\"><font title=\"Set the selected flags on the other notes in the reference chain\">Set flags on reference chain</font>
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
echo "
|
|
|
|
|
|
|
|
<input type=\"hidden\" name=\"syncflags\" value=\"0\">
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($add && $refto) $refstring = $refto;
|
|
|
|
if ($add && $refto) $refstring = $refto;
|
|
|
|
echo "
|
|
|
|
echo "
|
|
|
|
@@ -678,18 +683,14 @@ if ($add) {
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"partnums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"partnums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"sernums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"sernums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><select name=\"actions[$partline]\">
|
|
|
|
<td align=\"center\"><select name=\"actions[$partline]\">
|
|
|
|
<option value=\"select\">Select Action</option>
|
|
|
|
<option value=\"$defaultaction\" selected>Select Action</option>
|
|
|
|
";
|
|
|
|
";
|
|
|
|
$actrow = mysqli_query($db, "select * from logpartactions");
|
|
|
|
$actrow = mysqli_query($db, "select * from logpartactions");
|
|
|
|
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
|
|
|
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
|
|
|
if ($actitem["status"] == 1) {
|
|
|
|
if ($actitem["status"] == 1) {
|
|
|
|
if ($actitem["lpactionid"] == $defaultaction) {
|
|
|
|
|
|
|
|
printf("<option value=\"%s\" selected>%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
printf("<option value=\"%s\">%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
printf("<option value=\"%s\">%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "
|
|
|
|
echo "
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
@@ -739,19 +740,28 @@ if ($edit) {
|
|
|
|
<td align=\"center\">$epsn</td>
|
|
|
|
<td align=\"center\">$epsn</td>
|
|
|
|
<td align=\"center\">
|
|
|
|
<td align=\"center\">
|
|
|
|
";
|
|
|
|
";
|
|
|
|
$actrow = mysqli_query($db, "select * from logpartactions");
|
|
|
|
if ($defaultaction) {
|
|
|
|
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
|
|
|
// an action was selected previously, so just display it
|
|
|
|
if ($actitem["lpactionid"] == $defaultaction) {
|
|
|
|
$actname = dblookup($db, "logpartactions", "lpactionid", "lpactionname", $defaultaction);
|
|
|
|
echo "$actitem[lpactionname]";
|
|
|
|
echo "$actname";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "
|
|
|
|
echo "
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
";
|
|
|
|
";
|
|
|
|
// find maint form for this line and show link
|
|
|
|
// find maint form for this line and show link
|
|
|
|
$mflinknum = mysqli_fetch_assoc(mysqli_query($db, "select maintformid from maintforms where lognoteid=\"$noteid\" and mfpart=\"$lpidvar\""))["maintformid"];
|
|
|
|
|
|
|
|
echo "
|
|
|
|
echo "
|
|
|
|
<td align=\"center\"><a href=\"maintformentry.php?mfedit=1&maintformid=$mflinknum\" title=\"Click to view/edit this maintenance form\">$mflinknum</a></td>
|
|
|
|
<td align=\"center\">
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
$mflinkqry = mysqli_query($db, "select maintformid from maintforms where lognoteid=\"$noteid\" and mfpart=\"$lpidvar\"");
|
|
|
|
|
|
|
|
if (mysqli_num_rows($mflinkqry)) {
|
|
|
|
|
|
|
|
$mflinkdata = mysqli_fetch_assoc($mflinkqry);
|
|
|
|
|
|
|
|
$mflinknum = $mflinkdata["maintformid"];
|
|
|
|
|
|
|
|
echo "
|
|
|
|
|
|
|
|
<a href=\"maintformentry.php?mfedit=1&maintformid=$mflinknum\" title=\"Click to view/edit this maintenance form\">$mflinknum</a>
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -764,18 +774,14 @@ if ($edit) {
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"partnums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"partnums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"sernums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><input type=\"text\" name=\"sernums[$partline]\" size=\"20\"></td>
|
|
|
|
<td align=\"center\"><select name=\"actions[$partline]\">
|
|
|
|
<td align=\"center\"><select name=\"actions[$partline]\">
|
|
|
|
<option value=\"select\">Select Action</option>
|
|
|
|
<option value=\"$defaultaction\" selected>Select Action</option>
|
|
|
|
";
|
|
|
|
";
|
|
|
|
$actrow = mysqli_query($db, "select * from logpartactions");
|
|
|
|
$actrow = mysqli_query($db, "select * from logpartactions");
|
|
|
|
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
|
|
|
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
|
|
|
if ($actitem["status"] == 1) {
|
|
|
|
if ($actitem["status"] == 1) {
|
|
|
|
if ($actitem["lpactionid"] == $defaultaction) {
|
|
|
|
|
|
|
|
printf("<option value=\"%s\" selected>%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
printf("<option value=\"%s\">%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
printf("<option value=\"%s\">%s</option>", $actitem["lpactionid"], $actitem["lpactionname"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "
|
|
|
|
echo "
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
|