$orderfield = '<input type="hidden" name="sort" value="' . $orderBy[0] . '~' . $orderBy[1] . '">';
     $apicall .= $order;
 }
 $apicall .= $where;
 //echo $apicall;die;
 // Load the call and capture the document returned by eBay API
 $resp = simplexml_load_file($apicall);
 $ebay_total = (int) $resp->paginationOutput->totalEntries;
 $pages = new Paginator();
 $pages->items_per_page = 110;
 $pages->current_page = $fillfor;
 if (count($dataArray) >= 1) {
     if ($groupby != "" && $sort != "") {
         $order = explode("~", $sort);
         $orderby = $groupby . "," . $order[0];
         $total_rows = $search->attributeSearchCount($dataArray, $groupby);
         $pages->items_total += $total_rows;
         $pages->paginate();
         $cars = $search->attributeSearch($dataArray, $orderby, $order[1], $pages->limit);
     } else {
         if ($groupby == "" && $sort != "") {
             $order = explode("~", $sort);
             $total_rows = $search->attributeSearchCount($dataArray, $groupby);
             $pages->items_total += $total_rows;
             $pages->paginate();
             $cars = $search->attributeSearch($dataArray, $order[0], $order[1], $pages->limit);
         } else {
             if ($groupby != "" && $sort == "") {
                 $total_rows = $search->attributeSearchCount($dataArray, $groupby);
                 $pages->items_total += $total_rows;
                 $pages->paginate();
$obj_search = new search();
if (isset($_GET['field']) and $_GET['field'] != '') {
    $field = $_GET['field'];
} else {
    $field = 'car_id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
    $orderby = $_GET['orderBy'];
} else {
    $orderby = 'ASC';
}
$addCarToQuery = '';
$dataArr = array("featured" => 169);
if ($submitcar == 'Search') {
    $backtype = explode("~", $searchattr);
    if ($backtype[2] == "select" or $backtype[2] == "radio" or $backtype[2] == "multiselect" or $backtype[2] == "checkbox") {
        $value_id = $obj_setting->customQuery("select value_id from attribute_option_value where attribute_id = '" . $backtype['0'] . "' and value like '" . "%" . $searchcar . "%" . "' ");
        $value_id = mysql_fetch_object($value_id);
        $value = $value_id->value_id;
    } else {
        $value = $searchcar;
    }
    $attribute_code = $obj_setting->customQuery("select attribute_code from attribute where attribute_id = " . $backtype['0']);
    $attribute_code = mysql_fetch_object($attribute_code);
    $dataArr[$attribute_code->attribute_code] = $value;
}
$pages->items_total = $obj_search->attributeSearchCount($dataArr);
$total_rows = $pages->items_total;
$pages->paginate();
$all_car = $obj_search->attributeSearch($dataArr, "fullName", "ASC", $pages->limit);
$all_car = $obj_setting->CarAttributesFromID($all_car);