public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST')) {
             $id = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::ID, true));
             $fecha = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::FECHA_NACIMIENTO, true));
             $hembras = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::HEMBRAS_NACIDAS_VIVAS, true));
             $machos = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::MACHOS_NACIDOS_VIVOS, true));
             $muertos = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::NACIDOS_MUERTOS, true));
             //                $raza = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::RAZA_ID, true));
             $animal_id = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::ANIMAL_ID, true));
             //  $fecha = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::FECHA_NACIMIENTO, true));
             //                $caracteres = validator::getInstance()->validatorCharactersSpecial($nombre);
             //
             //                if ($caracteres == true) {
             //                    throw new PDOException(i18n::__(10005, null, 'errors', null, 10005));
             //                }
             $ids = array(registroPartoTableClass::ID => $id);
             $data = array(registroPartoTableClass::FECHA_NACIMIENTO => $fecha, registroPartoTableClass::HEMBRAS_NACIDAS_VIVAS => $hembras, registroPartoTableClass::MACHOS_NACIDOS_VIVOS => $machos, registroPartoTableClass::NACIDOS_MUERTOS => $muertos, registroPartoTableClass::ANIMAL_ID => $animal_id);
             registroPartoTableClass::update($ids, $data);
             session::getInstance()->setSuccess(i18n::__('succesUpdate', null, 'parto'));
             log::register(i18n::__('update'), registroPartoTableClass::getNameTable());
             routing::getInstance()->redirect('animal', 'indexRegistroParto');
         } else {
             log::register(i18n::__('update'), registroPartoTableClass::getNameTable(), i18n::__('errorUpdateBitacora'));
             session::getInstance()->setError(i18n::__('errorUpdate'));
             routing::getInstance()->redirect('animal', 'indexRegistroParto');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST')) {
             $fecha = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::FECHA_NACIMIENTO, true));
             $hembras = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::HEMBRAS_NACIDAS_VIVAS, true));
             $machos = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::MACHOS_NACIDOS_VIVOS, true));
             $muertos = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::NACIDOS_MUERTOS, true));
             //                $raza = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::RAZA_ID, true));
             $animal_id = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::ANIMAL_ID, true));
             //                $caracteres = validator::getInstance()->validatorCharactersSpecial($nombre);
             //
             //                if ($caracteres == true) {
             //                    throw new PDOException(i18n::__(10005, null, 'errors', null, 10005));
             //                }
             //                loteTableClass::validatCreate($nombre);
             $fieldsAnimal = array(hojaVidaTableClass::ANIMAL, hojaVidaTableClass::ID, hojaVidaTableClass::PARTO, hojaVidaTableClass::GENERO_ID);
             $whereAnimal = array(hojaVidaTableClass::ANIMAL => $animal_id, hojaVidaTableClass::GENERO_ID => 1);
             $objAnimal = hojaVidaTableClass::getAll($fieldsAnimal, true, null, null, null, null, $whereAnimal);
             //                print_r($objAnimal);
             //                exit();
             $flag = false;
             if ($objAnimal[0]->numero_parto > 5) {
                 session::getInstance()->setError("Disponible para la Venta");
                 $flag = true;
                 session::getInstance()->setFlash(animalTableClass::getNameField(animalTableClass::PESO, true), true);
             }
             if ($flag == true) {
                 request::getInstance()->setMethod('GET');
                 routing::getInstance()->forward('animal', 'insertRegistroParto');
             }
             $partosAnimal = $objAnimal[0]->numero_parto + 1;
             $idAnimalInventario = array(hojaVidaTableClass::ANIMAL => $animal_id);
             $dataAnimal = array(hojaVidaTableClass::PARTO => $partosAnimal);
             hojaVidaTableClass::update($idAnimalInventario, $dataAnimal);
             $data = array(registroPartoTableClass::FECHA_NACIMIENTO => $fecha, registroPartoTableClass::HEMBRAS_NACIDAS_VIVAS => $hembras, registroPartoTableClass::MACHOS_NACIDOS_VIVOS => $machos, registroPartoTableClass::NACIDOS_MUERTOS => $muertos, registroPartoTableClass::ANIMAL_ID => $animal_id);
             registroPartoTableClass::insert($data);
             session::getInstance()->setSuccess(i18n::__('succesCreate', null, 'parto'));
             log::register(i18n::__('create'), registroPartoTableClass::getNameTable());
             routing::getInstance()->redirect('animal', 'indexRegistroParto', array(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL) => $animal_id));
         } else {
             log::register(i18n::__('create'), registroPartoTableClass::getNameTable(), i18n::__('errorCreateBitacora'));
             session::getInstance()->setError(i18n::__('errorCreate'));
             routing::getInstance()->redirect('animal', 'indexRegistroParto');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST') and request::getInstance()->isAjaxRequest()) {
             $id = request::getInstance()->getPost(registroPartoTableClass::getNameField(registroPartoTableClass::ID, true));
             $ids = array(registroPartoTableClass::ID => $id);
             registroPartoTableClass::delete($ids, true);
             $this->arrayAjax = array('code' => 11, 'msg' => 'La eliminacion ha sido exitosa');
             $this->defineView('delete', 'registroParto', session::getInstance()->getFormatOutput());
             log::register(i18n::__('delete'), registroPartoTableClass::getNameTable());
             session::getInstance()->setSuccess(i18n::__('succesDelete'));
         } else {
             log::register(i18n::__('delete'), registroPartoTableClass::getNameTable(), i18n::__('errorDeleteBitacora'));
             session::getInstance()->setError(i18n::__('errorDelete'));
             routing::getInstance()->redirect('animal', 'indexRegistroParto');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
echo $count;
?>
, '<?php 
echo routing::getInstance()->getUrlWeb('animal', 'indexRegistroParto');
?>
')" id="anterior"><a href="#" aria-label="Previous"><span aria-hidden="true">&Gg;</span></a></li>
                    </ul>
                </nav>
            </div>

            <form id="frmDelete" action="<?php 
echo routing::getInstance()->getUrlWeb('animal', 'deleteRegistroParto');
?>
" method="POST">
                <input type="hidden" id="idDelete" name="<?php 
echo registroPartoTableClass::getNameField(registroPartoTableClass::ID, true);
?>
">
            </form>
        </div>


        <!-- WINDOWS MODAL FILTERS -->
        <div id="myModalFilter" class="modalmask">
            <div class="modalbox rotate">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel"><?php 
echo i18n::__('buscar');
?>
</h4>
                </div>