<?php
include("rcubed.inc");
$connection= mysql_connect($host, $user, $password) or die ("Couldn't connect to server");
$db = mysql_select_db($database, $connection) or die ("Couldn't select database");
//to display the correct header title
if ($item_code == "GPT"){
$title = "General Purpose Terminals";
$gpt = "<font face= 'Verdana' size= '1'>
General Purpose Terminals</font>";
}
else
$gpt = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=GPT'>General Purpose Terminals</a></font>";
if ($item_code == "PRINT"){
$title = "Printers";
$print = "<font face= 'Verdana' size= '1'>
Printers</font>";
}
else
$print = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=PRINT'>Printers</a></font>";
if ($item_code == "WINT"){
$title = "Thin Clients";
$wint = "<font face= 'Verdana' size= '1'>
Thin Clients</font>";
}
else
$wint = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=WINT'>Thin Clients</a></font>";
if ($item_code == "KYBD"){
$title = "Keyboards";
$kybd = "<font face= 'Verdana' size= '1'>
Keyboards</font>";
}
else
$kybd = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=KYBD'>Keyboards</a></font>";
if ($item_code == "MON"){
$title = "Monitors";
$mon = "<font face= 'Verdana' size= '1'>
Monitors</font>";
}
else
$mon = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=MON'>Monitors</a></font>";
if ($item_code == "PRH"){
$title = "Print Heads";
$prh = "<font face= 'Verdana' size= '1'>
Print Heads</font>";
}
else
$prh = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=PRH'>Print Heads</a></font>";
if ($item_code == "SUP"){
$title = "Supplies/Assemblies";
$sup = "<font face= 'Verdana' size= '1'>
Supplies/Assemblies</font>";
}
else
$sup = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=SUP'>Supplies/Assemblies</a></font>";
if ($item_code == "NET"){
$title = "Network/Software";
$net = "<font face= 'Verdana' size= '1'>
Network/Software</font>";
}
else
$net = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=NET'>Network/Software</a></font>";
if ($item_code == "SURG"){
$title = "Surge Suppressors";
$surg = "<font face= 'Verdana' size= '1'>
Surge Suppressors</font>";
}
else
$surg = "<font face= 'Verdana' size= '1'>
<a style= 'color: #CC0000; text-decoration: none'
href='equipment.php?item_code=SURG'>Surge Suppressors</a></font>";
//query to retrieve equpment information
$limit = 5;
$query_count = "select * from equipment where item_code = '$item_code'";
//retrieve equipment information from database
$result_count = mysql_query($query_count) or die ( mysql_error() );
$totalrows=mysql_num_rows($result_count);
//to see if the page is empty
if(empty($page)){
$page = 1;
}
$limitvalue = $page $limit - ($limit);
$query = "select from equipment where item_code = '$item_code' order by item_title limit $limitvalue, $limit";
$result = mysql_query($query) or die("error: " . mysql_error());
if(mysql_num_rows($result) == 0){
echo ("Nothing to Display!");
}
?>
<head>
<style type="text/css">
</head>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="772"
id="AutoNumber1" height="336">
<tr>
<td colspan="2" width="766" height="40">
<font face="Verdana" size="5" color="#333333">Equipment</font></td>
</tr>
<tr>
<td width="169" height="49"> </td>
<td width="603" height="49" align="left">
<font size="4" face="Verdana"
color="#333333"><?php echo $title;
?></font></td>
</tr>
<tr>
<td width="169" height="195" align="left" valign="top">
<p style="margin-top: 8; margin-bottom: 8"><?php echo $gpt; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $wint; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $print; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $kybd; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $mon; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $prh; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $sup; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $net; ?></p>
<p style="margin-top: 8; margin-bottom: 8"><?php echo $surg; ?></p>
<p style="margin-top: 8; margin-bottom: 8"> </p>
<!--webbot bot="HTMLMarkup" startspan -->
<style type="text/css">
<!-- #surveyDiv {position:absolute; height:1; width:1; top:0; left:0;} -->
</style><script language="JavaScript" src="http://www.rcubed.com/phplive/web/rcubed/surveys.php?base_url=http://www.rcubed.com/phplive"></script><a href="http://www.phplivesupport.com"></a><script language="JavaScript" src="http://www.rcubed.com/phplive/js/status_image.php?base_url=http://www.rcubed.com/phplive&l=rcubed&x=1&deptid=0&btn=1"></script>
<!--webbot bot="HTMLMarkup" endspan --></p></td>
<td align="left" valign="top" width="603" height="195">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="597"
id="AutoNumber2">
<?php
//loop to layout the dynamic table
while ($row = mysql_fetch_array($result))
{
extract ($row);
if ($alt_img == ""){
$img= "<img border= 0 src= $img_loc width= $img_width height= $img_height>";
}
else
$img = "<a href= javascript:pop1('pict_popup.php?man_pn=$man_pn')>
<img border= 0 src= $img_loc width= $img_width height= $img_height>
<p style='margin-top: 0; margin-bottom: 0'>
<font face= Verdana size= 1 color= #CC0000>View Larger Image</font>";
if ($img_loc == ""){
$img= "<img border= 0 src= equip_images/imageNA.jpg width= 100 height= 105>";
}
echo "<tr>\n";
echo "<td width= 131 align= center>";
echo "<script language= JavaScript>"; echo "<!--
function pop1(URL) {
window.open(URL,'','height=350,width=450,scrollbars=yes,top=05,left=10');
} //-->;";
echo "</script>";
echo "<p style='margin-top: 0; margin-bottom: 0'>";
echo $img; echo "</td>\n";
echo "<td width= 466 align= left valign= top>";
echo "<p style='margin-top: 0; margin-bottom: 0'>"; echo "<b>"; echo "<font face= Verdana color= #0000FF>"; echo $item_title; echo "</font>"; echo "</b>"; echo "</p>";
echo "<p style='margin-top: 0; margin-bottom: 0'>"; echo "<font face= Verdana size= 2>"; echo $item_desc; echo "</font>"; echo "</p>";
echo "<p style='margin-top: 0; margin-bottom: 0'>"; echo "<font face= Verdana>";
echo "<font size= 2>"; echo "Manufactor PN:"; echo " "; echo $man_pn; echo " "; echo "<b>"; echo "New: $"; echo $list_price; echo "</b>"; echo "</font>";
echo "</font>"; echo "</p>";
echo "<p style='margin-top: 0; margin-bottom: 0'>"; echo "<b>"; echo "<font face= Verdana size= 2 color= #CC0000>"; echo "Refurbished: $"; echo $r3_price; echo "</font>"; echo "</b>";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width= 597 colspan= 2>"; echo "<hr color= #C0C0C0 width= 596 size= 1 align= left>";
echo "</td>\n";
echo "</tr>\n";
}
?>
<tr>
<td width= 597 colspan= 2>
<?php
if($page != 1){
$pageprev = $page--;
echo("<a href='$PHP_SELF?page-$pageprev'>PREV" .$limit."</a> ");
}else
echo("PREV".$limit." ");
$numofpages = $totalrows / $limit;
for($i = 1; $i <= $numofpages; $i++){
if($i == $page){
echo($i." ");
}else{
echo("<a href='$PHP_SELF?page=$i'>$i</a> ");
}
}
if(($totalrows % $limit) != 0){
if($i == $page){
echo($i." ");
}else{
echo("<a href='$PHP_SELF?page=$i'>$i</a> ");
}
}
if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page++;
echo("<a href='$PHP_SELF?page=$pagenext'>NEXT".$limit."</a>");
}else{
echo("NEXT".$limit);
}
?>
</table>
</html>