public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST')) {
             $id = request::getInstance()->getPost(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::ID, true));
             $fecha = request::getInstance()->getPost(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::FECHA, true));
             $empleado = request::getInstance()->getPost(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true));
             salidaBodegaTableClass::validateUpdate($fecha, $empleado);
             $ids = array(salidaBodegaTableClass::ID => $id);
             $data = array(salidaBodegaTableClass::FECHA => $fecha, salidaBodegaTableClass::EMPLEADO => $empleado);
             salidaBodegaTableClass::update($ids, $data);
             session::getInstance()->setSuccess(i18n::__('succesUpdateS', null, 'bodega'));
             log::register('update', salidaBodegaTableClass::getNameTable());
             routing::getInstance()->redirect('bodega', 'indexSalida');
         } else {
             log::register(i18n::__('update'), salidaBodegaTableClass::getNameTable(), i18n::__('errorUpdateBitacora'));
             session::getInstance()->setError(i18n::__('errorUpdate'));
             routing::getInstance()->redirect('bodega', 'indexSalida');
         }
         //close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         if (request::getInstance()->hasRequest('filter')) {
             $report = request::getInstance()->getPost('filter');
             if (isset($report['fecha_inicio']) and $report['fecha_inicio'] !== null and $report['fecha_inicio'] !== '' and isset($report['fecha_fin']) and $report['fecha_fin'] !== null and $report['fecha_fin'] !== '') {
                 $where[salidaBodegaTableClass::getNameTable() . '.' . salidaBodegaTableClass::FECHA] = array(date(config::getFormatTimestamp(), strtotime($report['fecha_inicio'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($report['fecha_fin'] . ' 23.59.59')));
             }
             //close if
             if (isset($report['empleado']) and $report['empleado'] !== null and $report['empleado'] !== '') {
                 $where[salidaBodegaTableClass::getNameTable() . '.' . salidaBodegaTableClass::EMPLEADO] = $report['empleado'];
             }
         }
         $fields = array(salidaBodegaTableClass::ID, salidaBodegaTableClass::FECHA, salidaBodegaTableClass::EMPLEADO);
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $fJoin1 = salidaBodegaTableClass::EMPLEADO;
         $fJoin2 = empleadoTableClass::ID;
         $orderBy = array(salidaBodegaTableClass::ID);
         $this->mensaje = "Informe de Salidas de Bodega";
         $this->objSalida = salidaBodegaTableClass::getAllJoin($fields, $fieldsEmpleado, null, null, $fJoin1, $fJoin2, null, null, null, null, true, $orderBy, 'ASC', null, null, $where);
         log::register(i18n::__('reporte'), salidaBodegaTableClass::getNameTable());
         $this->defineView('index', 'salidaBodega', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public static function validateUpdate($fecha, $empleado)
 {
     $flag = false;
     $dateNow = date("Y-m-d", strtotime("now"));
     if (empty($fecha) or !isset($fecha) or $fecha == '') {
         session::getInstance()->setError(i18n::__(10055, null, 'errors'));
         $flag = true;
         session::getInstance()->setFlash(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::FECHA, true), true);
     }
     if ($fecha > $dateNow) {
         session::getInstance()->setError(i18n::__(10010, null, 'errors', array('%fecha%' => $fecha)));
         $flag = true;
         session::getInstance()->setFlash(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::FECHA, true), true);
     }
     if (empty($empleado) or !isset($empleado) or $empleado == '') {
         session::getInstance()->setError(i18n::__(10099, null, 'errors'));
         $flag = true;
         session::getInstance()->setFlash(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true), true);
     }
     if (!is_numeric($empleado)) {
         session::getInstance()->setError(i18n::__(10100, null, 'errors'));
         $flag = true;
         session::getInstance()->setFlash(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true), true);
     }
     if ($empleado < 0) {
         session::getInstance()->setError(i18n::__(10101, null, 'errors'));
         $flag = true;
         session::getInstance()->setFlash(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true), true);
     }
     if ($flag == true) {
         request::getInstance()->setMethod('GET');
         routing::getInstance()->forward('bodega', 'updateSalida');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             if (isset($filter['fecha_fin']) and $filter['fecha_fin'] !== null and $filter['fecha_fin'] !== '' and isset($filter['fecha_inicio']) and $filter['fecha_inicio'] !== null and $filter['fecha_inicio'] !== '') {
                 $where[salidaBodegaTableClass::getNameTable() . '.' . salidaBodegaTableClass::FECHA] = array(date(config::getFormatTimestamp(), strtotime($filter['fecha_inicio'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($filter['fecha_fin'] . ' 23.59.59')));
             }
             if (isset($filter['empleado']) and $filter['empleado'] !== null and $filter['empleado'] !== '') {
                 $where[salidaBodegaTableClass::EMPLEADO] = $filter['empleado'];
             }
             //close if
             session::getInstance()->setAttribute('salidaFilter', $where);
         } elseif (session::getInstance()->hasAttribute('salidaFilter')) {
             $where = session::getInstance()->getAttribute('salidaFilter');
         }
         //close if
         $fieldsSalida = array(salidaBodegaTableClass::EMPLEADO, salidaBodegaTableClass::ESTADO, salidaBodegaTableClass::FECHA, salidaBodegaTableClass::ID);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $fieldsEmpleado2 = array(empleadoTableClass::NOMBRE, empleadoTableClass::ID);
         $fJoin1 = salidaBodegaTableClass::EMPLEADO;
         $fJoin2 = empleadoTableClass::ID;
         $orderBy = array(salidaBodegaTableClass::ID);
         $fieldsInsumo = array(insumoTableClass::ID, insumoTableClass::NOMBRE);
         $fieldsTipoInsumo = array(tipoInsumoTableClass::ID, tipoInsumoTableClass::DESCRIPCION);
         $fieldsLote = array(loteTableClass::ID, loteTableClass::NOMBRE);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(salidaBodegaTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = salidaBodegaTableClass::getAllCount($f, true, $lines, $where);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         //close if
         $this->objTipoInsumo = tipoInsumoTableClass::getAll($fieldsTipoInsumo, false);
         $this->objInsumo = insumoTableClass::getAll($fieldsInsumo, true);
         $this->objLote = loteTableClass::getAll($fieldsLote, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado2, false);
         $this->objSalidaBodega = salidaBodegaTableClass::getAllJoin($fieldsSalida, $fieldsEmpleado, null, null, $fJoin1, $fJoin2, null, null, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('ver1', null, 'bodega'), salidaBodegaTableClass::getNameTable());
         $this->defineView('index', 'salidaBodega', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         $idVacunacion = request::getInstance()->getRequest(salidaBodegaTableClass::ID);
         if (request::getInstance()->hasRequest('report')) {
             $report = request::getInstance()->getPost('report');
             //                if (isset($report['fecha']) and $report['fecha'] !== null and $report['fecha'] !== '') {
             //                    $where[detalleVacunacionTableClass::FECHA] = $report['fecha'];
             //                }//close if
             if (isset($report['tipoInsumo']) and $report['tipoInsumo'] !== null and $report['tipoInsumo'] !== '') {
                 $where[detalleSalidaBodegaTableClass::TIPO_INSUMO] = $report['tipoInsumo'];
             }
             //close if
             if (isset($report['Insumo']) and $report['Insumo'] !== null and $report['Insumo'] !== '') {
                 $where[detalleSalidaBodegaTableClass::ID_INSUMO] = $report['Insumo'];
             }
             //close if
             if (isset($report['cantidad']) and $report['cantidad'] !== null and $report['cantidad'] !== '') {
                 $where[detalleSalidaBodegaTableClass::getNameTable() . '.' . detalleSalidaBodegaTableClass::CANDITDAD] = $report['cantidad'];
             }
             //close if
         }
         //close if
         $where[detalleSalidaBodegaTableClass::ID_SALIDA] = $idVacunacion;
         $fieldsDetalleSalidaBodega = array(detalleSalidaBodegaTableClass::ID, detalleSalidaBodegaTableClass::CANDITDAD);
         $fieldsS = array(salidaBodegaTableClass::ID);
         $fieldsTipo = array(tipoInsumoTableClass::DESCRIPCION);
         $fieldsInsumo = array(insumoTableClass::NOMBRE);
         $fJoin1 = detalleSalidaBodegaTableClass::ID_SALIDA;
         $fJoin2 = salidaBodegaTableClass::ID;
         $fJoin3 = detalleSalidaBodegaTableClass::TIPO_INSUMO;
         $fJoin4 = tipoInsumoTableClass::ID;
         $fJoin5 = detalleSalidaBodegaTableClass::ID_INSUMO;
         $fJoin6 = insumoTableClass::ID;
         $fieldsSalida = array(salidaBodegaTableClass::ID, salidaBodegaTableClass::FECHA);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $fJoinVacunacion1 = salidaBodegaTableClass::EMPLEADO;
         $fJoinVacunacion2 = empleadoTableClass::ID;
         $whereVacunacion = array(salidaBodegaTableClass::getNameTable() . "." . salidaBodegaTableClass::ID => $idVacunacion);
         $orderBy = array(detalleSalidaBodegaTableClass::ID);
         $this->objDetalleSalidaBodega = detalleSalidaBodegaTableClass::getAllJoin($fieldsDetalleSalidaBodega, $fieldsS, $fieldsTipo, $fieldsInsumo, $fJoin1, $fJoin2, $fJoin3, $fJoin4, $fJoin5, $fJoin6, true, $orderBy, 'ASC', $where);
         $this->objSalidaBodega = salidaBodegaTableClass::getAllJoin($fieldsSalida, $fieldsEmpleado, null, null, $fJoinVacunacion1, $fJoinVacunacion2, null, null, null, null, true, null, null, null, null, $whereVacunacion);
         $this->mensajeDetalle = "Informe de Detalles de Salida de Bodega";
         log::register(i18n::__('reporte'), detalleSalidaBodegaTableClass::getNameTable());
         $this->defineView('reportDetalle', 'bodega', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (session::getInstance()->hasAttribute('salidaFilter')) {
             session::getInstance()->deleteAttribute('salidaFilter');
         }
         //clse if
         routing::getInstance()->redirect('bodega', 'indexSalida');
         log::register(i18n::__('eliminar filtros'), salidaBodegaTableClass::getNameTable());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fecha = request::getInstance()->getPost(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::FECHA, true));
         $empleado = request::getInstance()->getPost(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true));
         salidaBodegaTableClass::validateCreate($fecha, $empleado);
         $data = array(salidaBodegaTableClass::EMPLEADO => $empleado, salidaBodegaTableClass::FECHA => $fecha, salidaBodegaTableClass::ESTADO => true);
         salidaBodegaTableClass::insert($data);
         session::getInstance()->setSuccess(i18n::__('succesCreate1', null, 'bodega'));
         log::register(i18n::__('create'), salidaBodegaTableClass::getNameTable());
         routing::getInstance()->redirect('bodega', 'indexSalida');
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(salidaBodegaTableClass::ID)) {
             $fieldsSalida = array(salidaBodegaTableClass::ID, salidaBodegaTableClass::FECHA, salidaBodegaTableClass::EMPLEADO);
             $where = array(salidaBodegaTableClass::ID => request::getInstance()->hasRequest(salidaBodegaTableClass::ID));
             $fieldsEmpleado2 = array(empleadoTableClass::NOMBRE, empleadoTableClass::ID);
             $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado2, false);
             $this->objSalidaBodega = salidaBodegaTableClass::getAll($fieldsSalida, true, null, null, null, null, $where);
             $this->defineView('edit', 'salidaBodega', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('bodega', 'indexSalida');
         }
         //close if
     } 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(salidaBodegaTableClass::getNameField(salidaBodegaTableClass::ID, true));
             $ids = array(salidaBodegaTableClass::ID => $id);
             $this->arrayAjax = array('code' => 11, 'msg' => 'La eliminacion ha sido exitosa');
             salidaBodegaTableClass::stateToToggle($ids);
             session::getInstance()->setSuccess(i18n::__('succesDelete1', null, 'bodega'));
             //                log::register(i18n::__('delete'), detalleVacunacionTableClass::getNameTable());
             $this->defineView('delete', 'salidaBodega', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('bodega', 'indexEntrada');
         }
         //close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(detalleSalidaBodegaTableClass::ID)) {
             $fields = array(detalleSalidaBodegaTableClass::ID, detalleSalidaBodegaTableClass::ID_SALIDA, detalleSalidaBodegaTableClass::TIPO_INSUMO, detalleSalidaBodegaTableClass::ID_INSUMO, detalleSalidaBodegaTableClass::CANDITDAD);
             $where = array(detalleSalidaBodegaTableClass::ID => request::getInstance()->getRequest(detalleSalidaBodegaTableClass::ID));
             $fieldsTipo = array(tipoInsumoTableClass::ID, tipoInsumoTableClass::DESCRIPCION);
             $fieldsInsumo = array(insumoTableClass::ID, insumoTableClass::NOMBRE);
             $fieldsSalida = array(salidaBodegaTableClass::ID);
             $this->objTipo = tipoInsumoTableClass::getAll($fieldsTipo, true);
             $this->objSalida = salidaBodegaTableClass::getAll($fieldsSalida, true);
             $this->objInsumo = insumoTableClass::getAll($fieldsInsumo, true);
             $this->objDetalleSalida = detalleSalidaBodegaTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->defineView('edit', 'detalleSalidaBodega', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('bodega', 'indexDetalleSalida');
         }
         //close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
                                <a href="#close" title="Close" class="close">X</a>
                                <div class="modal-body">
                                    <?php 
    echo i18n::__('confirmInhabil');
    ?>
                                </div>
                                <div class="modal-footer">
                                    <a href="#close2" title="Close" class="close2 btn btn-default fa fa-times-circle-o close2"> <?php 
    echo i18n::__('cancel');
    ?>
</a>
                                    <button type="button" class="btn btn-primary fa fa-ban" onclick="eliminar(<?php 
    echo $key->{$id};
    ?>
, '<?php 
    echo salidaBodegaTableClass::getNameField(salidaBodegaTableClass::ID, true);
    ?>
', '<?php 
    echo routing::getInstance()->getUrlWeb('bodega', 'deleteSalida');
    ?>
')"> <?php 
    echo i18n::__('inhabil');
    ?>
</button>
                                </div>
                            </div>
                        </div>

                        <!-- WINDOWS MODAL DETAILS -->
                        <div id="myModalInserDetails<?php 
    echo $key->{$id};
 public function execute()
 {
     try {
         $where = null;
         //      if (request::getInstance()->hasRequest(entradaBodegaTableClass::ID)) {
         $idSalida = request::getInstance()->getRequest(detalleSalidaBodegaTableClass::ID);
         $where = null;
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             if (isset($filter['tipoInsumo']) and $filter['tipoInsumo'] !== null and $filter['tipoInsumo'] !== '') {
                 $where[detalleEntradaBodegaTableClass::TIPO_INSUMO] = $filter['tipoInsumo'];
             }
             //close if
             if (isset($filter['Insumo']) and $filter['Insumo'] !== null and $filter['Insumo'] !== '') {
                 $where[detalleEntradaBodegaTableClass::ID_INSUMO] = $filter['Insumo'];
             }
             //close if
             if (isset($filter['cantidad']) and $filter['cantidad'] !== null and $filter['cantidad'] !== '') {
                 $where[detalleEntradaBodegaTableClass::CANDITDAD] = $filter['cantidad'];
             }
             //close if
             $where[detalleSalidaBodegaTableClass::ID_SALIDA] = $idSalida;
             session::getInstance()->setAttribute('detalleSalida', $where);
         } elseif (session::getInstance()->hasAttribute('detalleSalida')) {
             $where = session::getInstance()->getAttribute('detalleSalida');
         } else {
             $where = array(detalleSalidaBodegaTableClass::ID_SALIDA => $idSalida);
         }
         //close if
         $fieldsSalida = array(salidaBodegaTableClass::ID, salidaBodegaTableClass::FECHA);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $whereSalida = array(salidaBodegaTableClass::getNameTable() . '.' . salidaBodegaTableClass::ID => $idSalida);
         $fJoinEntrada1 = salidaBodegaTableClass::EMPLEADO;
         $fJoinEntrada2 = empleadoTableClass::ID;
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(detalleSalidaBodegaTableClass::ID);
         $whereCnt = array(detalleSalidaBodegaTableClass::ID_SALIDA => $idSalida);
         $lines = config::getRowGrid();
         $fieldsDetalleSalida = array(detalleSalidaBodegaTableClass::ID, detalleSalidaBodegaTableClass::CANDITDAD, detalleSalidaBodegaTableClass::ID_SALIDA);
         $fieldsDetalleInsumo = array(insumoTableClass::NOMBRE);
         $fieldsDetalleTipoInsumo = array(tipoInsumoTableClass::DESCRIPCION);
         $fieldsL = array(loteTableClass::NOMBRE);
         $fJoin1 = detalleSalidaBodegaTableClass::ID_INSUMO;
         $fJoin2 = insumoTableClass::ID;
         $fJoin3 = detalleSalidaBodegaTableClass::TIPO_INSUMO;
         $fJoin4 = tipoInsumoTableClass::ID;
         $fJoin5 = detalleSalidaBodegaTableClass::LOTE;
         $fJoin6 = loteTableClass::ID;
         $fieldsInsumo = array(insumoTableClass::ID, insumoTableClass::NOMBRE);
         $fieldsTipoInsumo = array(tipoInsumoTableClass::ID, tipoInsumoTableClass::DESCRIPCION);
         $fieldsLote = array(loteTableClass::ID, loteTableClass::NOMBRE);
         $this->objTipoInsumo = tipoInsumoTableClass::getAll($fieldsTipoInsumo, false);
         $this->objInsumo = insumoTableClass::getAll($fieldsInsumo, true);
         $this->objLote = loteTableClass::getAll($fieldsLote, true);
         $this->cntPages = detalleSalidaBodegaTableClass::getAllCount($f, true, $lines, $whereCnt);
         $this->objSalida = salidaBodegaTableClass::getAllJoin($fieldsSalida, $fieldsEmpleado, null, null, $fJoinEntrada1, $fJoinEntrada2, null, null, null, null, true, null, null, config::getRowGrid(), $page, $whereSalida);
         $this->objDetalleSalida = detalleSalidaBodegaTableClass::getAllJoin($fieldsDetalleSalida, $fieldsDetalleInsumo, $fieldsDetalleTipoInsumo, $fieldsL, $fJoin1, $fJoin2, $fJoin3, $fJoin4, $fJoin5, $fJoin6, false, null, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('ver3', null, 'bodega'), detalleSalidaBodegaTableClass::getNameTable());
         $this->defineView('view', 'salidaBodega', session::getInstance()->getFormatOutput());
         //      } else {
         //        session::getInstance()->setError('pailas');
         //        routing::getInstance()->redirect('vacunacion', 'indexVacunacion');
         //      }//close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
Esempio n. 13
0
echo salidaBodegaTableClass::getNameField(salidaBodegaTableClass::FECHA, true);
?>
">
              </th>   

            </tr>
            <tr>
              <th>  
                <?php 
echo i18n::__('empleado', NULL, 'empleado');
?>
:
              </th>
              <th> 
                <select name="<?php 
echo salidaBodegaTableClass::getNameField(salidaBodegaTableClass::EMPLEADO, true);
?>
">
                  <option value="">...</option>
                  <?php 
foreach ($objEmpleado as $key) {
    ?>
                    <option value="<?php 
    echo $key->{$id};
    ?>
"> <?php 
    echo $key->{$nombreEmpleado};
    ?>
</option>
                  <?php 
}