Various reformats. Changed boolean variables from 1/0 to TRUE/FALSE in multiple files.
This commit is contained in:
@@ -9,69 +9,70 @@
|
||||
|
||||
include("functions.php");
|
||||
|
||||
$print=$_REQUEST['print'] ?? "";
|
||||
$chainnote=$_REQUEST['chainnote'];
|
||||
$print = $_REQUEST['print'] ?? "";
|
||||
$chainnote = $_REQUEST['chainnote'] ?? NULL;
|
||||
|
||||
$logname=LOG_NAME;
|
||||
$logname = LOG_NAME;
|
||||
|
||||
if ($print) {
|
||||
$sbcolor=P_SIDEBAR_COLOR;
|
||||
$mbgcolor=P_MENUBG_COLOR;
|
||||
$sbcolor = P_SIDEBAR_COLOR;
|
||||
$mbgcolor = P_MENUBG_COLOR;
|
||||
} else {
|
||||
$sbcolor=SIDEBAR_COLOR;
|
||||
$mbgcolor=MENUBG_COLOR;
|
||||
$sbcolor = SIDEBAR_COLOR;
|
||||
$mbgcolor = MENUBG_COLOR;
|
||||
}
|
||||
|
||||
|
||||
framework("begin","$logname","Reference Chain Display",$print);
|
||||
framework("begin", "$logname", "Reference Chain Display", $print);
|
||||
|
||||
// ******** begin database manipulation ********
|
||||
|
||||
$master=generate_chain($chainnote);
|
||||
$master = generate_chain($chainnote);
|
||||
|
||||
// ******** end database manipulation ********
|
||||
|
||||
pagetable("begin");
|
||||
if(!$print){
|
||||
pageblock("left","begin");
|
||||
if (!$print) {
|
||||
pageblock("left", "begin");
|
||||
sidemenu();
|
||||
pageblock("left","end");
|
||||
pageblock("left", "end");
|
||||
}
|
||||
pageblock("right","begin");
|
||||
pageblock("right", "begin");
|
||||
banner($print);
|
||||
// display the chain
|
||||
$mptr=0;
|
||||
$mptr = 0;
|
||||
echo "<br><br><table border=\"1\" width=\"100%\">";
|
||||
echo "<tr><th>Note ID</th><th>Date / Time</th><th>Shift</th><th>Tech</th><th>Subject</th><th>Note</th><th>References</th></tr>";
|
||||
while($mptr<count($master)) {
|
||||
if(mysqli_num_rows(mysqli_query($db,"select * from lognotes where lognoteid=$master[$mptr]"))) {
|
||||
$tablerow = mysqli_fetch_assoc(mysqli_query($db,"select * from lognotes where lognoteid=$master[$mptr]"));
|
||||
$noteid=$tablerow["lognoteid"];
|
||||
$urldatestr="y=".date("Y",strtotime($tablerow["date"]))."&m=".date("m",strtotime($tablerow["date"]))."&d=".date("d",strtotime($tablerow["date"]));
|
||||
$refs=" <a href=\"logentry.php?add=1&refto=$noteid\"><img src=\"icons/plus.png\" border=\"0\" alt=\"Add referring note\" title=\"Add referring note\"></a> <a href=\"lognotes.php?$urldatestr\" title=\"View note in log\"><img src=\"icons/magnifier--arrow.png\"></a>";
|
||||
while ($mptr < count($master)) {
|
||||
if (mysqli_num_rows(mysqli_query($db, "select * from lognotes where lognoteid=$master[$mptr]"))) {
|
||||
$tablerow = mysqli_fetch_assoc(mysqli_query($db, "select * from lognotes where lognoteid=$master[$mptr]"));
|
||||
$noteid = $tablerow["lognoteid"];
|
||||
$urldatestr = "y=" . date("Y", strtotime($tablerow["date"])) . "&m=" . date("m", strtotime($tablerow["date"])) . "&d=" . date("d", strtotime($tablerow["date"]));
|
||||
$refs = " <a href=\"logentry.php?add=1&refto=$noteid\"><img src=\"icons/plus.png\" border=\"0\" alt=\"Add referring note\" title=\"Add referring note\"></a> <a href=\"lognotes.php?$urldatestr\" title=\"View note in log\"><img src=\"icons/magnifier--arrow.png\"></a>";
|
||||
// convert the shift number to a name
|
||||
$shname=dblookup($db,"shifts","shiftid","shiftname",$tablerow["shift"]);
|
||||
$shname = dblookup($db, "shifts", "shiftid", "shiftname", $tablerow["shift"]);
|
||||
// convert tech number to name
|
||||
$tname=dblookup($db,"techs","techid","techname",$tablerow["tech"]);
|
||||
$tname = dblookup($db, "techs", "techid", "techname", $tablerow["tech"]);
|
||||
//convert subject number to name
|
||||
$subjname=dblookup($db,"subjects","subjectid","subjectname",$tablerow["subject"]);
|
||||
$subjname = dblookup($db, "subjects", "subjectid", "subjectname", $tablerow["subject"]);
|
||||
// create links of urls in note
|
||||
$fmtnote=convertweblinks($tablerow["lognote"]);
|
||||
$fmtnote = convertweblinks($tablerow["lognote"]);
|
||||
// generate the flags string
|
||||
$flagstring="";
|
||||
$flagmapqry=mysqli_query($db,"select flagid from flagmap where lognoteid=$noteid");
|
||||
$flagstring = "";
|
||||
$flagmapqry = mysqli_query($db, "select flagid from flagmap where lognoteid=$noteid");
|
||||
if (mysqli_num_rows($flagmapqry)) {
|
||||
while ($flagids=mysqli_fetch_row($flagmapqry)) {
|
||||
$flagid=$flagids[0];
|
||||
$flagparam=mysqli_fetch_assoc(mysqli_query($db,"select * from flags where flagid=\"$flagid\""));
|
||||
$flagcolor=$flagparam["flagcolor"];
|
||||
$flagsym=$flagparam["flagsym"];
|
||||
$flagstring=$flagstring."<font color=\"$flagcolor\">$flagsym</font> ";
|
||||
while ($flagids = mysqli_fetch_row($flagmapqry)) {
|
||||
$flagid = $flagids[0];
|
||||
$flagparam = mysqli_fetch_assoc(mysqli_query($db, "select * from flags where flagid=\"$flagid\""));
|
||||
$flagcolor = $flagparam["flagcolor"];
|
||||
$flagsym = $flagparam["flagsym"];
|
||||
$flagstring = $flagstring . "<font color=\"$flagcolor\">$flagsym</font> ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($flagstring) $fmtnote=$fmtnote."<br>".$flagstring;
|
||||
printf("
|
||||
|
||||
if ($flagstring) $fmtnote = $fmtnote . "<br>" . $flagstring;
|
||||
printf(
|
||||
"
|
||||
<tr>
|
||||
<td><a href=\"logentry.php?edit=1¬eid=%s\">%s</a></td>
|
||||
<td>%s / %s</td>
|
||||
@@ -81,23 +82,24 @@ while($mptr<count($master)) {
|
||||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
</tr>",
|
||||
$tablerow["lognoteid"],$tablerow["lognoteid"],
|
||||
$tablerow["date"],$tablerow["time"],
|
||||
$shname,
|
||||
$tname,
|
||||
$subjname,
|
||||
$fmtnote,
|
||||
$refs);
|
||||
$tablerow["lognoteid"],
|
||||
$tablerow["lognoteid"],
|
||||
$tablerow["date"],
|
||||
$tablerow["time"],
|
||||
$shname,
|
||||
$tname,
|
||||
$subjname,
|
||||
$fmtnote,
|
||||
$refs
|
||||
);
|
||||
} else {
|
||||
printf("<tr><td colspan=\"7\"><font color=\"red\">Note Id <b> %s</b> has been deleted and cannot be displayed.</font></td></tr>\n",$master[$mptr]);
|
||||
printf("<tr><td colspan=\"7\"><font color=\"red\">Note Id <b> %s</b> has been deleted and cannot be displayed.</font></td></tr>\n", $master[$mptr]);
|
||||
}
|
||||
$mptr=$mptr+1;
|
||||
$mptr = $mptr + 1;
|
||||
}
|
||||
echo "</table><br><br>";
|
||||
banner($print);
|
||||
pageblock("right","end");
|
||||
pageblock("right", "end");
|
||||
pagetable("end");
|
||||
|
||||
framework("end","","",$print);
|
||||
|
||||
?>
|
||||
framework("end", "", "", $print);
|
||||
|
||||
Reference in New Issue
Block a user