@extends('layout/master2')

@section('contentchild')

<style>
.help-block{
  color:red;
}
.is-invalid{border:1px solid red !important;}
</style>

   <?php 

$data=App\Project::all()->pluck('id','projectnm');

//dd($data);
   ?>              
<div class="col-sm-6 offset-sm-3 ">
                         <h3 class="text-center"> Assign Porject </h3> 
                                    <form method="post" action="{{route('saveassignproject')}}">
@csrf

<input type="hidden" name="id" value="{{ !empty($list->id)?$list->id:''}}" />
          @foreach(["success","error"] as $status)
@if(Session::has($status))
<div class="alert alert-{{$status}} alert-dismissible">
  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  <strong>{{$status}}!</strong> {{Session::get($status)}} action.
</div>
@endif
@endforeach

<div class="form-group">
              <label for="password">Project Name</label>
<select class='@error('project_id') is-invalid @enderror form-control' name='project_id'>
    <option value=''>-- Select--</option>

 
@foreach($data as $key=>$value)
 
<option value="{{ $value }}">{{ $key }}</option>

@endforeach

</select>
 @if ($errors->has('project_id'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('project_id') }}</p>
        @endif


            </div>



<div class="form-group">
              <label for="password">Role</label>
<select class='@error('role') is-invalid @enderror form-control' name='role'>
    <option value=''>-- Select--</option>
 <option value="superviser"> superviser</option>
<option value="labour">labour</option>
 

</select>
 @if ($errors->has('role'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('role') }}</p>
        @endif

 </div>


 <div class="form-group">
                    <label for="password">Name</label>
<input id="subcategorynm" type="text"  class="@error('name') is-invalid @enderror form-control" autocomplete="off" name="name"     >
 @if ($errors->has('name'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('name') }}</p>
        @endif
       </div>

 <div class="form-group">
                                            <label for="password">Email</label>
<input id="subcategorynm" type="text"  class="@error('email') is-invalid @enderror form-control" autocomplete="off" name="email"    >
 @if ($errors->has('email'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('email') }}</p>
        @endif
  </div>


 <div class="form-group">
                                            <label for="password">Password</label>
<input id="subcategorynm" type="text"  class="@error('subcategorynm') is-invalid @enderror form-control" autocomplete="off" name="password"     >
 @if ($errors->has('subcategorynm'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('subcategorynm') }}</p>
        @endif
              </div>

 <div class="form-group">
                                            <label for="password">Openin Balance</label>
<input id="subcategorynm" type="text"  class="@error('subcategorynm') is-invalid @enderror form-control" autocomplete="off" name="opening_balance"     >
 @if ($errors->has('subcategorynm'))
  <p class="help-block"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            {{ $errors->first('subcategorynm') }}</p>
        @endif
              </div>







   


<div class="col-sm-12 text-center">
<button type="submit" name="change" class="btn btn-primary" >create</button>

</div>
 </form>
                             
        </div>



     @endsection
             