|
楼主 |
发表于 2009-7-1 17:10:20
|
显示全部楼层
$this->form_validation->set_error_delimiters('<div class="erreur">', '</div>');
//verifier si les champs sont bien rempli.
$this->form_validation->set_rules('civilite', 'Civilite', '');
$this->form_validation->set_rules('nom', 'NOM', 'trim|required|xss_clean');
$this->form_validation->set_rules('prenom','PRENOM','trim|required|xss_clean');
$this->form_validation->set_rules('voie','voie','trim|xss_clean');
$this->form_validation->set_rules('adresse','adresse','trim|xss_clean');
$this->form_validation->set_rules('adresse2','Complément adr.','trim|xss_clean');
$this->form_validation->set_rules('ville','VILLE','trim|required|xss_clean');
$this->form_validation->set_rules('cp','CODE POSTAL','trim|required|xss_clean');
$this->form_validation->set_rules('tel','Téléphone Fixe','trim|xss_clean');
$this->form_validation->set_rules('protable','Portable','trim|xss_clean');
$this->form_validation->set_rules('fax','Fax','trim|xss_clean');
$this->form_validation->set_rules('mail','E-mail','trim|valid_email|required|matches[mail2]');
$this->form_validation->set_rules('mail2','Confirmer E-mail','trim|valid_email|required');
//verifier si ts les champs de profil sont bien rempli
$this->form_validation->set_rules('profil', 'Profil', '');
$this->form_validation->set_rules('choixProfils', 'choixProfils', '');
$profil=$this->input->xss_clean($this->input->post('profil'));
if($profil == "personnalise"){
$this->form_validation->set_rules('statut', 'Statut', '');
$this->form_validation->set_rules('qualite', 'Qualité', '');
$this->form_validation->set_rules('categorie', 'Catégorie personne', '');
$this->form_validation->set_rules('imposable', 'Imposable', '');
$this->form_validation->set_rules('nbCharge', 'Nombre de personnes à charge', 'trim|required|xss_clean');
$this->form_validation->set_rules('revenu', 'Revenu', 'trim|required|xss_clean');
$this->form_validation->set_rules('dAchevement', 'Date d\'achèvement', 'trim|required|xss_clean');
$this->form_validation->set_rules('dAchat', 'Date d\'achat', 'callback_constru_check');
}
if ($this->form_validation->run() == FALSE)
{
//les champs sont pas bien rempli
$this->load->view('pro/crea_dossier1',$data);
}
else
{ //bien rempli, va étape suivante.
$this->load->model('pro/Dossier_m','',TRUE);//charger le Model Dossier_m
$this->Dossier_m->insert_coordonnees(); //insert les coordonnées de pariticulier dans la base de donnée
$id_par = $this->session->userdata('id_par');
$this->Dossier_m->insert_profil($id_par);
redirect('/pro/crea_dossier/etape_2', 'refresh');
}
你再看看这些呢. |
|