[eluser]Soltic[/eluser]
Hi, i changed my code Controller and it look this:
Code:
<?php
class insertsms extends CI_Controller {
function __construct()
{
parent::__construct();
}
function journalier()
{
$this->form_validation->set_rules('structure','Structure','trim|required|xss_clean');
$this->form_validation->set_rules('patho[]','Patho','trim|required|xss_clean');
$this->form_validation->set_rules('tranche[]','Tranche','trim|required|xss_clean');
$this->form_validation->set_rules('nbcas[]');
$this->form_validation->set_message('required', 'Veuillez remplir les champs vides');
if($this->form_validation->run())
{
//$structure_id=$this->input->post('structure');
$date_sms=$this->input->post('datesms');
$pathoid=$this->input->post('patho');
$trancheid=$this->input->post('tranche');
$nb_cas=$this->input->post('nbcas');
for ($i=1; $i < count($pathoid); $i++) {
$data = array(
'structure_id' =>$this->input->post('structure'),
'date_sms' =>$this->input->post('datesms'),
'pathoid' =>$this->input->post('patho'.$i),
'trancheid' =>$this->input->post('tranche'.$i),
'nb_cas' =>$this->input->post('nbcas'.$i)
);
//$this->model_liste->create($data);
echo "<pre>";
print_r($data);
echo "</pre>";
}
}
else
{
$this->template->write_view('nav','navigation');
$this->template->write_view('logo','logo');
$this->template->render();
$test['result'] = $this->model_liste->getPathologie();
$test['result'] = $this->model_liste->getTrancheAge();
$this->load->write_view('content','vue_insertsms',$test);
}
}
}
?>
And when i print data i have this result:
Array
(
[structure_id] => 221779128978
[date_sms] => 2012/06/17 04:19
[pathoid] =>
[trancheid] =>
[nb_cas] =>
)
Array
(
[structure_id] => 221779128978
[date_sms] => 2012/06/17 04:19
[pathoid] =>
[trancheid] =>
[nb_cas] =>
)
Array
(
[structure_id] => 221779128978
[date_sms] => 2012/06/17 04:19
[pathoid] =>
[trancheid] =>
[nb_cas] =>
)
there are three field without value.
I need help
Thanks