Jump to content

[SOLVED] Displaying a table row based on DB data


jaxdevil

Recommended Posts

I am trying to make a table row visible only if the database says to. Basically I have products in a database, I have fields in each entry for img and pdf, which I mark as 'Yes' or 'No' in each field depending on if the product has an image or a pdf on the server. I am trying to make the ones that have the field 'pdf' marked as 'No' to not display the row, and the ones that have 'pdf' marked as 'Yes' to display the image (with imagemap) that gives them the option to download it. Below is the doe I am came up with, its not working. PLEASE help me figure out whats wrong...

 

Thanks in advance,

SK

 

<?php
if ($row['pdf'] != 'Yes')
{
?>
<tr>
<td>
<div style="padding-left:2px;">
<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">PRODUCT DOCUMENTS:</font>
<img src="/images/docs.gif" border="0" USEMAP="#docs.gif">
</div>
</td>
</tr>
<?php
}
?>


<?php
if ($row['pdf'] != 'No')
{}
?>

<?php
else
{
?>
<tr>
<td>
<div style="padding-left:2px;">
<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">What the hell?</font>
</div>
</td>
</tr>
<?php
}
?>

Link to comment
Share on other sites

Here is the whole page. Everything works except that dynamic TR. Thanks for looking at it man, I appreciate it.

 

SK

 

<?php
$db_host = "localhost";
$db_user = "xxx_xxx";
$db_pwd = "xxxxxx";
$db_name = "usice_usice";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name) or die(mysql_error()); 
$query = "SELECT * FROM `products` WHERE `mod` = '$icemachines' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
{
?>
<?php
$unformated_price = $row['price'];
$price = number_format($unformated_price, 2, '.', ',');
?>

<html>
<head>
<title>Ice Machines: US Ice Machines</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="Javascript">
function PrintLine() {
var printline = "<?=$icemachines?>";/*The text to be "imaged". Allowed punctuation: space, comma, period, exclamation sign, apostrophe.*/
lct = printline.toLowerCase();
st = lct.replace(/\ /g,'+')
dt = st.replace(/\./g,'.')
splitline = dt.split('');
imgline = splitline.join('.png" lowsrc="print2\/place.png" border="0"><\/td><td><img src="print2\/');
document.write('<table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="print2\/'+imgline+'.png" lowsrc="print2\/place.png" border="0"><\/td><\/tr><\/table>');
}
</script>
</head>
<body bgcolor="#1c3c79" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" width="1225" height="941" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="10">
		<img src="images/ice_machines_01.gif" width="949" height="105" alt=""></td>
	<td rowspan="9" background="images/ice_machines_02.bk.gif" width="275" height="1500">
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="105" alt=""></td>
</tr>
<tr>
	<td colspan="2">
		<img src="images/ice_machines_03.gif" width="177" height="62" alt=""></td>
	<td>
	<a href="http://www.usice.us"><img src="images/icemachines_04.gif" width="86" height="62" alt="US Ice Machines" border="0"></a></td>
	<td>
	<a href="/Ice-Machines.AboutUs.php"><img src="images/icemachines_05.gif" width="73" height="62" alt="About US Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.OrderingInfo.php"><img src="images/icemachines_06.gif" width="102" height="62" alt="Ice Machines Ordering Info" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.ShippingInfo.php"><img src="images/icemachines_07.gif" width="96" height="62" alt="Ice Machines Shipping Information" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Leasing.php"><img src="images/icemachines_08.gif" width="125" height="62" alt="Leasing Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Careers.php"><img src="images/icemachines_09.gif" width="79" height="62" alt="Careers with Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Support.php"><img src="images/icemachines_10.gif" width="123" height="62" alt="Support for Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Account.php"><img src="images/icemachines_11.gif" width="88" height="62" alt="Ice Machines Account" border="0"></a></td>
	<td>
		<img src="images/spacer.gif" width="1" height="62" alt=""></td>
</tr>
<tr>
	<td rowspan="2" background="images/icemachines_12.gif" width="175" height="80" align="left" valign="middle">
<br style='font-size:18px;'>
<form action="ice-machines-search.php">
<img src="/images/spacer.gif" width="30" height="1"><input type="text" size="17" style="height:1.2em;">
<img src="/images/spacer.gif" width="30" height="1"><input type="image" src="images/gobutton.gif"></form>
</td>
	<td colspan="9" background="images/ice_machines_13.gif" width="774" height="64">
<div style="padding-left: 10px; padding-right: 0px; padding-top: 5px; padding-bottom: 5px;">
<script type="text/javascript" language="Javascript">PrintLine();</script>
</div>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="64" alt=""></td>
</tr>
<tr valign="top">
	<td colspan="9" rowspan="5" background="images/ice_machines_14.bk.gif" STYLE="background-position: top;background-color:#FFFFFF; background-repeat:no-repeat;background-attachment:scroll" width="774" height="639" valign="top">
<div style="padding-left: 10px; padding-right: 0px; padding-top: 5px; padding-bottom: 5px;">
<table width="750" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="475" valign="top">
<table width="475" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="475">
<font style="font:bold 1.6em Arial, Helvetica, sans-serif; color:#94200d;">
<?=$row['name']?></font><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#0b7ecc;">
Manufactured by <?=$row['man']?></font>
</td>
</tr>
<tr>
<td height="3">
</td>
</tr>
<tr>
<td width="475" background="/images/pdpricing.gif" valign="middle" height="28">
<table width="475" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="200" align="left" valign="middle">
<img src="/images/blank.gif" width="10" height="1"><font style="font:bold 0.95em Arial, Helvetica, sans-serif; color:#1b3975;">$<?=$price?></font>
</td>
<td width="275" align="right" valign="middle">
<font style="font:bold 0.70em Arial, Helvetica, sans-serif; color:#1b3975;"><a href="#ice-machine-spec-sheet">See specifications chart below</a></font><img src="/images/blank.gif" width="30" height="1">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div style="padding-left: 2px; padding-right: 2px; padding-top: 5px;">
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;"><?=$row['full']?></font><br><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#94200d;"><a name="ice-machine-spec-sheet">Product Specifications</a></font>
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;"><?=$row['specs']?></font>
</div>
</td>
</tr>
</table>
</td>
<td width="275" align="center" valign="top">
<table>
<tr>
<td height="10">
</td>
</tr>

<tr>
<td>
<table width="250">
<tr>
<td background="/productimages/<?=$row['mod']?>_pd.jpg" width="250" height="300" STYLE="background-position: center;background-color:#FFFFFF; background-repeat:no-repeat;background-attachment:scroll">
<a href="/productimages/<?=$row['mod']?>.jpg"><img src="/images/vlo.gif" border="0"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="3">
</td>
</tr>



<?php
if ($row['pdf'] != 'Yes')
{
?>
<tr>
<td>
<div style="padding-left:2px;">
<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">PRODUCT DOCUMENTS:</font>
<img src="/images/docs.gif" border="0" USEMAP="#docs.gif">
</div>
</td>
</tr>
<?php
}
?>


<?php
if ($row['pdf'] != 'No')
{}
?>

<?php
else
{
?>
<tr>
<td>
<div style="padding-left:2px;">
<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">What the hell?</font>
</div>
</td>
</tr>
<?php
}
?>


<tr>
<td>
<div style="padding-left:2px;">
<img src="/images/contactdata.gif" border="0" USEMAP="#contactdata.gif">
</div>
</td>
</tr>

<tr>
<td>
<div style="padding-left:2px;">
<img src="/images/emailfriend.gif" border="0" USEMAP="#emailfriend.gif">
</div>
</td>
</tr>

<tr>
<td>
<div style="padding-left:2px;">
<form action="/classes/db_cart/db_cart_continue.php" method="post">
    <input type="hidden" name="new_amount" value="1">
<input type="hidden" name="price" value="<?=$row['price']?>">
<input type="hidden" name="art_no" value="<?=$row['mod']?>">
<input type="hidden" name="product" value="<?=$row['name']?>">
    <input type="image" src="/images/cart_big.gif" name="submit">
</form>
</div>
</td>
</tr>

</table>
</td>
</tr>
</table>





</div>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="16" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/ice_machines_15.gif" width="175" height="52" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
	<td bgcolor="#e9e9e9" width="175" height="146" align="left" valign="top">
<font face="Tahoma" style="font-size:0.70em" color="#94200d"><b>
<script language="JavaScript" type="text/javascript">
<!--

/*
*** Multiple dynamic combo boxes
*** by Mirko Elviro, 9 Mar 2005
*** Script featured and available on JavaScript Kit (http://www.javascriptkit.com)
***
***Please do not remove this comment
*/

// This script supports an unlimited number of linked combo boxed
// Their id must be "combo_0", "combo_1", "combo_2" etc.
// Here you have to put the data that will fill the combo boxes
// ie. data_2_1 will be the first option in the second combo box
// when the first combo box has the second option selected


// first combo box

data_1 = new Option("Cracked Ice Machines", "Cracked Ice Machines");
data_2 = new Option("Cubed Ice Machines", "Cubed Ice Machines");
data_3 = new Option("Cylindrical Ice Machines", "Cylindrical Ice Machines");
data_4 = new Option("Flaked Ice Machines", "Flaked Ice Machines");
data_5 = new Option("Nugget Compressed Ice Machines", "Nugget Compressed Ice Machines");
data_6 = new Option("Round Ice machines", "Round Ice Machines");

// second combo box

data_1_1 = new Option("Turbo Air", "Turbo Air");
data_1_2 = new Option("US Ice Machines", "US Ice Machines");
data_2_1 = new Option("Cornelius", "Cornelius");
data_3_1 = new Option("", "");
data_4_1 = new Option("Cornelius", "Cornelius");
data_5_1 = new Option("Cornelius", "Cornelius");
data_6_1 = new Option("US Ice Machines", "US Ice Machines");

// other parameters

    displaywhenempty=""
    valuewhenempty=-1

    displaywhennotempty="-select-"
    valuewhennotempty=0


function change(currentbox) {
numb = currentbox.id.split("_");
currentbox = numb[1];

    i=parseInt(currentbox)+1

// I empty all combo boxes following the current one

    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
         son = document.getElementById("combo_"+i);
     // I empty all options except the first one (it isn't allowed)
     for (m=son.options.length-1;m>0;m--) son.options[m]=null;
     // I reset the first option
     son.options[0]=new Option(displaywhenempty,valuewhenempty)
     i=i+1
    }


// now I create the string with the "base" name ("stringa"), ie. "data_1_0"
// to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill

    stringa='data'
    i=0
    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
           eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex")
           if (i==currentbox) break;
           i=i+1
    }


// filling the "son" combo (if exists)

    following=parseInt(currentbox)+1

    if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) &&
       (document.getElementById("combo_"+following)!=null)) {
       son = document.getElementById("combo_"+following);
       stringa=stringa+"_"
       i=0
       while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) {

       // if there are no options, I empty the first option of the "son" combo
   // otherwise I put "-select-" in it

   	  if ((i==0) && eval("typeof("+stringa+"0)=='undefined'"))
   	      if (eval("typeof("+stringa+"1)=='undefined'"))
   	         eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)")
   	      else
             eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)")
      else
              eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)")
      i=i+1
   }
       //son.focus()
       i=1
       combostatus=''
       cstatus=stringa.split("_")
       while (cstatus[i]!=null) {
          combostatus=combostatus+cstatus[i]
          i=i+1
          }
       return combostatus;
    }
}

//-->
</script>
<form action="ice-machines-browse.php">
Browse Ice Machines by:
<select name="combo0" id="combo_0" onChange="change(this);" style="width:170px;">
<option value="value0">-Select Type-</option>
<option value="Cracked Ice Machines">Cracked Ice Machines</option>
<option value="Cubed Ice Machines">Cubed Ice Machines</option>
<option value="Cylindrical Ice Machines">Cylindrical Ice Machines</option>
<option value="Flaked Ice Machines">Flaked Ice Machines</option>
<option value="BetterBilt">Nugget Compressed Ice Machines</option>

</select>
Now Choose Manufacturer:
<select name="combo1" id="combo_1" onChange="change(this)" style="width:170px;">
<option value="value1"></option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
<br>
Or <a href="all-ice-machines.php">View ALL</a> Ice Machines
</font>
</b>
</td>
	<td>
		<img src="images/spacer.gif" width="1" height="146" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/ice_machines_17.gif" width="175" height="58" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="58" alt=""></td>
</tr>
<tr>
	<td bgcolor="#e9e9e9" width="175" height="927" valign="top">
<form action="ice-machines-pst.php">
<font face="Tahoma" color="#1b3975" style="font-size:0.75em"><b>
Browse Parts & Supplies by:
<br>
Part & Supply Type:
<select name="combo0" id="combo_0" style="width:170px;">
<option value="">-Select Type-</option>
<option value="Compressor">Compressor</option>
<option value="Condensing Unit">Condensing Unit</option>
<option value="Packaging">Packaging</option>
<option value="Safety Decals">Safety Decals</option>
<option value="BetterBilt">Nugget Compressed Ice Machines</option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
Part & Supply Manufacturer:
<form action="ice-machines-psm.php">
<select name="combo1" id="combo_1" style="width:170px;">
<option value="value1"></option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
<br>
Or <a href="all-ice-machines.php">View ALL</a> Ice Machines
</font>
</b>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="367" alt=""></td>
</tr>
<tr>
	<td colspan="10">
		<img src="images/ice_machines_19.gif" width="949" height="70" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="70" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/spacer.gif" width="175" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="2" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="86" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="73" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="102" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="96" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="125" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="79" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="123" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="88" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="275" height="1" alt=""></td>
	<td></td>
</tr>
</table>
</body>
<MAP NAME="docs.gif">
<AREA SHAPE=RECT COORDS="7,41,99,71" HREF="http://www.adobe.com/products/acrobat/readstep2.html" TARGET="_blank">
<AREA SHAPE=RECT COORDS="8,9,246,24" HREF="/productdocs/<?=$row['mod']?>.pdf" TARGET="_blank">
</MAP><br><MAP NAME="emailfriend.gif">
<AREA SHAPE=RECT COORDS="7,97,133,116" HREF="mailto:?&subject=Check this out&body=I found this item and thought you would be interested.%0D%0Ahttp://www.usice.us/icemachines.php?icemachines=<?=$row['mod']?>" >
</MAP>
<MAP NAME="contactdata.gif">
<AREA SHAPE=RECT COORDS="19,53,166,66" HREF="/Ice-Machines.Support.php">
<AREA SHAPE=RECT COORDS="94,73,206,86" HREF="/Ice-Machines.ShippingInfo.php">
<AREA SHAPE=RECT COORDS="93,93,207,105" HREF="/Ice-Machines.OrderingInfo.php">
</MAP>
</html>
<?
}
?>

Link to comment
Share on other sites

Not really sure what you are trying to do, but I'll explain what you are doing to see if it matches.

 

$query = "SELECT * FROM `products` WHERE `mod` = '$icemachines' LIMIT 1";

 

That line will only return 1 row/record since you use LIMIT 1.  You are not using an ORDER BY so I'm not really sure what your intent is.

 

If you want to read all the rows/records tha match $icemachines, then remove the LIMIT.  Also, $icemachines doesn't appear to be set here so chances are your query will return no results.

 

Once you get the right query and you want to read more than 1 row, you would use a while loop and fetch them.  Inside the while loop is where you do your output, so you will get 1 TR per record.

Link to comment
Share on other sites

The $icemachines variable is passed by a form 'post'. One script I made pulls up and displays all the products matching the customers criteria (price, lbs per day, etc), when they select the machine they are interested and click on it the item info is sent to this page (copied above) so they see all the details about the item. The limit doesn't really need to be there, but it can not hurt it because onlny one ice machine will match the $icemachines variabl that is sent (the $icemachines variable is actually the model number, and there is only one of each model number) Any ideas from here? I really do appreciate your help, I am going around in circles in my head and getting nowhere by myself.

 

Thanks in advance,

SK

Link to comment
Share on other sites

I figured it out. I had no 'while' statement in the sql query, just a declaration so that I could pull all the row data and insert them into their proper places on the page. It works now, I copied my new code below....

 

<?php
$db_host = "localhost";
$db_user = "xxx_xxx";
$db_pwd = "xxxxx";
$db_name = "usice_usice";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name) or die(mysql_error()); 
$query = "SELECT * FROM `products` WHERE `mod` = '$icemachines' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
?>
<?php
$unformated_price = $row['price'];
$price = number_format($unformated_price, 2, '.', ',');
?>

<html>
<head>
<title>Ice Machines: US Ice Machines</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="Javascript">
function PrintLine() {
var printline = "<?=$icemachines?>";/*The text to be "imaged". Allowed punctuation: space, comma, period, exclamation sign, apostrophe.*/
lct = printline.toLowerCase();
st = lct.replace(/\ /g,'+')
dt = st.replace(/\./g,'.')
splitline = dt.split('');
imgline = splitline.join('.png" lowsrc="print2\/place.png" border="0"><\/td><td><img src="print2\/');
document.write('<table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="print2\/'+imgline+'.png" lowsrc="print2\/place.png" border="0"><\/td><\/tr><\/table>');
}
</script>
</head>
<body bgcolor="#1c3c79" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" width="1225" height="941" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="10">
		<img src="images/ice_machines_01.gif" width="949" height="105" alt=""></td>
	<td rowspan="9" background="images/ice_machines_02.bk.gif" width="275" height="1500">
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="105" alt=""></td>
</tr>
<tr>
	<td colspan="2">
		<img src="images/ice_machines_03.gif" width="177" height="62" alt=""></td>
	<td>
	<a href="http://www.usice.us"><img src="images/icemachines_04.gif" width="86" height="62" alt="US Ice Machines" border="0"></a></td>
	<td>
	<a href="/Ice-Machines.AboutUs.php"><img src="images/icemachines_05.gif" width="73" height="62" alt="About US Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.OrderingInfo.php"><img src="images/icemachines_06.gif" width="102" height="62" alt="Ice Machines Ordering Info" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.ShippingInfo.php"><img src="images/icemachines_07.gif" width="96" height="62" alt="Ice Machines Shipping Information" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Leasing.php"><img src="images/icemachines_08.gif" width="125" height="62" alt="Leasing Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Careers.php"><img src="images/icemachines_09.gif" width="79" height="62" alt="Careers with Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Support.php"><img src="images/icemachines_10.gif" width="123" height="62" alt="Support for Ice Machines" border="0"></a></td>
	<td>
		<a href="/Ice-Machines.Account.php"><img src="images/icemachines_11.gif" width="88" height="62" alt="Ice Machines Account" border="0"></a></td>
	<td>
		<img src="images/spacer.gif" width="1" height="62" alt=""></td>
</tr>
<tr>
	<td rowspan="2" background="images/icemachines_12.gif" width="175" height="80" align="left" valign="middle">
<br style='font-size:18px;'>
<form action="ice-machines-search.php">
<img src="/images/spacer.gif" width="30" height="1"><input type="text" size="17" style="height:1.2em;">
<img src="/images/spacer.gif" width="30" height="1"><input type="image" src="images/gobutton.gif"></form>
</td>
	<td colspan="9" background="images/ice_machines_13.gif" width="774" height="64">
<div style="padding-left: 10px; padding-right: 0px; padding-top: 5px; padding-bottom: 5px;">
<script type="text/javascript" language="Javascript">PrintLine();</script>
</div>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="64" alt=""></td>
</tr>
<tr valign="top">
	<td colspan="9" rowspan="5" background="images/ice_machines_14.bk.gif" STYLE="background-position: top;background-color:#FFFFFF; background-repeat:no-repeat;background-attachment:scroll" width="774" height="639" valign="top">
<div style="padding-left: 10px; padding-right: 0px; padding-top: 5px; padding-bottom: 5px;">
<table width="750" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="475" valign="top">
<table width="475" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="475">
<font style="font:bold 1.6em Arial, Helvetica, sans-serif; color:#94200d;">
<?=$row['name']?></font><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#0b7ecc;">
Manufactured by <?=$row['man']?></font>
</td>
</tr>
<tr>
<td height="3">
</td>
</tr>
<tr>
<td width="475" background="/images/pdpricing.gif" valign="middle" height="28">
<table width="475" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="200" align="left" valign="middle">
<img src="/images/blank.gif" width="10" height="1"><font style="font:bold 0.95em Arial, Helvetica, sans-serif; color:#1b3975;">$<?=$price?></font>
</td>
<td width="275" align="right" valign="middle">
<font style="font:bold 0.70em Arial, Helvetica, sans-serif; color:#1b3975;"><a href="#ice-machine-spec-sheet">See specifications chart below</a></font><img src="/images/blank.gif" width="30" height="1">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div style="padding-left: 2px; padding-right: 2px; padding-top: 5px;">
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;"><?=$row['full']?></font><br><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#94200d;"><a name="ice-machine-spec-sheet">Product Specifications</a></font>
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;"><?=$row['specs']?></font>
</div>
</td>
</tr>
</table>
</td>
<td width="275" align="center" valign="top">
<table>
<tr>
<td height="10">
</td>
</tr>

<tr>
<td>
<table width="250">
<tr>
<td background="/productimages/<?=$row['mod']?>_pd.jpg" width="250" height="300" STYLE="background-position: center;background-color:#FFFFFF; background-repeat:no-repeat;background-attachment:scroll">
<a href="/productimages/<?=$row['mod']?>.jpg"><img src="/images/vlo.gif" border="0"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="3">
</td>
</tr>


<?php
if ($row['pdf']=='Yes')
{
?>
<tr>
<td>
<div style="padding-left:2px;">
<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">PRODUCT DOCUMENTS:</font>
<img src="/images/docs.gif" border="0" USEMAP="#docs.gif">
</div>
</td>
</tr>
<?php
}
?>

<?php
if ($row['pdf']!='Yes')
{}
?>

<tr>
<td>
<div style="padding-left:2px;">
<img src="/images/contactdata.gif" border="0" USEMAP="#contactdata.gif">
</div>
</td>
</tr>

<tr>
<td>
<div style="padding-left:2px;">
<img src="/images/emailfriend.gif" border="0" USEMAP="#emailfriend.gif">
</div>
</td>
</tr>

<tr>
<td>
<div style="padding-left:2px;">
<form action="/classes/db_cart/db_cart_continue.php" method="post">
    <input type="hidden" name="new_amount" value="1">
<input type="hidden" name="price" value="<?=$row['price']?>">
<input type="hidden" name="art_no" value="<?=$row['mod']?>">
<input type="hidden" name="product" value="<?=$row['name']?>">
    <input type="image" src="/images/cart_big.gif" name="submit">
</form>
</div>
</td>
</tr>

</table>
</td>
</tr>
</table>





</div>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="16" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/ice_machines_15.gif" width="175" height="52" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
	<td bgcolor="#e9e9e9" width="175" height="146" align="left" valign="top">
<font face="Tahoma" style="font-size:0.70em" color="#94200d"><b>
<script language="JavaScript" type="text/javascript">
<!--

/*
*** Multiple dynamic combo boxes
*** by Mirko Elviro, 9 Mar 2005
*** Script featured and available on JavaScript Kit (http://www.javascriptkit.com)
***
***Please do not remove this comment
*/

// This script supports an unlimited number of linked combo boxed
// Their id must be "combo_0", "combo_1", "combo_2" etc.
// Here you have to put the data that will fill the combo boxes
// ie. data_2_1 will be the first option in the second combo box
// when the first combo box has the second option selected


// first combo box

data_1 = new Option("Cracked Ice Machines", "Cracked Ice Machines");
data_2 = new Option("Cubed Ice Machines", "Cubed Ice Machines");
data_3 = new Option("Cylindrical Ice Machines", "Cylindrical Ice Machines");
data_4 = new Option("Flaked Ice Machines", "Flaked Ice Machines");
data_5 = new Option("Nugget Compressed Ice Machines", "Nugget Compressed Ice Machines");
data_6 = new Option("Round Ice machines", "Round Ice Machines");

// second combo box

data_1_1 = new Option("Turbo Air", "Turbo Air");
data_1_2 = new Option("US Ice Machines", "US Ice Machines");
data_2_1 = new Option("Cornelius", "Cornelius");
data_3_1 = new Option("", "");
data_4_1 = new Option("Cornelius", "Cornelius");
data_5_1 = new Option("Cornelius", "Cornelius");
data_6_1 = new Option("US Ice Machines", "US Ice Machines");

// other parameters

    displaywhenempty=""
    valuewhenempty=-1

    displaywhennotempty="-select-"
    valuewhennotempty=0


function change(currentbox) {
numb = currentbox.id.split("_");
currentbox = numb[1];

    i=parseInt(currentbox)+1

// I empty all combo boxes following the current one

    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
         son = document.getElementById("combo_"+i);
     // I empty all options except the first one (it isn't allowed)
     for (m=son.options.length-1;m>0;m--) son.options[m]=null;
     // I reset the first option
     son.options[0]=new Option(displaywhenempty,valuewhenempty)
     i=i+1
    }


// now I create the string with the "base" name ("stringa"), ie. "data_1_0"
// to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill

    stringa='data'
    i=0
    while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &&
           (document.getElementById("combo_"+i)!=null)) {
           eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex")
           if (i==currentbox) break;
           i=i+1
    }


// filling the "son" combo (if exists)

    following=parseInt(currentbox)+1

    if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) &&
       (document.getElementById("combo_"+following)!=null)) {
       son = document.getElementById("combo_"+following);
       stringa=stringa+"_"
       i=0
       while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) {

       // if there are no options, I empty the first option of the "son" combo
   // otherwise I put "-select-" in it

   	  if ((i==0) && eval("typeof("+stringa+"0)=='undefined'"))
   	      if (eval("typeof("+stringa+"1)=='undefined'"))
   	         eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)")
   	      else
             eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)")
      else
              eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)")
      i=i+1
   }
       //son.focus()
       i=1
       combostatus=''
       cstatus=stringa.split("_")
       while (cstatus[i]!=null) {
          combostatus=combostatus+cstatus[i]
          i=i+1
          }
       return combostatus;
    }
}

//-->
</script>
<form action="ice-machines-browse.php">
Browse Ice Machines by:
<select name="combo0" id="combo_0" onChange="change(this);" style="width:170px;">
<option value="value0">-Select Type-</option>
<option value="Cracked Ice Machines">Cracked Ice Machines</option>
<option value="Cubed Ice Machines">Cubed Ice Machines</option>
<option value="Cylindrical Ice Machines">Cylindrical Ice Machines</option>
<option value="Flaked Ice Machines">Flaked Ice Machines</option>
<option value="BetterBilt">Nugget Compressed Ice Machines</option>

</select>
Now Choose Manufacturer:
<select name="combo1" id="combo_1" onChange="change(this)" style="width:170px;">
<option value="value1"></option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
<br>
Or <a href="all-ice-machines.php">View ALL</a> Ice Machines
</font>
</b>
</td>
	<td>
		<img src="images/spacer.gif" width="1" height="146" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/ice_machines_17.gif" width="175" height="58" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="58" alt=""></td>
</tr>
<tr>
	<td bgcolor="#e9e9e9" width="175" height="927" valign="top">
<form action="ice-machines-pst.php">
<font face="Tahoma" color="#1b3975" style="font-size:0.75em"><b>
Browse Parts & Supplies by:
<br>
Part & Supply Type:
<select name="combo0" id="combo_0" style="width:170px;">
<option value="">-Select Type-</option>
<option value="Compressor">Compressor</option>
<option value="Condensing Unit">Condensing Unit</option>
<option value="Packaging">Packaging</option>
<option value="Safety Decals">Safety Decals</option>
<option value="BetterBilt">Nugget Compressed Ice Machines</option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
Part & Supply Manufacturer:
<form action="ice-machines-psm.php">
<select name="combo1" id="combo_1" style="width:170px;">
<option value="value1"></option>
</select>
<input type="hidden" name="page" value="1">
<input type="image" src="images/gobutton.gif">
</form>
<br>
Or <a href="all-ice-machines.php">View ALL</a> Ice Machines
</font>
</b>
	</td>
	<td>
		<img src="images/spacer.gif" width="1" height="367" alt=""></td>
</tr>
<tr>
	<td colspan="10">
		<img src="images/ice_machines_19.gif" width="949" height="70" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="1" height="70" alt=""></td>
</tr>
<tr>
	<td>
		<img src="images/spacer.gif" width="175" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="2" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="86" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="73" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="102" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="96" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="125" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="79" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="123" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="88" height="1" alt=""></td>
	<td>
		<img src="images/spacer.gif" width="275" height="1" alt=""></td>
	<td></td>
</tr>
</table>
</body>
<MAP NAME="docs.gif">
<AREA SHAPE=RECT COORDS="7,41,99,71" HREF="http://www.adobe.com/products/acrobat/readstep2.html" TARGET="_blank">
<AREA SHAPE=RECT COORDS="8,9,246,24" HREF="/productdocs/<?=$row['mod']?>.pdf" TARGET="_blank">
</MAP><br><MAP NAME="emailfriend.gif">
<AREA SHAPE=RECT COORDS="7,97,133,116" HREF="mailto:?&subject=Check this out&body=I found this item and thought you would be interested.%0D%0Ahttp://www.usice.us/icemachines.php?icemachines=<?=$row['mod']?>" >
</MAP>
<MAP NAME="contactdata.gif">
<AREA SHAPE=RECT COORDS="19,53,166,66" HREF="/Ice-Machines.Support.php">
<AREA SHAPE=RECT COORDS="94,73,206,86" HREF="/Ice-Machines.ShippingInfo.php">
<AREA SHAPE=RECT COORDS="93,93,207,105" HREF="/Ice-Machines.OrderingInfo.php">
</MAP>
</html>
<?
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.