This commit is contained in:
m.razaghi
2026-08-16 21:26:26 +03:30
parent 464ed71360
commit 16fd292976
2 changed files with 45 additions and 33 deletions

View File

@@ -1,48 +1,58 @@
@extends('admin.layouts.app') @extends('admin.layouts.app')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@include('admin.partial.list-filter', ['filterRoute' => 'subscribe-plans.index']) @include('admin.partial.list-filter', ['filterRoute' => 'subscribe-plans.index'])
<div id="datatable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer"> <div id="datatable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<table id="datatable" class="table table-bordered dt-responsive nowrap dataTable no-footer dtr-inline" style="border-collapse: collapse; border-spacing: 0px; width: 100%;" role="grid" aria-describedby="datatable_info"> <table id="datatable" class="table table-bordered dt-responsive nowrap dataTable no-footer dtr-inline" style="border-collapse: collapse; border-spacing: 0px; width: 100%;" role="grid" aria-describedby="datatable_info">
<thead> <thead>
<tr role="row"> <tr role="row">
<th>نام پلن</th> <th>نام پلن</th>
<th>نوع (Type)</th>
<th>قیمت</th> <th>قیمت</th>
<th>وضعیت</th>
<th>عملیات</th> <th>عملیات</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach ($subscribePlans as $item) @foreach ($subscribePlans as $item)
<tr> <tr>
<td>{{ $item->name }}</td> <td>{{ $item->name }}</td>
<td>{{ $item->price }}</td> <td><span class="badge badge-info">{{ $item->type ?? 'ندارد' }}</span></td>
<td> <td>{{ number_format($item->price) }} تومان</td>
<form action="{{ route('subscribe-plans.destroy', $item->id) }}" method="POST" style="display: inline;"> <td>
@csrf @if($item->is_active)
@method('DELETE') <span class="badge badge-success">فعال</span>
<button type="submit" class="btn btn-danger waves-effect waves-light" onclick="return confirm('آیا مطمئنید که می‌خواهید این کتاب را حذف کنید؟')">حذف</button> @else
</form> <span class="badge badge-danger">غیرفعال</span>
<a href="{{route('subscribe-plans.edit',$item->id)}}" type="button" class="btn btn-primary waves-effect waves-light">ویرایش</a> @endif
</td> </td>
</tr> <td>
<form action="{{ route('subscribe-plans.destroy', $item->id) }}" method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger waves-effect waves-light" onclick="return confirm('آیا مطمئنید که می‌خواهید این پلن را حذف کنید؟')">حذف</button>
</form>
<a href="{{route('subscribe-plans.edit',$item->id)}}" type="button" class="btn btn-primary waves-effect waves-light">ویرایش</a>
</td>
</tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
</div>
<div class="d-flex justify-content-center mt-3">
{{ $subscribePlans->withQueryString()->links() }}
</div> </div>
</div> </div>
<div class="d-flex justify-content-center mt-3">
{{ $subscribePlans->withQueryString()->links() }}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> @endsection
@endsection

View File

@@ -55,7 +55,9 @@
<select name="subscribe_plan_id" id="subscribe_plan_id" class="form-control" required> <select name="subscribe_plan_id" id="subscribe_plan_id" class="form-control" required>
<option value="">یک پلن انتخاب کنید...</option> <option value="">یک پلن انتخاب کنید...</option>
@foreach($paidPlans as $plan) @foreach($paidPlans as $plan)
<option value="{{ $plan->id }}">{{ $plan->name }} ({{ number_format($plan->price) }} تومان)</option> <option value="{{ $plan->id }}">
{{ $plan->name }} | نوع: {{ $plan->type ?? 'ندارد' }} | ({{ number_format($plan->price) }} تومان)
</option>
@endforeach @endforeach
</select> </select>
</div> </div>