[eluser]zuluanshee[/eluser]
here is the site:
travelfound.com
press the 'Europe' link at the right (that's teh only one currently configured), you'll see what happens.
the view is mostly the same as the front page.
here si the code
view
Code:
<div class="newsItem">
<h1>Where Do You Want To Go?</h1>
<ul>
<li><?php echo anchor('continents/','Africa');?></li>
<li><?php echo anchor('continents/', 'Asia');?></li>
<li><?php echo anchor('continents/index/Europe/', 'Europe');?></li>
<li><?php echo anchor('continents/', 'US and Canada');?></li>
<li><?php echo anchor('continents/', 'Central America and Caribbean');?></li>
<li><?php echo anchor('continents/','South America');?></li>
<li><?php echo anchor('continents/','Pacific Rim and Oceania (+Australia & New Zealand)');?></li>
</ul>
</div>
model
Code:
class CountriesModel extends Model
{
function getCountries($continent)
{
$query = $this->db->query("SELECT country_name FROM countries WHERE continent_name = '$continent'");
//$query = $this->db->where('country_name', $continent);
if($query->num_rows() > 0)
{
foreach($query->result() as $row)
{
$data[] = $row;
}
}
return $data;
}
}
controller
Code:
class Continents extends Controller
{
function Continents()
{
parent::Controller();
// $this->load->helper('url');
}
function index()
{
$this->load->model('countriesmodel');
$continent = $this->uri->segment(3);
echo "xxx" . $continent;
$data['countries'] = $this->countriesmodel->getCountries($continent);
$this->load->view('continentview', $data);
}
}