This is whole main() function.. I'm sure you didn't need all this but I
wasn't sure what to send without possibly leaving out something important..
So here it is:
function main( $category = )
{
global $database, $PHP_SELF, $settings, $secure, $PHPSESSID, $items,
$cartId;
$inventory = $database-result( SELECT * FROM inventory WHERE
cartId='$cartId' );
//Get all the products
$products = $database-query( SELECT * FROM products WHERE
cartId='$cartId' AND category=\$category\ AND status='checked' ORDER BY
idNumber, headline, price );
$category = stripslashes( $category );
if( $category ) echo( b$category/bbr\n );
//only display the product links if you are viewing a category or there is
products
//that aren't in a category
if( $category or $database-numRows( $products ) )
{
echo( div align=right\n );
if( sizeof( $items ) ) echo( a href=\$PHP_SELF?command=viewCart\font
color=\$settings[link]\View Cart/font/a\n );
if( sizeof( $items ) ) echo( | );
if( sizeof( $items ) ) echo( a
href=\$PHP_SELF?command=checkOutPHPSESSID=$PHPSESSID\font
color=\$settings[link]\Check Out/font/a\n );
if( sizeof( $items ) and $category != ) echo( | );
if( $category != ) echo( a
href=\$PHP_SELF?command=viewCategory\Back/a\n );
echo( nbsp;nbsp;nbsp;/div\n );
}
//begin nested tables
echo( table border=0 cellpadding=0 cellspacing=0
bgcolor=\$settings[borderColor]\ width=\100%\trtd\n );
echo( table border=0 cellpadding=2 cellspacing=\$settings[border]\
bgcolor=\$settings[bgColor]\ width=\100%\\n );
if( $category or $database-numRows( $products ) )
{
//only display the product headings if you are viewing a category or there
is products
//that aren't in a category
echo( tr
bgcolor=\$settings[title]\tdbID/b/tdtdbHeadline/b/tdtd
bPrice/b/tdtdbQty
Discounts/b/tdtdbQuickAdd/b/td/tr\n );
}
if( $category )
{
//if you are viewing a category with no products in it
if( !$database-numRows( $products ) ) echo( trtd colspan=3
align=centerThere are no products in this category/td/tr\n );
}
$count = 0; //for alternating row colors
while( $product = $database-fetchArray( $products ) )
{
$bgColor = $settings['bgColor'];
if( $count % 2 ) $bgColor = $settings['oddColor'];
$img = ;
if( $product[thumbnail] and $product[thumbnail] != none )
{
$img = a
href=\$PHP_SELF?command=viewProductproduct=$product[idNumber]\img
border=0 src=\productImages/$product[thumbnail]\/a\n;
}
$font = font color=\$settings[font]\;
$link = a
href=\$PHP_SELF?command=viewProductproduct=$product[idNumber]\font
color=\$settings[link]\\n;
echo( tr bgcolor=\$bgColor\td width=\2%\ nowrap
valign=top$link$product[idNumber]br$img/font/a/td\n );
echo( td valign=top$link$product[headline]/font/a/td\n );
echo( td width=\2%\ nowrap align=right valign=top$font\$ .
sprintf( %.2f, $product[price] ) . /font/td\n );
echo( form method=post
action=\$PHP_SELF?command=addToCartproduct=$product[idNumber]\\n );
if( $inventory-trackInventory and !$inventory-allowOrder
and ( $product[inventory] = 0 or (string)$product[inventory] == out ) and
(string)$product[inventory] != exclude )
{
$buttonType = button;
$warning = onClick=\alert( 'Inventory is out on
this product. Please try back later.' );\;
}
else {
$buttonType = submit;
}
if( $product[discOneQty] and $product[discOneQty] != 0 ) echo td
width=\8%\ align=right valign=top nowrap$product[discOneQty]+ @ \$ .
sprintf( %.2f, $product[discOnePrice] ) . eabr\n;
else echo tdnbsp;\n;
if( $product[discTwoQty] and $product[discTwoQty] != 0 ) echo
$product[discTwoQty]+ @ \$ . sprintf( %.2f, $product[discTwoPrice] ) .
ea/td\n;
else echo /td\n;
echo( td width=\8%\ nowrap align=right
valign=bottominput type=text name=quantity value=1 size=2
style=\font-size: 8px;\nbsp;input type=$buttonType $warning value=\Add
To Cart\ style=\font-family: veranda, arial, sans-serif; font-size:
8pxl\/td/form/tr\n );
$count ++;
}
if( !$category ) displayCategories( $settings );
echo( /table/tr/td/tablebr\n );
if( $settings[returnLink] )
{
print a href=\$settings[returnLink]\$settings[returnLinkName]/a\n;
}
echo( brbr$settings[textAfter]/td/tr/table\n );
printPage();
}
Hopefully this helps.. Let me know if you have any questions about it..
Later,
Bob Weaver
Jennifer Downey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi Bob,
That would be just about what I am looking for.
And I wouldn't mind seeing the code you have.
Thanks
Jennifer
[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Are you talking about something that will display a list of products
like
this page:
http://survivalherbs.com:8080/order/index.php?command=viewCategorycategory=
Herbal+Remedies
These are all gathered from