Example #1
0
 function ventas()
 {
     $linea = new Linea();
     $vendedor = new Actor();
     if (count($_REQUEST) == 6) {
         $tamanio = 10;
         $ordenVenta = new OrdenVenta();
         $linea = new Linea();
         $vendedor = new Actor();
         $data['linea'] = $linea->listadoLineas('idpadre=0');
         $data['vendedor'] = $vendedor->listadoVendedoresTodos();
         $data['Paginacion'] = $ordenVenta->Paginacion($tamanio);
         $data['Pagina'] = 1;
         $this->view->show('/reporte/ventas.phtml', $data);
     } else {
         $idLinea = $_REQUEST['linea'];
         $idVendedor = $_REQUEST['vendedor'];
         $fInicial = $_REQUEST['fechaInicial'];
         $fFinal = $_REQUEST['fechaFinal'];
         $ordenVenta = new OrdenVenta();
         $data = $ordenVenta->listadoReporteVentas($idLinea, $idVendedor, $fInicial, $fFinal);
         //$data = $ordenVenta->listadoReporteVentas($idLinea, $idVendedor, '2012/09/07', '2012/09/07');
         //$objeto = $this->formatearparakui($data);
         //header("Content-type: application/json");
         echo json_encode($data);
     }
 }