From 85dec7d3c07b7c82724ccf45dd109b3c91a6444f Mon Sep 17 00:00:00 2001 From: Raihan Surya Date: Tue, 21 Nov 2023 13:48:29 +0700 Subject: [PATCH 1/2] API Flutter Patch 3 --- .../API/Pembeli/PembeliApiController.php | 6 +- .../API/Penjual/PenjualApiController.php | 10 +- .../API/Profile/ProfileApiController.php | 22 +- .../API/Refund/RefundApiController.php | 74 ++++++- .../Dashboard/AdminDashboardController.php | 4 +- .../Controllers/Invoice/InvoiceController.php | 12 +- .../Dashboard/UserDashboardController.php | 47 ++++- .../User/Penjual/PenjualController.php | 34 ++- ...08_01_073859_create_transactions_table.php | 2 +- resources/views/Admin/index.blade.php | 109 ---------- .../refund/modal-keterangan-status.blade.php | 47 +---- .../views/Admin/transaction/index.blade.php | 2 +- .../modal-keterangan-status.blade.php | 5 + resources/views/User/index.blade.php | 116 ++++++---- .../refund/modal-keterangan-status.blade.php | 47 +---- .../User/transaction/Pembeli/index.blade.php | 2 +- .../Pembeli/modal-keterangan-status.blade.php | 5 + .../User/transaction/penjual/index.blade.php | 45 +++- .../penjual/modal-keterangan-status.blade.php | 6 + .../views/invoice/export-invoice.blade.php | 198 +++++++++++------- routes/api.php | 68 +++--- routes/web.php | 1 + 22 files changed, 467 insertions(+), 395 deletions(-) diff --git a/app/Http/Controllers/API/Pembeli/PembeliApiController.php b/app/Http/Controllers/API/Pembeli/PembeliApiController.php index 86ef230..e6e50d3 100644 --- a/app/Http/Controllers/API/Pembeli/PembeliApiController.php +++ b/app/Http/Controllers/API/Pembeli/PembeliApiController.php @@ -191,6 +191,7 @@ class PembeliApiController extends Controller return response()->json([ 'status' => true, 'message' => 'Berhasil menambahkan transaksi. Silahkan lakukan pembayaran.', + 'url' => $result['redirect_url'] ]); } catch (Throwable $e) { DB::rollBack(); @@ -243,6 +244,7 @@ class PembeliApiController extends Controller public function payPayment(Request $request) { + $auth = base64_encode(env('MIDTRANS_SERVER_KEY')); $response = Http::withOptions([ @@ -351,8 +353,6 @@ class PembeliApiController extends Controller 'message' => 'Transaksi pembayaran gagal.', ]); } - - return response()->json(); } public function cancelPayment(Request $request) @@ -574,7 +574,7 @@ class PembeliApiController extends Controller 'status' => false, 'message' => 'Pembayaran sudah expire, silahkan buat transaksi baru.', ]); - } elseif ($result['transaction'] == 'failure') { + } elseif ($result['transaction_status'] == 'failure') { TransactionDescription::create([ 'transaction_id' => $request->input('id'), 'status' => 'failure', diff --git a/app/Http/Controllers/API/Penjual/PenjualApiController.php b/app/Http/Controllers/API/Penjual/PenjualApiController.php index 14c8d7b..19c7a7e 100644 --- a/app/Http/Controllers/API/Penjual/PenjualApiController.php +++ b/app/Http/Controllers/API/Penjual/PenjualApiController.php @@ -59,7 +59,7 @@ class PenjualApiController extends Controller $params = [ 'refund_key' => $request->input('id') . '-ref1', 'amount' => $transaction->total_bayar, - 'reason' => $request->complaint, + 'reason' => $request->input('complaint'), ]; $auth = base64_encode(env('MIDTRANS_SERVER_KEY')); @@ -91,7 +91,7 @@ class PenjualApiController extends Controller 'total' => $transaction->total_bayar, 'due_date' => now(), 'status' => 'refund', - 'complaint' => $request->complaint, + 'complaint' => $request->input('complaint'), ]); TransactionDescription::create([ @@ -100,7 +100,7 @@ class PenjualApiController extends Controller 'background' => 'bg-seller', 'user' => auth()->user()->email, 'judul' => 'fas fa-times', - 'deskripsi' => 'Transaksi ditolak ' . auth()->user()->nama_depan . ', uang akan dikembalikan ke pembeli. Alasan : ' . $request->complaint, + 'deskripsi' => 'Transaksi ditolak ' . auth()->user()->nama_depan . ', uang akan dikembalikan ke pembeli. Alasan : ' . $request->input('complaint'), ]); DB::commit(); @@ -339,4 +339,8 @@ class PenjualApiController extends Controller } } + public function acceptResult(Request $request){ + + } + } diff --git a/app/Http/Controllers/API/Profile/ProfileApiController.php b/app/Http/Controllers/API/Profile/ProfileApiController.php index a974b35..1ec9e8c 100644 --- a/app/Http/Controllers/API/Profile/ProfileApiController.php +++ b/app/Http/Controllers/API/Profile/ProfileApiController.php @@ -20,25 +20,17 @@ class ProfileApiController extends Controller { public function getProfile() { - $provinces = Provinsi::where('code', auth()->user()->village->district->city->province->code)->get(); - $cities = City::where('province_code', auth()->user()->village->district->city->province->code)->get(); - $districts = District::where('city_code', auth()->user()->village->district->city->code)->get(); - $villages = Village::where('district_code', auth()->user()->village->district->code)->get(); $token = JWTAuth::getToken(); $user = JWTAuth::user($token); return response()->json([ 'user' => $user, - 'provinces' => $provinces, - 'cities' => $cities, - 'districts' => $districts, - 'villages' => $villages ]); } public function updateProfile(Request $request) { - $nama_depan = str_replace(' ', '_', $request->input('nama_depan')); - $nama_belakang = str_replace(' ', '_', $request->input('nama_belakang')); + $nama_depan = $request->input('nama_depan'); + $nama_belakang = $request->input('nama_belakang'); $nohp = $request->input('nohp'); $kode_kelurahan = $request->input('kelurahan'); $alamat = $request->input('alamat'); @@ -47,7 +39,7 @@ class ProfileApiController extends Controller $foto_profile = ''; if ($request->hasFile('foto')) { $file = $request->file('foto'); - $foto_profile = 'Foto_Profil_' . $nama_depan . '_' . $nama_belakang .'.'. $file->getClientOriginalExtension(); + $foto_profile = 'Foto_Profil_' . str_replace(' ', '_', $request->input('nama_depan')) . '_' . str_replace(' ', '_', $request->input('nama_belakang')).'.'. $file->getClientOriginalExtension(); $path = 'foto-profile/' . $foto_profile; Storage::disk('public')->put($path, file_get_contents($file)); @@ -80,12 +72,12 @@ class ProfileApiController extends Controller } public function updateProfilePassword(Request $request){ - $currentPassword = $request->input('currentPassword'); - $newPassword = $request->input('newPassword'); - $renewPassword = $request->input('renewPassword'); + $currentPassword = $request->input('current_password'); + $newPassword = $request->input('new_password'); + $renewPassword = $request->input('renew_password'); if(!Hash::check($currentPassword, auth()->user()->password)){ - return response()->json(['status' => false, 'message' => 'Password sekarang tidak sama','password' => $currentPassword]); + return response()->json(['status' => false, 'message' => 'Password sekarang tidak sama']); } if($renewPassword != $newPassword){ diff --git a/app/Http/Controllers/API/Refund/RefundApiController.php b/app/Http/Controllers/API/Refund/RefundApiController.php index 8101fc3..e23d730 100644 --- a/app/Http/Controllers/API/Refund/RefundApiController.php +++ b/app/Http/Controllers/API/Refund/RefundApiController.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use App\Http\Controllers\Controller; use App\Models\TransactionDescription; +use Yajra\DataTables\Facades\DataTables; class RefundApiController extends Controller { @@ -83,7 +84,7 @@ class RefundApiController extends Controller Log::error($e->getMessage()); - return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); + return response()->json(['success' => false, 'message' => 'Terjadi kesalahan pada sisi server']); } } @@ -95,4 +96,75 @@ class RefundApiController extends Controller 'descriptions' => $refundDescription ]); } + + public function listRefund(Request $request) + { + try{ + $subQuery = Refund::join('transactions', 'refunds.transaction_id', '=', 'transactions.id') + ->join('users as s', 'transactions.penjual','=','s.email') + ->select( + 'refunds.id', + 'refunds.total', + 'refunds.due_date', + 'refunds.created_at', + 'refunds.status', + 'transactions.nama_barang', + DB::raw("CONCAT(s.nama_depan,' ',s.nama_belakang) as nama_penjual"), + ); + + if($request->has('search') && !empty($request->search['value'])){ + $searchRefund = $request->search['value']; + if(!is_numeric($searchRefund)){ + $subQuery->where(function($a) use ($searchRefund){ + $a->whereRaw("LOWER(CONCAT(s.nama_depan,' ',s.nama_belakang)) LIKE ?",['%'.strtolower($searchRefund).'%']) + ->orWhereRaw('LOWER(transactions.nama_barang) LIKE ?',['%'.strtolower($searchRefund).'%']) + ->orWhereRaw('LOWER(refunds.status) LIKE ?',['%'.strtolower($searchRefund).'%']); + }); + }else{ + $subQuery->where(function($a) use ($searchRefund){ + $a->whereDay('refunds.created_at', '=', $searchRefund) + ->orWhereMonth('refunds.created_at', '=', $searchRefund) + ->orWhereYear('refunds.created_at', '=', $searchRefund) + ->orWhereDay('refunds.due_date', '=', $searchRefund) + ->orWhereMonth('refunds.due_date', '=', $searchRefund) + ->orWhereYear('refunds.due_date', '=', $searchRefund) + ->orWhere('refunds.total', '=', $searchRefund); + }); + } + } + + $queryRefund = Refund::from(DB::raw("({$subQuery->toSql()}) as tmp")) + ->mergeBindings($subQuery->getQuery()) // Menggabungkan binding parameters + ->select('*') + ->get(); + + if ($request->ajax()) { + return DataTables::of($queryRefund) + ->addIndexColumn() + ->addColumn('action', function ($row) { + $url = route('user-refund.show', ['id' => $row->id]); + $html_code = ' +
+ + + +
'; + return $html_code; + }) + ->rawColumns(['action']) + ->make(true); + } + }catch(Throwable $e){ + Log::error($e->getMessage()); + + return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); + } + } } diff --git a/app/Http/Controllers/Admin/Dashboard/AdminDashboardController.php b/app/Http/Controllers/Admin/Dashboard/AdminDashboardController.php index 82fb298..d8cd92a 100644 --- a/app/Http/Controllers/Admin/Dashboard/AdminDashboardController.php +++ b/app/Http/Controllers/Admin/Dashboard/AdminDashboardController.php @@ -5,7 +5,6 @@ namespace App\Http\Controllers\Admin\Dashboard; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Carbon\Carbon; -use App\Models\Transactions; use App\Models\Transaction; use App\Models\Refund; use App\Models\User; @@ -15,7 +14,6 @@ class AdminDashboardController extends Controller { public function index() { - $transactions = Transactions::allTransactions(); $currentMonth = Carbon::now()->month; $currentYear = Carbon::now()->year; @@ -73,7 +71,7 @@ class AdminDashboardController extends Controller return view('admin.index', compact('transactions', 'countSuccess', 'countPending', 'countCancelled', 'countRefund', 'totalRefund', 'totalUser', 'totalTransaction', 'dataChartTransaction', 'dataChartRefund', 'dataChartTotalUser', 'dataChartTotalRefund', 'transactions')); } - public function getChartByMonth() + public function getSelectedChart() { $dataChartLaporan = []; $tahun = Carbon::now()->year; diff --git a/app/Http/Controllers/Invoice/InvoiceController.php b/app/Http/Controllers/Invoice/InvoiceController.php index 77ca40e..e7a4b63 100644 --- a/app/Http/Controllers/Invoice/InvoiceController.php +++ b/app/Http/Controllers/Invoice/InvoiceController.php @@ -18,11 +18,11 @@ class InvoiceController extends Controller public function exportInvoice(Request $request) { - // $transaction = Transaction::findOrFail($request->id); - // $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait'); - // return $pdf->download("invoice-$request->id.pdf"); - return view('invoice.export-invoice', [ - 'transaction' => Transaction::findOrFail($request->id), - ]); + $transaction = Transaction::findOrFail($request->id); + $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait'); + return $pdf->download("invoice-$request->id.pdf"); + // return view('invoice.export-invoice', [ + // 'transaction' => Transaction::findOrFail($request->id), + // ]); } } diff --git a/app/Http/Controllers/User/Dashboard/UserDashboardController.php b/app/Http/Controllers/User/Dashboard/UserDashboardController.php index 050a97e..28b5067 100644 --- a/app/Http/Controllers/User/Dashboard/UserDashboardController.php +++ b/app/Http/Controllers/User/Dashboard/UserDashboardController.php @@ -5,6 +5,8 @@ namespace App\Http\Controllers\User\Dashboard; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\RefundUser; +use App\Models\Transaction; +use Carbon\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; @@ -12,9 +14,46 @@ use Throwable; class UserDashboardController extends Controller { - public function index(){ - return view('user.index',[ - "refundUserss"=>RefundUser::HistoryRefundUser(), - ]); + public function index() + { + $currentMonth = Carbon::now()->month; + $currentYear = Carbon::now()->year; + $currentRole = 'Pembeli'; + + $countCreated = Transaction::where('status_transaksi', 'created') + ->whereMonth('updated_at', $currentMonth) + ->whereYear('updated_at', $currentYear) + ->where('pembeli', auth()->user()->email) + ->count(); + + $countPending = Transaction::where('status_pembayaran', 'pending') + ->whereMonth('updated_at', $currentMonth) + ->whereYear('updated_at', $currentYear) + ->where('pembeli', auth()->user()->email) + ->count(); + + $countFailure = Transaction::whereIn('status_pembayaran', ['cancel', 'expire', 'failure']) + ->whereMonth('updated_at', $currentMonth) + ->whereYear('updated_at', $currentYear) + ->where('pembeli', auth()->user()->email) + ->count(); + + $sumRefund = ''; + + $sumTransaksi = ''; + + return view('user.index'); + } + + public function getSelectedChart(){ + $currentMonth = Carbon::now()->month; + $currentYear = Carbon::now()->year; + $currentRole = 'Pembeli'; + + if($currentRole == 'Pembeli'){ + + }else{ + + } } } diff --git a/app/Http/Controllers/User/Penjual/PenjualController.php b/app/Http/Controllers/User/Penjual/PenjualController.php index d794337..2427405 100644 --- a/app/Http/Controllers/User/Penjual/PenjualController.php +++ b/app/Http/Controllers/User/Penjual/PenjualController.php @@ -115,7 +115,7 @@ class PenjualController extends Controller '; } - if ($row->status_transaksi == 'sent') { + if ($row->status_transaksi == 'sending') { $html_code .= '
  • '; } + + if ($row->status_transaksi == 'finished') { + $html_code .= + ' +
  • Terima Uang +
  • + '; + } $html_code .= ' '; @@ -336,11 +348,21 @@ class PenjualController extends Controller 'message' => 'Gagal update status karena kesalahan server.', ]); } + } - return response([ - 'status' => true, - 'message' => 'Sukses kirim data.', - 'data' => $request, - ]); + public function acceptResult(Request $request) + { + try{ + + }catch(Throwable $e){ + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Gagal update status karena kesalahan server.', + ]); + } } } diff --git a/database/migrations/2023_08_01_073859_create_transactions_table.php b/database/migrations/2023_08_01_073859_create_transactions_table.php index fb52e88..7480ed5 100644 --- a/database/migrations/2023_08_01_073859_create_transactions_table.php +++ b/database/migrations/2023_08_01_073859_create_transactions_table.php @@ -29,7 +29,7 @@ return new class extends Migration $table->string('token')->nullable(); $table->string('metode_pembayaran')->nullable(); $table->string('fraud_status')->nullable(); - $table->enum('status_transaksi',['success','challenge','failure','process','sending','sent','finished','created', 'refund'])->default('created'); // transaction_status + $table->enum('status_transaksi',['success','challenge','failure','process','sending','sent','finished','created', 'refund', 'done'])->default('created'); // transaction_status $table->enum('status_pembayaran',['settlement','capture','pending','expire','failure','cancel','refund'])->nullable(); // status transaksi dari midtrans $table->timestamp('batas_pembayaran')->nullable(); $table->timestamp('batas_konfirmasi_transaksi')->nullable(); diff --git a/resources/views/Admin/index.blade.php b/resources/views/Admin/index.blade.php index c263cc0..a33e1b2 100644 --- a/resources/views/Admin/index.blade.php +++ b/resources/views/Admin/index.blade.php @@ -130,32 +130,6 @@
    - {{--
    -
    - 7% -
    $243
    -
    Today's Sales
    -
    -
    - 23% -
    $2,902
    -
    This Week's Sales
    -
    -
    - 9% -
    $12,821
    -
    This Month's Sales
    -
    -
    - 19% -
    $92,142
    -
    This Year's Sales
    -
    -
    --}}
    @@ -298,89 +272,6 @@ - {{--
    -
    -
    -
    -
    -

    History Transaction

    -
    -
    -
    -
    - - - - - - - - - - - - - - - - @foreach ($transactions as $transaction) - - - - - - - - - - - - @endforeach - -
    - # - Nama BarangPembeliPenjualTotalTanggal TransaksiTanggal UpdateStatusAksi
    {{ $loop->iteration }}{{ $transaction->nama_barang }}{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }} - {{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }} - Rp {{ number_format($transaction->total_bayar, 2, ',', '.') }}{{ $transaction->created_at }}{{ $transaction->updated_at }}{{ ucwords($transaction->status) }} - -
    - - - -
    -
    -
    -
    -
    -
    -
    --}} @include('admin.transaction.modal-tracking') diff --git a/resources/views/Admin/refund/modal-keterangan-status.blade.php b/resources/views/Admin/refund/modal-keterangan-status.blade.php index 6e8b7e5..9eb9b3e 100644 --- a/resources/views/Admin/refund/modal-keterangan-status.blade.php +++ b/resources/views/Admin/refund/modal-keterangan-status.blade.php @@ -2,54 +2,23 @@ +
    + +

    Transaksi selesai dan uang akan dikirim ke penjual.

    +
    +

    Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan diff --git a/resources/views/User/index.blade.php b/resources/views/User/index.blade.php index b7d7a61..a674235 100644 --- a/resources/views/User/index.blade.php +++ b/resources/views/User/index.blade.php @@ -4,49 +4,59 @@

    -
    +
    List Transaction - + + Sebagai - +
    114
    -
    Success
    +
    Dibuat
    12
    @@ -54,7 +64,7 @@
    23
    -
    Canceled
    +
    Gagal
    @@ -63,15 +73,15 @@
    -

    Total Transaction

    +

    Jumlah Transaction

    - 159 + 159 Transaksi
    -
    + {{--
    @@ -81,10 +91,10 @@
    -

    Total Refund

    +

    Jumlah Refund

    - 190 + 190 Bulan ini
    @@ -102,19 +112,29 @@

    Total Transaction

    - 109
    + 109 Bulan ini
    -
    + --}}
    +
    -

    INCOME

    +

    Transaksi

    +
    +
    + Week + Month +
    +
    - 1412 +
    @@ -131,11 +151,11 @@ var myChart = new Chart(ctx, { type: 'line', data: { - labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September", - "Oktober", "November", "December" + labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Agu", "Sep", + "Okt", "Nov", "Des" ], datasets: [{ - label: 'Transaction', + label: 'Transaksi', data: [3200, 18009, 4305, 3022, 6310, 5120, 5880, 6154, 0], borderWidth: 2, backgroundColor: 'rgba(63,82,227,.8)', @@ -162,12 +182,13 @@ }, options: { layout: { - padding: 20, + padding: 10, }, legend: { display: true, labels: { - padding: 20, + padding: 10, + fontSize: 16 } }, scales: { @@ -186,13 +207,22 @@ style: 'currency', currency: 'IDR', }).format(value); - } - } + }, + fontSize: 14, + }, + scaleLabel: { + display: true, + labelString: 'Dalam Ratusan Juta', // Label khusus untuk sumbu Y + fontSize: 16 // Ukuran font untuk label sumbu Y + }, }], xAxes: [{ gridLines: { display: true, tickMarkLength: 15, + }, + ticks: { + fontSize: 16, } }] }, diff --git a/resources/views/User/refund/modal-keterangan-status.blade.php b/resources/views/User/refund/modal-keterangan-status.blade.php index 6e8b7e5..9eb9b3e 100644 --- a/resources/views/User/refund/modal-keterangan-status.blade.php +++ b/resources/views/User/refund/modal-keterangan-status.blade.php @@ -2,54 +2,23 @@ +
    + +

    Transaksi selesai dan uang akan dikirim ke penjual.

    +
    +

    Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan diff --git a/resources/views/User/transaction/penjual/index.blade.php b/resources/views/User/transaction/penjual/index.blade.php index 9f2bfe0..4b227ba 100644 --- a/resources/views/User/transaction/penjual/index.blade.php +++ b/resources/views/User/transaction/penjual/index.blade.php @@ -134,7 +134,7 @@ return ` ${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)} `; - } else if (row.status_transaksi == 'finished') { + } else if (['finished', 'done'].includes(row.status_transaksi)) { return ` ${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)} `; @@ -532,6 +532,49 @@ $('#acceptResult').on('click', function() { const csrfToken = $('meta[name="csrf-token"]').attr('content'); + const id = $(this).data('id'); + + Swal.fire({ + html: '

    Form Anda sedang diproses!

    Mohon tunggu...

    ', + allowEscapeKey: false, + allowOutsideClick: false, + didOpen: () => { + Swal.showLoading(); + } + }); + + $.ajaxSetup({ + headers: { + 'X-CSRF-TOKEN': csrfToken + } + }); + + $.ajax({ + url: "{{ route('user-penjual.accept-result') }}", + type: 'PUT', + data: { + id: id, + }, + success: function(response) { + Swal.fire({ + title: response.status ? 'Berhasil' : 'Gagal', + text: response.message, + icon: response.status ? 'success' : 'error', + confirmButtonText: 'OK', + }).then(function() { + if (response.status) { + listPenjual.ajax.reload(); + } + }); + }, + error: function(error) { + Swal.fire({ + title: 'Gagal', + text: 'Terjadi error di server', + icon: 'error' + }); + } + }); }); }); diff --git a/resources/views/User/transaction/penjual/modal-keterangan-status.blade.php b/resources/views/User/transaction/penjual/modal-keterangan-status.blade.php index 6e8b7e5..fce4f36 100644 --- a/resources/views/User/transaction/penjual/modal-keterangan-status.blade.php +++ b/resources/views/User/transaction/penjual/modal-keterangan-status.blade.php @@ -3,6 +3,7 @@ + +
    +@endsection diff --git a/resources/views/Admin/notification/edit.blade.php b/resources/views/Admin/notification/edit.blade.php new file mode 100644 index 0000000..4332cc5 --- /dev/null +++ b/resources/views/Admin/notification/edit.blade.php @@ -0,0 +1,240 @@ +@extends('layouts.main') +@section('content') + +
    +
    +
    +

    Edit Notifikasi

    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + Daftar akun akan yang mendapatkan notifikasi +
    +
    +
    + + +
    + + + + + + + + + + + + +
    + # + + Nama Lengkap + + Email +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +@endsection diff --git a/resources/views/Admin/notification/index.blade.php b/resources/views/Admin/notification/index.blade.php new file mode 100644 index 0000000..bc6d090 --- /dev/null +++ b/resources/views/Admin/notification/index.blade.php @@ -0,0 +1,120 @@ +@extends('layouts.main') +@section('content') + +
    +
    +
    +

    Notifikasi

    +
    + + +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + +
    + # + + Judul + + Teaser + + Dibuat pada + + Diperbarui pada + + Aksi +
    +
    +
    +
    +
    +
    +
    +@endsection diff --git a/resources/views/Admin/notification/show.blade.php b/resources/views/Admin/notification/show.blade.php new file mode 100644 index 0000000..49b264e --- /dev/null +++ b/resources/views/Admin/notification/show.blade.php @@ -0,0 +1,130 @@ +@extends('layouts.main') +@section('content') + +
    +
    +
    +

    Detail Notifikasi

    +
    + + + +
    +
    +
    +
    +
    +
    +

    {{ $notification->title }}

    +
    + +
    + {{ $notification->content }} +
    + +
    + Daftar akun yang mendapatkan notifikasi +
    +
    + + + + + + + + + + + + + +
    + # + + Nama Lengkap + + Email + + Tanggal Kirim + + Tanggal Terima +
    +
    +
    + +
    +
    +
    +
    +
    +@endsection diff --git a/resources/views/Admin/setting/index.blade.php b/resources/views/Admin/setting/index.blade.php index 9434f0e..2b37b72 100644 --- a/resources/views/Admin/setting/index.blade.php +++ b/resources/views/Admin/setting/index.blade.php @@ -196,7 +196,7 @@
    diff --git a/resources/views/Admin/transaction/detail-transaction.blade.php b/resources/views/Admin/transaction/detail-transaction.blade.php index 97fc1b8..3341e79 100644 --- a/resources/views/Admin/transaction/detail-transaction.blade.php +++ b/resources/views/Admin/transaction/detail-transaction.blade.php @@ -97,6 +97,64 @@ + {{-- batas pembayaran dan pengiriman --}} +
    +
    +
    + Batas Pembayaran:
    + {{ date('d F Y', strtotime($transaction->batas_pembayaran)) }}
    +
    +
    +
    +
    + Estimasi Pengiriman:
    + {{ date('Y', strtotime($transaction->batas_pengiriman_barang_awal)) == + date('Y', strtotime($transaction->batas_pengiriman_barang_akhir)) + ? (date('F', strtotime($transaction->batas_pengiriman_barang_awal)) == + date('F', strtotime($transaction->batas_pengiriman_barang_akhir)) + ? date('d', strtotime($transaction->batas_pengiriman_barang_awal)) . + '-' . + date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir)) + : date('F', strtotime($transaction->batas_pengiriman_barang_awal)) . + '-' . + date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir))) + : date('d F', strtotime($transaction->batas_pengiriman_barang_awal)) . + '-' . + date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir)) }}
    +
    +
    +
    + {{-- Keterangan Pembayaran --}} +
    +
    +
    + Status Transaksi:
    + {{ ucwords($transaction->status_transaksi) }} +
    +
    +
    +
    + Status Pembayaran:
    + {{ ucwords($transaction->status_pembayaran) }} +
    +
    +
    + + {{-- Keterangan --}} +
    +
    +
    + Status Indikasi Penipuan:
    + {{ $transaction->fraud_status == null ? 'Tidak ada' : 'Ada' }} +
    +
    +
    +
    + Keterangan:
    + {{ $transaction->keterangan }} +
    +
    +
    @@ -161,18 +219,25 @@ +
    @if ($transaction->status_transaksi == 'challenge') -

    Pada transaksi ini terjadi penipuan. Apakah anda ini menerima transaksi ini?

    +
    @endif +
    + +
    @@ -334,6 +399,11 @@ } }); }); + + $('#btnPDF').on('click', function() { + const id = $(this).data('id'); + location.href = "{{ route('invoice.get', ':id') }}".replace(':id', id); + }); }); @endsection diff --git a/resources/views/User/index.blade.php b/resources/views/User/index.blade.php index a674235..1b568ed 100644 --- a/resources/views/User/index.blade.php +++ b/resources/views/User/index.blade.php @@ -4,7 +4,7 @@
    -
    +
    List Transaction - @@ -44,10 +44,11 @@ Sebagai - +
    +
    23
    +
    Gagal
    +
    +
    +
    23
    +
    Gagal
    +
    @@ -81,7 +90,7 @@
    - {{--
    +
    @@ -91,10 +100,10 @@
    -

    Jumlah Refund

    +

    Pemasukan

    - 190 Bulan ini + Rp. 35.000.000,00
    @@ -109,13 +118,12 @@
    -

    Total Transaction

    +

    Pengeluaran

    -
    - 109 Bulan ini
    +
    Rp. 35.000.000,00
    -
    --}} +
    @@ -168,7 +176,7 @@ }, { label: 'Refund', - data: [2207, 3403, 220000, 5025, 2302, 4208, 3880, 4880, 5000], + data: [2207, 3403, 2200, 5025, 2302, 4208, 3880, 4880, 5000], borderWidth: 2, backgroundColor: 'rgba(254,86,83,.7)', borderWidth: 0, diff --git a/resources/views/User/notification/detail-notification.blade.php b/resources/views/User/notification/detail-notification.blade.php new file mode 100644 index 0000000..3425642 --- /dev/null +++ b/resources/views/User/notification/detail-notification.blade.php @@ -0,0 +1,28 @@ +@extends('layouts.main') +@section('content') +
    +
    +
    +

    Detail Notifikasi

    +
    + + + +
    +
    +
    +
    +
    +
    +

    {{ $notification->title }}

    +
    + +
    + {{ $notification->content }} +
    +
    +
    +
    +
    +
    +@endsection diff --git a/resources/views/User/notification/index.blade.php b/resources/views/User/notification/index.blade.php new file mode 100644 index 0000000..b80f5ed --- /dev/null +++ b/resources/views/User/notification/index.blade.php @@ -0,0 +1,108 @@ +@extends('layouts.main') +@section('content') + + +
    +
    +
    +

    Notifikasi

    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    + # + + Judul + + Teaser + + Tanggal Dibuat + + Aksi +
    +
    +
    +
    +
    + + +@endsection diff --git a/resources/views/invoice/export-invoice.blade.php b/resources/views/invoice/export-invoice.blade.php index 64c26c0..105248e 100644 --- a/resources/views/invoice/export-invoice.blade.php +++ b/resources/views/invoice/export-invoice.blade.php @@ -28,9 +28,10 @@ } .info-user, + .data-pesanan, .rincian-pesanan, .info-pembayaran, - .data-pesanan { + .judul-rincian { border-collapse: collapse; width: 100%; } @@ -42,9 +43,10 @@ font-size: 1rem; } - table h3 { + h3 { font-size: 1.4rem; color: #191919; + text-align: center; } table span { @@ -58,8 +60,8 @@ font-size: 1rem; } - .py-2 { - padding: 20px 0; + table hr { + width: 100%; } .pt-0 { @@ -70,20 +72,17 @@ padding-top: 20px; } - .pt-4 { - padding-top: 40px; - } - - .pb-1 { - padding-bottom: 10px; + .pb-2 { + padding-bottom: 20px; } .pr-1 { padding-right: 10px; } - .pl-1 { - padding-left: 10px; + .info-user td, + .judul-rincian td { + height: 0; } .info-user td:first-child { @@ -104,12 +103,13 @@ .info-pembayaran td:first-child { opacity: 1%; + width: 75%; } .info-pembayaran td:last-child { font-size: 0.8rem; background: whitesmoke; - width: 60%; + padding: 0 20px; } .data-pesanan { @@ -117,11 +117,10 @@ margin: 15px 0; } - .data-pesanan thead { - height: 40px; + .data-pesanan th { text-transform: capitalize; font-size: 0.85rem; - padding: 20px 25px; + padding: 15px 30px 5px 30px; } .data-pesanan td { @@ -176,13 +175,13 @@
    -

    Nota Pesanan

    +

    Nota Pesanan

    - - @@ -191,24 +190,24 @@ - - + - - + - @@ -230,15 +229,15 @@
    +

    Pembeli :

    +

    Penjual :

    Takapedia Top Up
    +

    Email :

    darwin@gmail.comdarwin@gmail.com
    +

    Alamat :

    Pondok ponogoro jl.raya bogor no.26 rt 2/2Pondok ponogoro jl.raya bogor no.26 - rt 2/2Pondok ponogoro jl.raya bogor no.26 rt 2/2Pondok ponogoro jl.raya bogor no.26 rt + 2/2
    +

    no. HP :

    - +
    - - - + +
    -

    Rincian Pesanan

    +
    +

    Rincian Pesanan

    Semua pesanan yang di daftarkan dalam transaksiSemua pesanan yang di daftarkan dalam transaksi
    @@ -259,40 +258,40 @@
    - +
    - - + + - - + - - - + - diff --git a/resources/views/invoice/invoice-transaction.blade.php b/resources/views/invoice/invoice-transaction.blade.php index 0f5fc35..fd9c9d5 100644 --- a/resources/views/invoice/invoice-transaction.blade.php +++ b/resources/views/invoice/invoice-transaction.blade.php @@ -114,7 +114,7 @@
    + data-id="{{ $transaction->id }}">Print
    diff --git a/resources/views/layouts/header.blade.php b/resources/views/layouts/header.blade.php index 1a848de..709fbf5 100644 --- a/resources/views/layouts/header.blade.php +++ b/resources/views/layouts/header.blade.php @@ -1,3 +1,10 @@ +user()->email) + ->where('status', 'unread') + ->count(); +?> + diff --git a/resources/views/layouts/js.blade.php b/resources/views/layouts/js.blade.php index 40b9279..eb4ddf8 100644 --- a/resources/views/layouts/js.blade.php +++ b/resources/views/layouts/js.blade.php @@ -13,7 +13,7 @@ - + diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 50c648b..448aed9 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -13,7 +13,7 @@ href="{{ route(Auth::user()->role == 'Admin' ? 'admin.index' : 'user.index') }}"> Dashboard - + @if (Auth::user()->role == 'Admin')
  • Setting
  • +
  • + Notifikasi
  • @else
    [ini kosongggggggggggggggggggg][ini kosong]
    [kosong] +

    Rp.35.989.184,00

    [kosong]
    [kosong] +

    Rp.30.000,00

    [kosong] +
    [kosong]
    [kosong] +

    Rp.30.000,00