<?php require_once('Connections/New.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
$deleteSQL = sprintf("DELETE FROM customer1 WHERE ID=%s",
GetSQLValueString($_GET['ID'], "int"));
mysql_select_db($database_New, $New);
$Result1 = mysql_query($deleteSQL, $New) or die(mysql_error());
$deleteGoTo = "success.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) {
$deleteSQL = sprintf("DELETE FROM customer1 WHERE ID=%s",
GetSQLValueString($_GET['ID'], "int"));
mysql_select_db($database_New, $New);
$Result1 = mysql_query($deleteSQL, $New) or die(mysql_error());
}
$colname_DetailRS1 = "-1";
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = $_GET['recordID'];
}
mysql_select_db($database_New, $New);
$query_DetailRS1 = sprintf("SELECT * FROM customer1 WHERE ID = %s ORDER BY `last Updated` ASC", GetSQLValueString($colname_DetailRS1, "int"));
$DetailRS1 = mysql_query($query_DetailRS1, $New) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);
$colname_recordset1 = "-1";
if (isset($_GET['RecordID'])) {
$colname_recordset1 = $_GET['RecordID'];
}
mysql_select_db($database_New, $New);
$query_recordset1 = sprintf("SELECT * FROM `comment` WHERE CustomerID = %s", GetSQLValueString($colname_recordset1, "int"));
$recordset1 = mysql_query($query_recordset1, $New) or die(mysql_error());
$row_recordset1 = mysql_fetch_assoc($recordset1);
$totalRows_recordset1 = mysql_num_rows($recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="200" border="1">
<tr>
<th scope="row"><?php echo $row_Recordset1['ID']; ?></th>
<td><?php echo $row_Recordset1['CustomerID']; ?></td>
<td><?php echo $row_Recordset1['Comment']; ?></td>
</tr>
</table>
<table border="1" align="center">
<tr>
<td width="77">ID</td>
<td width="248"><?php echo $row_DetailRS1['ID']; ?></td>
</tr>
<tr>
<td>Name</td>
<td><?php echo $row_DetailRS1['Name']; ?></td>
</tr>
<tr>
<td>Address</td>
<td><?php echo $row_DetailRS1['Address']; ?></td>
</tr>
<tr>
<td>Postcode</td>
<td><?php echo $row_DetailRS1['Postcode']; ?></td>
</tr>
<tr>
<td>Town</td>
<td><?php echo $row_DetailRS1['Town']; ?></td>
</tr>
<tr>
<td>Telephone</td>
<td><?php echo $row_DetailRS1['Telephone']; ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo $row_DetailRS1['Email']; ?></td>
</tr>
<tr>
<td>Category</td>
<td><?php echo $row_DetailRS1['Category']; ?></td>
</tr>
<tr>
<td height="163">Notes</td>
<td><?php echo $row_DetailRS1['Notes']; ?></td>
</tr>
<tr>
<td>last Updated</td>
<td><?php echo $row_DetailRS1['last Updated']; ?></td>
</tr>
</table>
<p><br />
</p>
<p><br />
</p>
<p> </p>
<p> </p>
<p><br />
</p>
</body>
</html><?php
mysql_free_result($DetailRS1);
mysql_free_result($recordset1);
?>