1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
public function index()
{
$this->load->model('queries');
$projet = $this->queries->getPosts();
$this->load->view('welcome_message',['projet'=>$projet]);
}
public function projet()
{
var_dump('test');
$this->load->library('form_validation');
$this->form_validation->set_rules('nomprojet','Nom projet','required');
$this->form_validation->set_rules('datedebut','Date début','required');
$this->form_validation->set_rules('datefin','Date fin','required');
if($this->form_validation->run() == FALSE)
{
$this->load->view('projet');
}
else{
$data = array(
'NOM_PROJET ' => $this->input->post('nomprojet'),
'DATE_DEBUT_PROJET' => $this->input->post('datedebut'),
'DATE_FIN_PROJET' => $this->input->post('datefin')
);
$this->db->insert('projet', $data);
$this->load->view('vehicule1');
j'ai bien la vue vehicule1 qui marche bien quand jessaie de validé ce second formulaire il me renvoi sur la page de projet je ne sais pas si j'ai loupé un truc votre aide serait la bienvenue. Merci d'avance
public function Vehicule1(){
$this->load->library('form_validation');
$this->form_validation->set_rules('amortissement','Catégorie','required');
$this->form_validation->set_rules('vehicule1','Quantité expert','required');
$this->form_validation->set_rules('distance','Prix terrain','required');
$this->form_validation->set_rules('quantite','Prix bureau','required');
$this->form_validation->set_rules('carburant','Appui technique','required');
$this->form_validation->set_rules('entretien','Appui administratif','required');
if($this->form_validation->run() == FALSE)
{
$this->load->view('Ajouterexpert1');
}
else{
$expert1 = array(
'AMORTISSEMENT_KM_CAT1' => $this->input->post('amortissement'),
'TYPE_CAT1' => $this->input->post('vehicule1'),
'DISTANCE_A_PARCOURIR_CAT1' => $this->input->post('distance'),
'QUANTITE_VEHICULE_CAT1' => $this->input->post('quantite'),
'PRIX_CARBURANT_CAT1' => $this->input->post('carburant'),
'ENTRETIENT_CAT1' => $this->input->post('entretien')
);
$this->db->insert('vehiculecat1', $expert1 );
$this->load->view('vehiculecat2');
}
} |
Partager