@extends('layouts.Layout')

@section('content')
        <div class="col-md-12">
            <div class="card">
                <div class="header">
                    <h4>Data Pendaftar</h4>
                </div>
                    <div class="col-md-6">
                        <form method="get" action="{{url('tatausaha/Daftar')}}">
                            <input type="text" name="search" class="form-control" placeholder="Search...">
                                <button type="search" class="btn btn-default-sm">
                                    <span class="glyphicon glyphicon-search"> </span>
                                </button>
                        </form>
                    </div>
                    <div class="content table-responsive table-full-width" id="table">
                    <table class="table table-borderless">
                        <thead>
                            <th></th>
                            <th>No Pendaftar</th>
                            <th>Status</th>
                            <th></th>
                        </thead>
                        {{csrf_field()}}
                        <tbody>
                            @foreach($pendaftar as $pen)
                            <tr class="item{{$pen->id}}">
                                <td>
                                    <button class="edit-modal btn btn-primary" data-id="{{$pen->id}}" data-nomor="{{$pen->no_pendaftar}}" data-status="{{$pen->status}}"><span class="glyphicon glyphicon-edit"></span>Edit</button>
                                </td>
                                <td>{{$pen->no_pendaftar}}</td>
                                <td>{{$pen->status}}</td>
                                <td>
                                    <form class="" action="{{route('Daftar.destroy', $pen->id)}}" method="post">
                                    <input class="w3-btn" type="hidden" name="_method" value="delete">
                                    <input class="w3-btn" type="hidden" name="_token" value="{{ csrf_token() }}">
                                       <button class="delete-modal btn btn-danger" onclick="return confirm('Are you sure to delete this data');">
                                       <span class="glyphicon glyphicon-trash"></span>Delete</button>
                                    </form>
                                </td>
                                
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
             
            </div>
        </div>
        <meta name="_token" content="{!! csrf_token() !!}" />
@endsection

         <div id="myModal" class="modal fade" tabindex="-1" role="dialog" >
             <div class="modal-dialog">
                 <div class="modal-content">
                     <div class="modal-header">
                         <button type="button" class="close" data-dismiss="modal">&times;</button>
                         <h4 class="modal-title"></h4>
                     </div>
                     <div class="modal-body">
                         <form class="form-horizontal" role="form">
                             <div class="form-group">
                                 <label class="control-label col-sm-2" for="no_pendaftar">ID :</label>
                                 <div class="col-sm-10">
                                     <input type="text" class="form-control" id="fid" disabled>
                                 </div>
                             </div>
                             <div class="form-group">
                                 <label class="control-label col-sm-2" for="no_pendaftar">No Pendaftar :</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="nomor" disabled>
                                    </div>
                            </div>
                             <div class="form-group">
                                 <label class="control-label col-sm-2" for="status">Status :</label>
                                    <div class="col-sm-10">
                                    <select id="status" type="text" class="form-control border-input" value="{{old('status')}}" name="status">
                                      <option></option>
                                      <option>Lulus</option>
                                      <option>Tidak Lulus</option>
                                      <option>Request</option>
                                    </select>
                                      <span id="helpBlock2" class="help-block">{{$errors->first('status')}}</span>
                                        
                                    </div>
                            </div>
                         </form>
                     <div class="deleteContent">
                            Are you sure you want to delete <span class="title"></span> ?
                            <span class="hidden id"></span>
                    </div>
                     <div class="modal-footer">
                        <button type="submit" class="btn actionBtn" data-dismiss="modal">
                            <span id="footer_action_button" class='glyphicon'></span>
                        </button>
                        <button type="button" class="btn action-warning" data-dismiss="modal">
                            <span class='glyphicon glyphicon-remove'></span>Close
                        </button>    
                    </div>
                </div>
                </div>
             </div>
         </div>
         
