category_details($cat_id); $cat_name = $cat_row['category_name']; $fields = $cat_row['fields']; $brands = $cat_row['brands']; $category_parents = $cat_row['category_parents']; $own_url = "/$cat_url-c$cat_id"."a".$at."p1.html"; $cat_url_sub = $cat_url; $ind_row = $sanformation->category_details($category_parents); $cat_url_parents = $ind_row['category_url']; $cat_name_parents = $ind_row['category_name']; $cat_id_parents = $ind_row['c_id']; $cat_url_child = $cat_url; $city_url = $_GET['city']; if($city_url != ''){ $cts = $sanformation->city_ip_check($city_url); if($cts != '0'){ $city_url_new = $sanformation->city_ip_name($city_url); if($city_url_new != $city_url){ $city_url = $city_url_new; $ne_url = "http://www.dialindia.com/$city_url".$own_url; $indus_url = "http://www.dialindia.com/$city_url/$cat_url_parents-s$cat_id_parents"."a0p1.html"; header("Location: $ne_url"); } }else{ $city_url = ''; $ne_url = "http://www.dialindia.com$own_url"; $indus_url = "http://www.dialindia.com/$cat_url_parents-s$cat_id_parents"."a0p1.html"; header("Location: $ne_url"); } }else{ $city_url = ''; $indus_url = "http://www.dialindia.com/$cat_url_parents-s$cat_id_parents"."a0p1.html"; } if($city_url != ''){ $ct = "`city_url` = '$city_url' AND "; $crl = "$city_url/"; $ct_aj = $city_url; $city_name = $sanformation->city_name($city_url); $cth = ' >'; }else{ $ct = ''; $crl = ''; $cth = ''; } //============================================ duration calculator ================================ $dt = $date->format( 'd M Y H:i' ); $time_now = strtotime("$dt"); function Duration($s, $e){ $timestamp = $e - $s; $years=floor($timestamp/(60*60*24*365));$timestamp%=60*60*24*365; $weeks=floor($timestamp/(60*60*24*7));$timestamp%=60*60*24*7; $days=floor($timestamp/(60*60*24));$timestamp%=60*60*24; $hrs=floor($timestamp/(60*60));$timestamp%=60*60; $mins=floor($timestamp/60);$secs=$timestamp%60; /* if ($years >= 1) { $str.= $years.' years '; } if ($weeks >= 1) { $str.= $weeks.' weeks '; } if ($days >= 1) { $str.=$days.' days '; } if ($hrs >= 1) { $str.=$hrs.' hours '; } if ($mins >= 1) { $str.=$mins.' minutes '; } */ //--------------------------------------------------- if($days < 1){ if ($hrs >= 1) { $str.=$hrs.' hours '; } if ($mins >= 1) { $str.=$mins.' minutes '; } }else{ $str = '2'; } return $str; } //============================================================================= AD TYPE ================================================= $quary1 = "SELECT * FROM asso_field_value WHERE asso_with = '1'"; $result1 = mysql_query($quary1) or die('Error, query failed ' . mysql_error()); while($row = mysql_fetch_array($result1)){ $val = $row['radio_set_1']; $vals = $row['radio_set_2']; $value_one .= "',$val,', "; $value_two .= "',$vals,', "; } $value_one .= substr($value_one, 0, -2); $value_two .= substr($value_two, 0, -2); if($at == '1'){ $adt = "AND `ad_type` IN ($value_one)"; $typ_txt = " - Offering Ads "; }elseif($at == '2'){ $adt = "AND `ad_type` IN ($value_two)"; $typ_txt = " - Wanted Ads "; }else{ $adt = ""; $typ_txt = " - All Ads "; } //===================================================================== page navigation ==================================== $pr = $_REQUEST['pr']; if(!$pr) $pr = 20; $wn = $_REQUEST['page']; $w = (($wn*$pr)-$pr); $st = $w; if((!$st || ($st < 0))) $st = 0; $slr = round($st/$pr, 0)+2; $next = $st+$pr; if($st <= $pr) { $back = 0; }else{ $back = $st-$pr; } $pct = ($st/20)+1; if(!isset($_REQUEST['page'])){ $tit = ""; }else{ $tit = "- page ".$pct; } //===================================================================== page navigation end ==================================== $srt = "$ct `category_id` = '$cat_id' AND `status` = '1' $adt"; $page_ulr = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a".$at."p"; $indus_url = "http://www.dialindia.com/$crl"."$cat_url_parents-s$cat_id_parents"."a0p1.html"; $sql_count = "SELECT * FROM `ad_details` WHERE $srt "; $result_count = mysql_query($sql_count) or die('Error, query failed category ' . mysql_error()); $count = mysql_num_rows($result_count); $cat_parent_name = $cat_name_parents; if($city_name == ''){ $city_name = 'india'; } //======================================================================================================================================= $ord = $_GET['order']; if($ord == '1'){ $ord_str = ""; $ord_page_url = ""; }elseif($ord == '2'){ $ord_str = "`activated_on` DESC, "; $ord_page_url = "?order=2"; $ord_txt = " - order by newly added ads "; }elseif($ord == '3'){ $ord_str = "`activated_on` ASC, "; $ord_page_url = "?order=3"; $ord_txt = " - order by earlier added ads "; }elseif($ord == '4'){ $ord_str = "`price` ASC, "; $ord_page_url = "?order=4"; $ord_txt = " - order by lowest price "; }elseif($ord == '5'){ $ord_str = "`price` DESC, "; $ord_page_url = "?order=5"; $ord_txt = " - order by highest price "; }elseif($ord == '6'){ $ord_str = "`views` DESC, "; $ord_page_url = "?order=6"; $ord_txt = " - order by highest visits "; } $page_ulr_order = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a".$at."p$wn.html?order="; $clear_all_url = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a".$at."p$wn.html"; $srt_all = "$ct `category_id` = '$cat_id' AND `status` = '1'"; $srt_offered = "$ct `category_id` = '$cat_id' AND `status` = '1' AND `ad_type` IN ($value_one)"; $srt_wanted = "$ct `category_id` = '$cat_id' AND `status` = '1' AND `ad_type` IN ($value_two)"; $sql_all = "SELECT * FROM `ad_details` WHERE $srt_all "; $result_all = mysql_query($sql_all) or die('Error, query failed category ' . mysql_error()); $count_all = mysql_num_rows($result_all); $all_url = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a0p1.html$ord_page_url"; $sql_offered = "SELECT * FROM `ad_details` WHERE $srt_offered "; $result_offered = mysql_query($sql_offered) or die('Error, query failed category ' . mysql_error()); $count_offered = mysql_num_rows($result_offered); $offered_url = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a1p1.html$ord_page_url"; $sql_wanted = "SELECT * FROM `ad_details` WHERE $srt_wanted "; $result_wanted = mysql_query($sql_wanted) or die('Error, query failed category ' . mysql_error()); $count_wanted = mysql_num_rows($result_wanted); $wanted_url = "http://www.dialindia.com/$crl"."$cat_url-c$cat_id"."a2p1.html$ord_page_url"; ?> <?=$cat_parent_name;?> - <?=$cat_name;?> in <?=ucwords($city_name);?> <?=$ord_txt;?><?=$typ_txt;?> <?=$tit;?>
> >
Results for   [ ]
Order By  
", $description); $description = ''; for($i = 0; $i < count($wordChunks); $i++){ $description .= "$wordChunks[$i] "; } $wordChunks = explode("
", $description); $description = ''; for($i = 0; $i < count($wordChunks); $i++){ $description .= "$wordChunks[$i] "; } $description = remove_any_tags($description); $description = substr($description, 0, 200); $city_url_l = $rows['city_url']; $listing_approve_date = $rows['activated_on']; $listing_approve_date_disp = date("F j, Y, g:i a", $listing_approve_date); $images = $rows[photo]; $image_array = explode(",",$images); $count_array = count($image_array); if($count_array == '1' AND $images == ''){ $cnt = '0'; }else{ $cnt = $count_array; } if($rows[photo] == 'none'){ $img = "/images/noimage.gif"; $img_cd = ''; }elseif($rows[photo] != ''){ if($count_array == '0'){ $img = "http://medias.dialindia.com/".$rows[photo]; }else{ $img = "http://medias.dialindia.com/".$image_array[0]; } $img_cd = ''; }else{ $img = "/images/noimage.gif"; $img_cd = ''; } $duration = Duration($listing_approve_date, $time_now); if($duration != '2'){ $duro = $duration.' ago'; }else{ $duro = $listing_approve_date_disp; } $locations = $rows[locations]; $locations_array = explode(",",$locations); if($locations != ''){ $loc = ''.$locations_array[0].''; }else{ $loc = ''; } $you_are = $rows[you_are]; $yr = substr($you_are, 1, 50); $yr = substr($yr, 0, -2); if($yr != ''){ $you = ''.$yr.''; }else{ $you = ''; } $price = $rows[price]; if($price != '0'){ $pric = 'Rs. '.number_format($price).''; }else{ $pric = ''; } $add_url = "http://www.dialindia.com/$city_url_l/$title_url-v$ad_id.html"; //if($plan == '1'){ $class = "whitebox"; }elseif($plan == '2'){ $class = 'yellowbox'; } $class = $sanformation->plan_class($plan); $display = '

'.$title.'

'.$description.'...
'.$cnt.' photos | Posted: '.$duro.'
'.$pric.$you.$loc.'
'; echo $display; } ?>
Showing Results: - of Sorry ! Still there is no ads for this category $cat_name. You may become first to post ads on this page. To post your ad please click here ....

'; } ?> $pr) { if($back == '0'){ $back = 1; } while($y < $xx){ $y = $y+1; if($y == $wn){ $slrsx[] = "$y"; }else{ $slrsx[] = "$y"; }} echo $slrsx[$slr-5].$slrsx[$slr-4].$slrsx[$slr-3].$slrsx[$slr-2].$slrsx[$slr-1].$slrsx[$slr].$slrsx[$slr+1].$slrsx[$slr+2].$slrsx[$slr+3].$slrsx[$slr+4].$slrsx[$slr+5]; $next = $wn+1; if($next > $y){ $next = $y; }elseif($wn == '0' || $wn == ''){ $next = 2; } } ?>