include "shop.phtml";
$strSQL = "SELECT prod.*, cat.fldHasAttributes FROM tblProduct prod, tblCategory cat WHERE prod.ProductID = '\\|$f_strProdID\\|' AND cat.CatID=prod.CatID";
$sclResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascProdResult, SQL_GET_ROW_COUNT, "Get all Shop Product data");
if($g_objDB->HasError())
{
$g_objDB->DisplayError(__FILE__, __LINE__, "Product Not Found!");
include "bottom.phtml";
exit;
}
elseif(($intNumRows = $g_objDB->GetRowCount($sclResultID)) == 0)
{
$g_objDB->DisplayError("", 0, "Product Data Not Found.");
include "bottom.phtml";
exit;
}
$g_objDB->FreeResults($sclResultID);
?>
print ($ascProdResult['ProductName']); ?>
| Product ID |
/*
Category |
*/
?>
Name |
Price |
|
Quantity |
|
$strProdID = $ascProdResult['ProductID'];
$intCatID = $ascProdResult['CatID'];
$strHasAttributes = $ascProductResult['fldHasAttributes'];
$strName = $ascProdResult['ProductName'];
$dblPrice = $ascProdResult['Price'];
$strPictureURL = $ascProdResult['picture_url'];
$dblWeight = $ascProdResult['weight'];
$dblWeight = 0.0; // Force it to not be displayed
$strPictureURL = $ascProdResult['picture_url'];
if($strHasAttributes == "Y")
{
$strSQL = "SELECT attr.*, opt.* FROM tblAttributes attr, tblAttibOptions opt WHERE (attr.CatID=$CatID OR attr.ProductID='$strProdID') AND opt.fldAttributeID=attr.fldAttributeID ORDER BY fldAttributeID";
$g_objDB->GetAllRows($strSQL, &$ascAttrResult, &$blnMoreRows, SQL_GET_ROW_COUNT, &$sclAttrResultID, "Get attributes");
if($g_objDB->HasError())
{
$g_objDB->DisplayError(__FILE__, __LINE__, "Get attributes failed!");
$g_intAttrRowCount = 0;
}
else
$g_intAttrRowCount = $g_objDB->GetRowCount($sclAttrResultID);
if($g_intAttrRowCount == 0)
$strHasAttributes = "N";
}
AddForm($strProdID, $intCatID, $strName, $dblPrice, $dblWeight, $intNumRows, $strHasAttributes, $strPictureURL);
?>
$strSQL = "SELECT CategoryName, ParentID FROM tblCategory WHERE CatID = $intCatID";
$sclCResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascCatResult, SQL_GET_ROW_COUNT, "Get Category name and parent data");
if($g_objDB->HasError())
{
$g_objDB->DisplayError(__FILE__, __LINE__);
include "bottom.phtml";
exit;
}
elseif($g_objDB->GetRowCount($sclCResultID) == 0)
{
$g_objDB->DisplayError("", 0, "Category name and parent data not found.");
include "bottom.phtml";
exit;
}
$strCatName = $ascCatResult['CategoryName'];
$strSQL = "SELECT CategoryName FROM tblCategory WHERE CatID = ".$ascCatResult['ParentID'];
$sclResultID = $g_objDB->GetFirstRowOfSet($strSQL, &$ascCatParentResult, SQL_GET_ROW_COUNT, "Get Category parent data");
if($g_objDB->HasError())
{
$g_objDB->DisplayError(__FILE__, __LINE__);
include "bottom.phtml";
exit;
}
elseif($g_objDB->GetRowCount($sclResultID) > 0)
{
if($ascCatParentResult['CategoryName'] != "")
{
$strCatName = $ascCatParentResult['CategoryName'].", ".$ascCatResult['CategoryName'];
}
$g_objDB->FreeResults($sclResultID);
}
$g_objDB->FreeResults($sclCResultID);
?>
Return to "> print htmlspecialchars($strCatName) ?>