Last active
August 29, 2015 14:12
-
-
Save mrios/ee670259898043c5a2b2 to your computer and use it in GitHub Desktop.
Controlador para el formulario de Turnos de Enfermería
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class turnoenfermeria_form extends generic_controller_form_lite { | |
public function __construct() { | |
parent::__construct(); | |
//Seteo de los parametros basicos del controlador | |
$this->setTitle('Turnos Enfermeria'); | |
$this->setModel('turnosEnfermeria'); | |
$this->setModule('admin'); | |
$this->setHeading('Enfermeria'); | |
$this->setFieldsToSave(array('nombre')); | |
$this->setRules('generic'); | |
} | |
public function index($id = null){ | |
$vars['title'] | |
= 'Turnos de Enfermeria'; | |
$model | |
= 'turnoenfermeria'; | |
$vars['model'] | |
= $model; | |
$vars['controller'] | |
= 'Admin/'.$model; | |
$vars['programa'] | |
= $this->doctrine | |
->em | |
->getRepository('\Admin\TurnoEnfermeria') | |
->findOneById($id) | |
; | |
$this->load->view('enfermeria_form_view', $vars); | |
} | |
public function save() { | |
$data = array(); | |
$data['id'] = (int)$this->input->post('id'); | |
$data['codigo'] = trim($this->input->post('codigo')); | |
$data['fecha_inicio'] = trim($this->input->post('fecha_inicio')); | |
$data['fecha_fin'] = trim($this->input->post('fecha_fin')); | |
echo json_encode( | |
$this->doctrine->em->getRepository('\Admin\Admin')->save($data) | |
); | |
} | |
public function delete($id){ | |
$this->deleteLogic($id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment