Ejemplo n.º 1
0
 public function editar()
 {
     if ($_POST) {
         $datos = $this->input->post('Datos');
         $this->form_validation->set_error_delimiters('<span class="error-form">', '</span>');
         $this->form_validation->set_rules('Datos[manadas]', 'Manadas', 'trim|required|numeric|max_length[2]|xss_clean');
         $this->form_validation->set_rules('Datos[campos]', 'Campos', 'trim|required|numeric|max_length[2]|xss_clean');
         $this->form_validation->set_rules('Datos[edad_limite]', 'Edad Limite', 'trim|required|numeric|max_length[2]|xss_clean');
         $this->form_validation->set_rules('Datos[nombres_campos]', 'Nombre de Campos', 'trim|required|xss_clean');
         if ($this->form_validation->run()) {
             if ($this->ajuste->actualizar('rally', $this->input->post('Datos'))) {
                 $msg['title'] = 'Configuración Actualizada';
                 $msg['text'] = sprintf('La configuración ha sido actualizada.');
                 $msg['image'] = relative_root('img/checkmark_64.png');
                 $dialog = jgritter_script($msg);
                 $this->session->set_flashdata('extrascript', $dialog);
                 redirect('ajustes');
             }
         }
     } else {
         $this->ajuste->consultar();
         $datos = $this->ajuste->datos[0];
     }
     $this->template->add_js('js/jquery.uniform.js');
     $this->template->write('content', '<h1 class="titulo_seccion">Modificar Parámetros</h1>');
     $this->template->write_view('content', 'form', $datos);
     $this->template->render();
 }
Ejemplo n.º 2
0
 public function nuevo()
 {
     $this->template->add_js('js/jquery.uniform.js');
     $this->template->add_js('js/jquery.gritter.min.js');
     $this->template->add_css('temas/registro/css/jquery.gritter.css');
     $this->template->write('content', '<h1 class="titulo_seccion">Registro de Nuevo Staff</h1>');
     if ($_POST) {
         $datos['extra'] = '';
         $msg = array();
         $this->form_validation->set_rules('cum', 'CUM', 'trim|required|exact_length[10]|xss_clean');
         $this->form_validation->set_error_delimiters('<span class="error-form">', '</span>');
         if ($this->form_validation->run()) {
             $err = $this->miembro->validar_staff($this->input->post('cum'));
             $arreglo = array('cum' => strtoupper($this->input->post('cum')));
             if (sizeof($err) == 0) {
                 $this->servicio->agregar($arreglo);
                 $msg['title'] = 'Staff Agregado';
                 $msg['text'] = sprintf('El miembro %s ha sido agregado al listado del Staff.', $this->miembro->nombre);
                 $msg['image'] = relative_root('img/checkmark_64.png');
                 $dialog = jgritter_script($msg);
                 $this->session->set_flashdata('extrascript', $dialog);
                 redirect('staff');
             } else {
                 $msg['title'] = 'Staff No Válido';
                 $msg['text'] = '';
                 if (array_key_exists('noexiste', $err)) {
                     $msg['text'] .= 'El CUM no se encuentra registrado o no existe. ';
                 } else {
                     if (array_key_exists('membresia', $err)) {
                         $msg['text'] .= 'La membresia se encuentra vencida. ';
                     }
                     if (array_key_exists('nivel', $err)) {
                         $msg['text'] .= 'No tiene el cargo apropiado para ser staff. ';
                     }
                 }
             }
         } else {
             $msg['title'] = 'Verificar CUM';
             $msg['text'] = 'La información proporcionada no parece ser válida.';
         }
         $msg['image'] = relative_root('img/error_64.png');
         $msg['sticky'] = TRUE;
         $datos['extra'] = jgritter_script($msg);
         $datos['cum'] = $this->input->post('cum');
     } else {
         $datos['cum'] = '';
         $datos['extra'] = '';
     }
     $this->template->write_view('content', 'cum', $datos);
     $this->template->render();
 }
Ejemplo n.º 3
0
 public function editar($id)
 {
     if ($_POST) {
         $datos = $this->input->post('Datos');
         $this->form_validation->set_error_delimiters('<span class="error-form">', '</span>');
         $this->form_validation->set_rules('Datos[nombre]', 'Nombre', 'required|trim');
         $this->form_validation->set_rules('Datos[capacidad]', 'Capacidad', 'required|integer|trim');
         $this->form_validation->set_rules('Datos[tipo]', 'Tipo', 'required|trim');
         if ($this->form_validation->run()) {
             if ($this->actividad->actualizar($id, $this->input->post('Datos'))) {
                 $msg['title'] = 'Actividad Actualizada';
                 $msg['text'] = sprintf('La actividad %s ha sido actualizada en el listado del sistema.', $datos['nombre']);
                 $msg['image'] = relative_root('img/checkmark_64.png');
                 $dialog = jgritter_script($msg);
                 $this->session->set_flashdata('extrascript', $dialog);
                 redirect('actividades');
             }
         }
     } else {
         $c = array('id' => $id);
         $this->actividad->consultar($c, 0, 1);
         $datos = $this->actividad->datos[0];
     }
     $this->template->write('content', '<h1 class="titulo_seccion">Editar datos de actividad</h1>');
     $this->template->write_view('content', 'form', $datos);
     $this->template->add_js('js/jquery.uniform.js');
     $this->template->render();
 }
Ejemplo n.º 4
0
 public function editar($id)
 {
     if ($_POST) {
         $datos = $this->input->post('Datos');
         $this->form_validation->set_error_delimiters('<span class="error-form">', '</span>');
         $this->form_validation->set_rules('Datos[nombre]', 'Nombre completo', 'trim|required|max_length[255]|xss_clean');
         $this->form_validation->set_rules('Datos[provincia]', 'Provincia', 'trim|required|max_length[255]|xss_clean');
         $this->form_validation->set_rules('Datos[nivel]', 'Nivel', 'trim|required|max_length[255]|xss_clean');
         $this->form_validation->set_rules('Datos[localidad]', 'Localidad', 'trim|required|max_length[255]|xss_clean');
         $this->form_validation->set_rules('Datos[grupo]', 'Grupo', 'trim|required|numeric|max_length[3]|xss_clean');
         $this->form_validation->set_rules('Datos[cum]', 'CUM', 'trim|required|exact_length[10]|xss_clean');
         $this->form_validation->set_rules('Datos[vigencia]', 'Vigencia', 'trim|required|exact_length[10]|xss_clean');
         if ($this->form_validation->run()) {
             if ($this->miembro->actualizar($id, $this->input->post('Datos'))) {
                 $msg['title'] = 'Miembro Actualizado';
                 $msg['text'] = sprintf('El miembro %s ha sido actualizado en el listado del REGNAL.', $datos['nombre']);
                 $msg['image'] = relative_root('assets/img/checkmark_64.png');
                 $dialog = jgritter_script($msg);
                 $this->session->set_flashdata('extrascript', $dialog);
                 redirect('regnal');
             }
         }
     } else {
         $c = array('cum' => $id);
         $this->miembro->consultar($c, 0, 1);
         $datos = $this->miembro->datos[0];
     }
     $datos['provincia'] = $this->miembro->combo_provincias($datos['provincia']);
     $datos['nivel'] = $this->miembro->combo_nivel($datos['nivel']);
     $this->template->add_js('assets/js/jquery.uniform.js');
     $this->template->write('content', '<h1 class="titulo_seccion">Modificar Miembro</h1>');
     $this->template->write_view('content', 'form', $datos);
     $this->template->render();
 }
Ejemplo n.º 5
0
 public function cuenta()
 {
     $id = $this->session->userdata('ses_idusuario');
     if ($_POST) {
         $this->form_validation->set_error_delimiters('<span class="error-form">', '</span>');
         $this->form_validation->set_rules('Datos[nombre]', 'Nombre', 'trim|required|xss_clean');
         if (!empty($_POST['Datos']['pass'])) {
             $this->form_validation->set_rules('Datos[pass]', 'Contraseña', 'trim|required|min_length[8]|max_length[15]|matches[repetir]|md5');
             $this->form_validation->set_rules('repetir', 'Repetir contraseña', 'trim|required|min_length[8]|max_length[15]');
         } else {
             unset($_POST['Datos']['pass']);
         }
         if ($this->form_validation->run()) {
             if ($this->usuario->actualizar($id, $this->input->post('Datos'))) {
                 $msg['title'] = 'Cuenta Actualizada';
                 $msg['text'] = sprintf('Los datos de su cuenta han sido actualizados.');
                 $msg['image'] = relative_root('assets/img/checkmark_64.png');
                 $script = '$(function() { ' . jgritter_script($msg) . '});';
                 $this->template->add_js('assets/js/jquery.gritter.min.js');
                 $this->template->add_css('assets/css/jquery.gritter.css');
                 $this->template->add_js($script, 'embed');
                 $this->session->set_userdata('ses_nombre', $_POST['Datos']['nombre']);
             }
         }
     }
     $c = array('id' => $id);
     $this->usuario->consultar($c);
     $datos = $this->usuario->datos[0];
     $this->template->add_js('assets/js/jquery.uniform.js');
     $this->template->write('content', '<h1 class="titulo_seccion">Información de Cuenta</h1>');
     $this->template->write_view('content', 'cuenta', $datos);
     $this->template->render();
 }