File Manager Lite
Dir:
/home/u540325668/domains/mkjsindia.org/public_html-chash/resources/views/admin/donation
Upload
[..]
edit.blade.php (2.85 KB)
Edit
Rename
Del
manage.blade.php (6.38 KB)
Edit
Rename
Del
Edit: manage.blade.php
@extends('admin.master') @section('title', 'Donation Management') @section('mainContent') <div class="content-wrapper"> <section class="content py-3"> <div class="container-fluid"> <div class="card shadow-sm"> <!-- Header --> <div class="card-header bg-primary text-white"> <div class="d-flex align-items-center justify-content-between"> <h4 class="mb-0"> <i class="fas fa-donate mr-2"></i> Donation Details </h4> <a href="{{ url('/admin/dashboard') }}" class="btn btn-danger btn-sm"> <i class="fas fa-arrow-left"></i> Back </a> </div> </div> <div class="card-body"> <!-- Date Range Picker --> <div class="mb-3"> <div id="daterange" class="form-control text-center" style="cursor:pointer;"> <i class="fa fa-calendar"></i> <span></span> <i class="fa fa-caret-down"></i> </div> </div> <!-- Table --> <div class="table-responsive"> <table class="table table-bordered table-striped w-100" id="daterange_table"> <thead class="table-dark"> <tr> <th>ID</th> <th>Date Time</th> <th>Transaction ID</th> <th>Payment Mode</th> <th>Name</th> <th>Mobile</th> <th>Email</th> <th>Amount</th> <th>Status</th> <th width="120">Action</th> </tr> </thead> <tbody></tbody> </table> </div> </div> </div> </div> </section> </div> @endsection @section('pagejs') <script> $(function () { let startDate = moment().subtract(29, 'days'); let endDate = moment(); function updateDateText(start, end) { $('#daterange span').html( start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY') ); } // Date Range Picker $('#daterange').daterangepicker({ startDate: startDate, endDate: endDate, locale: { format: 'DD/MM/YYYY' }, ranges: { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'Last 365 Days': [moment().subtract(364, 'days'), moment()], 'All Time': [moment('1900-01-01'), moment()] }, opens: 'center', applyButtonClasses: 'btn-primary', cancelButtonClasses: 'btn-secondary' }, function (start, end) { updateDateText(start, end); table.draw(); }); updateDateText(startDate, endDate); // DataTable let table = $('#daterange_table').DataTable({ processing: true, serverSide: true, order: [[0, 'desc']], ajax: { url: "{{ route('admin.donation.show') }}", data: function (d) { d.from_date = $('#daterange').data('daterangepicker') .startDate.format('YYYY-MM-DD'); d.to_date = $('#daterange').data('daterangepicker') .endDate.endOf('day').format('YYYY-MM-DD HH:mm:ss'); } }, columns: [ { data: 'id' }, { data: 'created_at' }, { data: 'transaction_id' }, { data: 'payment_mode' }, { data: 'name' }, { data: 'mobile' }, { data: 'email' }, { data: 'amount' }, { data: 'status', render: function (status) { return status == 'Success' ? '<span class="badge bg-success">Success</span>' : '<span class="badge bg-danger">Failed</span>'; } }, { data: 'id', render: function (id) { return ` <button class="btn btn-sm btn-primary edit-btn" data-id="${id}"> Edit </button> <button class="btn btn-sm btn-danger delete-btn" data-id="${id}"> Delete </button> `; } } ], rowCallback: function (row, data) { $(row).addClass(data.status == 'Success' ? 'table-success' : 'table-danger'); } }); // Auto refresh every 15 minutes setInterval(() => table.ajax.reload(null, false), 900000); // Edit $('#daterange_table').on('click', '.edit-btn', function () { redirectEncrypted('edit', $(this).data('id')); }); // Delete $('#daterange_table').on('click', '.delete-btn', function () { if (!confirm('Are you sure you want to delete this donation?')) return; redirectEncrypted('delete', $(this).data('id')); }); function redirectEncrypted(action, id) { $.get(`/admin/directgo/${id}`, function (encryptedId) { let url = action === 'edit' ? "{{ route('admin.donation.edit', ':id') }}".replace(':id', encryptedId) : "{{ route('admin.donation.delete', ':id') }}".replace(':id', encryptedId); window.location.href = url; }); } }); </script> @endsection
Simpan