【发布时间】:2017-08-31 12:16:25
【问题描述】:
我有一个观点
<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;
}
我需要在视图中有一张桌子,但在 get 参数的帮助下,我显示了锦标赛地图:
<?php echo base_url(); ?>tournaments?type=upcoming",
<?php echo base_url(); ?>tournaments?type=finished"
如何检查获取参数类型
【问题讨论】:
标签: codeigniter url get