@extends('layouts.dashboard')
@section('page_title')
	Manage User/Projects
@endsection
@section('page_header_title')
	Manage User/Projects
@endsection

@section('page_body')
{{ Breadcrumbs::render('supplier') }}

<div class="row row-cards row-deck" style="background: white; ">
	<div class="col-12">
		<div class="table-responsive table-height">
			<table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
				<thead>
					<tr>

						<th>#</th>
						<th>User Name</th>
		 <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
					</tr>
				</thead>
				<tbody>
							@foreach($auser_list as $rows)
			<tr>
				<td>{{$loop->iteration}}</td>
				<td>{{$rows->name}}</td>
				<td class="text-center">
								<button class="btn-sm btn-primary" onclick="getprojects(this.id)" id="{{ Crypt::encrypt($rows->id)}}"> <i class="fa fa-edit"></i> Settings</button>
								 </td>
								 </tr>

					@endforeach

				</tbody>
			</table>
		</div>
											</div>
									</div>
@endsection

@section('page_modal')
  @include('inventory_module.usertoproject.modals.projects')
@endsection

@section('page_script')
 <script>
 function getprojects(id)
 {
	 var myid = id;
	 //DEFAULT EVENT REQUEST PREVENT

	 event.preventDefault();

	 var route = "{{url('get_usertoprojects')}}/"+myid;

	 showLoader();

	 $.get(route,function(data)
	 {

			 $('#itemsproject').html(data);
			 $('#userid').val(myid);
			 $('#md_usertoprojects').modal('show');

			 removeLoader();
		 });

	 $('#md_usertoprojects').modal('show');

 }
 </script>

@endsection
