rendered paste body<?php require_once('Connections/conn_gto.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
?>
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmaddsite")) {
$insertSQL = sprintf("INSERT INTO clientsite (siteid, sitedetails, staffid, clientid) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['ClientSiteID'], "text"),
GetSQLValueString($_POST['SiteDetails'], "text"),
GetSQLValueString($_POST['StaffID'], "text"),
GetSQLValueString($_POST['clientidx'], "text"));
mysql_select_db($database_conn_gto, $conn_gto);
$Result1 = mysql_query($insertSQL, $conn_gto) or die(mysql_error());
$insertGoTo = "clientsite.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<?
$str1 = $row_rs_numberofclientsite['COUNT(*)'];
$str2 = $str1 + 1;
?>
<!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=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="800" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td><div align="center"><img src="images/banner.jpg" alt="Banner" width="761" height="81" border="0" /></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><form action="<?php echo $editFormAction; ?>" method="POST" name="frmaddsite" id="frmaddsite" onsubmit="MM_validateForm('SiteDetails','','R');return document.MM_returnValue">
<table width="95%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="75%"><label>
<input name="StaffID" type="hidden" id="StaffID" value="<?php echo $row_rs_staffID['staffid']; ?>" size="5" maxlength="5" />
</label></td>
</tr>
<tr>
<td><div align="right">Client ID:</div></td>
<td><label>
<select name="clientidx" id="clientid">
<?php
do {
?>
<option value="<?php echo $row_rs_client['clientid']?>"><?php echo $row_rs_client['clientid']?></option>
<?php
} while ($row_rs_client = mysql_fetch_assoc($rs_client));
$rows = mysql_num_rows($rs_client);
if($rows > 0) {
mysql_data_seek($rs_client, 0);
$row_rs_client = mysql_fetch_assoc($rs_client);
}
?>
</select>
Click here to search for the Client ID. </label></td>
</tr>
<tr>
<td></td>
<td><label>
<input name="ClientSiteID" type="hidden" id="ClientSiteID" value ="<? echo $_POST['clientidx'].S.$str2;?>" />
</label></td>
</tr>
<tr>
<td><div align="right">Site Details:</div></td>
<td><label>
<textarea name="SiteDetails" cols="75" rows="8" id="SiteDetails"><Location>
<Notes>
</textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="Submit" value="Add" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="frmaddsite">
</form> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</body>
</html>