<?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>Market Area</h1>
				<h2>States</h2>
                <ul class="market-list">
                    <?php $state = $this->db->query("SELECT * FROM wps_states_list WHERE status ='1' order By name")->result_array();
                    foreach ($state as $rows) { ?>
                    <li><a href="<?php echo site_url($rows['temp_title']); ?>"><?php echo $rows['name']; ?></a></li>
                    <?php }  ?>
                </ul>
				
				<h2>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><?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'); ?>