Search for a Service Plan
Enter Your ZIPCODE Please
Quick Phone Search
Search Phone Plans
Search Phone Makers
Cell Phone Articles
Cell Phone News Feeds
Hottest New Cell Phones With Plans
$v){
if (array_key_exists('page',$output)) {
unset($output['page']);
} else if (array_key_exists('list',$output)){
unset($output['list']);
} else if (array_key_exists('zip',$output)){
unset($output['zip']);
}
}
foreach ($output as $k => $v){
$v = str_replace("&","%26",$v);
$currentQueryByPages .= $k . "=" . $v . "&";
}
$currentQueryByPages = substr($currentQueryByPages, 0, -1);
}
// submit xml data
$XMLSent = "";
$XMLSent .= "" . $crid . " ";
$XMLSent .= "" . $Website . " ";
$XMLSent .= "" . $SecurityCode . " ";
$XMLSent .= "" . getenv("REMOTE_ADDR") . " ";
$XMLSent .= "" . htmlspecialchars($zip) . " ";
$XMLSent .= "" . htmlspecialchars($shopfor) . " ";
if($shopfor == "phone") {
$XMLSent .= "" . htmlspecialchars($m) . " ";
$XMLSent .= "" . htmlspecialchars($p) . " ";
$XMLSent .= "" . htmlspecialchars($t) . " ";
$XMLSent .= "" . htmlspecialchars($c) . " ";
} else if ($shopfor == "provider") {
$XMLSent .= "" . htmlspecialchars($c) . " ";
} else if ($shopfor == "plan") {
$XMLSent .= "" . htmlspecialchars($carrier) . " ";
$XMLSent .= "" . htmlspecialchars($n) . " ";
$XMLSent .= "" . htmlspecialchars($plantype) . " ";
$XMLSent .= "" . htmlspecialchars($minutes) . " ";
$XMLSent .= "" . htmlspecialchars($price) . " ";
}
$XMLSent .= " ";
include_once('GeoXML.class.php');
$geoxml = new GeoXML;
$XmlUrlA = array('http://marketing.riveroffers.com/cell_phone_info.php');
$geoxml->fetchXML($XmlUrlA, $XMLSent);
$vals = $geoxml->vals;
$myxml = $geoxml->myxml;
if ($geoxml->XMLError == 1) {
include("cellular_error.php");
exit;
}
$TheResult = GetValidXML('RESULT',0,'');
$ErrorMsg = GetValidXML('ERRORMESSAGE',0,'');
if ($TheResult == "Success") {
$Zip = GetValidXML('ZIP',0,'');
$carrierDataList = GetValidXML('CARRIERDATALIST',0,'');
$manufacturerNameDataList = GetValidXML('MANUFACTURERNAMEDATALIST',0,'');
$typeDataList = GetValidXML('TYPEDATALIST',0,'');
$checkZipDesc = GetValidXML('CHECKZIPDESC',0,'');
$Products = array();
$CarrierLogo = array();
$CarrierDescription = array();
$ProductId = array();
$EquipmentName = array();
$EquipmentID = array();
$ManufacturerName = array();
$EquipmentPrice = array();
$RebateAmount = array();
$PriceAfterRebate = array();
$EquipmentImageFileSmallURL = array();
$selectedLink = array();
$totalCellNum = count($myxml['PRODUCTID']);
for($i=0; $i < $totalCellNum; $i++){
$CarrierLogo[$i] = GetValidXML('CARRIERLOGO',$i,'');
$CarrierDescription[$i] = GetValidXML('CARRIERDESCRIPTION',$i,'');
$CarrierDescription[$i] = str_replace("AT&T","at-t",$CarrierDescription[$i]);
$CarrierDescription[$i] = str_replace(" ","-",$CarrierDescription[$i]);
$CarrierDescription[$i] = strtolower($CarrierDescription[$i]);
$ProductId[$i] = GetValidXML('PRODUCTID',$i,'');
$EquipmentName[$i] = GetValidXML('EQUIPMENTNAME',$i,'');
$EquipmentID[$i] = GetValidXML('EQUIPMENTID',$i,'');
$ManufacturerName[$i] = GetValidXML('MANUFACTURERNAME',$i,'');
$EquipmentPrice[$i] = GetValidXML('EQUIPMENTPRICE',$i,'');
$RebateAmount[$i] = GetValidXML('REBATEAMOUNT',$i,'');
$PriceAfterRebate[$i] = GetValidXML('PRICEAFTERREBATE',$i,'');
$EquipmentImageFileSmallURL[$i] = GetValidXML('EQUIPMENTIMAGEFILESMALLURL',$i,'');
$selectedLink[$i] = "cellular_results" . $PageExtension . "?pid=" . GetValidXML('PRODUCTID',$i,'');
if($sid != ""){
$selectedLink[$i] = "cellular_results" . $PageExtension . "?pid=" . GetValidXML('PRODUCTID',$i,'') . "&sid=" . $sid;
}
if($Zip != "" && $Zip != 0 && $checkZipDesc != ''){
$selectedLink[$i] .= "&zip=" . $Zip;
}
}
}
// rebuild current query string //
if ($Zip != ''){
$currentQueryByPages .= "&zip=" . $Zip;
}
// paging begin
phpparam('page',1);
phpparam('list','');
if($list != "all" && $totalCellNum > 0){
$pageSize = 15;
$pageCount = ceil($totalCellNum / $pageSize);
$start = ($page - 1) * $pageSize;
$fields = array("CarrierLogo", "ProductId", "EquipmentName", "EquipmentID", "ManufacturerName",
"EquipmentPrice", "RebateAmount", "PriceAfterRebate", "EquipmentImageFileSmallURL", "selectedLink");
foreach($fields as $v){
$$v = array_slice($$v,$start,$pageSize);
}
$nav = '';
$prev = '';
$first = '';
$next = '';
$last = '';
$DisplayFirst = '';
$DisplayLast = '';
if ($page <= 4){
$DisplayFirst = 1;
$DisplayLast = $pageCount > 6 ? 6 : $pageCount;
} elseif ($page >= $pageCount - 3){
$DisplayFirst = $pageCount - 6;
$DisplayLast = $pageCount;
} else {
$DisplayFirst = $page - 3;
$DisplayLast = $page + 3;
}
if ($DisplayFirst < 1) {
$DisplayFirst = 1;
}
if ($DisplayLast > $pageCount){
$DisplayLast = $pageCount;
}
for($i = $DisplayFirst; $i <= $DisplayLast; $i++){
if ($i == $page){
$nav .= " $i ";
} else {
$nav .= " $i ";
}
}
if ($page > 1) {
$i = $page - 1;
$prev = " ";
$first = " ";
}
if ($page < $pageCount) {
$i = $page + 1;
$next = " ";
$last = " ";
}
$navPages = "display all ";
$navDesc .= "Page: " . $page . " of " . $pageCount . " " ;
$navbar = $navDesc . "" . $first . $prev . $nav . $next . $last . " ";
} else {
$navbar = "display by pages ";
$navPages = '';
}
$productCounter = count($ProductId);
// paging end
$compareHeader =<<< EOF
EOF;
// without filter variables, display most popular phones //
if ($m == '' && $p == '' && $t == '' && $c == ''){
$navbar = '';
$navPages = '';
$compareHeader = <<
Most Popular Cellular Phones
EOF;
}
$compareFooter =<<
EOF;
if ($checkZipDesc != 'Cellular Phone Shopping'){
$title = $checkZipDesc;
$changeLocation = "change location ";
} else {
$changeLocation = "check availability ";
}
echo <<
EOF;
if ($totalCellNum == 0){
echo "
There is no cellular service for your request. Please refine your search.
";
exit;
}
// display phones //
echo <<