<?php require('includes/cmain.inc.php'); ?> 
<?php
$qs1=explode("/",$_SERVER["REQUEST_URI"]);
//echo "<pre>"; print_r($qs1); echo "</pre>";
$countryName=str_replace('-',' ',$qs1[1]);
$banner_match = ucwords(stripslashes($countryName));
$stateName=str_replace('-',' ',$qs1[2]);	
$SpCountyName =trim($qs1[3]);
$countyName = str_replace('-',' ',$SpCountyName);
$location_replace = ucwords(stripslashes($countyName));

$sql_st = mysql_query("select county_name, county_short_name from tbl_county where `county_name` LIKE '".$countyName."' and county_status='1' and `state_id`=(select `state_id` from tbl_state where `state_name` LIKE '".$stateName."' and state_status=1) ");
$st_data = mysql_fetch_assoc($sql_st);

$sqls=mysql_query("select * from tbl_country where `country_url` LIKE '".$countryName."' and country_status=1 ");
$ress=mysql_fetch_array($sqls); 

if((mysql_num_rows($sql_st) !=NULL) &&  (mysql_num_rows($sqls) !=NULL)) {
    $meta_title = str_replace("LOCATION_REPLACE", $location_replace.', '.$st_data['county_short_name'], $ress['title']);
	$meta_description =str_replace("LOCATION_REPLACE",$location_replace.', '.$st_data['county_short_name'],$ress['description']);
	$meta_keyword = str_replace("LOCATION_REPLACE",$location_replace.', '.$st_data['county_short_name'],$ress['keyword']);   
} else {
	include('tSt.php');
	exit;
}
?>
<?php include('header.php'); ?>
<?php include('banner.php'); ?>
<!-- Service section -->
<?php //include('index_img_links.php'); ?>
<!-- Welcome sec -->
<div class="welcome-sec">
<div class="container cf">

<div class="welcome-img">
<?php include('right_menu_county.php'); ?>
</div>

<h1><?php if($ress['country_title'])
{ 
echo str_replace("LOCATION_REPLACE", $location_replace, stripslashes($ress['country_title'])); 
}
else
{ 
echo ucwords(stripslashes($countryName.' in '.$countyName));  
}					 
?></h1>

<p>
<?php  
$res_desc = mysql_fetch_assoc(mysql_query("select country_descriptions from tbl_country where `country_name` LIKE '".$countryName."' and country_status='1'"));
$location_replace = '<b>'.ucwords(stripslashes($countyName)).'</b> ';
//LOCATION_REPLACE							 
$desc = stripslashes($res_desc['country_descriptions']);
echo str_replace("LOCATION_REPLACE", $location_replace,$desc);
?>
</p>

<?php  $location_replace = '<b>'.ucwords(stripslashes($countyName)).'</b> ';
$desc = stripslashes($ress['country_descriptions']);
echo str_replace("LOCATION_REPLACE", $location_replace, $desc);
?> 


<ul id="double">
<?php 
$qName=explode("/",$_SERVER["REQUEST_URI"]);
$name=ucwords(str_replace('-',' ',$qName[1]));
//echo "<pre>"; print_r($qName); echo "</pre>";
$sql=mysql_query("select * from tbl_related_link where country_id=(select country_id from tbl_country where country_url='".trim($name)."')");
while($res=mysql_fetch_array($sql))
{
$res['link_name'];
$qName5=explode("/",$res['link_name']);
//echo "<pre>"; print_r($qName5); echo "</pre>";
$link1=strtolower(str_replace(' ','-',$qName5[1]));$link2=strtolower(str_replace(' ','-',$qName5[2]));$link3=strtolower(str_replace(' ','-',$qName5[3]));
$link4=strtolower(str_replace(' ','-',$qName5[4]));$link5=strtolower(str_replace(' ','-',$qName5[5]));$link6=strtolower(str_replace(' ','-',$qName5[6]));
$link7=strtolower(str_replace(' ','-',$qName5[7]));$link8=strtolower(str_replace(' ','-',$qName5[8]));$link9=strtolower(str_replace(' ','-',$qName5[9]));
$link10=strtolower(str_replace(' ','-',$qName5[10]));$link11=strtolower(str_replace(' ','-',$qName5[11]));$link12=strtolower(str_replace(' ','-',$qName5[12]));
$link12=strtolower(str_replace(' ','-',$qName5[14]));$link12=strtolower(str_replace(' ','-',$qName5[15]));$link12=strtolower(str_replace(' ','-',$qName5[16]));
$link12=strtolower(str_replace(' ','-',$qName5[17]));$link12=strtolower(str_replace(' ','-',$qName5[18]));$link12=strtolower(str_replace(' ','-',$qName5[19]));
$link12=strtolower(str_replace(' ','-',$qName5[20]));$link12=strtolower(str_replace(' ','-',$qName5[21]));$link12=strtolower(str_replace(' ','-',$qName5[22]));
$link12=strtolower(str_replace(' ','-',$qName5[23]));$link12=strtolower(str_replace(' ','-',$qName5[24]));$link12=strtolower(str_replace(' ','-',$qName5[25]));
$sqserv=mysql_query("select * from tbl_country where country_name='".$qName5[1]."' and parent_childs !='0'"); $req=mysql_fetch_array($sqserv); $link1url=strtolower(str_replace(' ','-',$req['country_url']));
$sqserv1=mysql_query("select * from tbl_country where country_name='".$qName5[2]."' and parent_childs !='0'"); $req1=mysql_fetch_array($sqserv1); $link2url=strtolower(str_replace(' ','-',$req1['country_url']));
$sqserv2=mysql_query("select * from tbl_country where country_name='".$qName5[3]."' and parent_childs !='0'"); $req2=mysql_fetch_array($sqserv2); $link3url=strtolower(str_replace(' ','-',$req2['country_url']));
$sqserv3=mysql_query("select * from tbl_country where country_name='".$qName5[4]."' and parent_childs !='0'"); $req3=mysql_fetch_array($sqserv3); $link4url=strtolower(str_replace(' ','-',$req3['country_url']));
$sqserv4=mysql_query("select * from tbl_country where country_name='".$qName5[5]."' and parent_childs !='0'"); $req4=mysql_fetch_array($sqserv4); $link5url=strtolower(str_replace(' ','-',$req4['country_url']));
$sqserv5=mysql_query("select * from tbl_country where country_name='".$qName5[6]."' and parent_childs !='0'"); $req5=mysql_fetch_array($sqserv5); $link6url=strtolower(str_replace(' ','-',$req5['country_url']));
$sqserv6=mysql_query("select * from tbl_country where country_name='".$qName5[7]."' and parent_childs !='0'"); $req6=mysql_fetch_array($sqserv6); $link7url=strtolower(str_replace(' ','-',$req6['country_url']));
$sqserv7=mysql_query("select * from tbl_country where country_name='".$qName5[8]."' and parent_childs !='0'"); $req7=mysql_fetch_array($sqserv7); $link8url=strtolower(str_replace(' ','-',$req7['country_url']));
$sqserv8=mysql_query("select * from tbl_country where country_name='".$qName5[9]."' and parent_childs !='0'"); $req8=mysql_fetch_array($sqserv8); $link9url=strtolower(str_replace(' ','-',$req8['country_url']));
$sqserv9=mysql_query("select * from tbl_country where country_name='".$qName5[10]."' and parent_childs !='0'"); $req9=mysql_fetch_array($sqserv9); $link10url=strtolower(str_replace(' ','-',$req9['country_url']));
$sqserv10=mysql_query("select * from tbl_country where country_name='".$qName5[11]."' and parent_childs !='0'"); $req10=mysql_fetch_array($sqserv10); $link11url=strtolower(str_replace(' ','-',$req10['country_url']));
$sqserv11=mysql_query("select * from tbl_country where country_name='".$qName5[12]."' and parent_childs !='0'"); $req11=mysql_fetch_array($sqserv11); $link12url=strtolower(str_replace(' ','-',$req11['country_url']));
$sqserv12=mysql_query("select * from tbl_country where country_name='".$qName5[13]."' and parent_childs !='0'"); $req12=mysql_fetch_array($sqserv12); $link13url=strtolower(str_replace(' ','-',$req12['country_url']));
$sqserv13=mysql_query("select * from tbl_country where country_name='".$qName5[14]."' and parent_childs !='0'"); $req13=mysql_fetch_array($sqserv13); $link14url=strtolower(str_replace(' ','-',$req13['country_url']));
$sqserv14=mysql_query("select * from tbl_country where country_name='".$qName5[15]."' and parent_childs !='0'"); $req14=mysql_fetch_array($sqserv14); $link15url=strtolower(str_replace(' ','-',$req14['country_url']));
$sqserv15=mysql_query("select * from tbl_country where country_name='".$qName5[16]."' and parent_childs !='0'"); $req15=mysql_fetch_array($sqserv15); $link16url=strtolower(str_replace(' ','-',$req15['country_url']));
$sqserv16=mysql_query("select * from tbl_country where country_name='".$qName5[17]."' and parent_childs !='0'"); $req16=mysql_fetch_array($sqserv16); $link17url=strtolower(str_replace(' ','-',$req16['country_url']));
$sqserv17=mysql_query("select * from tbl_country where country_name='".$qName5[18]."' and parent_childs !='0'"); $req17=mysql_fetch_array($sqserv17); $link18url=strtolower(str_replace(' ','-',$req17['country_url']));
$sqserv18=mysql_query("select * from tbl_country where country_name='".$qName5[19]."' and parent_childs !='0'"); $req18=mysql_fetch_array($sqserv18); $link19url=strtolower(str_replace(' ','-',$req18['country_url']));
$sqserv19=mysql_query("select * from tbl_country where country_name='".$qName5[20]."' and parent_childs !='0'"); $req19=mysql_fetch_array($sqserv19); $link20url=strtolower(str_replace(' ','-',$req19['country_url']));
$sqserv20=mysql_query("select * from tbl_country where country_name='".$qName5[21]."' and parent_childs !='0'"); $req20=mysql_fetch_array($sqserv20); $link21url=strtolower(str_replace(' ','-',$req20['country_url']));
$sqserv21=mysql_query("select * from tbl_country where country_name='".$qName5[22]."' and parent_childs !='0'"); $req21=mysql_fetch_array($sqserv21); $link22url=strtolower(str_replace(' ','-',$req21['country_url']));
$sqserv22=mysql_query("select * from tbl_country where country_name='".$qName5[23]."' and parent_childs !='0'"); $req22=mysql_fetch_array($sqserv22); $link23url=strtolower(str_replace(' ','-',$req22['country_url']));
$sqserv23=mysql_query("select * from tbl_country where country_name='".$qName5[24]."' and parent_childs !='0'"); $req23=mysql_fetch_array($sqserv23); $link24url=strtolower(str_replace(' ','-',$req23['country_url']));
$sqserv24=mysql_query("select * from tbl_country where country_name='".$qName5[25]."' and parent_childs !='0'"); $req24=mysql_fetch_array($sqserv24); $link25url=strtolower(str_replace(' ','-',$req24['country_url'])); ?>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link1url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[1]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link2url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[2]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link3url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[3]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link4url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[4]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link5url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[5]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link6url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[6]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link7url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[7]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link8url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[8]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link9url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[9]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link10url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[10]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link11url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[11]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link12url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[12]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link13url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[13]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link14url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[14]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link15url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[15]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link16url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[16]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link17url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[17]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link18url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[18]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link19url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[19]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link20url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[20]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link21url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[21]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link22url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[22]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link23url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[23]; ?></a> </li><li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link24url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[24]; ?></a> </li>
<li class="emaujli"><a  href="<?php echo SITE_WS_PATH.'/'.$link2url.'/'.$qName[2].'/'.$qName[3]; ?>" ><?php echo $qName5[25]; ?></a> </li>
<?php }?>
</ul>

</div>
</div>
</main>
</div>
</div>
<?php include('footer.php'); ?>
<style>
#double li {line-height: 0.80;float: left;display: inline;width:24%;padding: 7px;text-align: left;}
#double li a {width: 100%;font-size: 14px;color: #333333;}
</style>