Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3de786766 | |||
| b0aaf70e4d | |||
| f20b4cd8b6 |
@@ -40,7 +40,7 @@ $uids = $_POST['uids'] ?? [];
|
||||
$partnums = $_POST['partnums'] ?? [];
|
||||
$sernums = $_POST['sernums'] ?? [];
|
||||
$actions = $_POST['actions'] ?? [];
|
||||
$mfreqs = $_POST['mfreqs'] ?? [];
|
||||
$mfreqs = $_POST['mfreqs'] ?? ["off"];
|
||||
$schedmaintcomplete = $_REQUEST['schedmaintcomplete'] ?? NULL;
|
||||
$partview = $_REQUEST['partview'] ?? NULL;
|
||||
|
||||
@@ -199,7 +199,7 @@ if ($add) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ if ($add) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ if ($add) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$newnoteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
} else {
|
||||
@@ -364,7 +364,7 @@ if ($edit) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ if ($edit) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ if ($edit) {
|
||||
// add it to logparts table
|
||||
mysqli_query($db, "insert into logparts(lognoteid,partid,action) values(\"$noteid\",\"$lpid\",\"$actions[$plidx]\")");
|
||||
// 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\")");
|
||||
}
|
||||
} else {
|
||||
@@ -619,7 +619,6 @@ $flagcount = 1;
|
||||
|
||||
// display checkboxes for all the flags, selecting the ones that are set for this note/template
|
||||
while ($flagcheckbox = mysqli_fetch_assoc($flagslist)) {
|
||||
|
||||
if (in_array($flagcheckbox["flagid"], $theseflags)) {
|
||||
printf(
|
||||
"<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;
|
||||
}
|
||||
}
|
||||
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>
|
||||
";
|
||||
if (mysqli_num_rows($flagslist)) {
|
||||
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;
|
||||
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=\"sernums[$partline]\" size=\"20\"></td>
|
||||
<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");
|
||||
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "
|
||||
</select>
|
||||
</td>
|
||||
@@ -739,19 +740,28 @@ if ($edit) {
|
||||
<td align=\"center\">$epsn</td>
|
||||
<td align=\"center\">
|
||||
";
|
||||
$actrow = mysqli_query($db, "select * from logpartactions");
|
||||
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
||||
if ($actitem["lpactionid"] == $defaultaction) {
|
||||
echo "$actitem[lpactionname]";
|
||||
}
|
||||
if ($defaultaction) {
|
||||
// an action was selected previously, so just display it
|
||||
$actname = dblookup($db, "logpartactions", "lpactionid", "lpactionname", $defaultaction);
|
||||
echo "$actname";
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
";
|
||||
// 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 "
|
||||
<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>
|
||||
";
|
||||
}
|
||||
@@ -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=\"sernums[$partline]\" size=\"20\"></td>
|
||||
<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");
|
||||
while ($actitem = mysqli_fetch_assoc($actrow)) {
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "
|
||||
</select>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user