<?php $this->load->view('top'); ?>
  <div class="clearfix"></div>
  <section class="banner_category" style="background-image: url('<?php echo theme_url();?>images/listing-banner.jpg');">
    <div class="container">
     
      <h1 class="banner_title">Market Area</h1>
    </div>
  </section>
<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 >Market Area</h1> -->
				<h2 class="name_title">States</h2>
                <ul class="market-list">
                    <?php $city = $this->db->query("SELECT * FROM wps_states_list WHERE status ='1' order By name")->result_array();
                    foreach ($city as $rows) { ?>
                    <li><a href="<?php echo site_url($rows['temp_title']); ?>"><?php echo $rows['name']; ?></a></li>
                    <?php }  ?>
                </ul>
				
				<h2 class="name_title">Cities</h2>
				<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){
					?>
						<h3 class="name_title"><?php echo $state['name']; ?></h3>
						<ul class="market-list">
							<?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>
    </section>
        


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