$include_file = DIR_INCLUDES . 'column_left.php'; include(DIR_INCLUDES . 'include_once.php'); ?>
if($_REQUEST['specials_id']){ ?>
onBlur="if(this.value=='') this.value='Part # or Search';" onFocus="if(this.value=='Part # or Search') this.value='';">
About =$sval["info"]?> Special
$cellval = '';
$cellval .= ' ';
$cellval .= '' . tep_image($sval['image'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, '0', $sval['name']) . ' ';
$cellval .= ''.$sval['description'].'
'."\n";
$cellval .= ' ';
$cellval .= ' '."\n";
$cellval .= '
';
echo ' ' . "\n";
echo ' '.$cellval.' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
echo ' '."\n";
echo ' '."\n";
echo ' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
echo ' '."\n";
echo '
'."\n";
echo ' ' . "\n";
echo ' '."\n";
echo ' '."\n";
echo ' '."\n";
}
else { ?>
=TOP_BAR_TITLE;?>
if($_REQUEST['specials_id']){?>=$sval['info'];?> =tep_image($sval['image'], '100', '0', '0', $sval["info"])?> } ?>
} if($_REQUEST['specials_id']){
if ((isset($yr_select))&&($yr_select != 0)){
$mrqry = " and '".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend";
}else{
$mrqry = '';
}
IF (isset($mk_select)){
if (isset($md_select)){
if ((isset($sunv))&&($sunv == 1)){
$aqry = "(((vehicle_make.MakeID = '".$mk_select."') AND (vehicle_model.ID = '".$md_select."')";
if (strlen($mrqry)){
$aqry .= " AND ('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend)";
}
$aqry .= ") OR (product.universal = 1)) AND ";
}else{
$aqry = "((vehicle_make.MakeID = '".$mk_select."') AND (vehicle_model.ID = '".$md_select."')";
if (strlen($mrqry)){
$aqry .= " AND ('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend)";
}
$aqry .= ") AND ";
}
}else{
if ((isset($sunv))&&($sunv == 1)){
if (strlen($mrqry)){
$aqry = "(((vehicle_make.MakeID = '".$mk_select."') AND ('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend)) OR (product.universal = 1)) AND ";
}else{
$aqry = "((vehicle_make.MakeID = '".$mk_select."') OR (product.universal = 1)) AND ";
}
}else{
if (strlen($mrqry)){
$aqry = "vehicle_make.MakeID = '".$mk_select."' AND '".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend AND";
}else{
$aqry = "vehicle_make.MakeID = '".$mk_select."' AND ";
}
}
}
}else{
$aqry = "";
}
if ((isset($bnd_select))&&($bnd_select != 'n')){
if (strlen($aqry)){
$bqry = "product.supplier_id = '".$bnd_select."' AND ";
}else{
if ((isset($sunv))&&($sunv == 1)){
if (strlen($mrqry)){
$bqry = "product.supplier_id = '".$bnd_select."' AND (('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend) || (product.universal = 1)) AND";
}else{
$bqry = "product.supplier_id = '".$bnd_select."' AND ";
}
}else{
if (strlen($mrqry)){
$bqry = "product.supplier_id = '".$bnd_select."' AND product.universal != 1 AND '".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend AND";
}else{
$bqry = "product.supplier_id = '".$bnd_select."' AND product.universal != 1 AND";
}
}
}
}else{
$bqry = "";
}
if ((isset($sunv)) && (!strlen($bqry)) && (!strlen($aqry))&&($sunv == 1)){
if (strlen($mrqry)){
$cqry = "(('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend) || (product.universal = 1)) AND";
}else{
$cqry = "";
}
}elseif (((!isset($sunv))||($sunv != 1)) && (!strlen($bqry)) && (!strlen($aqry))){
if (strlen($mrqry)){
$cqry = "('".$yr_select."' BETWEEN product_to_vehicle.yearstart AND product_to_vehicle.yearend) AND product.universal != 1 AND";
}else{
$cqry = " product.universal = 0 AND ";
}
}
?>
$listing_total = tep_db_query("select count(product.id) as total from supplier, product LEFT JOIN product_to_vehicle ON product.id = product_to_vehicle.product_id LEFT JOIN vehicle_model ON product_to_vehicle.vehicle_model_id = vehicle_model.ID LEFT JOIN vehicle_make ON vehicle_model.Make_ID = vehicle_make.MakeID where ".$aqry.$bqry.$cqry." product.id IN (".$sval['product_id'].") AND supplier.id = product.supplier_id and product.active = '1' Order by vehicle_make.Make, vehicle_model.Model, product_to_vehicle.yearstart, product_to_vehicle.yearend, product.name, supplier.dba_name");
$pos = $_REQUEST['pos'];
$lt_ar = tep_db_fetch_array($listing_total);
$prod_total = $lt_ar['total'];
IF(!isset($pos)) $pos = 0;
if ($pos > $prod_total){$pos=0;}
$query_limit = isset($pos)?"LIMIT $pos, " . MAX_DISPLAY_NEW_PRODUCTS . "":"";
IF($prod_total > $pos + MAX_DISPLAY_NEW_PRODUCTS) {
$pos_next = $pos + MAX_DISPLAY_NEW_PRODUCTS;
} else {
$pos_next = $prod_total;
}
$pos_prev = $pos - MAX_DISPLAY_NEW_PRODUCTS;
IF ($pos_prev < 0) $pos_prev = 0;
$posdisplay = $pos + 1;
$posnextdisplay = $pos_next + 1;
$postotal = $prod_total;
$listing = tep_db_query("select product.id as product_id, product.name as product_name, product.supplier_part_number as part_number, supplier.dba_name as supplier_name, product.supplier_id, product.price as product_price, product.retail as product_retail, product.shipping, product.collect, product.image as product_image, vehicle_model.Model, vehicle_make.Make, product_to_vehicle.yearstart, product.universal, product_to_vehicle.yearend from supplier, product LEFT JOIN product_to_vehicle ON product.id = product_to_vehicle.product_id LEFT JOIN vehicle_model ON product_to_vehicle.vehicle_model_id = vehicle_model.ID LEFT JOIN vehicle_make ON vehicle_model.Make_ID = vehicle_make.MakeID where ".$aqry.$bqry.$cqry." product.id IN (".$sval['product_id'].") AND supplier.id = product.supplier_id and product.active = '1' Order by vehicle_make.Make, vehicle_model.Model, product_to_vehicle.yearstart, product_to_vehicle.yearend, product.name, supplier.dba_name ".$query_limit."");
while ($listing_values = tep_db_fetch_array($listing)) {
$number_of_products++;
if ($number_of_products > 0){
echo ''."\n";
echo ' '."\n";
echo ' '."\n";
}
echo ' ' . "\n";
$mridept = $listing_values['yearstart'] .' - '. $listing_values['yearend'] . ' ' . $listing_values['Make'] . ' ' . $listing_values['Model'] . ' ' . $listing_values['note'];
//$descq = tep_db_query("select `desc` from product_desc where id = '".$listing_values['desc2']."'");
//echo "select `desc` from product_desc where id = '".$listing_values['desc2']."'";
//$descv = tep_db_fetch_array($descq);
if (strlen($mridept)>6){
$pdtveh = $mridept;
}else{
if ($listing_values['universal'] == 1){
$pdtveh = "Universal";
}else{
$pdtveh = "Unassigned";
}
}
if ((file_exists(DIR_SERVER_ROOT.'/shared/'.$listing_values['supplier_id'].'/'.$listing_values['product_image']))&&(is_file(DIR_SERVER_ROOT.'/shared/'.$listing_values['supplier_id'].'/'.$listing_values['product_image']))){
$p_image = HTTP_SERVER.DIR_CATALOG.'shared/'.$listing_values['supplier_id'].'/'.$listing_values['product_image'];
print "";
list($width, $height, $type, $attr) = getimagesize($p_image);
print "";
if($height>$width){
$imgheight = 100;
$imgsz = 'height="'.$imgheight.'"';
}else{
$imgwidth = 100;
$imgsz = 'width="'.$imgwidth.'"';
}
}else{
$p_image = HTTP_SERVER.DIR_CATALOG.'images/default_product_image.gif';
$imgwidth = 100;
$imgsz = 'width="'.$imgwidth.'"';
}
if (stristr($p_image,'default_product_image.gif')){
$p_image = HTTP_SERVER.DIR_CATALOG.'images/default_product_image.gif';
}
$shipping = $listing_values['shipping'];
$check_special = tep_db_query("select * from specials2 where product_id REGEXP '^".$listing_values['product_id'].",|,".$listing_values['product_id'].",|,".$listing_values['product_id']."$|^".$listing_values['product_id']."$' and active=1 and (CURDATE() BETWEEN start AND end) AND ((site_id = 1)OR(site_id = '".WEBSITE_ID."'))");
//echo "select * from specials2 where MATCH(product_id) AGAINST(\"" . $listing_values['product_id'] . "\" IN BOOLEAN MODE) and active=1 and (CURDATE() BETWEEN start AND end) AND ((site_id = 1)OR(site_id = '".WEBSITE_ID."'))";
if (tep_db_num_rows($check_special)) {
//echo"FOUND IT ";
while($special_values = tep_db_fetch_array($check_special)){
if(!$new_price){
switch($special_values['type']){
case "0":
unset($new_price);
break;
case "1":
$disc_val = (100 - $special_values['rate']);
$new_price = number_format(($listing_values['product_price'] * ($disc_val/100)),2);
break;
case "2":
$new_price = number_format(($listing_values['product_price'] - $special_values['rate']),2);
break;
case "3":
$new_price = number_format(($special_values['rate']),2);
break;
default:
}
}
$show_price = $special_values['show_price'];
if($shipping > 0){
if(($special_values['fship']==='1')&&(($special_values['exft']==='0')||(($special_values['exft']==='1')&&($listing_values['collect']==='0')))){
if((($special_values['ltype'] === '1')&&($listing_values['product_price'] > $special_values['lrate']))||($special_values['ltype'] == '0')){
$shipping = 0;
}
}
}
}
}
if($listing_values['collect'] == '1'){
$tf_icon = ' ';
}else{
$tf_icon = "";
}
$prod_image = ' '.$tf_icon.'' . "\n";
$prod_image = '';
$products_name = $listing_values['product_name'];
if((strlen($listing_values['exception']) > 3)&&($listing_values['exception'] != 'None'))
{
$excval = ' Note: '.$listing_values['exception'];
}
else
{
$excval = ' ';
}
if ($listing_values['product_price'] > 0){
if ($new_price) {
if($show_price == '1'){
$specialprice = 'Sale Price: $' . $new_price . ' ';
}else{
$specialprice = 'View In Cart ';
}
unset($show_price);
unset($new_price);
} else {
$specialprice = ' ';
}
$p_information_link = tep_href_link('product_info'. $furl2 . '/products_id/' . $listing_values['product_id'].'/', '', 'NONSSL');
$p_cart_link = HTTP_SERVER.DIR_CATALOG.'shopping_cart.php?action=add_product&products_id=' . $listing_values['product_id'];
$p_wishlist_link = tep_href_link('wishlist.php', 'action=add_product&products_id=' . $listing_values['product_id'], 'NONSSL');
} else {
//echo 'Call for Price ';
unset($show_price);
unset($new_price);
}
?>
style="max-height:100px; max-width:100px;" border="0">
=$products_name?>
Part # : =$listing_values['part_number']?>
=$pdtveh?>
more information
Suggested Retail Price: $=$listing_values['product_retail']?>
Our Low Price: $=$listing_values['product_price']?>
=$specialprice?>
}
?>
}else{
?>
$new = tep_db_query("select specials2.id, specials2.product_id, specials2.info, specials2.image from specials2 where specials2.active=1 and CURDATE() BETWEEN specials2.start AND specials2.end AND (site_id = '".WEBSITE_ID."' OR site_id = '0' OR site_id = '1') order by specials2.date_added DESC");
$row = 0;
$rowsep = 0;
while ($new_values = tep_db_fetch_array($new)) {
$row++;
$rowsep++;
//$products_name = tep_products_name($new_values['supplier_name'], $new_values['product_name']);
echo ' ' . tep_image($new_values['image'], '100', '100', '0', $new_values["info"]).' '.$new_values["info"].'
' . "\n";
if (($rowsep == 1) || ($rowsep == 2)) {
echo ' ';
}
if ((($row / 3) == floor($row / 3))) {
echo ' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
$rowsep=0;
}
}
?>
} ?>
=tep_black_line();?>
IF ($pos_next > MAX_DISPLAY_NEW_PRODUCTS) {
$pagerp = ' ';
}else{
$pagerp = ' ';
}?>
IF ($pos_next < $prod_total) {
$pagern = ' ';
}else{
$pagern = ' ';
}?>
$cpos = 0;
$numpages = ($postotal / MAX_DISPLAY_NEW_PRODUCTS)+1;
for ($np=1; $np<$numpages; $np++){
if($cpos == $pos){
$pager .= ''.$np.' ';
if ($np < $numpages-1){
$pager .= '| ';
} else {
$pager .= ' ';
}
}else{
$pager .= ''.$np.' ';
if ($np < $numpages-1){
$pager .= '| ';
} else {
$pager .= ' ';
}
}
if (($np / 15) == (floor($np / 15))){
$pager .= ' ';
}
$cpos = $cpos + MAX_DISPLAY_NEW_PRODUCTS;
}
?>
=$pagerp?> =$pager?> of =round($numpages);?> =$pagern?>
$include_file = DIR_INCLUDES . 'footer.php'; include(DIR_INCLUDES . 'include_once.php'); ?>
$include_file = DIR_INCLUDES . 'application_bottom.php'; include(DIR_INCLUDES . 'include_once.php'); ?>