下載
@extends('layouts.masterMem')
@section('title', '待辦事項')
@section('content')
<h1 style="text-align:center">待辦管理</h1>
<a href="{{url('Member/TodoAdd')}}" class="btn btn-primary">新增</a>
<div class="container">
<div class="row">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">標題</th>
<th scope="col">等級</th>
<th scope="col">期限</th>
<th scope="col">動作</th>
</tr>
</thead>
<tbody>
@forelse($todo as $index => $row)
<tr>
<th scope="row">{{ $index+1 }}</th>
<td>{{ $row->title }}</td>
<td>
@php
echo $row->level == '普通'
? '<img src="' . url('images/green.jpg') . '" style="width: 40px; height: 40px;" title="普通">'
: '<img src="' . url('images/red.jpg') . '" style="width: 40px; height: 40px;" title="重要">';
@endphp
</td>
<td>{{ $row->deadline }}</td>
<td>
<a href="{{url('Member/TodoEdit')}}/{{$row->id}}" class="btn btn-success">編輯</a>
<a href="{{url('Member/TodoDelete')}}/{{$row->id}}" onclick="return confirm('確定要刪除嗎?');" class="btn btn-danger">刪除</a>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="text-center">沒有資料</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@stop