0
得到的参数我有一个观点Сodeigniter从URL
<div class="panel-body">
<div class="table-responsive">
<table id="mytable" class="table table-responsive table-striped table-bordered" cellspacing="0"
width-="100%">
<tbody>
<?php
foreach ($result as $row) {
if ($row->active == 1) {
foreach ($countries as $country) {
if ($country->id == $row->country) {
if ($this->session->userdata('language') == 3) {
$ccountry = $country->ro_name;
} else if ($this->session->userdata('language') == 2) {
$ccountry = $country->ru_name;
} else {
$ccountry = $country->name;
}
}
}
$time_sbs = substr($row->time, 0, 5);
echo '<tr ">
<td width="20%">' . $row->name . '</td>
<td width="10%">' . $row->date . ' ' . $time_sbs . '</td>
<td width="10%">' . $row->registration_date . '</td>
<td width="10%">' . $ccountry . '</td>
<td width="10%">' . $row->city . '</td>
<td width="10%">' . $row->address . ' </td>
<td width="20%">' . $row->description . '</td>
我从数据库中取样日期
function get_tournaments()
{
//data is retrive from this query
$query = $this->ci->db->query("SELECT * FROM tournaments WHERE date > CURDATE() ORDER BY date");
/*$query = $this->ci->db->query("SELECT * FROM tournaments");*/
return $query;
}
function get_tournaments_finished()
{
//data is retrive from this query
$query = $this->ci->db->query("SELECT * FROM tournaments WHERE date < CURDATE() ORDER BY date");
/*$query = $this->ci->db->query("SELECT * FROM tournaments");*/
return $query;
}
我需要在视图中的一个表,但随着帮助得到的参数,我发现比赛地图:
<?php echo base_url(); ?>tournaments?type=upcoming",
<?php echo base_url(); ?>tournaments?type=finished"
如何检查GET参数类型