Exemplo n.º 1
0
 protected function process()
 {
     /// declaramos los objetos sólo para asegurarnos de que existen las tablas
     $albaran_cli = new albaran_cliente();
     $albaran_pro = new albaran_proveedor();
     $this->mostrar = 'stats';
     if (isset($_REQUEST['mostrar'])) {
         $this->mostrar = $_REQUEST['mostrar'];
     }
     $this->tipo = 'ventas';
     if (isset($_REQUEST['tipo'])) {
         $this->tipo = $_REQUEST['tipo'];
     }
     if ($this->mostrar == 'listado') {
         $this->desde = Date('1-m-Y');
         $this->hasta = Date('d-m-Y', mktime(0, 0, 0, date("m") + 1, date("1") - 1, date("Y")));
         if (isset($_POST['desde'])) {
             $this->desde = $_POST['desde'];
             $this->hasta = $_POST['hasta'];
         }
         if ($this->tipo == 'ventas') {
             $this->resultados = $albaran_cli->all_desde($this->desde, $this->hasta);
         } else {
             $this->resultados = $albaran_pro->all_desde($this->desde, $this->hasta);
         }
     }
 }