Esempio n. 1
0
 public function insertRDV()
 {
     $BDagenda = new AgendaModel();
     // Insertion nouveau RDV
     $BDagenda->datedebut = $this->params('new_datedebut');
     $BDagenda->datefin = $this->params('new_datefin');
     $BDAgenda->heuredebut = $this->params('new_heuredebut');
     $BDAgenda->heurefin = $this->params('new_heurefin');
     $BDagenda->repetition = $this->params('new_repetition');
     $BDagenda->lieu = $this->params('new_lieu');
     $BDagenda->sujet = $this->params('new_sujet');
     $BDagenda->commentaire = $this->params('new_com');
     $BDagenda->insert();
     // Recuperation de l'id insere
     $BDagenda->datedebut = $this->params('new_datedebut');
     $BDagenda->datefin = $this->params('new_datefin');
     $BDAgenda->heuredebut = $this->params('new_heuredebut');
     $BDAgenda->heurefin = $this->params('new_heurefin');
     $BDagenda->repetition = $this->params('new_repetition');
     $BDagenda->lieu = $this->params('new_lieu');
     $BDagenda->sujet = $this->params('new_sujet');
     $BDagenda->commentaires = $this->params('new_com');
     $BDagenda->get(array('datedebut', 'datefin', 'repetition', 'lieu', 'sujet'));
     $id = $BDagenda->id;
     // Completer la table de correspondance
     $BDagendautilisateur = new AgendaUtilisateurModel();
     $BDagendautilisateur->agenda = $id;
     $BDUtil = new UtilisateurModel();
     $BDUtil->login = $this->session('login');
     $BDUtil->get(array('login'));
     $BDagendautilisateur->utilisateur = $BDUtil->id;
     $this->redirect('agenda/default/index');
 }
 public function deleteagendasearchAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $tabela = new AgendaModel();
     $id = $this->_request->getPost("id");
     $agenda = $tabela->find($id)->current();
     $agenda->delete();
 }