Server IP : 51.89.169.208 / Your IP : 3.148.107.92 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/pages/ |
Upload File : |
<?php $radius=100; $kilometers=6371; // reference to calculate with kilometers $miles=3959; // reference to calculate with miles $query = "SELECT *, ( {$miles} * acos( cos( radians(' ".$connect->real_escape_string($lat)." ') ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(' ".$connect->real_escape_string($long)." ') ) + sin( radians(' ".$connect->real_escape_string($lat)." ') ) * sin( radians( latitude ) ) ) ) AS distance FROM ads WHERE `active`='1' AND mcategory='{$mcategory}' AND adid!='{$adid}' HAVING distance < '".$connect->real_escape_string($radius)."' ORDER BY distance LIMIT 0 , 6"; $query_result = $connect->query($query) or die($connect->error); $related_business.='<div class="cn_shaddow cont_cn" style="padding:0px;width:250px;">'; $related_business.='<div class="heading" style="padding:15px 15px 5px;font-size:11pt;color:#D64136;"><a href="/" style="display:block" border="0"><img src="/img/logo_lil.png" style="padding:1px 1px 19px 1px;" border="0"></a>RELATED BUSINESSES</div><div class="ln_height">'; $related_business.='<table class="relatedBusiness" width="100%">'; $num_row_related=$query_result->num_rows; if($num_row_related==0){ $related_business.='<tr><td style="text-align:center;color: #555;background: #FDFDFD;">No related businesses.</td></tr>'; }else{ while ($row = $query_result->fetch_assoc()){ $r_adid=strtolower($row['adid']); $r_ad_name=strtolower($row['companyname']); $r_ad_name = preg_replace("/[^A-Za-z 0-9]/", "", $r_ad_name); $r_ad_name=str_replace(" "," ",$r_ad_name); $ad_name=str_replace(" ","-",$r_ad_name); $promo_bg = ($i++ & 1) ? '#fff' : '#FFFCC1'; // background alternator $related_business.='<tr>'; $related_business.='<td valign="middle" style="text-align:center;height:5px;width:50px;background:'.$promo_bg.'">'; if($row['image']!=''){ $related_business.= '<img width="50" style="border:1px solid #d1d1d1;" src="/members/uploads/logo/'.$row['image'].'">'; }else{ $related_business.= '<img width="50" style="border:1px solid #d1d1d1;" src="/img/no_logo.png">'; } $blogo = $row['image'] && file_exists($path.'/members/uploads/logo/'.$row['image']) ? '<img alt="Listing" src="/members/uploads/logo/'.$row['image'].'">' : '<img alt="Listing" src="/img/not-found.jpg">'; if($row['seo_title']) {$alttitle =$row['seo_title'].' in '.$row['town_name'];} else {$alttitle=$row['companyname'].' in '.$row['town_name'];} $related_business.='</td>'; $related_business.='<td style="background:'.$promo_bg.'" valign="middle">'; $related_business.='<a title="'.$alttitle.'" style="font-size:10pt;font-weight:bold;" href="/pages/'.$r_adid.'-'.$ad_name.'.html">'.$row['companyname'].'</a>'; $related_business.='<div style="color:#333;font-size:9pt">'.round($row['distance'], 1).'mi from '.$town_name.'.</div>'; $related_business.='</td>'; $related_business.='</tr>'; $lngth = 100; $subDesc=substr(strip_tags($row['description']),0,$lngth); if(strlen($row['description'])>$lngth){$description = $subDesc.'...';}else{$description = strip_tags($row['description']);} $related .='<div class="listing-side-item"> '.$blogo.' <a href="/pages/'.$r_adid.'-'.$ad_name.'.html" class="listing-side-item-link">'.ucfirst($row['companyname']).'</a> <p class="listing-side-item-description">'.$subDesc.'</p> </div>'; } } ?>