\n";
while ($tablerow = mysqli_fetch_assoc($note)) {
$reftonote=$tablerow["lognoteid"];
$refs=" ";
if (islink($tablerow["lognoteid"])) {
$refs=$refs." ";
}
// convert tech number to name
$tname=dblookup($db,"techs","techid","techname",$tablerow["tech"]);
//convert subject number to name
$subjname=dblookup($db,"subjects","subjectid","subjectname",$tablerow["subject"]);
// create links of urls in note
$fmtnote=convertweblinks($tablerow["lognote"]);
// generate the flags string
$flagstring="";
$allflagqry=mysqli_query($db,"select flagid from flags");
while ($allflagids=mysqli_fetch_row($allflagqry)) {
$flagid=$allflagids[0];
$flag_tbl="flag_".$flagid;
if (mysqli_num_rows(mysqli_query($db,"select id from $flag_tbl where target=\"lognotes\" and id=\"$reftonote\""))) {
$flagparam=mysqli_fetch_assoc(mysqli_query($db,"select * from flags where flagid=\"$flagid\""));
$flagcolor=$flagparam["flagcolor"];
$flagsym=$flagparam["flagsym"];
$flagname=$flagparam["flagname"];
$flagstring=$flagstring."$flagsym ";
}
}
if ($flagstring) {
$fmtnote=$fmtnote." ".$flagstring." ";
} else {
$fmtnote=$fmtnote." ";
}
if ($doparts) {
// turn on the parts indicator if parts were entered with the note
if (mysqli_num_rows(mysqli_query($db,"select logpartid from logparts where lognoteid=\"$reftonote\""))) {
$fmtnote=$fmtnote."PARTS";
}
}
// now print the line in the table
if ($showtime) {
printf(
"%s
%s
%s
%s
%s
%s
\n",
$tablerow["lognoteid"],$tablerow["lognoteid"],
$tablerow["time"],
$tname,
$subjname,
$refs,
$fmtnote
);
} else {
printf(
"%s
%s
%s
%s
%s
\n",
$tablerow["lognoteid"],$tablerow["lognoteid"],
$tname,
$subjname,
$refs,
$fmtnote
);
}
}
echo " |