[eluser]Linkark07[/eluser]
On the textbox form, if I use a static value on the model function everything works fine, and each textbox is populated. But if I try to pass the value from the dropdown then these messages appear:
Message: Undefined variable: info
Message: Missing argument 1 for Participante_model::obtenerdatosgrupo(), called in C:\xampp\htdocs\educcont\application\controllers\site.php on line 116 and defined
Here is the code:
Dropdown view
Code:
<?=form_open(base_url().'site/buscarcurso', $attributes)?>
<label>Curso</label><select class="cursos" id="cursos" name="cursos">
</br>
<?php
foreach($grupos as $row)
{
echo '<option value="'.$row->nombre.'">'.$row->nombre.'</option>';
}
?>
</select><p></p>
<input type="submit" name="submit" value="Confirmar Datos" />
<?=form_close()?>
Controller
Code:
public function buscarcurso(){
$nombre = $this->input->post('cursos');
$info = array ('nombre' => $nombre);
// $this->load->view("prueba", $info);
$buscanombre = $this->participante_model->obtenerdatosgrupo($info);
$this->confirma_inscr()
}
Model
Code:
public function obtenerdatosgrupo($info){
$nombre = $info['nombre'];
$this->db->select('nombre, Horas, Costo');
$this->db->where('nombre', $nombre);
$query = $this->db->get('curso');
if($query->num_rows()== 1){
return $query->result();
} // else {
// redirect(base_url().'site/inscribir','refresh');
// }
}