I see it all the time? Here’s entire page code:
<?php require_once('Connections/eam.php'); ?>
<?php
$colname_rsHardwareAsset = "-1";
if (isset($_GET['recordID'])) {
$colname_rsHardwareAsset = $_GET['recordID'];
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO maintenance_history (
by_staff,
date_completed,
maint_comm,
maint_id)
VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['by_staff'], "text"),
GetSQLValueString(date('Y-m-d'), "text"),
GetSQLValueString($_POST['maint_comm'], "text"),
GetSQLValueString($colname_rsHardwareAsset, "text")
);
mysql_select_db($database_eam, $eam);
$Result1 = mysql_query($insertSQL, $eam) or die(mysql_error());
$insertGoTo = "MaintenanceDone.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_eam, $eam);
$query_rsHardwareAsset = sprintf("SELECT * FROM assets_hardware WHERE asset_hardware_id = %s", GetSQLValueString($colname_rsHardwareAsset, "int"));
$rsHardwareAsset = mysql_query($query_rsHardwareAsset, $eam) or die(mysql_error());
$row_rsHardwareAsset = mysql_fetch_assoc($rsHardwareAsset);
$totalRows_rsHardwareAsset = mysql_num_rows($rsHardwareAsset);
mysql_select_db($database_eam, $eam);
$query_rsMaintenanceHistory = sprintf("SELECT * FROM maintenance_history WHERE maint_id = %s", GetSQLValueString($colname_rsHardwareAsset, "int"));
$rsMaintenanceHistory = mysql_query($query_rsMaintenanceHistory, $eam) or die(mysql_error());
$row_rsMaintenanceHistory = mysql_fetch_assoc($rsMaintenanceHistory);
$totalRows_rsMaintenanceHistory = mysql_num_rows($rsMaintenanceHistory);
$pageTitle="Start Maintenance"; ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script>
$(() => {
'use strict';
$('.donebutton').click(function() {
$(this).toggleClass('pressed');
if ($('.pressed').length === $('.donebutton').length) {
$("finaltable").show();
}
});
});
</script>
<?php include('includes/header.php'); ?>
<table border="0" align="center" cellspacing="0" class="tableDetails1" style"margin:0 auto;width 600px;">
<tr>
<td style="font-size:100%">
<fieldset>
<legend>Maintenance
<i class="fa fa-print fa-lg" aria-hidden="true" onclick="goPrint()" onmouseover="" style="cursor: pointer;float:right;" ></i>
<i class="fa fa-arrow-circle-left fa-lg" aria-hidden="true" onclick="goBack()" onmouseover="" style="cursor: pointer;float:right;"> </i>
</legend>
<center><p><h4>Asset maintenance procedure</h4></p></center>
<center><p><h5>WSL Tool No.: <?php echo $row_rsHardwareAsset['wsltoolno']; ?></h5></p></center>
<hr />
<?php if($row_rsHardwareAsset['maint1'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 1</th>
<td><?php echo $row_rsHardwareAsset['maint1']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } else echo "<center><h4>Please fill atleast one instruction step to start maintenance!</h4></center>" ?>
<?php if($row_rsHardwareAsset['maint2'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 2</th>
<td><?php echo $row_rsHardwareAsset['maint2']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint3'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 3</th>
<td><?php echo $row_rsHardwareAsset['maint3']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint4'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 4</th>
<td><?php echo $row_rsHardwareAsset['maint4']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint5'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 5</th>
<td><?php echo $row_rsHardwareAsset['maint5']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint6'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 6</th>
<td><?php echo $row_rsHardwareAsset['maint6']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint7'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 7</th>
<td><?php echo $row_rsHardwareAsset['maint7']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint8'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 8</th>
<td><?php echo $row_rsHardwareAsset['maint8']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint9'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 9</th>
<td><?php echo $row_rsHardwareAsset['maint9']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<?php if($row_rsHardwareAsset['maint10'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Step 10</th>
<td><?php echo $row_rsHardwareAsset['maint10']; ?> </td>
</tr>
</table>
<center><button class='donebutton' onclick="this.disabled = true">DONE</button></center>
<hr />
<?php } ?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1">
<?php if($row_rsHardwareAsset['maint1'] != "") { ?>
<table class="tableDetails2">
<tr>
<th>Comments</th>
<td><textarea name="maint_comm" cols="40"></textarea></td>
</tr>
</table>
<hr />
<p>
<label for="User">User</label>
<input type="text" name="by_staff" value="<?php echo $_SESSION['MM_Username'];?> " size="8" STYLE="background-color: #F2EFE9;" readonly>
</p>
<p>
<label for="User">Date</label>
<input type="text" name="date_completed" value="<?php echo date("Y-m-d");?> " size="8" STYLE="background-color: #F2EFE9;" readonly>
</p>
<?php } ?>
<p class="submit">
<input type="submit" value="Submit" />
</p>
<input type="hidden" name="MM_insert" value="form1" />
</fieldset>
</form>
</td>
<?php include('includes/footer.php'); ?>
<?php
mysql_free_result($rsVendors);
mysql_free_result($rsPlatform);
mysql_free_result($rsHardwareType);
mysql_free_result($rsDivision);
mysql_free_result($rsLocation);
mysql_free_result($rsHardwareStatus);
mysql_free_result($rsMonitorSize);
?>