<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Curl\Curl;


class PageController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
     
     public function settings()
    {
        $set['compname'] = "International People's Bank of Europe";
        $set['shortname'] = "IPBOE";
        $set['shortnamex'] = "IPBOE";
        $set['email'] = "info@ipboe.com";
        $set['phone'] = "+44 7990 113901 ";
        $set['compname2'] = "IPBOE";
        $set['applink'] = "https://auth.ipboe.com/";
        
        $set['address'] = 'Quaves Road, Slough, SL3 7NU, UK | 80 Avenue du Prado. Marseille, France 13008';
     
        $set['tawk'] = 'https://embed.tawk.to/65b74d730ff6374032c5fc9b/1hla0d39n';
        
        return $set;
    }
     
     
     public function check()
    {
        $curl = new Curl();
        $curl->get('https://api.example.com/');
        
        if ($curl->error) {
            echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage . "\n";
        } else {
           // echo 'Response:' . "\n";
           // var_dump($curl->response);
            return response()->json($curl->response);
        }
    }


// BANKING PAGES

    public function index()
    {
        $data['title']='Home';
        $data['titlex']='Home';
        $data['settings']= (object) $this->settings();
        
        return view('index', $data);

    }
    
    public function contact()
    {
        $data['title']='Contact Us';
        $data['titlex']='Contact Us';
        $data['settings']= (object) $this->settings();
        
        return view('contact', $data);
    }
    
    
    public function personnalbanking()
    {
        $data['title']='Personnal Banking';
        $data['titlex']='Personnal';
        $data['settings']= (object) $this->settings();


        return view('personnalbanking', $data);
    }
    
    
    
    public function loans()
    {
        $data['title']='Loans';
        $data['titlex']='Loans';
        $data['settings']= (object) $this->settings();


        return view('loans', $data);
    }
    
    
    public function about()
    {
        $data['title']='About Us';
        $data['titlex']='About Us';
        $data['settings']= (object) $this->settings();


        return view('about', $data);
    }
    
    
    public function smallbusiness ()
    {
        $data['title']='Small Business Banking';
        $data['titlex']='Small Business';
        $data['settings']= (object) $this->settings();


        return view('smallbusiness ', $data);
    }
    
    
    public function commercial  ()
    {
        $data['title']='Commercial Banking';
        $data['titlex']='Commercial';
        $data['settings']= (object) $this->settings();


        return view('commercial  ', $data);
    }
    
    public function investment   ()
    {
        $data['title']='Investment  Banking';
        $data['titlex']='Investment';
        $data['settings']= (object) $this->settings();


        return view('investment   ', $data);
    }
// END BANKING PAGES
    
    public function security()
    {
        $data['title']='Security';
        $data['titlex']='Security';
        $data['settings']= (object) $this->settings();


        return view('security', $data);
    }
    
    
    public function bankguarantee()
    {
        $data['title']='Bank Guarantee';
        $data['titlex']='Guarantee';
        $data['settings']= (object) $this->settings();


        return view('bankguarantee', $data);
    }
    
    

    
            public function syndicated()
    {
        $data['title']='Syndicated Loan';
        $data['titlex']='Syndicated Loan';
        $data['settings']= (object) $this->settings();


        return view('syndicated', $data);
    }
    
    
            public function letterofcredit()
    {
        $data['title']='Letter of Credit';
        $data['titlex']='Letter of Credit';
        $data['settings']= (object) $this->settings();


        return view('letterofcredit', $data);
    }


            public function projectfinance()
    {
        $data['title']='Project Funding';
        $data['titlex']='Project Funding';
        $data['settings']= (object) $this->settings();


        return view('projectfinance', $data);
    }
    

    
    /**
     * 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  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

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

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