<?php $this->load->view('top'); ?>

<div class="page_breadcrumbs">
        <div class="container">
            <ul>
            <li><a href="<?= site_url(); ?>" title="Home">Home</a>
            </li>
              <li>Market Area</li>
            </ul>
        </div>
    </div>
    <section class="privacy_policy marketarea">
		<div class="container">
			<div class="row">
				<div class="col-lg-12 col-md-12">
                <h1 class="title_h22">Market Area</h1>
                <div class="marketareas">
                <h2>Country</h2>
               <ul class="market-list">
                    <?php $country = $this->db->query("SELECT * FROM wps_countries_list WHERE status ='1' order By name")->result_array();
                    foreach ($country as $rows) { ?>
                    <li><a href="<?php echo site_url($rows['country_temp_name']); ?>"><?php echo $rows['name']; ?></a></li>
                    <?php }  ?>
                </ul>
                <ul class="market-list">
                    <?php $country = $this->db->query("SELECT * FROM wps_countries_list WHERE status ='1' order By name")->result_array();
					foreach($country as $rows) { 
					$statelist = $this->db->query("SELECT * FROM wps_states_list WHERE country_id = '".$rows['id']."' AND status ='1' order By name")->result_array();
					if(count($statelist) > 0){
					?>
						<ul class="market-list">
						    	<h2>States of <?=$rows['name'];?></h2> 
							<?php foreach($statelist as $state) { ?>
							  
								<li><a href="<?php echo site_url($state['temp_title']); ?>"><?php echo $state['name']; ?></a></li>
							<?php } ?>
						</ul>
					
					
					
                    <?php } }  ?>
                </ul>
				
				<ul class="market-list">
                    <?php $statelist = $this->db->query("SELECT * FROM wps_states_list WHERE status ='1' order By name")->result_array();
					foreach($statelist as $state) { 
					$citylist = $this->db->query("SELECT * FROM wps_cities_list WHERE state_id = '".$state['id']."' AND status ='1' order By city")->result_array();
					if(count($citylist) > 0){
					?>
						<ul class="market-list">
						    	<h2>Cities of <?=$state['name'];?></h2> 
							<?php foreach($citylist as $city) { ?>
							  
								<li><a href="<?php echo site_url($city['temp_title']); ?>"><?php echo $city['city']; ?></a></li>
							<?php } ?>
						</ul>
					
					
					
                    <?php } }  ?>
                </ul>
        </div>
    </div>
      </div>
    </div>
    </section>
        


<?php $this->load->view('bottom'); ?>