<?php virtual('/ams/Connections/amscon.php'); ?>
<?php
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;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$searchstring_Recordset1 = "-1";
if (isset($_GET['searchstring'])) {
$searchstring_Recordset1 = $_GET['searchstring'];
}
mysql_select_db($database_amscon, $amscon);
$query_Recordset1 = sprintf("SELECT * FROM publisher WHERE pubs_sku = %s", GetSQLValueString($searchstring_Recordset1, "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $amscon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_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="795" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="25" height="49"></td>
<td width="35"></td>
<td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="396" height="29"></td>
<td width="165"> </td>
</tr>
<tr>
<td height="19"></td>
<td valign="top"> </td>
</tr>
</table> </td>
<td width="1865"> </td>
<td width="4"></td>
</tr>
<tr>
<td height="80"> </td>
<td></td>
<td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="561" height="80" valign="top"><form id="form2" name="form2" method="get" action="index.php">
<label>
<textarea name="searchstring" id="searchstring" cols="45" rows="5"></textarea>
</label>
<label>
<input type="submit" name="search2" id="search2" value="Submit" />
</label>
</form>
</td>
</tr>
</table>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="54"> </td>
<td></td>
<td width="495"> </td>
<td width="66"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="54" colspan="5" valign="top"><table border="1">
<tr>
<td>pubs_id</td>
<td>pubs_brand</td>
<td>pubs_page</td>
<td>pubs_new</td>
<td>pubs_inter_code</td>
<td>pubs_sku</td>
<td>pubs_des</td>
<td>pubs_price</td>
<td>pubs_haz</td>
<td>pubs_lenght</td>
<td>pubs_width</td>
<td>pubs_height</td>
<td>pubs_weight</td>
<td>pubs_origin_code</td>
<td>pubs_origin</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['pubs_id']; ?></td>
<td><?php echo $row_Recordset1['pubs_brand']; ?></td>
<td><?php echo $row_Recordset1['pubs_page']; ?></td>
<td><?php echo $row_Recordset1['pubs_new']; ?></td>
<td><?php echo $row_Recordset1['pubs_inter_code']; ?></td>
<td><?php echo $row_Recordset1['pubs_sku']; ?></td>
<td><?php echo $row_Recordset1['pubs_des']; ?></td>
<td><?php echo $row_Recordset1['pubs_price']; ?></td>
<td><?php echo $row_Recordset1['pubs_haz']; ?></td>
<td><?php echo $row_Recordset1['pubs_lenght']; ?></td>
<td><?php echo $row_Recordset1['pubs_width']; ?></td>
<td><?php echo $row_Recordset1['pubs_height']; ?></td>
<td><?php echo $row_Recordset1['pubs_weight']; ?></td>
<td><?php echo $row_Recordset1['pubs_origin_code']; ?></td>
<td><?php echo $row_Recordset1['pubs_origin']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table></td>
<td> </td>
</tr>
<tr>
<td height="70"> </td>
<td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="54" height="13"></td>
<td width="415"></td>
<td width="61"></td>
</tr>
<tr>
<td height="34"></td>
<td valign="top">
<table border="0">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
<?php } // Show if not first page ?> </td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
<?php } // Show if not first page ?> </td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
<?php } // Show if not last page ?> </td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
<?php } // Show if not last page ?> </td>
</tr>
</table></td>
<td></td>
</tr>
</table></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="56"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>