Replaced template line loading code with the templateselect function.
This commit is contained in:
@@ -498,70 +498,15 @@ if ($submit) {
|
|||||||
if ($delete) {
|
if ($delete) {
|
||||||
format_message(0,"<strong>Note deleted.</strong> <a href=\"lognotes.php\">Return to main page.</a>");
|
format_message(0,"<strong>Note deleted.</strong> <a href=\"lognotes.php\">Return to main page.</a>");
|
||||||
}
|
}
|
||||||
echo "
|
|
||||||
<form method=\"post\" action=\"logentry.php\">
|
|
||||||
";
|
|
||||||
if ($_SESSION['login']) {
|
if ($_SESSION['login']) {
|
||||||
// generate template line
|
// show the template selection line
|
||||||
echo "
|
templateselect($techid,NULL);
|
||||||
<table border=\"0\" cellpadding=\"10\"><tr>
|
|
||||||
";
|
|
||||||
// list user templates
|
|
||||||
echo "
|
|
||||||
<td>
|
|
||||||
<select name=\"usertemplateid\" title=\"Select the user template you'd like to load and click the Load Template button. User template selection takes precedence.\">
|
|
||||||
";
|
|
||||||
if ($loadtemplate) $templatename=dblookup($db,"notetemplates","templateid","templatename",$usertemplateid);
|
|
||||||
$templaterow=mysqli_query($db,"select * from notetemplates where tech=\"$techid\" order by templatename asc");
|
|
||||||
if ($loadtemplate) {
|
|
||||||
printf("<option value=\"%s\">%s</option>","0","Select user template");
|
|
||||||
} else {
|
|
||||||
printf("<option value=\"%s\" selected>%s</option>","0","Select user template");
|
|
||||||
}
|
|
||||||
while ($templateitem=mysqli_fetch_assoc($templaterow)) {
|
|
||||||
if ($loadtemplate && ($templateitem["templateid"] == $usertemplateid)) {
|
|
||||||
printf("<option value=\"%s\" selected>%s</option>",$templateitem["templateid"],$templateitem["templatename"]);
|
|
||||||
} else {
|
|
||||||
printf("<option value=\"%s\">%s</option>",$templateitem["templateid"],$templateitem["templatename"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
</select> or
|
|
||||||
";
|
|
||||||
// list global templates
|
|
||||||
echo "
|
|
||||||
<select name=\"globaltemplateid\" title=\"Select the global template you'd like to load and click the Load Template button. User template selection takes precedence.\">
|
|
||||||
";
|
|
||||||
if ($loadtemplate) $templatename=dblookup($db,"notetemplates","templateid","templatename",$globaltemplateid);
|
|
||||||
$templaterow=mysqli_query($db,"select * from notetemplates where tech=\"0\" order by templatename asc");
|
|
||||||
if ($loadtemplate) {
|
|
||||||
printf("<option value=\"%s\">%s</option>","0","Select global template");
|
|
||||||
} else {
|
|
||||||
printf("<option value=\"%s\" selected>%s</option>","0","Select global template");
|
|
||||||
}
|
|
||||||
while ($templateitem=mysqli_fetch_assoc($templaterow)) {
|
|
||||||
if ($loadtemplate && ($templateitem["templateid"] == $globaltemplateid)) {
|
|
||||||
printf("<option value=\"%s\" selected>%s</option>",$templateitem["templateid"],$templateitem["templatename"]);
|
|
||||||
} else {
|
|
||||||
printf("<option value=\"%s\">%s</option>",$templateitem["templateid"],$templateitem["templatename"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
</select>
|
|
||||||
";
|
|
||||||
// show load button
|
|
||||||
echo "
|
|
||||||
<input type=\"submit\" name=\"loadtemplate\" value=\"Load Template\">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href=\"templates.php\">Manage templates</a>
|
|
||||||
</td>
|
|
||||||
</tr></table>
|
|
||||||
<hr>
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start note entry section
|
// start note entry section
|
||||||
echo "
|
echo "
|
||||||
|
<form method=\"post\" action=\"logentry.php\">
|
||||||
<table border=\"0\" cellpadding=\"5\">
|
<table border=\"0\" cellpadding=\"5\">
|
||||||
<tr>
|
<tr>
|
||||||
<td align=\"center\" colspan=\"2\"><b>Date: </b>
|
<td align=\"center\" colspan=\"2\"><b>Date: </b>
|
||||||
|
|||||||
Reference in New Issue
Block a user