Updated to use fix_date and fix_time functions
This commit is contained in:
@@ -96,10 +96,9 @@ if ($add) {
|
|||||||
// add the entry if submit is pressed
|
// add the entry if submit is pressed
|
||||||
if ($note) {
|
if ($note) {
|
||||||
// sanitize and fix blank date and time
|
// sanitize and fix blank date and time
|
||||||
$date = mysqli_real_escape_string($db, $date);
|
$date = fix_date($date);
|
||||||
$time = mysqli_real_escape_string($db, $time);
|
$time = fix_time($time);
|
||||||
if (!$date) $date = $today;
|
|
||||||
if (!$time) $time = $now;
|
|
||||||
// determine whether supplied date is future or past
|
// determine whether supplied date is future or past
|
||||||
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$date\",CURRENT_DATE)"));
|
$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
|
// 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 ($removepart && $authorized) mysqli_query($db, "delete from logparts where lognoteid=\"$noteid\" and logpartid=\"$removepart\"");
|
||||||
if ($submit) {
|
if ($submit) {
|
||||||
if ($note) {
|
if ($note) {
|
||||||
|
// sanitize and fix blank date and time
|
||||||
|
$date = fix_date($date);
|
||||||
|
$time = fix_time($time);
|
||||||
|
|
||||||
// remove cruft from note text
|
// remove cruft from note text
|
||||||
$note = strip_tags($note, "<a>");
|
$note = strip_tags($note, "<a>");
|
||||||
$note = mysqli_real_escape_string($db, $note);
|
$note = mysqli_real_escape_string($db, $note);
|
||||||
|
|||||||
@@ -135,6 +135,9 @@ if ($mfadd) {
|
|||||||
if ($mfsubmit) {
|
if ($mfsubmit) {
|
||||||
// add the entry if submit is pressed
|
// add the entry if submit is pressed
|
||||||
if ($mfmalfunction && ($uid || ($partnum && $sernum))) {
|
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
|
// determine whether supplied date is future or past
|
||||||
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$mfdate\",CURRENT_DATE)"));
|
$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
|
// 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 ($actionadd) {
|
||||||
if ($actionaddsubmit) {
|
if ($actionaddsubmit) {
|
||||||
if ($action) {
|
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
|
// determine whether supplied date is future or past
|
||||||
$datediff = mysqli_fetch_row(mysqli_query($db, "select datediff(\"$actiondate\",CURRENT_DATE)"));
|
$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
|
// if future, set time to 00:00:01, if past, set to 23:59:59
|
||||||
@@ -260,6 +266,9 @@ if ($actionadd) {
|
|||||||
if ($actionedit) {
|
if ($actionedit) {
|
||||||
if ($actioneditsubmit && $actionauthorized) {
|
if ($actioneditsubmit && $actionauthorized) {
|
||||||
// update the action
|
// update the action
|
||||||
|
// sanitize and fix blank date and time
|
||||||
|
$actiondate = fix_date($actiondate);
|
||||||
|
$actiontime = fix_time($actiontime);
|
||||||
// remove cruft from action text
|
// remove cruft from action text
|
||||||
$action = htmlentities($action);
|
$action = htmlentities($action);
|
||||||
$action = addslashes($action);
|
$action = addslashes($action);
|
||||||
|
|||||||
Reference in New Issue
Block a user