backend-admin #3

Open
runggumanalu8 wants to merge 10 commits from backend-admin into master
27 changed files with 392 additions and 250 deletions
Showing only changes of commit 48dabaef9c - Show all commits

View File

@ -26,7 +26,7 @@ class AdminRefundController extends Controller
public function show($id)
{
$refund = Refund::find($id);
$refundDescription = RefundDescription::where($id)->get();
$refundDescription = RefundDescription::where('refund_id',$id)->get();
return view('admin.refund.detail-refund',[
"refund"=> $refund,
'descriptions' => $refundDescription

View File

@ -27,7 +27,7 @@ class AdminTransactionController extends Controller
{
return view('admin.transaction.detail-transaction', [
'transaction' => Transaction::findOrFail($id),
'trackings' => TransactionDescription::where('order_id', $id)
'trackings' => TransactionDescription::where('transaction_id', $id)
->latest()
->get(),
]);

View File

@ -17,7 +17,10 @@ class UserRefundController extends Controller
public function index()
{
return view('user.refund.index', [
'refunds' => Refund::where()
'refunds' => Refund::join('transactions', 'refunds.transaction_id', '=', 'transactions.id')
->where('transactions.pembeli', auth()->user()->email)
->select('refunds.*')
->get()
]);
}
@ -45,10 +48,10 @@ class UserRefundController extends Controller
$filename = $file->getClientOriginalName();
$mime = $file->getClientMimeType();
if (strpos($mime, 'image') !== false) {
$type = 'Image';
$type = 'image';
$file->storeAs('public/refund-image/', $filename);
} elseif (strpos($mime, 'video') !== false) {
$type = 'Video';
$type = 'video';
$file->storeAs('public/refund-video/', $filename);
} else {
$type = 'Other';

View File

@ -62,7 +62,7 @@ class UserTransactionController extends Controller
{
return view('user.transaction.pembeli.detail-transaction', [
'transaction' => Transaction::findOrFail($id),
'trackings' => TransactionDescription::where('order_id', $id)
'trackings' => TransactionDescription::where('transaction_id', $id)
->latest()
->get(),
]);

View File

@ -28,7 +28,7 @@ class Refund extends Model
//Relasi
public function transaction(){
return $this->belongsTo(Transaction::class, 'id', 'transaction_id');
return $this->belongsTo(Transaction::class, 'transaction_id', 'id');
}
//Relasi
}

View File

@ -3,10 +3,15 @@
namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use App\Models\Refund;
use App\Models\RefundDescription;
use Illuminate\Database\Seeder;
use App\Models\User;
use Carbon\Carbon;
use App\Models\Setting;
use App\Models\Transaction;
use App\Models\TransactionDescription;
use Illuminate\Support\Str;
use Faker\Factory as FakerFactory;
use Faker\Provider\id_ID\Person as Person;
@ -29,7 +34,7 @@ class DatabaseSeeder extends Seeder
'id' => Str::uuid(),
'nama_depan' => $faker->firstName,
'nama_belakang' => $faker->lastName,
'tanggal_lahir' => $faker->date($format = 'Y-m-d', $max = 'now'),
'tanggal_lahir' => $faker->date('Y-m-d', 'now'),
'email' => 'admin@example.net',
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
@ -43,7 +48,45 @@ class DatabaseSeeder extends Seeder
'gender' => $faker->randomElement(['Laki-laki', 'Perempuan']),
'kode_kelurahan' => '1101012002',
]);
User::factory(20)->create();
$user1 = User::factory()->create([
'id' => Str::uuid(),
'nama_depan' => $faker->firstName,
'nama_belakang' => $faker->lastName,
'tanggal_lahir' => $faker->date('Y-m-d', 'now'),
'email' => $faker->email,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
'role' => 'User',
'nik' => $faker->nik($faker->randomElement(['male', 'female']), $faker->dateTimeBetween('-65 years', '-18 years')),
'alamat' => $faker->address,
'nohp' => $faker->phoneNumber(),
'status' => 'Finished',
'persentase_kemiripan' => 100,
'gender' => $faker->randomElement(['Laki-laki', 'Perempuan']),
'kode_kelurahan' => '1101012002',
]);
$user2 = User::factory()->create([
'id' => Str::uuid(),
'nama_depan' => $faker->firstName,
'nama_belakang' => $faker->lastName,
'tanggal_lahir' => $faker->date('Y-m-d', 'now'),
'email' => $faker->email(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
'role' => 'User',
'nik' => $faker->nik($faker->randomElement(['male', 'female']), $faker->dateTimeBetween('-65 years', '-18 years')),
'alamat' => $faker->address,
'nohp' => $faker->phoneNumber(),
'status' => 'Finished',
'persentase_kemiripan' => 100,
'gender' => $faker->randomElement(['Laki-laki', 'Perempuan']),
'kode_kelurahan' => '1101012002',
]);
// User::factory(20)->create();
$now = Carbon::now()->tz('Asia/Jakarta');
$bulan = $now->format('n');
@ -53,7 +96,79 @@ class DatabaseSeeder extends Seeder
'bulan' => $bulan,
'tahun' => $tahun,
'persentase' => 5,
'status' => 'Active'
'status' => 'Active',
]);
$transaction = Transaction::create([
'id' => Str::uuid(),
'pembeli' => $user1->email,
'penjual' => $user2->email,
'nama_barang' => 'hah',
'deskripsi_transaksi' => null,
'satuan_barang' => 'barang',
'harga_barang' => 2000,
'jumlah_barang' => 2,
'persentase_keuntungan' => 2,
'total_keuntungan' => 2,
'total_harga' => 2,
'total_bayar' => 2,
'token' => 'asda',
'status' => 'pending',
'batas_pembayaran' => now(),
'batas_pengiriman_barang_awal' => now(),
'batas_pengiriman_barang_akhir' => now(),
'nama_bank_penjual' => 'asd',
'no_rek_penjual' => '21-',
]);
TransactionDescription::create([
'transaction_id' => $transaction->id,
'status' => 'pending',
'user' => $user1->email,
'judul' => 'fa fa-plus',
'background' => 'bg-buyer',
'deskripsi' => $user1->nama_depan . ' telah membuat transaksi baru dengan ' . $user2->nama_depan,
]);
$transactionRefund = Transaction::create([
'id' => Str::uuid(),
'pembeli' => $user1->email,
'penjual' => $user2->email,
'nama_barang' => 'hah',
'deskripsi_transaksi' => null,
'satuan_barang' => 'barang',
'harga_barang' => 2000,
'jumlah_barang' => 2,
'persentase_keuntungan' => 2,
'total_keuntungan' => 2,
'total_harga' => 2,
'total_bayar' => 2,
'token' => 'asda',
'status' => 'refund',
'batas_pembayaran' => now(),
'batas_pengiriman_barang_awal' => now(),
'batas_pengiriman_barang_akhir' => now(),
'nama_bank_penjual' => 'asd',
'no_rek_penjual' => '21-',
]);
$refund = Refund::create([
'transaction_id' => $transactionRefund->id,
'total' => $transactionRefund->total_harga,
'due_date' => now(),
'complaint' => 'ha',
]);
RefundDescription::create([
'refund_id' => $refund->id,
'filename' => 'img_1.jpg',
'type' => 'image'
]);
RefundDescription::create([
'refund_id' => $refund->id,
'filename' => 'img_2.jpg',
'type' => 'image'
]);
$this->call([ProvincesSeeder::class, CitiesSeeder::class, DistrictsSeeder::class, VillagesSeeder::class]);

View File

@ -1667,7 +1667,8 @@ table tr:hover .table-links {
}
.badge.badge-warning {
color: #fff;
background-color: #ffb300;
color: #ffffff;
}
.badge.badge-primary {

View File

@ -56,9 +56,9 @@ $("#table-3").dataTable({
searchable: true,
});
// Refund Admin
// Refund, Transaction Admin
$("#table-4").dataTable({
columnDefs: [{ sortable: false, targets: [8] }],
columnDefs: [{ sortable: false, targets: [0, 8] }],
searchable: true,
});
@ -68,8 +68,8 @@ $("#table-5").dataTable({
searchable: true,
});
// Transaction Admin
// Contact User
$("#table-6").dataTable({
columnDefs: [{ sortable: false, targets: [8] }],
columnDefs: [{ sortable: false, targets: [4] }],
searchable: true,
});

View File

@ -14,7 +14,7 @@
<div class="card">
<div class="card-body p-0">
<div class="container">
<p><strong>Image/Video</strong></p>
<p><strong>Bukti Foto/Video</strong></p>
@foreach ($descriptions as $description)
@if ($description->type == 'image')
<img src="{{ asset('storage/refund-image/' . $description->filename) }}"
@ -52,14 +52,14 @@
</div><br>
<div class="row">
<div class="col-2"><strong>Alasan Komplain</strong></div>
<div class="col justified-text">{{ $refund->complain }}</div>
<div class="col justified-text">{{ $refund->complaint }}</div>
</div>
@if ($refund)
<div class="d-flex justify-content-center mt-3">
<a href="#" data-toggle="modal" data-target="#ModalRefund"
class="btn btn-primary mx-1">Accept</a>
<a href="/history_refund" class="btn btn-danger mx-1">Decline</a>
<a href="{{ route('admin-refund.index') }}" class="btn btn-danger mx-1">Decline</a>
</div>
@endif

View File

@ -3,7 +3,7 @@
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>History Refund</h1>
<h1>Refund</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
<div class="breadcrumb-item">Refund</div>
@ -33,16 +33,16 @@
@foreach ($refunds as $refund)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $transaction->id }}</td>
<td class="font-weight-600">{{ $refund->orders->pembeli }}</td>
<td class="font-weight-600">{{ $refund->orders->penjual }}</td>
<td class="font-weight-600">{{ $refund->total }}</td>
<td class="font-weight-600">{{ $refund->created_at }}</td>
<td class="font-weight-600">{{ $refund->due_date }}</td>
<td>
<div
class="badge {{ $refund->status == 'Partial Refund' ? 'badge-succes' : ($refund->status == 'Pending' ? 'badge-info' : 'badge-warning') }}">
{{ $refund->status }}</div>
<td>{{ $refund->id }}</td>
<td>{{ $refund->transaction->data_pembeli->nama_depan }}
</td>
<td>{{ $refund->transaction->data_penjual->nama_depan }}
</td>
<td>{{ $refund->total }}</td>
<td>{{ $refund->created_at }}</td>
<td>{{ $refund->due_date }}</td>
<td><a href="#" data-toggle="modal" data-target="#modalKeteranganStatus"
class="badge {{ $refund->status == 'partial refund' ? 'badge-succes' : ($refund->status == 'pending' ? 'badge-warning' : 'badge-danger') }}">{{ ucwords($refund->status) }}</a>
</td>
<td>
<div class="btn-group">
@ -64,4 +64,7 @@
</div>
</div>
</div>
@endsection
</section>
</div>
@extends('admin.transaction.modal-keterangan-status')
@endsection

View File

@ -23,7 +23,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
<a href="{{route('refund.index')}}" class="btn btn-primary mx-1">Accept Refund</a>
<a href="{{ route('admin-refund.index') }}" class="btn btn-primary mx-1">Accept Refund</a>
</div>
</div>
</div>

View File

@ -164,7 +164,9 @@
<table class="table table-striped" id="table-5">
<thead>
<tr>
<th>#</th>
<th class="text-center">
#
</th>
<th>Bulan</th>
<th>Tahun</th>
<th>Persentase (%)</th>

View File

@ -12,19 +12,22 @@
</div>
</div>
<div class="section-body">
<h2 class="section-title">
Admin</h2>
<h2 class="section-buyer">
{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }}</h2>
<h2 class="section-seller">
{{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }}</h2>
<div class="d-flex justify-content-between align-items-center">
<div class="card-title pb-2 m-0">
<h4>Timeline</h4>
</div>
</div>
<div class="row mt-sm-4">
<div class="col-sm-12 col-md-12 col-lg-5">
<h2 class="section-title">
Admin</h2>
<h2 class="section-buyer">
{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }}
</h2>
<h2 class="section-seller">
{{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }}
</h2>
<div class="d-flex justify-content-between align-items-center">
<div class="card-title pb-2 m-0">
<h4>Timeline</h4>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="activities">

View File

@ -13,7 +13,7 @@
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-6">
<table class="table table-striped" id="table-4">
<thead>
<tr>
<th class="text-center">
@ -41,8 +41,18 @@
<td>Rp {{ number_format($transaction->total_bayar, 2, ',', '.') }}</td>
<td>{{ $transaction->created_at }}</td>
<td>{{ $transaction->updated_at }}</td>
<td><a href="#" data-toggle="modal"
data-target="#modalKeteranganStatus">{{ ucwords($transaction->status) }}</a>
<td><a href="#" data-toggle="modal" data-target="#modalKeteranganStatus"
class="badge {{ in_array($transaction->status, ['pending', 'created'])
? 'badge-light'
: (in_array($transaction->status, ['settlement', 'capture'])
? 'badge-info'
: (in_array($transaction->status, ['process', 'sending', 'sended'])
? 'badge-warning'
: (in_array($transaction->status, ['cancel', 'expire', 'failure', 'refund'])
? 'badge-danger'
: ($transaction->status == 'finished'
? 'badge-success'
: '')))) }}">{{ ucwords($transaction->status) }}</a>
</td>
<td>
<div class="btn-group">
@ -126,8 +136,6 @@
modal.find('.activities').html(activitiesHtml);
});
});
</script>
@endsection

View File

@ -1,5 +1,5 @@
<!-- Modal -->
<div class="modal fade" id="ModalTransaction" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
<div class="modal fade" id="modalTracking" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
@ -14,98 +14,12 @@
<div class="row">
<div class="col-12">
<div class="activities">
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-comment-alt"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">August 21, 2023, 8:30:15 am</span>
</div>
<p>User Created Trade</p>
</div>
</div>
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-arrows-alt"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">August 22, 2023, 8:30:15 am</span>
</div>
<p>System Notified Admin</p>
</div>
</div>
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-unlock"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">August 23, 2023, 8:30:15 am</span>
</div>
<p>Admin Accepted Trade</p>
</div>
</div>
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-trash"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">August 24, 2023, 8:30:15 am</span>
</div>
<p>Trade in system</p>
</div>
</div>
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-comment-alt"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">August 24, 2023, 8:30:15 am</span>
</div>
<p>Transaction Success</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a href="{{ route('admin-transaction.index') }}" class="btn btn-primary mx-1">Back</a>
</div>
</div>
</div>
</div>
{{-- @extends('layout.main')
@section('content')
@foreach ($detail_transaction as $detail_transactions)
<div class="main-content">
<section class="section">
<div class="tracking-container">
<h2>Tracking Information</h2>
<div class="tracking-info">
<p>Tracking Number: <span
class="tracking-status">{{ $detail_transactions['tracking_number'] }}</span></p>
<p>Order ID: <span class="tracking-status">{{ $detail_transactions['orderId'] }}</span></p>
<p>Status: <span class="tracking-status">{{ $detail_transactions['status'] }}</span></p>
<p>Estimated: {{ $detail_transactions['estimated'] }}</p>
</div>
<h2>Tracking Details</h2>
<ul>
<li>{{ $detail_transactions['tracking_detail1'] }}</li>
<li>{{ $detail_transactions['tracking_detail2'] }}</li>
<li>{{ $detail_transactions['tracking_detail3'] }}</li>
</ul>
</div>
</section>
</div>
@endforeach
@endsection --}}

View File

@ -23,7 +23,7 @@
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-2">
<table class="table table-striped" id="table-6">
<thead>
<tr class="text-center">
<th>#</th>
@ -116,7 +116,8 @@
});
$.ajax({
url: "{{ route('user-contact.delete', ':id') }}".replace(':id',
url: "{{ route('user-contact.destroy', ':id') }}".replace(
':id',
dataId),
type: 'DELETE',
contentType: false,

View File

@ -0,0 +1,74 @@
@extends('layouts.main')
@section('content')
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>Detail</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
<div class="breadcrumb-item"><a href="{{ route('admin-refund.index') }}">Refund</a></div>
<div class="breadcrumb-item">Detail</div>
</div>
</div>
<div class="col-md-12">
<div class="card">
<div class="card-body p-0">
<div class="container">
<p><strong>Bukti Foto/Video</strong></p>
@foreach ($descriptions as $description)
@if ($description->type == 'image')
<img src="{{ asset('storage/refund-image/' . $description->filename) }}"
alt="Return Image" width="300">
@endif
@if ($description->type == 'videos')
<video src="{{ asset('storage/refund-video/' . $description->filename) }}"
alt="Return Image" width="300">
@endif
@endforeach
<br><br>
<div class="row">
<div class="col-2"><strong>ID Order</strong></div>
<div class="col">{{ $refund->order_id }}</div>
</div><br>
<div class="row">
<div class="col-2"><strong>Customer Name</strong></div>
<div class="col">
{{ $refund->transaction->data_pembeli->nama_depan . ' ' . $refund->transaction->data_pembeli->nama_belakang }}
</div>
</div><br>
<div class="row">
<div class="col-2"><strong>Seller Name</strong></div>
<div class="col">
{{ $refund->transaction->data_penjual->nama_depan . ' ' . $refund->transaction->data_penjual->nama_belakang }}
</div>
</div><br>
<div class="row">
<div class="col-2"><strong>Total</strong></div>
<div class="col">{{ $refund->total }}</div>
</div><br>
<div class="row">
<div class="col-2"><strong>Batas Pengajuan Refund</strong></div>
<div class="col">{{ $refund->due_date }}</div>
</div><br>
<div class="row">
<div class="col-2"><strong>Alasan Komplain</strong></div>
<div class="col justified-text">{{ $refund->complaint }}</div>
</div>
@if ($refund)
<div class="d-flex justify-content-center mt-3">
<a href="#" data-toggle="modal" data-target="#ModalRefund"
class="btn btn-primary mx-1">Accept</a>
<a href="{{ route('admin-refund.index') }}" class="btn btn-danger mx-1">Decline</a>
</div>
@endif
</div>
<br>
</div>
</div>
</div>
</section>
</div>
@include('admin.refund.modal-next-detail-refund')
@endsection

View File

@ -1,58 +0,0 @@
@extends('layouts.main')
@section('content')
<div class="main-content">
<section class="section">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h1>Detail Refund</h1>
<div class="section-header-breadcrumb">
<div class="breadcrumb-item active"><a href="{{ route('user.index') }}">Dashboard</a></div>
<div class="breadcrumb-item"><a href="{{ route('user-refund.index') }}">Refund</a></div>
<div class="breadcrumb-item">Detail Refund</div>
</div>
</div>
<div class="card-body p-0">
<div class="table-responsive table-invoice">
<table class="table table-striped">
<tr>
<th>Order ID</th>
<th>Customer</th>
<th>Seller</th>
<th>Total</th>
<th>Due Date</th>
<th>Status</th>
<th>Upload Bukti</th>
<th>Action</th>
</tr>
@foreach ($history_refund as $HistoryRefund)
<tr>
<td class="font-weight-600">{{ $HistoryRefund['orderId'] }}</a></td>
<td class="font-weight-600">{{ $HistoryRefund['customer'] }}</td>
<td class="font-weight-600">{{ $HistoryRefund['seller'] }}</td>
<td class="font-weight-600">{{ $HistoryRefund['total'] }}</td>
<td class="font-weight-600">{{ $HistoryRefund['dueDate'] }}</td>
<td>{{ $HistoryRefund['date'] }}</td>
<td>
<div class="badge badge-danger">{{ $HistoryRefund['status'] }}</div>
</td>
<td>
<a href="/detail_refund" class="btn btn-primary">Detail</a>
</td>
<td>
<!-- Input field for uploading an image or video -->
<div class="col-md-12 d-flex align-items-center">
<label class="form-label me-3"
for="uploadFile{{ $HistoryRefund['orderId'] }}">Upload File</label>
<input class="form-control" type="file"
id="uploadFile{{ $HistoryRefund['orderId'] }}" name="uploadedFiles[]">
</div>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -32,34 +32,36 @@
</tr>
</thead>
<tbody>
@foreach ($refundUserss as $key => $HistoryRefundUser)
@foreach ($refunds as $refund)
<tr>
<td> {{ ++$key }}</td>
<td class="font-weight-600">
{{ $HistoryRefundUser['orderId'] }}</td>
<td class="font-weight-600">
{{ $HistoryRefundUser['Customer'] }}</td>
<td class="font-weight-600">
{{ $HistoryRefundUser['seller'] }}</td>
<td class="font-weight-600">
{{ $HistoryRefundUser['Total'] }}</td>
<td>{{ $HistoryRefundUser['dueDate'] }}</td>
<td class="font-weight-600">
<div class="badge badge-danger" data-status="ditolak"
onclick="setStatus('ditolak')">Ditolak</div>
{{-- {{ $HistoryRefundUser['status'] }} --}}
<td>{{ $loop->iteration }}</td>
<td>{{ $refund->id }}</td>
<td>{{ $refund->transaction->data_pembeli->nama_depan }}
</td>
<td>{{ $refund->transaction->data_penjual->nama_depan }}
</td>
<td>{{ $refund->total }}</td>
<td>{{ $refund->created_at }}</td>
<td>{{ $refund->due_date }}</td>
<td><a href="#" data-toggle="modal"
data-target="#modalKeteranganStatus"
class="badge {{ $refund->status == 'partial refund' ? 'badge-succes' : ($refund->status == 'pending' ? 'badge-warning' : 'badge-danger') }}">{{ ucwords($refund->status) }}</a>
</td>
<td class="font-weight-600">
{{ $HistoryRefundUser['uploadBukti'] }}</td>
<td>
<button class="btn btn-info open-detail-modal" data-toggle="modal"
data-target="#awaldetailrefund">Detail</button>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Aksi
</button>
<div class="dropdown-menu">
<a class="dropdown-item"
href="{{ route('admin-refund.show', $refund->id) }}">Detail</a>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@ -68,5 +70,5 @@
</div>
</div>
</div>
@extends('user.refund.detail-refund')
@extends('user.refund.modal-detail-refund')
@endsection

View File

@ -12,19 +12,22 @@
</div>
</div>
<div class="section-body">
<h2 class="section-title">
Admin</h2>
<h2 class="section-buyer">
{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }}</h2>
<h2 class="section-seller">
{{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }}</h2>
<div class="d-flex justify-content-between align-items-center">
<div class="card-title pb-2 m-0">
<h4>Timeline</h4>
</div>
</div>
<div class="row mt-sm-4">
<div class="col-sm-12 col-md-12 col-lg-5">
<h2 class="section-title">
Admin</h2>
<h2 class="section-buyer">
{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }}
</h2>
<h2 class="section-seller">
{{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }}
</h2>
<div class="d-flex justify-content-between align-items-center">
<div class="card-title pb-2 m-0">
<h4>Timeline</h4>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="activities">

View File

@ -33,10 +33,12 @@
<table class="table table-striped" id="table-3">
<thead>
<tr>
<th>No</th>
<th class="text-center">
#
</th>
<th>Penjual</th>
<th>Total</th>
<th>Tanggal Pembuatan</th>
<th>Tanggal Transaksi</th>
<th>Tanggal Update</th>
<th>Status</th>
<th>Aksi</th>
@ -52,7 +54,18 @@
<td>{{ $transaction->created_at }}</td>
<td>{{ $transaction->updated_at }}</td>
<td><a href="#" data-toggle="modal"
data-target="#modalKeteranganStatus">{{ ucwords($transaction->status) }}</a>
data-target="#modalKeteranganStatus"
class="badge {{ in_array($transaction->status, ['pending', 'created'])
? 'badge-light'
: (in_array($transaction->status, ['settlement', 'capture'])
? 'badge-info'
: (in_array($transaction->status, ['process', 'sending', 'sended'])
? 'badge-warning'
: (in_array($transaction->status, ['cancel', 'expire', 'failure', 'refund'])
? 'badge-danger'
: ($transaction->status == 'finished'
? 'badge-success'
: '')))) }}">{{ ucwords($transaction->status) }}</a>
</td>
<td>
<div class="btn-group">

View File

@ -116,7 +116,6 @@
</div>
</section>
</div>
@extends('user.layout.progress-bar')
@extends('user.transaction.pembeli.modal-keterangan-status')
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>

View File

@ -27,7 +27,9 @@
<table class="table table-striped" id="table-3">
<thead>
<tr>
<th>No</th>
<th class="text-center">
#
</th>
<th>Order ID</th>
<th>Pembeli</th>
<th>Total</th>
@ -48,7 +50,18 @@
<td>{{ $transaction->created_at }}</td>
<td>{{ $transaction->updated_at }}</td>
<td><a href="#" data-toggle="modal"
data-target="#modalKeteranganStatus">{{ ucwords($transaction->status) }}</a>
data-target="#modalKeteranganStatus"
class="badge {{ in_array($transaction->status, ['pending', 'created'])
? 'badge-light'
: (in_array($transaction->status, ['settlement', 'capture'])
? 'badge-info'
: (in_array($transaction->status, ['process', 'sending', 'sended'])
? 'badge-warning'
: (in_array($transaction->status, ['cancel', 'expire', 'failure', 'refund'])
? 'badge-danger'
: ($transaction->status == 'finished'
? 'badge-success'
: '')))) }}">{{ ucwords($transaction->status) }}</a>
</td>
<td>
<div class="btn-group">
@ -59,13 +72,14 @@
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item"
href="{{ route('user-transaction.detail.pembeli', $transaction->id) }}">Detail</a>
</li>
<li><a class="dropdown-item" data-toggle="modal"
data-target="#tracking" id="tracking"
data-tracking="{{ $transaction->transactionDescription }}"
href="#">Tracking</a>
href="{{ route('user-penjual.show', $transaction->id) }}">Detail</a>
</li>
@if (!$transaction->transactionDescription->isEmpty())
<li><a class="dropdown-item" data-toggle="modal"
data-target="#modalTracking"
data-transaction="{{ $transaction->transactionDescription }}">Tracking</a>
</li>
@endif
{{-- Setelah dibayar --}}
@if ($transaction->status == 'settlement')
<li><a class="dropdown-item" href="#">Process</a>
@ -102,9 +116,52 @@
@extends('user.transaction.penjual.modal-keterangan-status')
<script>
$(document).ready(function() {
$('#table-3').on('click', '#tracking', function() {
const transactionTracking = $(this).data('tracking');
console.log(transactionTracking);
$('#modalTracking').on('show.bs.modal', function(event) {
var triggerLink = $(event.relatedTarget); // Tombol yang memicu modal
var transactionDatas = triggerLink.data('transaction'); // Ambil data dari tombol
// Buat variabel untuk menyimpan HTML aktivitas
transactionDatas = transactionDatas.reverse();
var activitiesHtml = '';
// Periksa apakah ada data transaksi
if (transactionDatas && transactionDatas.length > 0) {
// Iterasi melalui data transaksi dan tambahkan ke activitiesHtml
$.each(transactionDatas, function(index, transactionDescription) {
activitiesHtml += `
<div class="activity">
<div class="activity-icon ${transactionDescription.background} text-white shadow-primary">
<i class="${transactionDescription.judul}" style="font-size: 36px;"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">${new Date(transactionDescription.created_at).toLocaleString()}</span>
</div>
<p>${transactionDescription.deskripsi}</p>
</div>
</div>
`;
});
} else {
// Tidak ada data transaksi, tambahkan pesan kosong
activitiesHtml += `
<div class="activity">
<div class="activity-icon bg-primary text-white shadow-primary">
<i class="fas fa-ban" style="font-size: 36px;"></i>
</div>
<div class="activity-detail">
<div class="mb-2">
<span class="text-job text-primary">--, --:--:-- --</span>
</div>
<p>Kosong</p>
</div>
</div>
`;
}
// Menampilkan data dalam modal
var modal = $(this);
modal.find('.activities').html(activitiesHtml);
});
});
</script>

View File

@ -1,5 +1,5 @@
<!-- Modal -->
<div class="modal fade" id="tracking" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
<div class="modal fade" id="modalTracking" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">

View File

@ -1,8 +1,7 @@
<!-- General JS Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src="{{ asset('assets/modules/popper.js') }}"></script>
<script src="{{ asset('assets/modules/tooltip.js') }}"></script>
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('assets/modules/moment.min.js') }}"></script>
<script src="{{ asset('assets/js/stisla.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

View File

@ -9,6 +9,9 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous">
</script>
<script src="{{ asset('assets/modules/popper.js') }}"></script>
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.js') }}"></script>
<!-- dashboard -->
<script src="{{ asset('assets/modules/chart.min.js') }}"></script>

View File

@ -39,12 +39,12 @@
<div id="submenuTransaction" class="collapse">
<ul class="nav flex-column sub-menu">
<li class="nav-item {{ request()->routeIs('user-pembeli.index') ? 'active' : '' }}">
<li class="nav-item">
<a class="nav-link" href="{{ route('user-pembeli.index') }}">
<i class="fas fa-users"></i> Pembeli
</a>
</li>
<li class="nav-item {{ request()->routeIs('user-penjual.index') ? 'active' : '' }}">
<li class="nav-item">
<a class="nav-link" href="{{ route('user-penjual.index') }}">
<i class="fas fa-user"></i> Penjual
</a>