$theValue = $theValue != "" ? intval($theValue) : "NULL"; break; case "double": $theValue = $theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = $theValue != "" ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = $theValue != "" ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } if (isset($_POST["MM_update"]) && $_POST["MM_update"] == "maintenanceUpdate") { $updateSQL = sprintf("UPDATE maintenancenotifs SET maintenancenotifs.status=%s WHERE maintenancenotifs.maintenanceNotifsID=%s", GetSQLValueString2($_POST['status'], "text"), GetSQLValueString2($_POST['maintenance'], "int")); mysql_select_db($database_connProdOps, $connProdOps); $Result1 = mysql_query($updateSQL, $connProdOps) or die(mysql_error()); $updateGoTo = "maintenance.php?maintenance=" . $_POST['maintenance'] . "&sent=y"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= strpos($updateGoTo, '?') ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } $colname_rsMaintenanceNotif = "1"; if (isset($_POST['maintenance'])) { $colname_rsMaintenanceNotif = get_magic_quotes_gpc() ? $_POST['maintenance'] : addslashes($_POST['maintenance']); } mysql_select_db($database_connProdOps, $connProdOps); $query_rsMaintenanceNotif = sprintf("SELECT maintenancenotifs.maintenanceNotifsID, maintenancenotifs.reason, maintenancenotifs.customerImpact, maintenancenotifs.nocImpact, maintenancenotifs.prodChanges, TIME_FORMAT(startTime, '%%k:%%i') as startTime, maintenancenotifs.employeeID, maintenancenotifs.estimatedHours, maintenancenotifs.estimatedMinutes, DATE_FORMAT(startDate, '%%m/%%d/%%Y') as startDate, employees.displayName FROM maintenancenotifs, employees WHERE maintenanceNotifsID = %s AND maintenancenotifs.employeeID=employees.employeeID", $colname_rsMaintenanceNotif);
$theValue = $theValue != "" ? intval($theValue) : "NULL"; break; case "double": $theValue = $theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = $theValue != "" ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = $theValue != "" ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } if (isset($_POST["MM_insert"]) && $_POST["MM_insert"] == "maintenanceNotif1") { $insertSQL = sprintf("INSERT INTO maintenancenotifs (startDate, reason, customerImpact, nocImpact, prodChanges, employeeID, startTime, estimatedHours, estimatedMinutes) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString2($_POST['startDate'], "text"), GetSQLValueString2($_POST['reason'], "text"), GetSQLValueString2($_POST['customerImpact'], "text"), GetSQLValueString2($_POST['nocImpact'], "text"), GetSQLValueString2($_POST['prodChanges'], "text"), GetSQLValueString2($_POST['engineer'], "int"), GetSQLValueString2($_POST['startHour'] . $_POST['startMinute'] . "00", "int"), GetSQLValueString2($_POST['estHours'], "int"), GetSQLValueString2($_POST['estMins'], "int")); mysql_select_db($database_connProdOps, $connProdOps); $Result1 = mysql_query($insertSQL, $connProdOps) or die(mysql_error()); ?> <script> alert("Maintenance Notification sent successfully!"); setTimeout(function(){ window.location.href = "maintenances.php"; },0000); </script> <?php echo "Maintenance Notification sent successfully!"; /*$insertGoTo = "maintenanceAdd.php?sent=y"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING'];