Updated to use fix_date and fix_time functions

This commit is contained in:
2026-02-19 21:21:50 -05:00
parent 513017d3cb
commit d41519ba91
2 changed files with 16 additions and 4 deletions

View File

@@ -96,10 +96,9 @@ if ($add) {
// add the entry if submit is pressed
if ($note) {
// sanitize and fix blank date and time
$date = mysqli_real_escape_string($db, $date);
$time = mysqli_real_escape_string($db, $time);
if (!$date) $date = $today;
if (!$time) $time = $now;
$date = fix_date($date);
$time = fix_time($time);
// determine whether supplied date is future or past
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$date\",CURRENT_DATE)"));
// if future, set time to 00:00:01, if past, set to 23:59:59
@@ -263,6 +262,10 @@ if ($edit) {
if ($removepart && $authorized) mysqli_query($db, "delete from logparts where lognoteid=\"$noteid\" and logpartid=\"$removepart\"");
if ($submit) {
if ($note) {
// sanitize and fix blank date and time
$date = fix_date($date);
$time = fix_time($time);
// remove cruft from note text
$note = strip_tags($note, "<a>");
$note = mysqli_real_escape_string($db, $note);

View File

@@ -135,6 +135,9 @@ if ($mfadd) {
if ($mfsubmit) {
// add the entry if submit is pressed
if ($mfmalfunction && ($uid || ($partnum && $sernum))) {
// sanitize and fix blank date and time
$mfdate = fix_date($mfdate);
$mftime = fix_time($mftime);
// determine whether supplied date is future or past
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$mfdate\",CURRENT_DATE)"));
// if future, set time to 00:00:01, if past, set to 23:59:59
@@ -236,6 +239,9 @@ if ($mfdelete && $mfauthorized) {
if ($actionadd) {
if ($actionaddsubmit) {
if ($action) {
// sanitize and fix blank date and time
$actiondate = fix_date($actiondate);
$actiontime = fix_time($actiontime);
// determine whether supplied date is future or past
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$actiondate\",CURRENT_DATE)"));
// if future, set time to 00:00:01, if past, set to 23:59:59
@@ -260,6 +266,9 @@ if ($actionadd) {
if ($actionedit) {
if ($actioneditsubmit && $actionauthorized) {
// update the action
// sanitize and fix blank date and time
$actiondate = fix_date($actiondate);
$actiontime = fix_time($actiontime);
// remove cruft from action text
$action = htmlentities($action);
$action = addslashes($action);