Compare commits
7 Commits
63bb7a3445
...
5e1856f1dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e1856f1dc | |||
| 262bd6dcdc | |||
| ff71083b49 | |||
| 1a4c9a9c2a | |||
| 5396f3367b | |||
| 557af4db04 | |||
| cc2b638a6a |
@@ -794,7 +794,7 @@ switch($table) {
|
|||||||
$shiftrow=mysqli_query($db,"select * from shifts");
|
$shiftrow=mysqli_query($db,"select * from shifts");
|
||||||
while ($shiftitem=mysqli_fetch_assoc($shiftrow)) {
|
while ($shiftitem=mysqli_fetch_assoc($shiftrow)) {
|
||||||
if ($shiftitem["status"] == 1) {
|
if ($shiftitem["status"] == 1) {
|
||||||
if ($shiftitem["shiftid"]==$customshiftnum) {
|
if ($shiftitem["shiftid"]==$shift) {
|
||||||
printf("<option value=\"%s\" selected>%s</option>",$shiftitem["shiftid"],$shiftitem["shiftname"]);
|
printf("<option value=\"%s\" selected>%s</option>",$shiftitem["shiftid"],$shiftitem["shiftname"]);
|
||||||
} else {
|
} else {
|
||||||
printf("<option value=\"%s\">%s</option>",$shiftitem["shiftid"],$shiftitem["shiftname"]);
|
printf("<option value=\"%s\">%s</option>",$shiftitem["shiftid"],$shiftitem["shiftname"]);
|
||||||
@@ -830,7 +830,7 @@ switch($table) {
|
|||||||
} else {
|
} else {
|
||||||
$statdef="<img src=\"icons/cross.png\" title=\"inactive\" alt=\"inactive\">";
|
$statdef="<img src=\"icons/cross.png\" title=\"inactive\" alt=\"inactive\">";
|
||||||
}
|
}
|
||||||
$shiftname=dblookup($db,"shifts","shiftname","shiftid",$shift);
|
$shiftname=dblookup($db,"shifts","shiftid","shiftname",$tablerow["shift"]);
|
||||||
printf("
|
printf("
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href=\"admin.php?table=$table&edit=1&id=%s\">%s</a></td>
|
<td><a href=\"admin.php?table=$table&edit=1&id=%s\">%s</a></td>
|
||||||
|
|||||||
@@ -757,43 +757,45 @@ function get_part_data($partinputdata) {
|
|||||||
// partid, uid, partnum, sernum, partname, result
|
// partid, uid, partnum, sernum, partname, result
|
||||||
// where result=0 for success, 1 for no data found, 2 for mismatch
|
// where result=0 for success, 1 for no data found, 2 for mismatch
|
||||||
global $db;
|
global $db;
|
||||||
|
$checkmm = FALSE;
|
||||||
|
$result = 0;
|
||||||
// pull input data from input array
|
// pull input data from input array
|
||||||
if ($partinputdata['partid'] && $partinputdata['partid'] != "") $partid= $partinputdata['partid'];
|
$partid = (array_key_exists('partid', $partinputdata) && $partinputdata['partid'] != "") ? $partinputdata['partid'] : NULL;
|
||||||
if ($partinputdata['uid'] && $partinputdata['uid'] != "") $uid= $partinputdata['uid'];
|
$uid = (array_key_exists('uid', $partinputdata) && $partinputdata['uid'] != "") ? $partinputdata['uid'] : NULL;
|
||||||
if ($partinputdata['partnum'] && $partinputdata['partnum'] != "") $partnum= $partinputdata['partnum'];
|
$partnum = (array_key_exists('partnum', $partinputdata) && $partinputdata['partnum'] != "") ? $partinputdata['partnum'] : NULL;
|
||||||
if ($partinputdata['sernum'] && $partinputdata['sernum'] != "") $sernum= $partinputdata['sernum'];
|
$sernum = (array_key_exists('sernum', $partinputdata) && $partinputdata['sernum'] != "") ? $partinputdata['sernum'] : NULL;
|
||||||
// for part data supplied, see what info is available
|
// for part data supplied, see what info is available
|
||||||
// if a partid is supplied, pull other info from parts
|
// if a partid is supplied, pull other info from parts
|
||||||
if ($partid) { // if partid supplied
|
if ($partid) { // if partid supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where partid=\"$partid\"");
|
$partqry = mysqli_query($db, "select * from parts where partid=\"$partid\"");
|
||||||
} else if ($uid && (!$partnum && !$sernum)) { // if uid only supplied
|
} else if ($uid && (!$partnum && !$sernum)) { // if uid only supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where uid like \"$uid\"");
|
$partqry = mysqli_query($db, "select * from parts where uid like \"$uid\"");
|
||||||
} else if (($partnum && $sernum) && !$uid) { // if pn/sn only supplied
|
} else if (($partnum && $sernum) && !$uid) { // if pn/sn only supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where partnum=\"$partnum\" and sernum=\"$sernum\"");
|
$partqry = mysqli_query($db, "select * from parts where partnum=\"$partnum\" and sernum=\"$sernum\"");
|
||||||
} else if ($uid && $partnum && $sernum ) { //if uid and pn/sn supplied
|
} else if ($uid && $partnum && $sernum) { //if uid and pn/sn supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where uid like \"$uid\" and partnum=\"$partnum\" and sernum=\"$sernum\"");
|
$partqry = mysqli_query($db, "select * from parts where uid like \"$uid\" and partnum=\"$partnum\" and sernum=\"$sernum\"");
|
||||||
$checkmm=1;
|
$checkmm = TRUE;
|
||||||
$mismatchqry=mysqli_query($db,"select * from parts where
|
$mismatchqry = mysqli_query($db, "select * from parts where
|
||||||
(uid like \"$uid\" and ((partnum !=\"$partnum\" and partnum !=\"\")or (sernum !=\"$sernum\" and sernum !=\"\"))) or
|
(uid like \"$uid\" and ((partnum !=\"$partnum\" and partnum !=\"\")or (sernum !=\"$sernum\" and sernum !=\"\"))) or
|
||||||
((uid not like \"$uid\" and uid not like \"\") and (partnum =\"$partnum\" and sernum =\"$sernum\"))
|
((uid not like \"$uid\" and uid not like \"\") and (partnum =\"$partnum\" and sernum =\"$sernum\"))
|
||||||
");
|
");
|
||||||
} else if ($uid && $partnum && ! $sernum ) { //if uid and pn only supplied
|
} else if ($uid && $partnum && ! $sernum) { //if uid and pn only supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where uid like \"$uid\" and partnum=\"$partnum\"");
|
$partqry = mysqli_query($db, "select * from parts where uid like \"$uid\" and partnum=\"$partnum\"");
|
||||||
$checkmm=1;
|
$checkmm = TRUE;
|
||||||
$mismatchqry=mysqli_query($db,"select partid from parts where
|
$mismatchqry = mysqli_query($db, "select partid from parts where
|
||||||
(uid like \"$uid\" and partnum !=\"$partnum\") or
|
(uid like \"$uid\" and partnum !=\"$partnum\") or
|
||||||
(uid not like \"$uid\" and partnum =\"$partnum\")
|
(uid not like \"$uid\" and partnum =\"$partnum\")
|
||||||
");
|
");
|
||||||
} else if ($uid && ! $partnum && $sernum ) { //if uid and sn only supplied
|
} else if ($uid && ! $partnum && $sernum) { //if uid and sn only supplied
|
||||||
$partqry=mysqli_query($db,"select * from parts where uid like \"$uid\" and sernum=\"$sernum\"");
|
$partqry = mysqli_query($db, "select * from parts where uid like \"$uid\" and sernum=\"$sernum\"");
|
||||||
$checkmm=1;
|
$checkmm = TRUE;
|
||||||
$mismatchqry=mysqli_query($db,"select partid from parts where
|
$mismatchqry = mysqli_query($db, "select partid from parts where
|
||||||
(uid like \"$uid\" and sernum !=\"$sernum\") or
|
(uid like \"$uid\" and sernum !=\"$sernum\") or
|
||||||
(uid not like \"$uid\" and sernum =\"$sernum\")
|
(uid not like \"$uid\" and sernum =\"$sernum\")
|
||||||
");
|
");
|
||||||
} else {
|
} else {
|
||||||
// not enough input data supplied, so return result of 1
|
// not enough input data supplied, so return result of 1
|
||||||
$result=1;
|
$result = 1;
|
||||||
}
|
}
|
||||||
if (! $result) {
|
if (! $result) {
|
||||||
if (mysqli_num_rows($partqry)) {
|
if (mysqli_num_rows($partqry)) {
|
||||||
@@ -807,9 +809,6 @@ function get_part_data($partinputdata) {
|
|||||||
if ($checkmm) {
|
if ($checkmm) {
|
||||||
if (mysqli_num_rows($mismatchqry)) {
|
if (mysqli_num_rows($mismatchqry)) {
|
||||||
$result=2;
|
$result=2;
|
||||||
//while ($mmdata=mysqli_fetch_assoc($mismatchqry)) {
|
|
||||||
//var_dump($mmdata);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ include("functions.php");
|
|||||||
|
|
||||||
if (isset($_SESSION['login'])) $techid=$_SESSION['login'];
|
if (isset($_SESSION['login'])) $techid=$_SESSION['login'];
|
||||||
|
|
||||||
$histdays=$_REQUEST['histdays'];
|
$print=$_REQUEST['print'] ?? NULL;
|
||||||
$submit=$_REQUEST['submit'];
|
$histdays=$_REQUEST['histdays'] ?? NULL;
|
||||||
|
$submit=$_REQUEST['submit'] ?? NULL;
|
||||||
|
|
||||||
$logname=LOG_NAME;
|
$logname=LOG_NAME;
|
||||||
$uidtext=UID_TEXT;
|
$uidtext=UID_TEXT;
|
||||||
|
|||||||
@@ -31,38 +31,38 @@ function getactiondata($maintactionid) {
|
|||||||
return $actiondata;
|
return $actiondata;
|
||||||
}
|
}
|
||||||
|
|
||||||
$print=$_REQUEST['print'];
|
$print=$_REQUEST['print'] ?? NULL;
|
||||||
|
|
||||||
$maintformid=$_REQUEST['maintformid'];
|
$maintformid=$_REQUEST['maintformid'] ?? NULL;
|
||||||
$lognoteid=$_REQUEST['lognoteid'];
|
$lognoteid=$_REQUEST['lognoteid'] ?? NULL;
|
||||||
$mfdate=$_REQUEST['date'];
|
$mfdate=$_REQUEST['date'] ?? NULL;
|
||||||
$mftime=$_REQUEST['time'];
|
$mftime=$_REQUEST['time'] ?? NULL;
|
||||||
$mfsubmit=$_REQUEST['mfsubmit'];
|
$mfsubmit=$_REQUEST['mfsubmit'] ?? NULL;
|
||||||
$mfadd=$_REQUEST['mfadd'];
|
$mfadd=$_REQUEST['mfadd'] ?? NULL;
|
||||||
$mfedit=$_REQUEST['mfedit'];
|
$mfedit=$_REQUEST['mfedit'] ?? NULL;
|
||||||
$mfdelete=$_REQUEST['mfdelete'];
|
$mfdelete=$_REQUEST['mfdelete'] ?? NULL;
|
||||||
$mfpartloc=$_REQUEST['mfpartloc'];
|
$mfpartloc=$_REQUEST['mfpartloc'] ?? NULL;
|
||||||
$mfmalfunction=$_REQUEST['mfmalfunction'];
|
$mfmalfunction=$_REQUEST['mfmalfunction'] ?? NULL;
|
||||||
$nha=$_REQUEST['nha'];
|
$nha=$_REQUEST['nha'] ?? NULL;
|
||||||
$repord=$_REQUEST['repord'];
|
$repord=$_REQUEST['repord'] ?? NULL;
|
||||||
$mfpart=$_REQUEST['mfpart'];
|
$mfpart=$_REQUEST['mfpart'] ?? NULL;
|
||||||
$uid=$_REQUEST['uid'];
|
$uid=$_REQUEST['uid'] ?? NULL;
|
||||||
$partnum=$_REQUEST['partnum'];
|
$partnum=$_REQUEST['partnum'] ?? NULL;
|
||||||
$sernum=$_REQUEST['sernum'];
|
$sernum=$_REQUEST['sernum'] ?? NULL;
|
||||||
$partname=$_REQUEST['partname'];
|
$partname=$_REQUEST['partname'] ?? NULL;
|
||||||
$actionadd=$_REQUEST['actionadd'];
|
$actionadd=$_REQUEST['actionadd'] ?? NULL;
|
||||||
$actionedit=$_REQUEST['actionedit'];
|
$actionedit=$_REQUEST['actionedit'] ?? NULL;
|
||||||
$actiondelete=$_REQUEST['actiondelete'];
|
$actiondelete=$_REQUEST['actiondelete'] ?? NULL;
|
||||||
$maintactionid=$_REQUEST['maintactionid'];
|
$maintactionid=$_REQUEST['maintactionid'] ?? NULL;
|
||||||
$actiondate=$_REQUEST['actiondate'];
|
$actiondate=$_REQUEST['actiondate'] ?? NULL;
|
||||||
$actiontime=$_REQUEST['actiontime'];
|
$actiontime=$_REQUEST['actiontime'] ?? NULL;
|
||||||
$actiontech=$_REQUEST['actiontech'];
|
$actiontech=$_REQUEST['actiontech'] ?? NULL;
|
||||||
$action=$_REQUEST['action'];
|
$action=$_REQUEST['action'] ?? NULL;
|
||||||
$actionaddsubmit=$_REQUEST['actionaddsubmit'];
|
$actionaddsubmit=$_REQUEST['actionaddsubmit'] ?? NULL;
|
||||||
$actioneditsubmit=$_REQUEST['actioneditsubmit'];
|
$actioneditsubmit=$_REQUEST['actioneditsubmit'] ?? NULL;
|
||||||
$printfmt=$_REQUEST['printfmt'];
|
$printfmt=$_REQUEST['printfmt'] ?? NULL;
|
||||||
if ($printfmt) $print=1;
|
if ($printfmt) $print=TRUE;
|
||||||
$flags=$_POST['flags'];
|
$flags=$_POST['flags'] ?? [];
|
||||||
|
|
||||||
$logname=LOG_NAME;
|
$logname=LOG_NAME;
|
||||||
$uidtext=UID_TEXT;
|
$uidtext=UID_TEXT;
|
||||||
@@ -78,48 +78,49 @@ if ($printfmt) {
|
|||||||
framework("begin","","",$print);
|
framework("begin","","",$print);
|
||||||
} else if ($mfedit) {
|
} else if ($mfedit) {
|
||||||
framework("begin","$logname","Maintenance Form Edit",$print);
|
framework("begin","$logname","Maintenance Form Edit",$print);
|
||||||
if ($loggedinas) $mfauthorized=1;
|
if ($loggedinas) $mfauthorized=TRUE;
|
||||||
} else if ($mfdelete) {
|
} else if ($mfdelete) {
|
||||||
framework("begin","$logname","Maintenance Form Edit",$print);
|
framework("begin","$logname","Maintenance Form Edit",$print);
|
||||||
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
||||||
if (($loggedinas==$mfowner) || $isadmin) $mfauthorized=1;
|
if (($loggedinas==$mfowner) || $isadmin) $mfauthorized=TRUE;
|
||||||
} else if ($actionadd) {
|
} else if ($actionadd) {
|
||||||
framework("begin","$logname","Maintenance Action Entry",$print);
|
framework("begin","$logname","Maintenance Action Entry",$print);
|
||||||
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
||||||
if ($loggedinas) {
|
if ($loggedinas) {
|
||||||
$mfauthorized=1;
|
$mfauthorized=TRUE;
|
||||||
$actionauthorized=1;
|
$actionauthorized=TRUE;
|
||||||
}
|
}
|
||||||
} else if ($actionedit || $actiondelete) {
|
} else if ($actionedit || $actiondelete) {
|
||||||
framework("begin","$logname","Maintenance Action Edit",$print);
|
framework("begin","$logname","Maintenance Action Edit",$print);
|
||||||
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
$mfowner=dblookup($db,"maintforms","maintformid","mftech",$maintformid);
|
||||||
if ($loggedinas) $mfauthorized=1;
|
if ($loggedinas) $mfauthorized=TRUE;
|
||||||
$actionowner=dblookup($db,"maintactions","maintactionid","actiontech",$maintactionid);
|
$actionowner=dblookup($db,"maintactions","maintactionid","actiontech",$maintactionid);
|
||||||
if (($loggedinas==$actionowner) || $isadmin) $actionauthorized=1;
|
if (($loggedinas==$actionowner) || $isadmin) $actionauthorized=TRUE;
|
||||||
} else {
|
} else {
|
||||||
$mfadd=1;
|
$mfadd=TRUE;
|
||||||
framework("begin","$logname","Maintenance Form Entry",$print);
|
framework("begin","$logname","Maintenance Form Entry",$print);
|
||||||
$mftech=$loggedinas;
|
$mftech=$loggedinas;
|
||||||
$mfauthorized=1;
|
$mfauthorized=TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******** begin database manipulation ********
|
// ******** begin database manipulation ********
|
||||||
|
|
||||||
//var_dump($_REQUEST);
|
//var_dump($_REQUEST);
|
||||||
|
|
||||||
|
$pdatamismatch=NULL;
|
||||||
if ((($mfedit || $actionadd || $actionedit) && ! $mfsubmit) || $printfmt) {
|
if ((($mfedit || $actionadd || $actionedit) && ! $mfsubmit) || $printfmt) {
|
||||||
// pull mf data from database
|
// pull mf data from database
|
||||||
$mftoedit=getmfdata($maintformid);
|
$mftoedit=getmfdata($maintformid);
|
||||||
$partdatainput=array();
|
$partdatainput=[];
|
||||||
if ($mftoedit['mfpart']) $partdatainput['partid']=$mftoedit['mfpart'];
|
if ($mftoedit['mfpart']) $partdatainput['partid']=$mftoedit['mfpart'];
|
||||||
if ($uid) $partdatainput['uid']=$uid;
|
if ($uid) $partdatainput['uid']=$uid;
|
||||||
if ($partnum) $partdatainput['partnum']=$partnum;
|
if ($partnum) $partdatainput['partnum']=$partnum;
|
||||||
if ($sernum) $partdatainput['sernum']=$sernum;
|
if ($sernum) $partdatainput['sernum']=$sernum;
|
||||||
$partinfo=get_part_data($partdatainput);
|
$partinfo=get_part_data($partdatainput);
|
||||||
if ($partinfo['result']==2) {
|
if ($partinfo['result']==2) {
|
||||||
$pdatamismatch=1;
|
$pdatamismatch=TRUE;
|
||||||
} else {
|
} else {
|
||||||
unset($pdatamismatch);
|
$pdatamismatch=FALSE;
|
||||||
if ($partinfo['partid']) $mfpart=$partinfo['partid'];
|
if ($partinfo['partid']) $mfpart=$partinfo['partid'];
|
||||||
if ($partinfo['uid']) $uid=$partinfo['uid'];
|
if ($partinfo['uid']) $uid=$partinfo['uid'];
|
||||||
if ($partinfo['partnum']) $partnum=$partinfo['partnum'];
|
if ($partinfo['partnum']) $partnum=$partinfo['partnum'];
|
||||||
@@ -157,9 +158,10 @@ if ($mfadd) {
|
|||||||
mysqli_query($db,"insert into parts(uid,partnum,sernum,partname) values(\"$uid\",\"$partnum\",\"$sernum\",\"$partname\")");
|
mysqli_query($db,"insert into parts(uid,partnum,sernum,partname) values(\"$uid\",\"$partnum\",\"$sernum\",\"$partname\")");
|
||||||
$mfpart=mysqli_insert_id($db);
|
$mfpart=mysqli_insert_id($db);
|
||||||
} else if ($partinfo['result']==2) {
|
} else if ($partinfo['result']==2) {
|
||||||
$pdatamismatch=1;
|
$pdatamismatch=TRUE;
|
||||||
} else {
|
} else {
|
||||||
// if it is in parts table, get partid for this record
|
// if it is in parts table, get partid for this record
|
||||||
|
$pdatamismatch=FALSE;
|
||||||
$mfpart=$partinfo['partid'];
|
$mfpart=$partinfo['partid'];
|
||||||
}
|
}
|
||||||
if ($uid =="" || $partnum == "" || $sernum == "") {
|
if ($uid =="" || $partnum == "" || $sernum == "") {
|
||||||
@@ -214,7 +216,7 @@ if ($mfedit) {
|
|||||||
mysqli_query($db,"delete from flagmap where maintformid=\"$maintformid\"");
|
mysqli_query($db,"delete from flagmap where maintformid=\"$maintformid\"");
|
||||||
foreach ($flags as $thisflag) {
|
foreach ($flags as $thisflag) {
|
||||||
// set flag for this maintenance form
|
// set flag for this maintenance form
|
||||||
mysqli_query($db,"insert into flagmap(flagid,maintformid) values(\"$thisflag\",\"$$maintformid\")");
|
mysqli_query($db,"insert into flagmap(flagid,maintformid) values(\"$thisflag\",\"$maintformid\")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,7 +314,7 @@ if (($mfedit || $actionadd || $actionedit) && ! ($mfsubmit || $actionaddsubmit |
|
|||||||
$sernum=$partinfo['sernum'];
|
$sernum=$partinfo['sernum'];
|
||||||
$partname=$partinfo['partname'];
|
$partname=$partinfo['partname'];
|
||||||
$pluresult=$partinfo['result'];
|
$pluresult=$partinfo['result'];
|
||||||
if ($pluresult==2) $pdatamismatch=1; else unset($pdatamismatch);
|
if ($pluresult==2) $pdatamismatch=TRUE; else $pdatamismatch=FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$techname=dblookup($db,"techs","techid","techname",$mftech);
|
$techname=dblookup($db,"techs","techid","techname",$mftech);
|
||||||
@@ -373,32 +375,23 @@ if ($printfmt) {
|
|||||||
<table width=\"100%\" border=\"0\">
|
<table width=\"100%\" border=\"0\">
|
||||||
";
|
";
|
||||||
|
|
||||||
|
// create an array called theseflags of flagids set for this maintformid
|
||||||
|
$allflags=mysqli_query($db,"select flagid from flags");
|
||||||
|
unset($theseflags);
|
||||||
|
$theseflags=[];
|
||||||
|
while ($thisflag=mysqli_fetch_row($allflags)) {
|
||||||
|
if (mysqli_num_rows(mysqli_query($db,"select id from flagmap where flagid=\"$thisflag[0]\" and maintformid=\"$maintformid\""))) {
|
||||||
|
$theseflags[]=$thisflag[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// display flag symbols for set flags
|
||||||
// // get an array of flagids set for this maintformid
|
$flagslist=mysqli_query($db,"select * from flags");
|
||||||
// $allflags=mysqli_query($db,"select flagid from flags");
|
while ($flagsymbol=mysqli_fetch_assoc($flagslist)) {
|
||||||
// unset($theseflags);
|
if ($theseflags[0]=="") $theseflags=[];
|
||||||
// while ($thisflag=mysqli_fetch_row($allflags)) {
|
if (!empty($theseflags) && in_array($flagsymbol["flagid"],$theseflags)) {
|
||||||
// $thisflagtbl="flag_".$thisflag[0];
|
echo $flagsymbol['flagsym']." ";
|
||||||
// if (mysqli_num_rows(mysqli_query($db,"select id from $thisflagtbl where target=\"maintforms\" and id=\"$maintformid\""))) {
|
}
|
||||||
// $theseflags[]=$thisflag[0];
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// $flagslist=mysqli_query($db,"select * from flags");
|
|
||||||
// while ($flagsymbol=mysqli_fetch_assoc($flagslist)) {
|
|
||||||
// if ($theseflags[0]=="") $theseflags=[];
|
|
||||||
// if (in_array($flagsymbol["flagid"],$theseflags)) {
|
|
||||||
// echo $flagsymbol['flagsym']." ";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
echo "
|
echo "
|
||||||
</table><hr>
|
</table><hr>
|
||||||
<b><u>Maintenance Actions</u></b><br>
|
<b><u>Maintenance Actions</u></b><br>
|
||||||
@@ -469,13 +462,12 @@ if ($printfmt) {
|
|||||||
<tr><td><textarea rows=\"4\" cols=\"65\" name=\"mfmalfunction\" wrap=\"soft\">$mfmalfunction</textarea></td></tr>
|
<tr><td><textarea rows=\"4\" cols=\"65\" name=\"mfmalfunction\" wrap=\"soft\">$mfmalfunction</textarea></td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
";
|
";
|
||||||
// get an array of flagids set for this maintformid
|
// create an array called theseflags of flagids set for this maintformid
|
||||||
$allflags=mysqli_query($db,"select flagid from flags");
|
$allflags=mysqli_query($db,"select flagid from flags");
|
||||||
unset($theseflags);
|
unset($theseflags);
|
||||||
$theseflags=[];
|
$theseflags=[];
|
||||||
while ($thisflag=mysqli_fetch_row($allflags)) {
|
while ($thisflag=mysqli_fetch_row($allflags)) {
|
||||||
$thisflagtbl="flag_".$thisflag[0];
|
if (mysqli_num_rows(mysqli_query($db,"select id from flagmap where flagid=\"$thisflag[0]\" and maintformid=\"$maintformid\""))) {
|
||||||
if (mysqli_num_rows(mysqli_query($db,"select id from $thisflagtbl where target=\"maintforms\" and id=\"$maintformid\""))) {
|
|
||||||
$theseflags[]=$thisflag[0];
|
$theseflags[]=$thisflag[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,7 +479,7 @@ if ($printfmt) {
|
|||||||
$flagsperline=8;
|
$flagsperline=8;
|
||||||
$flagcount=1;
|
$flagcount=1;
|
||||||
while ($flagcheckbox=mysqli_fetch_assoc($flagslist)) {
|
while ($flagcheckbox=mysqli_fetch_assoc($flagslist)) {
|
||||||
if ($theseflags[0]=="") $theseflags=[];
|
//if ($theseflags[0]=="") $theseflags=[];
|
||||||
if (in_array($flagcheckbox["flagid"],$theseflags)) {
|
if (in_array($flagcheckbox["flagid"],$theseflags)) {
|
||||||
printf("<input type=\"checkbox\" name=\"flags[]\" value=\"%s\" checked><font color=\"%s\" title=\"%s\">%s</font>",
|
printf("<input type=\"checkbox\" name=\"flags[]\" value=\"%s\" checked><font color=\"%s\" title=\"%s\">%s</font>",
|
||||||
$flagcheckbox["flagid"],$flagcheckbox["flagcolor"],$flagcheckbox["flagname"],$flagcheckbox["flagsym"]);
|
$flagcheckbox["flagid"],$flagcheckbox["flagcolor"],$flagcheckbox["flagname"],$flagcheckbox["flagsym"]);
|
||||||
|
|||||||
@@ -17,17 +17,17 @@ if (!isset($_SESSION['login'])) {
|
|||||||
$loggedinas=$_SESSION['login'];
|
$loggedinas=$_SESSION['login'];
|
||||||
$isadmin=dblookup($db,"techs","techid","admin",$loggedinas);
|
$isadmin=dblookup($db,"techs","techid","admin",$loggedinas);
|
||||||
|
|
||||||
$print=$_REQUEST['print'];
|
$print=$_REQUEST['print'] ?? NULL;
|
||||||
$add=$_REQUEST['add'];
|
$add=$_REQUEST['add'] ?? NULL;
|
||||||
$edit=$_REQUEST['edit'];
|
$edit=$_REQUEST['edit'] ?? NULL;
|
||||||
$delete=$_REQUEST['delete'];
|
$delete=$_REQUEST['delete'] ?? NULL;
|
||||||
|
|
||||||
$partid=$_REQUEST['partid'];
|
$partid=$_REQUEST['partid'] ?? NULL;
|
||||||
$uid=$_REQUEST['uid'];
|
$uid=$_REQUEST['uid'] ?? NULL;
|
||||||
$partnum=$_REQUEST['partnum'];
|
$partnum=$_REQUEST['partnum'] ?? NULL;
|
||||||
$sernum=$_REQUEST['sernum'];
|
$sernum=$_REQUEST['sernum'] ?? NULL;
|
||||||
$partname=$_REQUEST['partname'];
|
$partname=$_REQUEST['partname'] ?? NULL;
|
||||||
$submit=$_REQUEST['submit'];
|
$submit=$_REQUEST['submit'] ?? NULL;
|
||||||
|
|
||||||
$logname=LOG_NAME;
|
$logname=LOG_NAME;
|
||||||
$uidtext=UID_TEXT;
|
$uidtext=UID_TEXT;
|
||||||
@@ -96,13 +96,13 @@ $partdatainput=array();
|
|||||||
$partdatainput['partid']=$partid;
|
$partdatainput['partid']=$partid;
|
||||||
$partinfo=get_part_data($partdatainput);
|
$partinfo=get_part_data($partdatainput);
|
||||||
if ($partinfo['result']==2) {
|
if ($partinfo['result']==2) {
|
||||||
$pdatamismatch=1;
|
$pdatamismatch=TRUE;
|
||||||
} else {
|
} else {
|
||||||
unset($pdatamismatch);
|
$pdatamismatch=FALSE;
|
||||||
if ($partinfo['uid']) $uid=$partinfo['uid'];
|
$uid = (array_key_exists('uid',$partinfo)) ? $partinfo['uid'] : NULL;
|
||||||
if ($partinfo['partnum']) $partnum=$partinfo['partnum'];
|
$partnum = (array_key_exists('partnum',$partinfo)) ? $partinfo['partnum'] : NULL;
|
||||||
if ($partinfo['sernum']) $sernum=$partinfo['sernum'];
|
$sernum = (array_key_exists('sernum',$partinfo)) ? $partinfo['sernum'] : NULL;
|
||||||
if ($partinfo['partname']) $partname=$partinfo['partname'];
|
$partname = (array_key_exists('partname',$partinfo)) ? $partinfo['partname'] : NULL;
|
||||||
}
|
}
|
||||||
if ($delete) {
|
if ($delete) {
|
||||||
if ($inmaintforms) {
|
if ($inmaintforms) {
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ if (isset($_SESSION['login'])) {
|
|||||||
unset($loggedin);
|
unset($loggedin);
|
||||||
}
|
}
|
||||||
|
|
||||||
$print=$_REQUEST['print'];
|
$print=$_REQUEST['print'] ?? NULL;
|
||||||
$add=$_REQUEST['add'];
|
$add=$_REQUEST['add'] ?? NULL;
|
||||||
$sort=$_REQUEST['sort'];
|
$sort=$_REQUEST['sort'] ?? NULL;
|
||||||
$order=$_REQUEST['order'];
|
$order=$_REQUEST['order'] ?? NULL;
|
||||||
|
|
||||||
$logname=LOG_NAME;
|
$logname=LOG_NAME;
|
||||||
$uidtext=UID_TEXT;
|
$uidtext=UID_TEXT;
|
||||||
|
|||||||
@@ -807,10 +807,10 @@ if ($search) {
|
|||||||
<table width=\"100%\" border=\"1\" cellpadding=\"5\">
|
<table width=\"100%\" border=\"1\" cellpadding=\"5\">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
<th><a href=\"parts.php?sort=uid&order=$order\" title=\"Sort by $uidtext\">$uidtext</a></th>
|
<th>$uidtext</th>
|
||||||
<th><a href=\"parts.php?sort=partnum&order=$order\" title=\"Sort by Part Number\">Part Number</a></th>
|
<th>Part Number</th>
|
||||||
<th><a href=\"parts.php?sort=sernum&order=$order\" title=\"Sort by Serial Number\">Serial Number</a></th>
|
<th>Serial Number</th>
|
||||||
<th><a href=\"parts.php?sort=partname&order=$order\" title=\"Sort by Part Name\">Part Name</a></th>
|
<th>Part Name</th>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
while ($partrow=mysqli_fetch_assoc($prowqry)) {
|
while ($partrow=mysqli_fetch_assoc($prowqry)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user