pedi2/app/Http/Controllers/AdminController.php

36 lines
893 B
PHP

<?php
namespace App\Http\Controllers;
use App\GrupoDeCompra;
use Illuminate\Http\Request;
use Response;
class AdminController extends Controller
{
public function show()
{
return view('auth/admin_login');
}
public function index() {
return view('auth/admin_subpedidos');
}
public function exportarPlanillasAPdf(GrupoDeCompra $gdc) {
return $gdc->exportarPlanillasAPdf();
}
public function exportarPedidoACSV(GrupoDeCompra $gdc) {
$gdc->exportarPedidoEnCSV();
$file = resource_path('csv/exports/'.$gdc->nombre.'.csv');
return response()->download($file);
}
public function exportarPedidoConNucleosACSV(GrupoDeCompra $gdc) {
$gdc->exportarPedidoConNucleosEnCSV();
$file = resource_path('csv/exports/'.$gdc->nombre.'-completo.csv');
return response()->download($file);
}
}