@extends('master')

@section('title')
    Manage Users
@stop

@section('styles')

@stop

@section('content')

<link href="/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="/css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="/css/font-awesome.css" rel="stylesheet">
<link href="/css/app.css" rel="stylesheet">
<link href="/css/foundation.css" rel="stylesheet">
<link href="/css/normalize.css" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Lato:400,100,100italic,300,300italic,400italic,700,900,900italic,700italic' rel='stylesheet' type='text/css'>

<!-- header -->
<div class="header" id="home">
	<div class="container">
		<ul style="margin-bottom: 0.25rem;">
            <li><i class="fa fa-phone" aria-hidden="true"></i> <a>Call: (011) 022 0642</a></li>
            <li><i class="fa fa-envelope-o" aria-hidden="true"></i> <a href="mailto:info@prestigecredit.co.za">info@prestigecredit.co.za</a></li>
            <li><a href="terms-and-conditions"><i class="fa fa-file-o" aria-hidden="true"></i> Terms & Conditions of use</a></li>
        </ul>
	</div>
</div>
<!-- //header -->
<!-- header-bot -->
<div style="padding: 29px 0;" class="header-bot">
	<div class="header-bot_inner_wthreeinfo_header_mid">
		<!-- header-bot -->
			<div class="col-md-12 logo_agile">
				<img width="20%" src="/img/PrestigeAdvantage.jpg" />
			</div>
		</div>
		<div class="clearfix"></div>
	</div>
</div>



    @if($companies!=NULL)
    <div>

        @if(Auth::user()->role=='admin')
        <h1>Log into management dashboard</h1>
        <ul style="text-align: center;list-style-type: none;">
            <li><a href="/redirect-admin">Admin</a></li>
        </ul>
        <h1>Log into main website</h1>
        <p style="text-align:center;">Select company</p>
        <ul style="text-align: center;list-style-type: none;">
        @foreach($companies as $company)
            <li><a href="/choose-company/{{ $company }}">{{ $company }}</a></li>
        @endforeach
        </ul>
        @elseif(Auth::user()->role=='user')
        <ul style="text-align: center;list-style-type: none;">
        <p style="text-align:center;">Select company</p>
        @foreach($companies as $company)
            <li><a href="/choose-company/{{ $company }}">{{ $company }}</a></li>
        @endforeach
        </ul>
        @else

        @endif
    </div>
    @else
    <h2>No Linked companies, contact system administrator for assistance.</h2>
    @endif


<hr>

@include('partials.footer')
@stop