@extends('layouts.master') @section('title') Chandra Peer Review | Profile @stop @section('head') @stop @section('content')
@if(Auth::check())

Admin Dashboard

Welcome to your dashboard page, {!! $user->first !!} {!! $user->last !!}.
Here you can interact with the reviewers database.


{!! Form::open( ['url' => 'dashboard', 'method' => 'post'] ) !!}

{!! Form::submit('Load Account', ['class' => 'btn btn-primary']) !!} Create Account {!! Form::close() !!}
{{--


Search on Areas of Expertise
--}}

@if(count($errors) > 0) @endif @if(isset($reviewer)) @if($reviewer->hasRole('admin'))

Note this is an admin account!

@endif

Edit Reviewer information

{!! Form::open( ['url' => 'dashboard-edit', 'method' => 'post'] ) !!}
{!! Form::label('first','First Name') !!} {!! Form::text('first', $reviewer->first, ['class' => 'form-control'] ) !!}
{!! Form::label('last','Last Name') !!} {!! Form::text('last', $reviewer->last, ['class' => 'form-control'] ) !!}
{!! Form::label('email','Email') !!} {!! Form::text('email', $reviewer->email, ['class' => 'form-control'] ) !!}
{!! Form::label('institution','Institution') !!} {!! Form::text('institution', isset($reviewer->profile->institution) ? $reviewer->profile->institution : '', ['class' => 'form-control'] ) !!}
{!! Form::label('street','Street') !!} {!! Form::text('street', isset($reviewer->profile->street) ? $reviewer->profile->street : '', ['class' => 'form-control'] ) !!}
{!! Form::label('city','City') !!} {!! Form::text('city', isset($reviewer->profile->city) ? $reviewer->profile->city : '', ['class' => 'form-control'] ) !!}
{!! Form::label('state','State') !!} {!! Form::text('state', isset($reviewer->profile->state) ? $reviewer->profile->state : '', ['class' => 'form-control'] ) !!}
{!! Form::label('zip','Zip') !!} {!! Form::text('zip', isset($reviewer->profile->zip) ? $reviewer->profile->zip : '', ['class' => 'form-control'] ) !!}
{!! Form::label('country','Country') !!} {!! Form::text('country', isset($reviewer->profile->country) ? $reviewer->profile->country : '', ['class' => 'form-control'] ) !!}

{{-- Use a hidden form element to pass the reviewer id to the AdminController --}} {!! Form::hidden('reviewer_id', $reviewer->id ) !!} @if($reviewer->hasRole('admin')) {!! Form::submit('Update Admin Info', ['class' => 'btn btn-primary']) !!} Delete Admin {!! Form::close() !!}

@else {!! Form::submit('Update Reviewer Info', ['class' => 'btn btn-primary']) !!} Delete Reviewer {!! Form::close() !!}

@endif

{{-- only show travel info for reviewers (does not apply to admins) --}} @if($reviewer->hasRole('standard'))

Reviewer Travel Prefs

{!! Form::open( ['url' => 'dashboard-travel', 'method' => 'post'] ) !!} Traveling to Boston, coming from:
{!! Form::label('fromcity','City') !!} {!! Form::text('fromcity', isset($reviewer->travel->fromcity) ? $reviewer->travel->fromcity : '', ['class' => 'form-control'] ) !!}
{!! Form::label('fromstate','State') !!} {!! Form::text('fromstate', isset($reviewer->travel->fromstate) ? $reviewer->travel->fromstate : '', ['class' => 'form-control'] ) !!}
{!! Form::label('fromcountry','Country') !!} {!! Form::text('fromcountry', isset($reviewer->travel->fromcountry) ? $reviewer->travel->fromcountry : '', ['class' => 'form-control'] ) !!}
{!! Form::label('arrivedate','Date of Arrival to Boston') !!} {!! Form::text('arrivedate', isset($reviewer->travel->arrivedate) ? $reviewer->travel->arrivedate : '', ['id' => 'datepicker', 'class' => 'form-control'] ) !!}
Traveling from Boston, going to:
{!! Form::label('tocity','City') !!} {!! Form::text('tocity', isset($reviewer->travel->tocity) ? $reviewer->travel->tocity : '', ['class' => 'form-control'] ) !!}
{!! Form::label('tostate','State') !!} {!! Form::text('tostate', isset($reviewer->travel->tostate) ? $reviewer->travel->tostate : '', ['class' => 'form-control'] ) !!}
{!! Form::label('tocountry','Country') !!} {!! Form::text('tocountry', isset($reviewer->travel->tocountry) ? $reviewer->travel->tocountry : '', ['class' => 'form-control'] ) !!}
{!! Form::label('departdate','Date of Departure from Boston') !!} {!! Form::text('departdate', isset($reviewer->travel->departdate) ? $reviewer->travel->departdate : '', ['id' => 'datepicker2', 'class' => 'form-control'] ) !!}

{!! Form::hidden('reviewer_id', $reviewer->id ) !!} {!! Form::submit('Update Reviewer Travel Prefs', ['name' => 'submit', 'class' => 'btn btn-primary'] ) !!} {!! Form::close() !!} @endif
@endif
@endif
@stop @section('body') @stop