<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Modules</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
	        <div class="response-data">
				
			</div>
			<form action="{{ url('user/config/modules/'.$data->id) }}" method="POST" onsubmit="updatingform(this); return false">
				<div class="row">
					<div class="col-6">
						<label for=""><b>Module:</b></label>
						<input type="text" class="form-control" name="name" required="" placeholder="Ingresa tu modulo" value="{{$data->name}}">
					</div>
					<div class="col-6">
						<label for=""><b>Url module:</b></label>
						<input type="text" class="form-control" name="url" required="" placeholder="Ingresa tu modulo" value="{{ $data->url }}">
					</div>

				</div>
				<hr>
				<div class="row">
					<div class="col-12">
						<h3 class="text-center">Roles</h3>
					</div>
				</div>
				<hr>
				<div class="row">
					@foreach ($roles as $r)
						<?php $en = false; ?>
						@foreach ($roles_by_id as $rr)
							@if($rr->id == $r->id)
								<div class="col-12">
									<input type="checkbox" name="roles[]" checked="" value="{{$r->id}}" >
									<span class="text-uppercase" ><b>{{$r->name}}</b></span>
								</div>
								<?php $en = true; ?>
							@endif
						@endforeach
						@if($en == false)
							<div class="col-12">
								<input type="checkbox" name="roles[]" value="{{$r->id}}" >
								<span class="text-uppercase" ><b>{{$r->name}}</b></span>
							</div>
						@endif
					@endforeach
				</div>

				<hr>
				<div class="row selected_items">
		
				</div>
				<hr>
				<div class="row">
					<div class="col-12 text-center">
						<button class="btn btn-primary"><i class="icon-floppy-disk "></i> Guardar</button>
					</div>
				</div>
			</form>
      </div>
    </div>
  </div>
</div>