|
|
$sql = "SELECT i.*, im.Name AS Make FROM unipageone.Item i JOIN unipageone.ItemManufacturer im
ON i.ItemManufacturerID = im.ID
WHERE i.ID = ANY (
SELECT Max(ID) From unipageone.Item Where (ItemTypeID = 148 OR ItemTypeID = 139 OR ItemTypeID = 197 OR ItemTypeID = 206) AND WebActive = 1 and isnull(discontinued, 0) = 0
GROUP BY ModelNo
)" . $sql2 . $sql3 . " ORDER BY im.Name, i.ModelNo";
$result = mssql_query($sql) or die ("can't search.");
?>
|
$sql = "SELECT i.*, im.Name AS Make FROM unipageone.Item i JOIN unipageone.ItemManufacturer im
ON i.ItemManufacturerID = im.ID
WHERE i.ID = ANY (
SELECT Max(ID) From unipageone.Item Where (ItemTypeID = 148 OR ItemTypeID = 139) AND WebActive = 1 and isnull(discontinued, 0) = 0
GROUP BY ModelNo
)" . $sql1 . $sql3 . " ORDER BY im.Name, i.ModelNo";
$result = mssql_query($sql) or die ("can't search.");
?>
|
$sql = "SELECT i.*, im.Name AS Make FROM unipageone.Item i JOIN unipageone.ItemManufacturer im
ON i.ItemManufacturerID = im.ID
WHERE i.ID = ANY (
SELECT Max(ID) From unipageone.Item Where (ItemTypeID = 148 OR ItemTypeID = 139) AND WebActive = 1 and isnull(discontinued, 0) = 0
GROUP BY ModelNo
)" . $sql1 . $sql2 . " ORDER BY im.Name, i.ModelNo";
$result = mssql_query($sql) or die ("can't search.");
?>
|
$CategorySql = "";
$dict1 = new Dictionary;
$dict2 = new Dictionary;
$dict3 = new Dictionary;
if ($phone1 != "") {
$sql = "select itf.name, itfd.detail from unipageone.itemfeaturedetail itfd left join unipageone.itemfeature itf on itf.id = itfd.itemfeatureid where itfd.itemid = $phone1";
$result = mssql_query($sql) or die ("can't search.");
while ($details=mssql_fetch_array($result))
{
$dict1->add($details[name], $details[detail]);
} // end while
$sql = "select price, thumbimage, isnull(price, 0) - isnull(rebatepostpaid3yearagreement, 0) - isnull(discountwith3yearagreement, 0) as pricewithagreement from unipageone.item where id = $phone1";
$result = mssql_query($sql) or die ("can't search.");
$details = mssql_fetch_array($result);
$dict1->add("Thumbimage", "/".$details[thumbimage]);
$dict1->add("Retail Price", $details[price]);
$dict1->add("Price w/ 3-Year Agreement", $details[pricewithagreement]);
$CategorySql = $CategorySql . " or itfd.itemid = $phone1";
}
if ($phone2 != '') {
$sql = "select itf.name, itfd.detail from unipageone.itemfeaturedetail itfd left join unipageone.itemfeature itf on itf.id = itfd.itemfeatureid where itfd.itemid = $phone2";
$result = mssql_query($sql) or die ("can't search.");
while ($details=mssql_fetch_array($result))
{
$dict2->add($details[name], $details[detail]);
} // end while
$sql = "select price, thumbimage, isnull(price, 0) - isnull(rebatepostpaid3yearagreement, 0) - isnull(discountwith3yearagreement, 0) as pricewithagreement from unipageone.item where id = $phone2";
$result = mssql_query($sql) or die ("can't search.");
$details = mssql_fetch_array($result);
$dict2->add("Thumbimage", "/".$details[thumbimage]);
$dict2->add("Retail Price", $details[price]);
$dict2->add("Price w/ 3-Year Agreement", $details[pricewithagreement]);
$CategorySql = $CategorySql . " or itfd.itemid = $phone2";
}
if ($phone3 != '') {
$sql = "select itf.name, itfd.detail from unipageone.itemfeaturedetail itfd left join unipageone.itemfeature itf on itf.id = itfd.itemfeatureid where itfd.itemid = $phone3";
$result = mssql_query($sql) or die ("can't search.");
while ($details=mssql_fetch_array($result))
{
$dict3->add($details[name], $details[detail]);
} // end while
$sql = "select price, thumbimage, isnull(price, 0) - isnull(rebatepostpaid3yearagreement, 0) - isnull(discountwith3yearagreement, 0) as pricewithagreement from unipageone.item where id = $phone3";
$result = mssql_query($sql) or die ("can't search.");
$details = mssql_fetch_array($result);
$dict3->add("Thumbimage", "/".$details[thumbimage]);
$dict3->add("Retail Price", $details[price]);
$dict3->add("Price w/ 3-Year Agreement", $details[pricewithagreement]);
$CategorySql = $CategorySql . " or itfd.itemid = $phone3";
}
?>
| Price w/ 3-Year Agreement |
if($phone1 != "") {echo "$", $dict1->item("Price w/ 3-Year Agreement");} ?> |
if($phone2 != "") {echo "$", $dict2->item("Price w/ 3-Year Agreement");} ?> |
if($phone3 != "") {echo "$", $dict3->item("Price w/ 3-Year Agreement");} ?> |
$CategorySql = "SELECT DISTINCT itfd.ItemFeatureID, itf.Name, itf.Priority, itf.PrintPriority
FROM unipageone.ItemFeatureDetail itfd LEFT OUTER JOIN
unipageone.ItemFeature itf ON itfd.ItemFeatureID = itf.ID
WHERE 1=0" . $CategorySql . "
ORDER BY itf.PrintPriority, itf.Priority";
$CategoryResult = mssql_query($CategorySql) or die();
while ($CategoryRow = mssql_fetch_array($CategoryResult))
{
?>