public function execute() { try { if (request::getInstance()->hasRequest(dpVentaTableClass::ID)) { $fields = array(dpVentaTableClass::ID, dpVentaTableClass::FECHA, dpVentaTableClass::USUARIO_ID, dpVentaTableClass::ANIMAL_ID, dpVentaTableClass::PESO_ANIMAL, dpVentaTableClass::PRECIO_ANIMAL); $where = array(dpVentaTableClass::ID => request::getInstance()->getRequest(dpVentaTableClass::ID)); $fields3 = array(usuarioBaseTableClass::ID, usuarioBaseTableClass::USER); $fields2 = array(animalBaseTableClass::ID); $fields4 = array(pVentaTableClass::ID); $this->objPventa = dpVentaTableClass::getAll4($fields4, false); $this->objUsuario = dpVentaTableClass::getAll3($fields3, true); $this->objAnimal = dpVentaTableClass::getAll2($fields2, false); $this->objdpVenta = dpVentaTableClass::getAll($fields, false, null, null, null, null, $where); $this->defineView('edit', 'dpVenta', session::getInstance()->getFormatOutput()); } else { routing::getInstance()->redirect('dpVenta', 'index'); } } catch (PDOException $exc) { echo $exc->getMessage(); echo '<br>'; echo '<pre>'; print_r($exc->getTrace()); echo '</pre>'; } }
public function execute() { try { $fields = array(dpVentaTableClass::ID, dpVentaTableClass::NUMERO_DOCUMENTO, dpVentaTableClass::FECHA, dpVentaTableClass::USUARIO_ID, dpVentaBaseTableClass::PESO_ANIMAL, dpVentaTableClass::PRECIO_ANIMAL, dpVentaTableClass::ANIMAL_ID); $this->objDventa = dpVentaTableClass::getAll($fields, false); $this->defineView('index', 'dpVenta', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { echo $exc->getMessage(); echo '<br>'; echo '<pre>'; print_r($exc->getTrace()); echo '</pre>'; } }
public function execute() { try { $where = null; $fields = array(dpVentaTableClass::ID, dpVentaTableClass::FECHA, dpVentaTableClass::USUARIO_ID, dpVentaTableClass::NUMERO_DOCUMENTO, dpVentaTableClass::PESO_ANIMAL, dpVentaTableClass::PRECIO_ANIMAL, dpVentaTableClass::ANIMAL_ID); $fields2 = array(usuarioTableClass::USER); $orderBy = array(dpVentaTableClass::ID); $this->objdpVenta = dpVentaTableClass::getAll($fields, false, $orderBy, 'ASC', null, null, $where); $this->mensaje = 'Informe de los facturas de venta en nuestro sistema'; $this->defineView('index', 'dpVenta', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { echo $exc->getMessage(); echo '<br>'; echo '<pre>'; print_r($exc->getTrace()); echo '</pre>'; } }
public function execute() { try { $fields = array(dpVentaBaseTableClass::ID, dpVentaBaseTableClass::ANIMAL_ID); $fields2 = array(animalBaseTableClass::ID); $fields3 = array(usuarioBaseTableClass::ID, usuarioBaseTableClass::USER); $fields4 = array(pVentaBaseTableClass::ID); $this->objdpVenta = dpVentaTableClass::getAll($fields, false); $this->objAnimal = dpVentaTableClass::getAll2($fields2); $this->objUsuario = dpVentaTableClass::getAll3($fields3, false); $this->objPventa = dpVentaTableClass::getAll4($fields4, false); $this->defineView('insert', 'dpVenta', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { echo $exc->getMessage(); echo '<br>'; echo '<pre>'; print_r($exc->getTrace()); echo '</pre>'; } }
public function execute() { try { if (request::getInstance()->isMethod('POST')) { $fecha = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::FECHA, true)); $numero_documento = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::NUMERO_DOCUMENTO, true)); $usuario_id = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::USUARIO_ID, true)); $peso_animal = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::PESO_ANIMAL, true)); $precio_animal = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::PRECIO_ANIMAL, true)); $animal_id = request::getInstance()->getPost(dpVentaTableClass::getNameField(dpVentaTableClass::ANIMAL_ID, true)); $data = array(dpVentaTableClass::FECHA => $fecha, dpVentaTableClass::NUMERO_DOCUMENTO => $numero_documento, dpVentaTableClass::USUARIO_ID => $usuario_id, dpVentaTableClass::PESO_ANIMAL => $peso_animal, dpVentaTableClass::PRECIO_ANIMAL => $precio_animal, dpVentaTableClass::ANIMAL_ID => $animal_id); dpVentaTableClass::insert($data); } routing::getInstance()->redirect('dpVenta', 'index'); } catch (PDOException $exc) { echo $exc->getMessage(); echo '<br>'; echo '<pre>'; print_r($exc->getTrace()); echo '</pre>'; } }
?> " type="text" name="<?php echo dpVentaTableClass::getNameField(dpVentaTableClass::PRECIO_ANIMAL, true); ?> " ></th> </tr> <tr> <th> <?php echo i18n::__('animal_id', NULL, 'dpVenta'); ?> :</th> <th> <input placeholder="<?php echo isset($objDventa) == FALSE ? i18n::__('animal_id', NULL, 'dpVenta') : ($objDventa[0]->{$animal_id} = ucwords($objDventa[0]->{$animal_id})); ?> " type="text" name="<?php echo dpVentaTableClass::getNameField(dpVentaTableClass::ANIMAL_ID, true); ?> " ></th> </tr> <tr> <th colspan="2"> <div class="titulo"> <input type="submit" value="<?php echo i18n::__(isset($objDventa) == TRUE ? 'edit' : 'register', NULL, 'dpVenta'); ?> "> </div> </th> </tr> </table>