<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use URL;
use Session;
use Illuminate\Support\Facades\Http;
class PostController extends Controller
{



    public function index(Request $request)

    {

       $response = Http::get('https://192.168.18.168/prl_api/oj/key_reg.php',['reg_key'=>$request->reg_key]);

    

        $jsonData = $response->json();
       
       

          return $jsonData;

     

    } 
    public function fetch_emp_cat(Request $request)

    {

//dd($request);
        $urls="https://192.168.18.168/prl_api/ij/".$request->url1;
       $response = Http::get($urls,['cid'=>$request->cid,'row_id'=>$request->row_id,'CID'=>$request->CID,'emp_cat_id'=>$request->emp_cat_id]);


        $jsonData = $response->json();
      
       

          return $jsonData;

     

    }



    public function get_data(Request $request)

    {


        $urls="https://192.168.18.168/prl_api/ij/".$request->url1;
       $response = Http::get($urls,['cid'=>$request->cid,'row_id'=>$request->row_id,'CID'=>$request->CID,'b_id'=>$request->b_id]);

        $jsonData = $response->json();
      
       

          return $jsonData;

     

    }
    public function get_data_shdl(Request $request)

    {


        $urls="https://192.168.18.168/prl_api/ij/".$request->url1;
       $response = Http::get($urls,['cid'=>$request->cid,'row_id'=>$request->row_id,'CID'=>$request->CID,'emp_id'=>$request->emp_id]);

        $jsonData = $response->json();
      
       

          return $jsonData;

     

    }



    
    public function store_data(Request $request)

    {

//dd($request);
        $urls="https://192.168.18.168/prl_api/ij/".$request->url1;
       $response = Http::get($urls,['json_data'=>$request->json_data]);


        $jsonData = $response->json();
       


          return $jsonData;

     

    }


}
