<?php

namespace App\Http\Controllers;

use App\Models\FraccionesDerogadas;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\Bitacora;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\DB;

class FraccionesDerogadasController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
     
    }

    public function index_object(string $cliente, string $desc, string $offset, string $items)
    {
       
    }


    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Models\PartNumber  $partNumber
     * @return \Illuminate\Http\Response
     */
    public function show(PartNumber $partNumber)
    {
        return "operacion no permitida";//PartNumber::where("part_number",$partNumber)->first();
    }
    // public function getInfo(string $partNumber, string $customer)
    // {
    //     return PartNumber::where("part_number",$partNumber)->where("customer_id",$customer)->first();
    // }
    public function getInfo(Request $request)
    {
        dd($request);
        $infoFD=FraccionesDerogadas::where("last",$request->fraccion)->get();
        
        return $infoFD;
       
    }
    

    public function edit(Request $request, string $customer, string $numEntrada)
    {
      
    }

    public function edit_existing(string $partNumber_id)
    {
        
    }

    public function edit_existing_update_mode(string $partNumber_id, string $numEntrada)
    {
       
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\PartNumber  $partNumber
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, PartNumber $partNumber)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\PartNumber  $partNumber
     * @return \Illuminate\Http\Response
     */
    public function destroy(PartNumber $partNumber)
    {
      
    }

    public function getFracc()
    {
        //$infoFD=FraccionesDerogadas::All();
        $infoFD=DB::select('select * from bundle_types');
        
        return view('intern.fracciones.index',[
            'Fracc'=>$infoFD,
        ]);
        //return $infoFD;
    }
}
