<?php
namespace App\Http\Controllers;
use App\Path;
use App\Car;
use App\People;
use Illuminate\Support\Facades\Auth;
class PageController extends Controller
{
    public function page()
    {
        $query = Path::all();
  
        $main=Car::all();

        return View('index',['page' => 'page','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','title'=>'首頁']);
    }

    public function car_sys()
    {
        if(Auth::check())
        {
            return '登入';
        }
        else{
            $query = Path::all();
            return View('index',['page' => 'car_sys','result'=>$query]);
        }
        
    }
    
    public function video_replay()
    {
        $query = Path::all();
  
        $main=Car::all();
        return View('index',['page' => 'video_replay.index','result'=>$query,'iresult'=>$main,'navbar_li'=>'video_replay.layout.navbar_li','title'=>'tt']);
    }
    public function HRM()
    {
        $query = Path::all();
  
        $main=Car::all();
        return View('index',['page' => 'HRM.HRM','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
    }
    public function new()
    {
        $query = Path::all();
  
        $main=Car::all();
        return View('index',['page' => 'new','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
    }
    public function service()
    {
        $query = Path::all();
  
        $main=Car::all();
        return View('index',['page' => 'service','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
    }
    public function people()
    {
        $query = Path::all();
  
        $main=Car::all();
        $people=People::all();
        return View('index',['page' => 'people','result'=>$query,'iresult'=>$main,'people'=>$people,'navbar_li'=>'video_replay.layout.navbar_li','title'=>'tt']);
    }
    
}