<?php
//error_reporting(0);
# where am i ?
if(preg_match("/^www\.[a-z]{2,12}\.newremotecontrol\.com\/catalog_item\.php/", $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'])){$domref = "sub";}else{$domref = "root";}
//WA eCart Include
require_once("../WA_eCart/RemShop_PHP.php");
$bad_chars = array(")", ";", "'", "`", "\"");
$good_str = str_replace($bad_chars, " ", $_POST['dts']);
require_once('../Connections/catalog_access.php');
require ("../catalog/prtconfig.php");

if (isset($_POST["RemShop_1_ATC"]) || isset($_POST["RemShop_1_ATC_x"]))     {
	$newinstok = $_POST['stk'] - $_POST['RemShop_1_Quantity_Add'];
	$stk_upd_query = "UPDATE parts SET instok = ('$newinstok'), dtstamp = CONCAT('".date('Y-m-d H:i:s').", ".$_SERVER['REMOTE_ADDR']."<br>',dtstamp) WHERE parts.ID = ('".$_POST['RemShop_1_ID_Add']."')";
//	$stock_update = @mysqli_query($i_access, $stk_upd_query) or die(mysqli_error());
} 
?>
<?php
$RemShop->GetContent();
?>
<? 
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $v_access = mysqli_connect("localhost", "newremot_partcat", "datacat", "newremot_webcat");
	$theValue = mysqli_real_escape_string($v_access, $theValue) ;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
//  mysqli_close($v_access);
}
}
$colname_Recordset1 = "-1";
if (isset($_GET['catnum'])) {
  $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['catnum'] : addslashes($_GET['catnum']);
}
$query_Recordset1 = sprintf("SELECT * FROM parts WHERE partnum = %s", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysqli_query($i_access, $query_Recordset1) or die(mysqli_error());
$row_Recordset1 = mysqli_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysqli_num_rows($Recordset1);
/* if($totalRows_Recordset1 == 0){
	header("Location: http://www.newremotecontrol.com/catalog/newremsearch.php");
	exit;	
} */
$query_Recordset2 = "SELECT * FROM img_url WHERE partnum = '".$row_Recordset1['partnum']."'";
$Recordset2 = mysqli_query($i_access, $query_Recordset2) or die(mysqli_error());
$row_Recordset2 = mysqli_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysqli_num_rows($Recordset2);
$cart_th_src = urlencode(thumbLink($row_Recordset2['url']));
$batt_aray = explode("|", $row_Recordset1['batt']);
$battnum = $batt_aray[1]."X".$batt_aray[0];

#
$urlcat = urlencode($row_Recordset1['partnum']);
$yesacc = "0";
$htmodlist = "";
$nomods = "";
$subcount = 0;
$ubnegnote ="0";
$avsub = 0;
$subplural = " is";
$subnegplural = "e ";
if(strlen($row_Recordset1['models']) < 1){
			$nomods = "<br><b>No Models for ".$row_Recordset1['partnum']." </b>";
			/* $htmodlist .= "None Listed"; */
			}
/* Begin current fuckup */
		else{
			$groups = preg_split("/#/", $row_Recordset1['models'], -1, PREG_SPLIT_NO_EMPTY);
			foreach($groups as $onegroup){
				$onegroup = "$onegroup|";
				$onegroup = str_replace("g", "", $onegroup);
				/* echo "<p>$onegroup<br>"; */
				$onebrand = preg_split("/\^/", $onegroup, -1, PREG_SPLIT_NO_EMPTY);
				/* echo "$onebrand[0]<br>"; */
				$htmodlist .= "<b>$onebrand[0]</b><br>";
				$cbrand = "|$onebrand[1]|";
				$onemodel = preg_split("/\|/", $cbrand, -1, PREG_SPLIT_NO_EMPTY);
				foreach($onemodel as $mod){
					$mqu = "SELECT models FROM parts WHERE parts.models LIKE '%$onebrand[0]%' AND parts.models LIKE '%$mod%' AND partnum != '".$row_Recordset1['partnum']."' AND gen_num != '".$row_Recordset1['gen_num']."' limit 1";
#					echo "$mqu<br>$nomods";
					$mod_res = mysqli_query($i_access,$mqu);
					$modrows = mysqli_num_rows($mod_res);
					/* echo "$modrows partial matches found<br>"; */
					if($modrows < 1){
						$htmodlist .= "$mod<br>";
					}
					else{
					while($found = mysqli_fetch_row($mod_res)){
						foreach($found as $fndstr){
							$fndstr = preg_replace("/(#.*?\^)/", "|", $fndstr);
							/* echo "$fndstr<br>"; */
							$onefoundmod = preg_split("/\|/", $fndstr, -1, PREG_SPLIT_NO_EMPTY);
							foreach($onefoundmod as $thisfoundmod){
								/* echo "$thisfoundmod..."; */
								if(($thisfoundmod == "$mod") || ($thisfoundmod == "g$mod")){
									/* echo "<b>Accessory matched $thisfoundmod</b><br>"; */
									if(!strstr($htmodlist, "dyn_models_accys.php?modnum=$mod&brand=$onebrand[0]")){
										$htmodlist = str_replace("<br>$mod<br>", "<br>", $htmodlist);
										$htmodlist .= "<a href=\"http://www.newremotecontrol.com/catalog/dyn_models_accys.php?modnum=$mod&brand=$onebrand[0]\">$mod</a><br>";
									}
									$yesacc++;
								}
								elseif((!strstr($htmodlist, "<br>$mod<br>")) && (!strstr($htmodlist, "dyn_models_accys.php?modnum=$mod&brand=$onebrand[0]"))){
									$htmodlist .= "$mod<br>";
								}
								/* echo "<br>"; */
							}
						}
					}
					}
				}
			}
		}
		/* echo "$yesacc exact matches<br>"; */
#		echo "$htmodlist";
/* End current fuckup */
# begin associated numbers
$ctml = "";
$alt_links = "";
			if(($row_Recordset1['match'] != "") && ($row_Recordset1['match'] != $row_Recordset1['partnum'])){
				$p = explode('|', $row_Recordset1['match'], 11);
				foreach($p as $j){
					if(($j != $row_Recordset1['partnum']) && ($j != $row_Recordset1['gen_num']) && ($j != "") && (!stristr($j, "used")) && (!stristr($j, "repack")) && (!stristr($j, "refurb"))){
						$ctml .= "    $j<br>\n";
					}
					if($j != ""){
						$alt_link_query = "select cart_url from parts where cart_url not like '".$row_Recordset1['cart_url']."' and partnum = '$j' and av NOT REGEXP '[3-5]' limit 1";	
						$alt_link_res = mysqli_query($i_access,$alt_link_query) or die(mysqli_error());
						$alt_link_rows = mysqli_num_rows($alt_link_res);
						if($alt_link_rows > 0){
							$alt_link_recset = mysqli_fetch_row($alt_link_res);
							if($alt_link_recset[0] != "http://www.newremotecontrol.com".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']){
								$alt_links .= "<a href=\"$alt_link_recset[0]".(isset($_GET['refnum'])?"&refnum=".$_GET['refnum']."+Alt":"")."\">$j</a><br>\n";	
								$subcount++;
							}
						}
					}
				}
			}
# set some variables
if(stristr($row_Recordset1['partnum'], "used")){
					$unr = "USED";
					}
				elseif(stristr($row_Recordset1['partnum'], "refurb")){
					$unr = "REFURBISHED";
					}
				elseif(stristr($row_Recordset1['partnum'], "repack")){
					$unr = "REPACKAGED NEW";
					}
				elseif((stristr($row_Recordset1['desc'], "book")) || (stristr($row_Recordset1['desc'], "manual"))){
					$unr = " ";
				}
				else{
					$unr = "NEW";
					}
				if($row_Recordset1['instok'] > 1){
					$plur = "pieces";
					}
				else{
					$plur = "piece";
					}
				if(strstr($row_Recordset1['av'], "|")){
					$avc = explode("|", $row_Recordset1['av']);
					$avcon = $avc[0];
				}
				else{
					$avcon = $row_Recordset1['av'];
				}
				if(preg_match('/[7-9]/', $row_Recordset1['qd'])){
					$spec = "<span class=\"spec\">Special!</span><br><span class=\"subtexta\">Sale Price - </span>";
				}
				if(preg_match('/^[3-7]/', $avcon)){
					$col3_border_color = "border-color:#FF0000;";
				}else{
					$col3_border_color = "border-color:#00FF00;";
				}
				if($row_Recordset1['subpart'] != ""){
						if(preg_match("/.*Except.*/", $row_Recordset1['ers_sub_note'])){
						$ubnegnote++;
				}
					$subcount++;
					$man_sub_query = "SELECT url, gen_num, cart_url, brand, price, av FROM parts WHERE parts.partnum = ('".$row_Recordset1['subpart']."')";
					$man_sub_result = mysqli_query($i_access,"$man_sub_query") or die ('manuf sub link routine failed');
						while($m_s_r = mysqli_fetch_row($man_sub_result)){
							$ms_thimg = "";
							$ms_img_query = "select `url` from `img_url` where `partnum` = ('".$row_Recordset1['subpart']."')";
							$ms_img_result = mysqli_query($i_access,$ms_img_query);
							if(mysqli_num_rows($ms_img_result)>0){
								$ms_img= mysqli_fetch_assoc($ms_img_result);
								$th_src = thumbLink($ms_img['url']);
								$ms_thimg = "<img align=\"right\" src=\"".$th_src."\"  onerror=\"this.style.visibility = 'hidden'\"><br clear=\"left\" />";
								
							}
							$msrlink = "$m_s_r[0]";
							$msrgen_num = "$m_s_r[1]";
							$msrcart = "$m_s_r[2]";
							$msrbrand = strtolower($m_s_r[3]);
							if($m_s_r[5] < 3){
								$msrprice = "&#36;".$m_s_r[4].$ms_thimg;
								$avsub++;
							}else{
								$msrprice = "$ms_thimg";	
							}
							if($msrlink != ""){
						
								if(file_exists("/home/newremot/public_html/$msrbrand/catalog_item.php")){
									$msrlink = "http://www.$msrbrand.newremotecontrol.com/catalog_item.php?catnum=".$row_Recordset1['subpart'].(isset($_GET['refnum'])?"&refnum=".$_GET['refnum']."+Sub":"");
								}
							}
							if($msrlink != ""){
								$man_sub_link = "<a href=\"$msrlink\" target=\"_parent\">".$row_Recordset1['subpart']."</a>";
							}elseif((!preg_match('/^http/', $m_s_r[1])) && ($msrcart != "")){
								$ers_sub_link = "<a href=\"$msrcart\" target=\"_self\">".$row_Recordset1['subpart']."</a>";
							}else{
								$man_sub_link = $row_Recordset1['subpart'];
							}
							if($row_Recordset1['subpart'] != $msrgen_num){
								$man_sub_link .= "<br>$msrgen_num";
							}
						}
					}
					if(($row_Recordset1['ers_sub'] != "") && (!strstr($row_Recordset1['ers_sub'], "|"))){
						if(preg_match("/.*Except.*/", $row_Recordset1['ers_sub_note'])){
						$ubnegnote++;
						}
					$subcount++;
					$ers_sub_query = "SELECT url, gen_num, cart_url, brand, price, av FROM parts WHERE parts.partnum = ('".$row_Recordset1['ers_sub']."')";
					$ers_sub_result = @mysqli_query($i_access,"$ers_sub_query") or die ('ers sub link routine failed');
						
						while($e_s_r = mysqli_fetch_row($ers_sub_result)){							
							$es_thimg = "";
							$es_img_query = "select `url` from `img_url` where `partnum` = '".$row_Recordset1['ers_sub']."'"; 
							$es_img_result = mysqli_query($i_access,$es_img_query);
							if(mysqli_num_rows($es_img_result)>0){
								$es_img= mysqli_fetch_assoc($es_img_result);
								$th_src = thumbLink($es_img['url']);
								$es_thimg = "<img align=\"right\" src=\"".$th_src."\"  onerror=\"this.style.visibility = 'hidden'\"><br clear=\"left\" />";
								
							}
							$esrlink = "$e_s_r[0]";
							$esrgen_num = "$e_s_r[1]";
							$esrcart = "$e_s_r[2]";
							$esrbrand = strtolower($e_s_r[3]);
							if($e_s_r[5] <3){
								$esrprice = "&#36;".$e_s_r[4].$es_thimg."<br />";
								$avsub++;
							}
							else{
								$esrprice = "$es_thimg<br />";	
							}
							if($esrlink != ""){
						
								if(file_exists("/home/newremot/public_html/$esrbrand/catalog_item.php")){
									$esrlink = "http://www.$esrbrand.newremotecontrol.com/catalog_item.php?catnum=".$row_Recordset1['ers_sub'].(isset($_GET['refnum'])?"&refnum=".$_GET['refnum']."+Sub":"");
								} 
								else{
									$esrlink = $esrcart;	
								} 
								$ers_sub_link = "<a href=\"$esrlink\" target=\"_parent\">".$row_Recordset1['ers_sub']."</a><br /> $esrprice";
							}elseif((!preg_match('/^http/', $e_s_r[0])) && ($esrcart != "")){
								$ers_sub_link = "<a href=\"$esrcart\" target=\"_self\">".$row_Recordset1['ers_sub']."</a><br /> $esrprice";
							}else{
								$ers_sub_link = $row_Recordset1['ers_sub'];
							}
							if($row_Recordset1['ers_sub'] != $esrgen_num){
								$ers_sub_link .= "<br>$esrgen_num\n";
							}
						}
					} /* continued on 736 */
				elseif(strstr($row_Recordset1['ers_sub'], "|")){
						if(preg_match("/.*Except.*/", $row_Recordset1['ers_sub_note'])){
						$ubnegnote++;
					}
					$esubpn_mult = explode("|", $row_Recordset1['ers_sub']);
					
					$esubnot_mult = explode("|",$row_Recordset1['ers_sub_note']);
					foreach($esubpn_mult as $key => $value){
						$esubray_mult[$value] = $esubnot_mult[$key];
						
					} 
					foreach($esubray_mult as $spn => $spnote){
						if(preg_match("/.*Except.*/", $row_Recordset1['ers_sub_note'])){
						$ubnegnote++;
					}
						$subcount++;
						$ers_sub_query = "SELECT url, gen_num, cart_url, brand, price, av FROM parts WHERE parts.partnum = ('$spn')";
						$ers_sub_result = @mysqli_query($i_access,"$ers_sub_query") or die ('ers sub link routine failed');
						while($e_s_r = mysqli_fetch_row($ers_sub_result)){
							$es_thimg = "";
							$es_img_query = "select `url` from `img_url` where `partnum` = '$spn'"; 
							$es_img_result = mysqli_query($i_access,$es_img_query);
							if(mysqli_num_rows($es_img_result)>0){
								$es_img= mysqli_fetch_assoc($es_img_result);
								$th_src = thumbLink($es_img['url']);
								$es_thimg = "\n<img align=\"right\" src=\"".$th_src."\"  onerror=\"this.style.visibility = 'hidden'\">\n<br clear=\"left\" />\n";
								
							}
							$esrprice = "";
							$esrlink = "$e_s_r[0]";
							$esrgen_num = "$e_s_r[1]";
							$esrcart = "$e_s_r[2]";
							$esrbrand = strtolower($e_s_r[3]);
							if($e_s_r[5] < 3){
								$esrprice = "&#36;".$e_s_r[4].$es_thimg."<br />";
								$avsub++;
							}
							else{
								$esrprice = "$es_thimg";	
							}
							if($esrlink != ""){
#								$ers_sub_link = "";
								if(file_exists("/home/newremot/public_html/$esrbrand/catalog_item.php")){
									$esrlink = "http://www.$esrbrand.newremotecontrol.com/catalog_item.php?catnum=$spn".(isset($_GET['refnum'])?"&refnum=".$_GET['refnum']."+Sub":"")."";
								}else{
									$esrlink = $esrcart;	
								}
								$ers_sub_link .= "<a href=\"$esrlink\" target=\"_parent\">$spn</a><br /> $esrprice";
							}elseif((!preg_match('/^http/', $e_s_r[0])) && ($esrcart != "")){
								$ers_sub_link .= "<a href=\"$esrcart\" target=\"_self\">$spn</a><br /> $esrprice";
							}else{
								$ers_sub_link = "$spn";
							}
							if($spn != $esrgen_num){
								$ers_sub_link .= "<br>$esrgen_num";
							}
							$ers_sub_link .= "<br />$spnote<br>___________________\n";
						}
					}
				}
				if(($row_Recordset1['gen_sub'] != "") && ($row_Recordset1['gen_sub'] != $row_Recordset1['partnum'])){
					$gen_sub_query = "SELECT url, gen_num, price, av FROM parts WHERE parts.partnum = ('".$row_Recordset1['gen_sub']."')";
					$gen_sub_result = @mysqli_query($i_access,"$gen_sub_query") or die ('gen sub link routine failed');
					while($g_s_r = mysqli_fetch_row($gen_sub_result)){
						$subcount++;
						$gsrlink = "http://www.newremotecontrol.com/Mfrs/OtherBrands/Def/dyn_part_data.php?catnum=".$row_Recordset1['gen_sub'];
						$gsrgen_num = $g_s_r[1];
						if($g_s_r[3] <3){
							$gsrprice = "&#36;".$g_s_r[2];
							$avsub++;
						}
						else{
							$gsrprice = "";	
						}
						if($gsrlink != ""){
							$gen_sub_link = "<a href=\"$gsrlink\" target=\"_parent\">".$row_Recordset1['gen_sub']."</a>";
						}else{
							$gen_sub_link = $row_Recordset1['gen_sub'];
						}
					}
				}	


if($avsub =0){
					$col4_border_color = "border-color:#FF0000;";
				}else{
					$col4_border_color = "border-color:#00FF00;";
				}
if($subcount > 1){
	$subplural = "s are";
}
# do a little battery stuff
if($row_Recordset1['batt'] != ""){
	$bt = explode('|', $row_Recordset1['batt']);
	if(!stristr($bt[0], "CR")){ 
		$bat_pn = "$bt[1]X$bt[0]";
	}else{
		$bat_pn = "$bt[0]";	
		$bat_thum = "http://www.newtvremotes.com/Mfrs/Generic/CR2025.jpg";
	}
	if($bt[1] == "1"){
		$batplur = "y";
		$batplur_it = "it";	
	}else{
		$batplur = "ies";
		$batplur_it = "they";
	}
	$query_Recordset3 = "SELECT * FROM parts WHERE partnum = '$bat_pn'";
	$Recordset3 = mysqli_query($i_access,$query_Recordset3) or die(mysqli_error());
	$row_Recordset3 = mysqli_fetch_assoc($Recordset3);
	$totalRows_Recordset3 = mysqli_num_rows($Recordset3);
	if($bt[2] == "NO"){		
		$batline = "<input name=\"batt_ID_Add\" type=\"checkbox\" value=\"".$row_Recordset3['ID']."\" checked ><span class=\"small\">Include $bt[1] $bt[0] batter$batplur<br />for each remote?</span>";
	}else{
#		$batline = "<span class=\"small\">$bt[0] batter$batplur included in package, but <a href=\"javascript:Popster( 'http://www.newremotecontrol.com/Policies.htm#Product%20Warranty', 'oldbat', 780, 375, 1 )\">$batplur_it may be old</a>.</span><br><input name=\"batt_ID_Add\" type=\"checkbox\" value=\"".$row_Recordset3['ID']."\"><span class=\"small\">Include $bt[1] fresh, new $bt[0] batter$batplur for each remote?</span>";
		$batline = "<span class=\"small\">$bt[0] batter$batplur included in package from ".ucwords(strtolower($row_Recordset1['brand'])).".</span>";
	}
}
$stuff = 0;
if (!$RemShop->IsEmpty())     {
	while (!$RemShop->EOF())      {
	$stuff += $RemShop->DisplayInfo("Quantity");	
	$RemShop->MoveNext();
	}
$RemShop->MoveFirst();
}
?>
<?php
// WA eCart AddToCart
if (isset($_POST["RemShop_1_ATC"]) || isset($_POST["RemShop_1_ATC_x"]))     {
  $ATC_itemID = $_POST["RemShop_1_ID_Add"];
  $ATC_AddIfIn = 0;
  $ATC_RedirectAfter = "../Shopping/RemShopCart.php";
  $ATC_RedirectIfIn  = "";
  if (isset($totalRows_Recordset1) && $totalRows_Recordset1 > 0)     {
    $row_Recordset1 = WAEC_findRecordMySQL_i($Recordset1, "ID", $ATC_itemID);
    if ($row_Recordset1)     {
      $ATC_itemName = "".$row_Recordset1['partnum']  ."";// column binding
      $ATC_itemDescription = "".$row_Recordset1['brand']  ." ".$row_Recordset1['type']  ." ".$row_Recordset1['desc']  ."";// column binding
      $ATC_itemThumbnail = "$cart_th_src";// column binding
      $ATC_itemWeight = floatval("".$row_Recordset1['wt']  ."");// column binding
      $ATC_itemSKU = "".$_POST['fr'] ."";
	  $ATC_itemLimit = "".$_POST['cil']."";
      $ATC_itemQuantity = "".$_POST["RemShop_1_Quantity_Add"]  ."";// column binding
      $ATC_itemPrice = floatval("".$row_Recordset1['price']  ."");// column binding
      $ATC_itemModel = "".$_POST["RemShop_1_Model_Add"]  ."";// column binding
      mysqli_data_seek($Recordset1, 0);
      $row_Recordset1 = mysqli_fetch_assoc($Recordset1);
    }
  }
  $ATC_itemQuantity = floatval($ATC_itemQuantity);
  if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0)     {
    $RemShop->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemModel, $ATC_itemSKU, $ATC_itemLimit);
    if ($ATC_RedirectAfter != "" && $RemShop->redirStr == "")     {
      $RemShop->redirStr = $ATC_RedirectAfter;
    }
    if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "")  {
      $_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
    }
    else  {
      $_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
    }
  }
}
?>
<?php
// WA eCart Trigger AddToCart
if ((!($totalRows_Recordset3 == 0)) && isset($_POST['batt_ID_Add'])){
  $cart = $RemShop;
  $ATC_itemID = "".$row_Recordset3['ID']  ."";
  $ATC_AddIfIn = 0;
  $ATC_RedirectAfter = "";
  $ATC_RedirectIfIn  = "";
    $row_Recordset3 = WAEC_findRecordMySQL_i($Recordset3, "ID", $ATC_itemID);
	if ($row_Recordset3)     {
    $ATC_itemName = "".$row_Recordset3['partnum']  ."";// column binding
    $ATC_itemDescription = "".$row_Recordset3['brand']." ".$row_Recordset3['desc']  ."";// column binding
    $ATC_itemThumbnail = urlencode("$bat_thum");// column binding
    $ATC_itemWeight = floatval("0");// column binding
    $ATC_itemQuantity = floatval("".((isset($_POST["RemShop_1_Quantity_Add"]))?$_POST["RemShop_1_Quantity_Add"]:"")  ."");// column binding
    $ATC_itemPrice = floatval("".$row_Recordset3['price']  ."");// column binding
    $ATC_itemModel = "".$row_Recordset1['partnum']  ."";// column binding
    $ATC_itemSKU = "".$_POST['fr'] ."";
	$ATC_itemLimit = "0 ";
	}
    $ATC_itemQuantity = floatval($ATC_itemQuantity);
  if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0)     {
    $cart->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemModel, $ATC_itemSKU, $ATC_itemLimit);
    if ($ATC_RedirectAfter != "" && $cart->redirStr == "")     {
      $cart->redirStr = $ATC_RedirectAfter;
    }
    if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "")  {
      $_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
    }
    else  {
      $_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
    }
  }
}
?>
<?php
// WA eCart Redirect
if ($RemShop->redirStr != "")     {
  header("Location: ".$RemShop->redirStr);
}
?>
<?php 
$zdb = "newremot_zc";

//$zconn_id = mysqli_connect($hs, $user, $pass, $zdb) or die ('I cannot connect to the database because: ');
//mysql_select_db($zdb);
$get_zid_sql = "select `products_id` from `products` where `products_model` = '".$_GET['catnum']."' limit 1";
$get_zid_result = mysqli_query($zen_access,$get_zid_sql) or die.(mysqli_connect_error());
while($zid = mysqli_fetch_assoc($get_zid_result)){
		$zen_id = $zid['products_id'];
}
mysqli_close($zconn_id);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="<?php echo $unr." ".$row_Recordset1['brand']; ?> <?php echo $row_Recordset1['type']; ?> <?php echo ucfirst($row_Recordset1['desc']); ?> <?php if($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){echo $row_Recordset1['gen_num'];} ?> <?php echo $row_Recordset1['partnum']; ?>" />
<meta name="keywords" content="<?php echo $row_Recordset1['brand']; ?>, <?php if((!strstr($_GET['refnum'], "Sub") && !strstr($_GET['refnum'], "Alt")))echo (isset($_GET['refnum'])?$_GET['refnum'].", ":""); ?><?php echo $row_Recordset1['partnum']; ?>, <?php echo ucfirst($row_Recordset1['desc']); ?><?php if($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){echo ", ".$row_Recordset1['gen_num'];} ?>" />
<meta name="robots" content="INDEX,FOLLOW" />
<title><?php echo $unr." ".$row_Recordset1['brand']; ?> <?php if((!strstr($_GET['refnum'], "Sub") && !strstr($_GET['refnum'], "Alt")))echo (isset($_GET['refnum'])?$_GET['refnum']." ":""); ?><?php echo $row_Recordset1['type']; ?> <?php echo ucfirst($row_Recordset1['desc']); ?> 	<?php if($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){echo $row_Recordset1['gen_num'];} ?> <?php echo " ".$row_Recordset1['partnum']; ?></title>
<!--[if lte IE 7]>
<style>
.content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
</style>
<![endif]--><script language="JavaScript" type="text/javascript">
	<!--	

//	if (parent.location != 'http://www.newremotecontrol.com/apex/catalog_item.php?catnum=<?php echo $_GET['catnum']; ?>') {
//	window.location = 'http://www.newremotecontrol.com/apex/catalog_item.php?catnum=<?php echo $_GET['catnum']; ?>'; }
var isMobile = false; 
if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
    || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) isMobile = true;
	if(isMobile == true){
		
		window.location = 'https://www.newremotecontrol.com/catalog/shop/index.php?main_page=product_info&cPath=1201<?php echo "&products_id=$zen_id"; ?>';}

	function chkstk(){
		var cookies_enabled = navigator.cookieEnabled; 
		if(cookies_enabled != true){alert('Browser cookies must be enabled to use this site.');return false;}
		var qreq = document.RemShop_1_ATC_<?php echo $row_Recordset1["ID"]; ?>.RemShop_1_Quantity_Add.value;
		var qstk = <?php echo $row_Recordset1['instok']; ?>;
		var qtrig = document.RemShop_1_ATC_<?php echo $row_Recordset1["ID"]; ?>.cil.value;
		var k = ~~Number(qreq);
		if((String(k) === qreq && k > 0) != true){alert('The quantity entered must be a whole number greater than zero.');return false;}
		if((qtrig==1)&&((qreq*1)>(qstk*1))){alert('The quantity entered is not available.\nPlease enter a quantity less than <?php echo ($row_Recordset1['instok']+1); ?>.');return false;}
		<?php 
  	if(preg_match("(^[6-7])", $row_Recordset1["av"])){
	echo "\tvar yep = confirm('No Cancellations, No Returns, No Refunds For This Item.\\nClick OK If You Agree To These Terms.\\nCancel If You Do Not.');\n
	\tif(yep == true){return true;}else{return false;}\n";
} 
 ?>	
	}

	function Popster( url, name, width, height, scrollbars ) {
	var top  = "0";
	var left = "0";
	if( scrollbars == null ) scrollbars = "0";
	str  = "";
	str += "resizable=0,titlebar=0,menubar=0,";
	str += "toolbar=0,location=0,directories=0,status=0,";
	str += "scrollbars=" + scrollbars + ",";
	str += "width=" + width + ",";
	str += "height=" + height + ",";
	str += "top=" + top + ",";
	str += "left=" + left;
	window.open( url, name, str );
	}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
<!--  //
	function go() {
	window.location = document.form1.Brands.options[document.form1.Brands.selectedIndex].value
		}
	//-->
	</script>
<script src="http://www.newremotecontrol.com/SpryAssets/SpryTooltip.js" type="text/javascript"></script>
<link href="http://www.newremotecontrol.com/CSS/Cat_thrColLiqHdr.css" rel="stylesheet" type="text/css" />
<link href="http://www.newremotecontrol.com/SpryAssets/SpryTooltip.css" rel="stylesheet" type="text/css" />
</head>

<body onLoad="MM_preloadImages('http://www.newremotecontrol.com/images/navbar/ohomebt.gif','http://www.newremotecontrol.com/images/navbar/obrandbt.gif','http://www.newremotecontrol.com/images/navbar/osrchbt.gif','http://www.newremotecontrol.com/images/navbar/ospec.gif','http://www.newremotecontrol.com/images/navbar/oused.gif','http://www.newremotecontrol.com/images/navbar/ogen.gif','http://www.newremotecontrol.com/images/navbar/okleen.gif','http://www.newremotecontrol.com/images/navbar/ounl.gif','http://www.newremotecontrol.com/images/navbar/orep.gif','http://www.newremotecontrol.com/images/navbar/opol.gif','http://www.newremotecontrol.com/images/navbar/ocont.gif','http://www.newremotecontrol.com/images/navbar/ofaq.gif','http://www.newremotecontrol.com/images/navbar/oshop.gif')">
<div class="container">
  <div class="header"> 
  <table bgcolor="#CCFFFF" width="100%"  border="0" cellspacing="0" cellpadding="1" summary="NewRemoteControl.com">
    <tr>
      <td width="468" bgcolor="#CCFFFF" colspan="1"><img src="http://www.newremotecontrol.com/images/1117.jpg"></td>
      <td colspan="2" align="center" nowrap bgcolor="#CCFFFF" class="avale">New Original Equipment Remote Controls<br>
        <small>From<br>
        Electronic Repair Service<br>
        Thomasville, Ga</small></td>
    </tr>
    <tr>
      <td colspan="1" align="center" bgcolor="#330099" class="whtbar" width="468">The One Stop Shop For Most Brands Of Replacement Remote Controls<br>
        <strong>TV, VCR, TV/VCR Combo, DVD, Audio</strong></td>
      <td colspan="1" align="right" bgcolor="#330099"><form name="form1" method="post" action="">
          <span class="whtbar">Select Brand</span>
          <select name="Brands" onChange="go()">
            <option value="default">Brand</option>
            <script language="JavaScript" type="text/JavaScript" src="http://www.dvdremotecontrols.com/Catalog/static_list.php"></script>
          </select>
        </form></td>
    </tr>
    <tr>
      <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0" background="http://www.newremotecontrol.com/images/navbar/bkgrnd.gif">
          <tr>
            <td><a href="http://www.newremotecontrol.com/index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','http://www.newremotecontrol.com/images/navbar/ohomebt.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/homebt.gif" alt="HOME" name="home" width="47" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/BrandIndex.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('brand','','http://www.newremotecontrol.com/images/navbar/obrandbt.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/brandbt.gif" alt="BRAND INDEX" name="brand" width="51" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/catalog/newremsearch.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('search','','http://www.newremotecontrol.com/images/navbar/osrchbt.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/srchbt.gif" alt="SEARCH" name="search" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/catalog/RemoteSpecials.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('spec','','http://www.newremotecontrol.com/images/navbar/ospec.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/spec.gif" alt="REMOTE SPECIALS" name="spec" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/catalog/notnew.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('used','','http://www.newremotecontrol.com/images/navbar/oused.gif',1)" target="_blank"><img src="http://www.newremotecontrol.com/images/navbar/used.gif" alt="USED REMOTES" name="used" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newtvremotes.com/Mfrs/Generic/index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('generic','','http://www.newremotecontrol.com/images/navbar/ogen.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/gen.gif" alt="GENERIC REMOTES" name="generic" width="52" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/ScreenKleen.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kleen','','http://www.newremotecontrol.com/images/navbar/okleen.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/kleen.gif" alt="SCREEN KLEEN" name="kleen" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/NewModel.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newmod','','http://www.newremotecontrol.com/images/navbar/ounl.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/unl.gif" alt="UNLISTED REMOTE" name="newmod" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/Policies.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('policies','','http://www.newremotecontrol.com/images/navbar/opol.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/pol.gif" alt="POLICIES" name="policies" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/Contact.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact','','http://www.newremotecontrol.com/images/navbar/ocont.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/cont.gif" alt="CONTACT" name="contact" width="57" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/FAQ.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('faq','','http://www.newremotecontrol.com/images/navbar/ofaq.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/faq.gif" alt="FAQ" name="faq" width="40" height="30" border="0"></a></td>
            <td><a href="http://www.newremotecontrol.com/Shopping/RemShopCart.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('cart','','http://www.newremotecontrol.com/images/navbar/oshop.gif',1)" target="_parent"><img src="http://www.newremotecontrol.com/images/navbar/shop.gif" alt="SHOPPING CART" name="cart" width="57" height="30" border="0"></a></td>  
          </tr>
        </table></td>
    </tr>
  </table> <br />
<table width="100%">
<tr>
	<td width="1" height="60"></td>
<td align="center"><big><strong><a href="http://www.apex.newremotecontrol.com/index.php">Apex Main Index</a></strong></big><br />
  
  <h1>&nbsp;<?php echo $row_Recordset1['brand']; ?> <?php if((!strstr($_GET['refnum'], "Sub") && !strstr($_GET['refnum'], "Alt")))echo (isset($_GET['refnum'])?$_GET['refnum']." ":""); ?><?php echo $row_Recordset1['type']; ?> <?php echo ucfirst($row_Recordset1['desc']); ?>
    <?php if($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){echo $row_Recordset1['gen_num'];} ?> <?php echo " ".$row_Recordset1['partnum']; ?> </h1>
</td>
	<td class="small" align="left"><span class="copy">
  <script type="text/javascript" src="https://www.newremotecontrol.com/scgi-bin/item_count.php">
</script>
  </span>
</td>
	</tr>
</table>
  
    <!-- end .header --></div>
      <div class="sidebar1">
    <table><tr><td width="204">
   <?php if($row_Recordset2['url'] != ""){ ?><img src="<?php echo $row_Recordset2['url']; ?>" width="200" />
   <?php 
   $yesimg = 1;   }else{echo "Image Not Available";} ?>
   	</td></tr></table>
    <!-- end .sidebar1 --></div>
  <div class="content"  onselectstart="return false;">
   <table width="180"><tr><td width="180" align="center" class="bvale">
   <?php if($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){ ?><br />
Manufacturer ID <br />
<?php echo $row_Recordset1['gen_num'];} ?><br />
<?php if($row_Recordset1['part_note'] != ""){	$snote = explode("|", $row_Recordset1['part_note'], 2);		if($snote[1] != ""){	echo "    <p>$snote[1]</p>\n";	}	}?>

<?php if($ctml != ""){
			echo "    <small>Associated Part Numbers<br>\n$ctml</small>\n";
			}?>
<?php 
if(strlen($htmodlist) >3){
	echo "    Originally Supplied With Models:<br>";
	if($yesacc > 0){
		echo "    <small>(Models with links have additional accessories available. Follow links to find manuals, cables, battery covers, etc. for that model.)</small><br>\n";	
	}
	echo "$htmodlist<br>";	
}else{
	echo "$nomods<br>";	
}
 ?>
   </td></tr></table>
   
    <!-- end .content --></div>
  <div class="sidebar2">
   <table width="410">
   <tr><td width="200" align="center" valign="top" class="Gk_AtcColumn">
   <div class="Gk_LiiHead" style="background-color:#CCFFFF"><span class="subhead">Live Inventory Information</span></div>  
  <div class="titlebluebg"><?php echo "$unr<br />".$row_Recordset1['brand']."<br />".$row_Recordset1['type']."<br />".$row_Recordset1['desc']; ?><br />
  </div>
  <div align="center">Part Number:<br />
    <span class="stronger"><?php echo $row_Recordset1['partnum']; ?> </span><br />
<?php if ($row_Recordset1['partnum'] != $row_Recordset1['gen_num']){echo "<span class=\"avale\">Manufacturer ID:</span><br /><span class=\"gen\">".$row_Recordset1['gen_num']."</span><br />";}?>

<?php if($row_Recordset1['part_note'] != ""){	
$prtnote = explode("|", $row_Recordset1['part_note'], 2);
if($prtnote[0] != ""){


print "\t<p align=\"center\" class=\"small\">\n";
print "\t$prtnote[0]<br>\n";
print "\t</p>\n  ";
}
} ?>

  <span class="small"><?php 
  $pagetime = date("D M j Y H:i:s T");
				
/* 				if(strstr($row_Recordset1['av'], "|")){
					$bodt = explode("|", $row_Recordset1['av']);
					if($bodt[0] == "6"){
						foreach($long_month as $abv => $longv){
							if(strstr($bodt[1], $abv)){
								$real_month = substr_replace($bodt[1], $longv, 0,3);
							}
						}
						print "$pagetime<br>This <strong>Normally Stocked</strong> item is currently on backorder from the manufacturer. <a href=\"javascript:Popster( 'http://www.newremotecontrol.com/FAQ.htm#ETA', 'eta', 780, 375, 1 )\">Estimated shipping date</a> is<br />$real_month.</p>\n\n\n\n";
						}
					elseif($bodt[0] == "7"){
						print "$pagetime<br>This is a <strong>Non-Stocking</strong> item.<br>Available for order. <a href=\"javascript:Popster( 'http://www.newremotecontrol.com/Policies.htm#Returns', 'eta', 780, 375, 1 )\">No cancellations, no returns except warranty exchange</a>. <a href=\"javascript:Popster( 'http://www.newremotecontrol.com/FAQ.htm#ETA', 'eta', 780, 375, 1 )\">Estimated shipping date</a> is<br />$bodt[1].</p>\n\n\n\n";
						}
				}
				else
 */				
 //				{
/* 					switch ($avcon){
						case 0:
							if(($row_Recordset1['instok'] < 1) && ($row_Recordset1['minstok'] < 1)){
							print "$pagetime<br>$ava2</span></p>\n\n\n";
							}
							elseif(($row_Recordset1['instok'] < 1) && ($row_Recordset1['minstok'] > 0)){
								print "$pagetime<br>Depleted Stock Inventory, currently enroute from our supplier. Normally restocked within 4 days.";
								if($row_Recordset1['minstok'] > 1){
									print "<br><strong>HOT ITEM !</strong> Order now to reserve yours.";
								}
								print "</span></p>\n\n\n";
							}
							elseif($row_Recordset1['instok'] >= 10){
								print "$pagetime<br>10+ $plur $ava3</span></p>\n\n\n";
 */#								print "$pagetime<br>".$row_Recordset1['instok']." $plur $ava3</span></p>\n\n\n";
/* 							}
							elseif($row_Recordset1['instok'] <= 10){ 
								print "$pagetime<br>".$row_Recordset1['instok']." $plur $ava3</span></p>\n\n\n";
							}
							break; 
						case 1:
							print "$pagetime<br>$ava2</span></p>\n\n\n";
							break;
						case 2:
							$lim = 1;
							if($row_Recordset1['instok'] >= 10){
								print "$pagetime<br>$ava1 10+ $plur currently in stock.</span></p>\n\n\n";
 */#								print "$pagetime<br>$ava1 ".$row_Recordset1['instok']." $plur currently in stock.</span></p>\n\n\n";
/* 							}
							elseif(($row_Recordset1['instok'] <= 9) && ($row_Recordset1['instok'] > 0)){
								print "$pagetime<br>$ava1 ".$row_Recordset1['instok']." $plur currently in stock.</span></p>\n\n\n";
							}
							elseif($row_Recordset1['instok'] < 1){
								print "$pagetime<br>$ava0<br>Due to recent orders, our remaining supply of this part appears to be depleted.<br><a href=\"http://www.newremotecontrol.com/csmail.php\">Email Customer Service</a> for the absolute status of this part.";
								if($subcount>0){
									print "<br>$subcount substitute$subplural listed.";
								}
								else{
									print "<br>No suitable substitutes found for this item.&nbsp;";
 */									/* if(stristr($row_Recordset1['desc'], "remote")){
										print "<a href=\"http://www.newremotecontrol.com/shipping_info.htm\" target=\"_parent\">Repairing your old remote may be possible.</a>";
									} */
/* 								}
								print "</span></p>\n\n\n";
								$d_abl .= " disabled";
							}
							break;
						case 3:
							print "$pagetime<br>$ava0";
							if($subcount>0){
								print "<br>$subcount substitute$subplural listed.";
							}
							else{
								print "<br>No suitable substitutes found for this item.&nbsp;";
 */								/* if(stristr($row_Recordset1['desc'], "remote")){
									print "<a href=\"http://www.newremotecontrol.com/shipping_info.htm\" target=\"_parent\">Repairing your old remote may be possible.</a>";
								} */
/* 							}
							print "</span></p>\n\n\n";
							$d_abl .= " disabled";
							break;
						case 4:
							print "$pagetime<br>This item is <b>Currently Unavailable</b>. Use Sub if listed.</span></p>\n\n\n";
							$d_abl .= " disabled";
							break;
						case 5:
							print "$pagetime<br>This item is listed in our catalog. Exact inventory status cannot be determined at this time.</span></p>\n\n\n";
							$d_abl .= " disabled";
							break;
						case 8:
							print "$pagetime<br>$ava4</span></p>\n\n\n";
							break;
						case 9:
							print "$pagetime<br>This part can be ordered, but we don't know if the manufacturer can actually supply it.</span></p>\n\n\n";
							break;
					}
 *///				}				
			if($row_Recordset1['av'] == 3){
				?>
                <span class="subtext">Item Is <b>Not Available</b> From This Store</span>
                <?php	
			}
			if(preg_match('/^([0-2]|[6-8])/', $row_Recordset1['av']) || isset($bodt)){
/* 			if($row_Recordset1['mfrprice'] > $row_Recordset1['price']){
						print "\t<span class=\"subtexta\">MSRP - &#36; ".$row_Recordset1['mfrprice']."</span><br>\n\n\n";
						print "\t$spec<span class=\"price\">&#36;".$row_Recordset1['price']."</span>\n\n\n";
						
					}else{
						print "\t$spec<span class=\"price\">&#36;".$row_Recordset1['price']."</span>\n\n\n\n\n";
						
					}
					if((stristr($row_Recordset1['desc'], "book")) || (stristr($row_Recordset1['desc'], "manual"))){
						print "<br><span class=\"small\" align=\"center\">All Literature Sales Are Final</span>\n\n\n";
					} 
*/  
  ?>

<!-- add cart link here -->
<!--<form name="RemShop_1_ATC_<?php echo $row_Recordset1["ID"]; ?>" method="POST" onsubmit="return chkstk();" action="<?php if($domref == "root"){echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:"";}else{ if($domref == "sub"){echo "http://www.newremotecontrol.com/catalog/Remote_ATC.php?catnum=".$row_Recordset1["partnum"];}} ?>">
  <input type="hidden" name="RemShop_1_ID_Add" value="<?php echo $row_Recordset1["ID"]; ?>" >
  <input name="stk" type="hidden" value="<?php echo $row_Recordset1['instok']; ?>" />
  <input type="hidden" name="cil" id="ulim" value="<?php echo (isset($lim)?$lim:"0") ?>" />
  <input type="hidden" name="fr" value="<?php echo $_SERVER['HTTP_HOST'].$_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>" />
  <br />
 -->  
<!--  <p align="left"> <span class="small"><a href="#" id="sprytrigger1">COMPATIBILITY VERIFIED</a><br />
 -->   
 <!-- If you enter the complete <b>model</b> number of your set here.</span><br />
    <input type="text" class="gravale" name="RemShop_1_Model_Add" size="18" maxlength="20" value="<?php echo (isset($_GET['refnum'])?$_GET['refnum']:"Model (recommended)"); ?>" onfocus="if(this.value=='Model (recommended)')this.value='';" />
    </p> 
    -->
  
<!--  <p align="left"><?php echo "$batline"; ?></p>
  <p align="left"><span class="small">Qty</span> <input type="text" name="RemShop_1_Quantity_Add" value="1" size="3" >&nbsp;	
    <input type="image" src="http://www.newremotecontrol.com/WA_eCart/Images/Nautica/Btn5_EN_addtocart.gif" border="0" class="eC_ImageButton" value="Add to Cart" name="RemShop_1_ATC" alt="Add to Cart"<?php echo $d_abl; ?> align="bottom"></p>
</form> 
 --><!-- <div class="tooltipContent" id="sprytooltip1">
   <p align="left" class="small">If you include the model number of <strong>the component that you are purchasing this <?php echo strtolower($row_Recordset1['desc']); ?> for</strong>, we will verify the correct application for the factory original replacement item and compatibility for the manufacturers substitute item up to any posted differences.<br />This verification is for one model only and does not extend to model numbers beyond the one given or any other secondary functions such as pairing, programming or learning, etc.<br />
    If we find a compatibility issue between the model given and this part number, your order will be held for clarification.<br />
  <a href="http://www.newremotecontrol.com/Policies.htm#Compatibility Guarantee" target="Compat">Read the entire Compatibility Policy</a> (Opens in a new window)</p>
</div>
 -->
 <!--<script type="text/javascript">
var sprytooltip1 = new Spry.Widget.Tooltip("sprytooltip1", "#sprytrigger1",{hideDelay:1000, showDelay:20, closeOnTooltipLeave:true, useEffect:"blind", offsetX:"-280px", offsetY:"-230px"});
</script>
<br /> -->
<br />
   <?php
  if($avcon != 3){ 
   ?>

<a href="https://www.newremotecontrol.com/catalog/shop/index.php?main_page=product_info&cPath=1201<?php echo "&products_id=$zen_id"; ?>" target="_self"><img src="http://www.newremotecontrol.com/images/buy_now2-18.jpg" width="120" height="34" alt="BUY NOW" /></a>
 <br />
 <?php } ?>
<br />

<?php /* if ($yesimg == 1){ ?><div class="Gk_ptxtFoot" style="background-color:#CCFFFF"><span class="subtext"><b>What You See Is What You Get</b><br />The item shipped will be identical to the image posted on this page. <?php if ($subcount == 0){ echo "We offer no substitutes for this ".$row_Recordset1['brand']." item."; } */ ?></span></div><?php /* } */?><?php }?>
   </td><td width="180" valign="top"<?php if($subcount != 0){?> class="Gk_AtcColumn"<?php } else{?> align="center"<?php }?>>
   <?php
  if($subcount == 0 && $avcon == 3){ 
   ?>
  <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- nlanosub -->
<ins class="adsbygoogle"
     style="display:inline-block;width:160px;height:600px"
     data-ad-client="ca-pub-3761494042755389"
     data-ad-slot="4952858156"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
   <?php
   }
   else if($subcount != 0){ 
	echo "<p class=\"titleltbluebg\">Substitutes For This<br/>".$row_Recordset1['desc']."<br />listed elsewhere in our catalog.</p>";
	if($row_Recordset1['subpart'] != ""){
		 echo "<p><span class=\"subhead\">Manufacturers Sub:</span><br>\n";
		 echo "<span class=\"subtext\">$man_sub_link&nbsp;<br />$msrprice <br>".$row_Recordset1['man_sub_note']."</span></p><br clear=\"all\"><hr>\n";
	}
	if($row_Recordset1['ers_sub'] != ""){
		if(!strstr($row_Recordset1['ers_sub'], "|")){
			if(!stristr($row_Recordset1['ers_sub_note'], "not a sub")){
				echo "<p><span class=\"subhead\">ERS Sub:</span><br>\n";
			}
			elseif(stristr($row_Recordset1['ers_sub_note'], "not a sub")){
				echo "<p><span class=\"subhead\">Reference:</span><br>\n";
			}
			echo "<span class=\"subtext\">$ers_sub_link".$row_Recordset1['ers_sub_note']."</span></p><br clear=\"all\"><hr>\n";
		}
		elseif(strstr($row_Recordset1['ers_sub'], "|")){
			if(!stristr($row_Recordset1['ers_sub_note'], "not a sub")){
				echo "<p><span class=\"subhead\">ERS Sub:</span><br>\n";
			}
			else{
				echo "<p><span class=\"subhead\">ERS Reference:</span><br>\n";
			}
			echo "<span class=\"subtext\">$ers_sub_link</span><br></p><br clear=\"all\"><hr>\n";
		}
	}
	if($row_Recordset1['gen_sub'] != ""){
		 echo "<p><span class=\"subhead\">Generic Sub:</span><br>\n";
		 echo "<span class=\"subtext\">$gen_sub_link&nbsp;<br />$gsrprice <br>".$row_Recordset1['gen_sub_note']."</span>\n";
	}
	if(($row_Recordset1['clone'] != "")&&($clon_sub_link != "")){
		echo "<p><span class=\"subhead\">Clone Remote:</span><br>\n";
		echo "<span class=\"subtext\">$clon_sub_link&nbsp;<br />$csrprice <br>".$row_Recordset1['clone_sub_note']."</span>\n";
	}
	if($alt_links != ""){
		echo "<p><span class=\"subhead\">Other Versions:</span><br>\n";	
		echo "<span class=\"subtext\">$alt_links</span></p>";
	}
	echo "&nbsp;<br>";
	if ($ubnegnote >0){ 
	if($ubnegnote > 1){
	$subnegplural = "ions Listed ";
	}
    echo "<hr><p class=\"smallred\">Substitut".$subnegplural."Above May Not Have All Of The Features Of The Original Remote Control. Exceptions Are Listed.</p>";
	}
}  
  ?>
  </td></tr></table>
    <!-- end .sidebar2 --></div>
  <div class="footer">
<?php if($avcon == "3"){ ?><div align="center"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  <!-- AU1 -->
  <ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-3761494042755389"
     data-ad-slot="5612573755"></ins>
  <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div><?php }?>
    <p><span class="copy">&copy;1996<script language="JavaScript">
		var d=new Date();
		yr=d.getFullYear();
		if (yr!=2011)
				document.write("- "+yr);
		</script> <a target="_blank" href="http://www.ersweb.com">Electronic Repair Service</a> of Thomasville, Georgia-An American Small Business. All Rights Reserved. All offers, promotions &amp; prices are subject to change without notice. ERS is not responsible for any typographical, photographic, or specification errors which may appear on our website. NewRemoteControl.com, ERS, <a href="http://www.ersweb.com" target="_blank">ERSWEB</a>, &amp;<a href="http://www.erswebsales.com" target="_blank"> ERSWEB Sales</a> are Trademarks of Electronic Repair Service. All Manufacturers Images, Logos, or Text are copyright of the respective holder and are used here for the sole purpose of promoting and selling their products. All items are subject to availability. Many items sold on this site are one of a kind. <br></span> </p>     
    <!-- end .footer --></div>
  <!-- end .container --></div>
</body>
</html>
<?php
mysqli_close($i_access);
?>
