0
Я хочу, чтобы показать конкретное изображение, когда значение строки возвращается из БДпоказать изображение со значением строки, используя, если заявление в CodeIgniter
Например: Когда значение возвращается как 1 я хочу показать
Но я знаю только код PHP в CodeIgniter я получаю сообщение об ошибке TN7
контроллер:
public function ajax_list()
{
$list = $this->person->get_datatables_vandaag();
$data = array();
$no = $_POST['start'];
foreach ($list as $person) {
$no++;
$row = array();
$current = $row[] = $person->doel;
if($current=='3') {echo 'image' ;}
elseif($current=='4') {echo 'image' ;}
elseif($current=='2') {echo 'image' ;}
elseif($current=='1') {echo 'image' ;}
$row[] = $person->firm;
$row[] = $person->name;
$row[] = $person->phone;
}
вид:
<table id="table" class="table table-striped table-bordered table-responsive" cellspacing="0" width="100%">
<thead>
<tr>
<th></th>
<th style="width:100px;">Firm</th>
<th style="width:100px;">Name</th>
<th style="width:75px;">number</th>
</tr>
</thead>
<tbody>
</tbody>
</table>