Welcome Guest, Not a member yet? Register   Sign In
How to pass data from a one form to another
#3

[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>
            &lt;?php

            foreach($grupos as $row)
            {
              echo '<option value="'.$row->nombre.'">'.$row->nombre.'</option>';
            }
            ?&gt;
            </select><p></p>

              &lt;input type="submit" name="submit" value="Confirmar Datos" /&gt;
            
               &lt;?=form_close()?&gt;


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');
       // }

        
    }





Messages In This Thread
How to pass data from a one form to another - by El Forum - 08-06-2014, 01:30 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 03:18 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 03:45 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 04:45 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 05:16 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 05:55 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 06:36 PM
How to pass data from a one form to another - by El Forum - 08-06-2014, 07:13 PM
How to pass data from a one form to another - by El Forum - 08-07-2014, 07:29 AM
How to pass data from a one form to another - by El Forum - 08-07-2014, 09:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB