index.blade.php 1.98 KB
@extends('master')
  @section('content')
  <div class="row">
    <div class="col-md-12">
      <h1>Table of Data</h1>
      </div>

    <form url="blog" role="search" method="GET">

      <div class="col-md-6">
        <div class="input-group custom-search-form">
          <input type="text" name="search" class="form-control" placeholder="Search ....">
          <span class="input-group-btn">
            <button  type="submit" class="btn btn-default">Search</button>
          </span>
        </div>
      </div>

    </form> 
    
  </div>

  <div class="row">
    <table class="table table-striped">
      <tr>
        <th>No.</th>
        <th>Image</th>
        <th>Fullname</th>
        <th>Sex</th>
        <th>ID Number</th>
        <th>Birth Date</th>
        <th>Province</th>
        <th>District</th>
        <th>Sector</th>
        <th>Actions</th>
      </tr>
      <a href="{{route('blog.create')}}" class="btn btn-info pull-right">Add new Data</a><br><br>
      <?php $no=1; ?>
      @foreach($blogs as $blog)
        <tr>
          <td>{{$no++}}</td>
          <td>{{$blog->full_name}}</td>
          <td>
            <img src="\image\{{$blog->image}}" style="width:100px;height:100px;"></td>
          <td>{{$blog->sex}}</td>
          <td>{{$blog->id_number}}</td>
          <td>{{$blog->birth_date}}</td>
          <td>{{$blog->province}}</td>
          <td>{{$blog->district}}</td>
          <td>{{$blog->sector}}</td>

          <td>
            <form class="" action="{{route('blog.destroy',$blog->id)}}" method="post">
              <input type="hidden" name="_method" value="delete">
              <input type="hidden" name="_token" value="{{ csrf_token() }}">
              <a href="{{route('blog.edit',$blog->id)}}" class="btn btn-primary">Edit</a>
              <input type="submit" class="btn btn-danger" onclick="return confirm('Are you sure to delete this data');" name="name" value="delete">
            </form>
          </td>
        </tr>
      @endforeach
    </table>
  </div>
  @stop