Eduardo Fuerte
asked on
Could you point a way to form a view's combo based on Codeigniter's results?
Hi Experts
Could you point a way to form a view's combo based on Codeigniter's results?
Accordingly to:
Controller's code:
View's code:
The values are actually "hard coded"
I tryed to do this way:
Thanks in advance!
Could you point a way to form a view's combo based on Codeigniter's results?
Accordingly to:
Controller's code:
public function index() {
// SELECT/DROPDOWN - Seguradora
$fk_seguradora = $this->cliente_corporativo_model->new_get(array('query' => 'select * from system_seguradora'));
$dropdown[0] = 'Selecione ...';
foreach ($fk_seguradora as $key => $value)
$dropdown[$value->id_seguradora] = $value->nome_seguradora;
$this->data['fk_seguradora'] = form_dropdown('fk_seguradora', $dropdown, '', 'id="id_seguradora"');
unset($dropdown);
...
View's code:
The values are actually "hard coded"
<div class="row">
<div class="col-xs-12 mb15">
<div class="input-group">
<span class="input-group-addon ">
<i class="fa fa-search c-gray"></i>
</span>
<span class="select">
<select id="fk_seguradora" name="fk_seguradora">
<option value="" selected="selected">...Cliente Corporativo...</option>
<option value="1">Ace</option>
<option value="2">Zurich</option>
<option value="3">Banco Safra</option>
<option value="4">SANTANDER</option>
....
</select>
</span>
</div>
</div>
</div>
I tryed to do this way:
<div class="row">
<div class="col-xs-12 mb15">
<div class="input-group">
<span class="input-group-addon ">
<i class="fa fa-search c-gray"></i>
</span>
<span class="select">
<select id="fk_seguradora" name="fk_seguradora">
// A for-each at this point makes sense?? - I guess there is a better option.
<option value="<?php $id_seguradora?>"><?$fk_seguradora?></option>
</select>
</span>
</label>
</div>
</div>
</div>
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's more likely to be a CSS issues rather than a CodeIgniter one.
ASKER
I'm going to ask another question on this particular subject, since it has derivated from the initial question.
Thanks for help!
Thanks for help!
ASKER
You are perfectly right.
I'm the meanwhile I did this way:
Open in new window
Just a problem in correctly positionate the icon.