From d501cefc46c27f73dbc7b5e8b5a8c7705e1a5045 Mon Sep 17 00:00:00 2001 From: Raihan Surya Date: Mon, 27 Nov 2023 09:06:28 +0700 Subject: [PATCH] Notifikasi --- .../API/Penjual/PenjualApiController.php | 31 ++ .../Admin/Notification/AdminNotification.php | 325 ++++++++++++++++++ .../Admin/User/AdminUserController.php | 53 +-- .../Controllers/Invoice/InvoiceController.php | 2 +- .../Controllers/Login/LoginController.php | 2 +- .../User/Notification/UserNotification.php | 126 +++++++ .../User/Pembeli/PembeliController.php | 11 +- .../User/Penjual/PenjualController.php | 20 ++ app/Models/Notification.php | 27 ++ app/Models/NotificationReceiver.php | 30 ++ app/Models/RefundUser.php | 44 --- app/Models/Refunds.php | 80 ----- app/Models/Settings.php | 50 --- app/Models/TransactionUser.php | 57 --- app/Models/Transactions.php | 90 ----- app/Models/transaction.php | 4 +- ...08_01_073859_create_transactions_table.php | 1 + ...2023_08_16_044527_create_refunds_table.php | 1 + ...1_22_091953_create_notifications_table.php | 31 ++ ...09_create_notification_receivers_table.php | 34 ++ database/seeders/DatabaseSeeder.php | 18 + public/assets/css/main.css | 43 ++- public/assets/css/style.css | 4 +- .../views/Admin/notification/create.blade.php | 214 ++++++++++++ .../views/Admin/notification/edit.blade.php | 240 +++++++++++++ .../views/Admin/notification/index.blade.php | 120 +++++++ .../views/Admin/notification/show.blade.php | 130 +++++++ resources/views/Admin/setting/index.blade.php | 2 +- .../transaction/detail-transaction.blade.php | 76 +++- resources/views/User/index.blade.php | 28 +- .../detail-notification.blade.php | 28 ++ .../views/User/notification/index.blade.php | 108 ++++++ .../views/invoice/export-invoice.blade.php | 77 ++--- .../invoice/invoice-transaction.blade.php | 2 +- resources/views/layouts/header.blade.php | 277 ++++++++------- resources/views/layouts/js.blade.php | 2 +- resources/views/layouts/sidebar.blade.php | 5 +- routes/web.php | 28 +- 38 files changed, 1854 insertions(+), 567 deletions(-) create mode 100644 app/Http/Controllers/Admin/Notification/AdminNotification.php create mode 100644 app/Http/Controllers/User/Notification/UserNotification.php create mode 100644 app/Models/Notification.php create mode 100644 app/Models/NotificationReceiver.php delete mode 100644 app/Models/RefundUser.php delete mode 100644 app/Models/Refunds.php delete mode 100644 app/Models/Settings.php delete mode 100644 app/Models/TransactionUser.php delete mode 100644 app/Models/Transactions.php create mode 100644 database/migrations/2023_11_22_091953_create_notifications_table.php create mode 100644 database/migrations/2023_11_22_112309_create_notification_receivers_table.php create mode 100644 resources/views/Admin/notification/create.blade.php create mode 100644 resources/views/Admin/notification/edit.blade.php create mode 100644 resources/views/Admin/notification/index.blade.php create mode 100644 resources/views/Admin/notification/show.blade.php create mode 100644 resources/views/User/notification/detail-notification.blade.php create mode 100644 resources/views/User/notification/index.blade.php diff --git a/app/Http/Controllers/API/Penjual/PenjualApiController.php b/app/Http/Controllers/API/Penjual/PenjualApiController.php index 19c7a7e..4b7340b 100644 --- a/app/Http/Controllers/API/Penjual/PenjualApiController.php +++ b/app/Http/Controllers/API/Penjual/PenjualApiController.php @@ -340,7 +340,38 @@ class PenjualApiController extends Controller } public function acceptResult(Request $request){ + try{ + DB::beginTransaction(); + Transaction::where('id', $request->input('id'))->update([ + 'status_transaction' => 'done' + ]); + + TransactionDescription::create([ + 'transaction_id' => $request->input('id'), + 'status' => 'sent', + 'background' => 'bg-seller', + 'user' => auth()->user()->email, + 'judul' => 'fas fa-money-bill', + 'deskripsi' => auth()->user()->nama_depan.' telah menerima uang.', + ]); + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Uang akan dikirim ke bank anda. Terima kasih telah menggunakan Rekber.' + ]); + }catch(Throwable $e){ + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Gagal update status karena kesalahan server.', + ]); + } } } diff --git a/app/Http/Controllers/Admin/Notification/AdminNotification.php b/app/Http/Controllers/Admin/Notification/AdminNotification.php new file mode 100644 index 0000000..c5a8983 --- /dev/null +++ b/app/Http/Controllers/Admin/Notification/AdminNotification.php @@ -0,0 +1,325 @@ +id)->first(); + return view('admin.notification.show', compact('notification')); + } + + public function selectAllUser() + { + $users = User::where('role', 'User') + ->where('status', 'Finished') + ->pluck('email') + ->toArray(); + return response()->json([ + 'users' => $users, + ]); + } + + public function listNotification(Request $request) + { + try { + $subQuery = Notification::latest()->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notifications.created_at'); + + if ($request->has('search') && !empty($request->search['value'])) { + $searchNotif = $request->search['value']; + $subQuery->where(function ($a) use ($searchNotif) { + $a->whereRaw('LOWER(notifications.title) LIKE ?', ['%' . strtolower($searchNotif) . '%']) + ->orWhereRaw('LOWER(notifications.teaser) LIKE ?', ['%' . strtolower($searchNotif) . '%']); + }); + } + + $queryNotif = Notification::from(DB::raw("({$subQuery->toSql()}) as tmp")) + ->mergeBindings($subQuery->getQuery()) + ->select('*') + ->get(); + + if ($request->ajax()) { + return DataTables::of($queryNotif) + ->addIndexColumn() + ->addColumn('action', function ($row) { + $detail = route('admin-notification.show', ['id' => $row->id]); + $edit = route('admin-notification.edit', ['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']); + } + } + + public function listUserForShow(Request $request) + { + try { + $subQuery = NotificationReceiver::join('users', 'notification_receivers.receiver', '=', 'users.email') + ->join('notifications', 'notification_receivers.notification_id', '=', 'notifications.id') + ->where('notification_receivers.notification_id', $request->id) + ->latest() + ->select(DB::raw("CONCAT(users.nama_depan,' ', users.nama_belakang) as nama_lengkap"), 'notification_receivers.created_at', 'notification_receivers.updated_at', 'notification_receivers.receiver'); + + if ($request->has('search') && !empty($request->search['value'])) { + $searchNotif = $request->search['value']; + if (!is_numeric($searchNotif)) { + $subQuery->where(function ($a) use ($searchNotif) { + $a->whereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchNotif) . '%']); + }); + } else { + } + } + + $queryNotif = NotificationReceiver::from(DB::raw("({$subQuery->toSql()}) as tmp")) + ->mergeBindings($subQuery->getQuery()) + ->select('*') + ->get(); + + if ($request->ajax()) { + return DataTables::of($queryNotif) + ->addIndexColumn() + ->make(true); + } + } catch (Throwable $e) { + Log::error($e->getMessage()); + + return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); + } + } + + public function listUserForCreateEdit(Request $request) + { + try { + $subQuery = User::latest() + ->where('users.status', '=', 'Finished') + ->where('users.role', '=', 'User') + ->select(DB::raw("CONCAT(users.nama_depan,' ', users.nama_belakang) as nama_lengkap"), 'users.email'); + + if ($request->has('search') && !empty($request->search['value'])) { + $searchUser = $request->search['value']; + $subQuery->where(function ($a) use ($searchUser) { + $a->whereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchUser) . '%'])->orWhereRaw('LOWER(users.email) LIKE ?', ['%' . strtolower($searchUser) . '%']); + }); + } + + $queryUser = User::from(DB::raw("({$subQuery->toSql()}) as tmp")) + ->mergeBindings($subQuery->getQuery()) + ->select('*') + ->get(); + + if ($request->ajax()) { + return DataTables::of($queryUser) + ->addIndexColumn() + ->make(true); + } + } catch (Throwable $e) { + Log::error($e->getMessage()); + + return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); + } + } + + public function store(Request $request) + { + try { + DB::beginTransaction(); + + $notif = Notification::create([ + 'title' => $request->title, + 'content' => $request->content, + 'teaser' => Str::limit($request->content, 20, '...'), + ]); + + foreach ($request->receivers as $receiver) { + NotificationReceiver::create([ + 'receiver' => $receiver, + 'notification_id' => $notif->id, + ]); + } + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil membuat notifikasi dan akan dikirim ke pengguna.', + ]); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Terjadi kesalahan di server.', + ]); + } + } + + public function delete(Request $request) + { + try { + DB::beginTransaction(); + + Notification::destroy($request->id); + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil menghapus notifikasi.', + ]); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Terjadi kesalahan di server.', + ]); + } + } + + public function deleteAll() + { + try { + DB::beginTransaction(); + + Notification::truncate(); + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil menghapus semua notifikasi.', + ]); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Terjadi kesalahan di server.', + ]); + } + } + + public function edit(Request $request) + { + $notification = Notification::where('id', $request->id)->first(); + $email = NotificationReceiver::where('notification_id', $request->id) + ->pluck('receiver') + ->toArray(); + return view('admin.notification.edit', compact('notification', 'email')); + } + + public function update(Request $request) + { + try { + DB::beginTransaction(); + + Notification::where('id', $request->id)->update([ + 'title' => $request->title, + 'content' => $request->content, + 'teaser' => Str::limit($request->content, 20, '...'), + ]); + + NotificationReceiver::where('notification_id', $request->id)->delete(); + + foreach ($request->receivers as $receiver) { + NotificationReceiver::create([ + 'receiver' => $receiver, + 'notification_id' => $request->id, + ]); + } + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil update notifikasi dan akan dikirim ke pengguna.', + ]); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'status' => false, + 'message' => 'Terjadi kesalahan di server.', + ]); + } + } + + public function updateNewNotification(Request $request) + { + $options = [ + 'cluster' => 'ap1', + 'useTLS' => true, + ]; + + $pusher = new Pusher('3e5bdc20dddd7fbc655e', 'f2274c37c616d29ff590', '1659859', $options); + + $payload = [ + 'receivers' => $request->receivers, + ]; + + $pusher->trigger('chanel-update-notifikasi', 'event-update-notifikasi', $payload); + } +} diff --git a/app/Http/Controllers/Admin/User/AdminUserController.php b/app/Http/Controllers/Admin/User/AdminUserController.php index 96ea836..bf4974e 100644 --- a/app/Http/Controllers/Admin/User/AdminUserController.php +++ b/app/Http/Controllers/Admin/User/AdminUserController.php @@ -35,16 +35,23 @@ class AdminUserController extends Controller public function destroy(Request $request) { try { - $result = User::destroy($request->id); - if ($result) { - return response()->json([ - 'message' => 'Berhasil hapus data', - 'status' => true, - ]); - } - } catch (\Exception $e) { + DB::beginTransaction(); + + User::destroy($request->id); + + DB::commit(); + return response()->json([ - 'message' => 'Gagal hapus data, karena ' . $e, + 'message' => 'Berhasil hapus data', + 'status' => true, + ]); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return response()->json([ + 'message' => 'Terjadi kesalahan di server', 'status' => false, ]); } @@ -52,11 +59,11 @@ class AdminUserController extends Controller public function approveUser(Request $request) { - try{ + try { DB::beginTransaction(); User::where('id', $request->id)->update([ - 'status' => 'Finished' + 'status' => 'Finished', ]); DB::commit(); @@ -65,7 +72,7 @@ class AdminUserController extends Controller 'message' => 'Akun telah disetujui dan dapat digunakan', 'status' => true, ]); - }catch(Throwable $e){ + } catch (Throwable $e) { Log::error($e->getMessage()); return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); @@ -74,12 +81,12 @@ class AdminUserController extends Controller public function denyUser(Request $request) { - try{ + try { DB::beginTransaction(); User::where('id', $request->id)->update([ 'status' => 'Rejected', - 'keterangan' => $request->keterangan + 'keterangan' => $request->keterangan, ]); DB::commit(); @@ -88,8 +95,7 @@ class AdminUserController extends Controller 'message' => 'Akun telah ditolak dan tidak dapat digunakan', 'status' => true, ]); - - }catch(Throwable $e){ + } catch (Throwable $e) { Log::error($e->getMessage()); return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']); @@ -106,16 +112,14 @@ class AdminUserController extends Controller if ($request->has('search') && !empty($request->search['value'])) { $searchUser = $request->search['value']; - if(!is_numeric($searchUser)){ + if (!is_numeric($searchUser)) { $subQuery->where(function ($a) use ($searchUser) { $a->whereRaw('LOWER(email) LIKE ?', ['%' . strtolower($searchUser) . '%']) ->orWhereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchUser) . '%']) - ->orWhereRaw('LOWER(status) LIKE ?',['%'.strtolower($searchUser).'%']); + ->orWhereRaw('LOWER(status) LIKE ?', ['%' . strtolower($searchUser) . '%']); }); - }else{ - + } else { } - } $queryUser = User::from(DB::raw("({$subQuery->toSql()}) as tmp")) @@ -128,7 +132,8 @@ class AdminUserController extends Controller ->addIndexColumn() ->addColumn('action', function ($row) { $url = route('admin-user.show', ['id' => $row->id]); - $html_code = ' + $html_code = + '
'; diff --git a/app/Http/Controllers/Invoice/InvoiceController.php b/app/Http/Controllers/Invoice/InvoiceController.php index e7a4b63..c5a0792 100644 --- a/app/Http/Controllers/Invoice/InvoiceController.php +++ b/app/Http/Controllers/Invoice/InvoiceController.php @@ -20,7 +20,7 @@ class InvoiceController extends Controller { $transaction = Transaction::findOrFail($request->id); $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait'); - return $pdf->download("invoice-$request->id.pdf"); + return $pdf->download("invoice-".uniqid().".pdf"); // return view('invoice.export-invoice', [ // 'transaction' => Transaction::findOrFail($request->id), // ]); diff --git a/app/Http/Controllers/Login/LoginController.php b/app/Http/Controllers/Login/LoginController.php index e8163c7..c4f2fdf 100644 --- a/app/Http/Controllers/Login/LoginController.php +++ b/app/Http/Controllers/Login/LoginController.php @@ -421,6 +421,6 @@ class LoginController extends Controller // $transaction = Transaction::findOrFail('80d9b19b-ba17-4aea-8cad-c3b4661d33bc'); $pdf = Pdf::loadView('invoice.export-invoice')->setPaper('A4','portrait'); - return $pdf->download("invoice-80d9b19b-ba17-4aea-8cad-c3b4661d33b-".uniqid().".pdf"); + return $pdf->download("invoice-".uniqid().".pdf"); } } diff --git a/app/Http/Controllers/User/Notification/UserNotification.php b/app/Http/Controllers/User/Notification/UserNotification.php new file mode 100644 index 0000000..5d9688b --- /dev/null +++ b/app/Http/Controllers/User/Notification/UserNotification.php @@ -0,0 +1,126 @@ +where('notification_receivers.receiver','=',auth()->user()->email) + ->latest() + ->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notification_receivers.created_at', 'notification_receivers.status'); + + if ($request->has('search') && !empty($request->search['value'])) { + $searchNotif = $request->search['value']; + $subQuery->where(function ($a) use ($searchNotif) { + $a->whereRaw('LOWER(notifications.title) LIKE ?', ['%' . strtolower($searchNotif) . '%']) + ->orWhereRaw('LOWER(notifications.teaser) LIKE ?', ['%' . strtolower($searchNotif) . '%']); + }); + } + + $queryNotif = Notification::from(DB::raw("({$subQuery->toSql()}) as tmp")) + ->mergeBindings($subQuery->getQuery()) + ->select('*') + ->get(); + + if ($request->ajax()) { + return DataTables::of($queryNotif) + ->addIndexColumn() + ->addColumn('action', function ($row) { + $detail = route('user-notifiaction.detail-notification', ['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']); + } + } + + public function show($id) + { + try { + DB::beginTransaction(); + + $notification = Notification::where('id', $id)->first(); + + NotificationReceiver::where('notification_id', $id) + ->where('receiver', auth()->user()->email) + ->update([ + 'status' => 'read', + ]); + + DB::commit(); + + return view('user.notification.detail-notification', compact('notification')); + } catch (Throwable $e) { + DB::rollBack(); + + Log::error($e->getMessage()); + + return redirect()->back(); + } + } + + public function latestNotification() + { + $notifications = NotificationReceiver::join('notifications', 'notification_receivers.notification_id', '=', 'notifications.id') + ->where('receiver', auth()->user()->email) + ->where('status', 'unread') + ->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notifications.updated_at') + ->latest('notifications.updated_at') + ->limit(4) + ->get(); + return response()->json([ + 'notifications' => $notifications, + ]); + } + + public function markAllAsRead() + { + NotificationReceiver::where('receiver', auth()->user()->email)->update([ + 'status' => 'read', + ]); + + return response()->json([ + 'status' => true, + 'message' => 'Berhasil', + ]); + } +} diff --git a/app/Http/Controllers/User/Pembeli/PembeliController.php b/app/Http/Controllers/User/Pembeli/PembeliController.php index cefb7e8..d65ec84 100644 --- a/app/Http/Controllers/User/Pembeli/PembeliController.php +++ b/app/Http/Controllers/User/Pembeli/PembeliController.php @@ -228,14 +228,14 @@ class PembeliController extends Controller 'background' => 'bg-buyer', 'user' => auth()->user()->email, 'judul' => 'fas fa-check', - 'deskripsi' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '.', + 'deskripsi' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '. Uang akan dikirim ke penjual.', ]); DB::commit(); return response()->json([ 'status' => true, - 'message' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '.', + 'message' => 'Pesanan anda selesai dan uang akan dikirim ke penjual. Terima kasih telah menggunakan Rekber.', ]); } catch (Throwable $e) { DB::rollBack(); @@ -319,7 +319,7 @@ class PembeliController extends Controller 'status' => 'challenge', 'background' => 'bg-primary', 'judul' => 'fas fa-clock', - 'deskripsi' => 'Transaksi ' . auth()->user()->email . ' terindikasi masalah, tunggu sesaat hingga admin menyetujui pembayaran.', + 'deskripsi' => 'Transaksi ' . auth()->user()->email . ' terindikasi masalah/penipuan, tunggu sesaat hingga admin menyetujui pembayaran.', 'user' => 'admin@example.net', 'keterangan' => $result['status_message'], ]); @@ -537,11 +537,6 @@ class PembeliController extends Controller } } - public function complaintTransaction($id) - { - return view('user.refund.new-refund', compact('id')); - } - public function onErrorTransaction(Request $request) { $auth = base64_encode(env('MIDTRANS_SERVER_KEY')); diff --git a/app/Http/Controllers/User/Penjual/PenjualController.php b/app/Http/Controllers/User/Penjual/PenjualController.php index 2427405..ade1002 100644 --- a/app/Http/Controllers/User/Penjual/PenjualController.php +++ b/app/Http/Controllers/User/Penjual/PenjualController.php @@ -353,7 +353,27 @@ class PenjualController extends Controller public function acceptResult(Request $request) { try{ + DB::beginTransaction(); + Transaction::where('id', $request->id)->update([ + 'status_transaction' => 'done' + ]); + + TransactionDescription::create([ + 'transaction_id' => $request->id, + 'status' => 'sent', + 'background' => 'bg-seller', + 'user' => auth()->user()->email, + 'judul' => 'fas fa-money-bill', + 'deskripsi' => auth()->user()->nama_depan.' telah menerima uang.', + ]); + + DB::commit(); + + return response()->json([ + 'status' => true, + 'message' => 'Uang akan dikirim ke bank anda. Terima kasih telah menggunakan Rekber.' + ]); }catch(Throwable $e){ DB::rollBack(); diff --git a/app/Models/Notification.php b/app/Models/Notification.php new file mode 100644 index 0000000..580b4d8 --- /dev/null +++ b/app/Models/Notification.php @@ -0,0 +1,27 @@ + 'string', + ]; + + // Relasi + public function notifications(){ + return $this->hasMany(NotificationReceiver::class, 'id', 'notification_id'); + } + // Relasi +} diff --git a/app/Models/NotificationReceiver.php b/app/Models/NotificationReceiver.php new file mode 100644 index 0000000..f9e0ec6 --- /dev/null +++ b/app/Models/NotificationReceiver.php @@ -0,0 +1,30 @@ + 'string', + ]; + + //Relasi + public function data_receiver(){ + return $this->belongsTo(User::class, 'receiver', 'email'); + } + + public function notifications(){ + return $this->belongsTo(Notification::class, 'notification_id', 'id'); + } + //Relasi +} diff --git a/app/Models/RefundUser.php b/app/Models/RefundUser.php deleted file mode 100644 index f517ccc..0000000 --- a/app/Models/RefundUser.php +++ /dev/null @@ -1,44 +0,0 @@ - "INV-1234", - "Customer" => "npannisa", - "seller" => "rayhan", - "Total" => " Rp.200.000", - "dueDate"=>"29 juni 2023", - "status"=>"diterima", - "uploadBukti" => "5.jpg" - ], - [ - "orderId" => "INV-1234", - "Customer" => "hantu", - "seller" => "rayhan", - "Total" => " Rp.200.000", - "dueDate"=>"29 juni 2023", - "status"=>"ditolak", - "uploadBukti" => "5.jpg" - ], - [ - "orderId" => "INV-1234", - "Customer" => "pocong", - "seller" => "rayhan", - "Total" => " Rp.200.000", - "dueDate"=>"29 juni 2023", - "status"=>"diterima", - "uploadBukti" => "5.jpg" - ], - ]; - public static function HistoryRefundUser(){ - return self::$history_refundUser; - } -} diff --git a/app/Models/Refunds.php b/app/Models/Refunds.php deleted file mode 100644 index 55765a5..0000000 --- a/app/Models/Refunds.php +++ /dev/null @@ -1,80 +0,0 @@ -"1", - "orderId" => "INV-1234", - "customer" => "Okta", - "seller" => "dodo", - "total" => "Rp. 15000", - "date" => "July 19, 2023 ", - "status"=>"Process Refund" - ], - [ - "no"=>"2", - "orderId" => "INV-0000", - "customer" => "Selvi", - "seller" => "dedo", - "total" => "Rp. 11000", - "date" => "August 19, 2023 ", - "status"=>"Refund Success" - ], - [ - "no"=>"3", - "orderId" => "INV-2313", - "customer" => "Septa", - "seller" => "dido", - "total" => "Rp. 15000", - "date" => "July 29, 2023 ", - "status"=>"Process Refund" - ], - [ - "no"=>"4", - "orderId" => "INV-5664", - "customer" => "Padia", - "seller" => "dedo", - "total" => "Rp. 14000", - "date" => "July 18, 2023 ", - "status"=>"Refunds Refused" - ], - [ - "no"=>"5", - "orderId" => "INV-9090", - "customer" => "hantu", - "seller" => "dado", - "total" => "Rp. 45000", - "date" => "2023-08-14 ", - "status"=>"Refunds Refused" - ] - ]; - - public static $detail_refund=[ - [ - "orderId" => "INV-9090", - "customer" => "hantu", - "seller" => "dado", - "total" => "Rp. 45000", - "date" => "2023-08-14 ", - "complaint" =>" Lorem ipsum dolor sit, amet consectetur adipisicing elit. Aliquam inventore, sit enim iure itaque fuga voluptates alias, eveniet quos ex reiciendis! Dolore mollitia ea inventore, excepturi hic fugiat id, magnam molestias sint ut enim repellendus, cum dolorum dolores sapiente adipisci tempora nihil omnis! Accusantium, non perspiciatis? Molestias modi debitis perferendis reprehenderit excepturi voluptates? Sit incidunt consequuntur iusto odit sapiente inventore nemo commodi, quam vero magnam temporibus ducimus praesentium assumenda blanditiis possimus perferendis totam placeat maiores. Quae ut id libero atque pariatur veritatis rerum culpa tempore consequatur quod corrupti corporis nobis quia repellendus iste quidem illum, voluptates aspernatur cumque officia. Tenetur.", - "image"=>"assets/images/dashboard/img_2.jpg" - ] - ]; - public static function HistoryRefund(){ - return self::$history_refund; - - } - public static function DetailRefund(){ - return self::$detail_refund; - } -} diff --git a/app/Models/Settings.php b/app/Models/Settings.php deleted file mode 100644 index 6603b6f..0000000 --- a/app/Models/Settings.php +++ /dev/null @@ -1,50 +0,0 @@ - "1", - "month" => "January", - "year" =>"2021", - "persentase" =>"50%", - "status" =>"Active" - ], - [ - "no" => "2", - "month" => "February", - "year" =>"2022", - "persentase" =>"40%", - "status" =>"Non Active" - ], - [ - "no" => "3", - "month" => "March", - "year" =>"2023", - "persentase" =>"30%", - "status" =>"Non Active" - ], - [ - "no" => "4", - "month" => "April", - "year" =>"2021", - "persentase" =>"60%", - "status" =>"Non Active" - ], - [ - "no" => "5", - "month" => "May", - "year" =>"2023", - "persentase" =>"20%", - "status" =>"Non Active" - ] - ]; - public static function HistorySetting(){ - return self::$History_Setting; - } -} diff --git a/app/Models/TransactionUser.php b/app/Models/TransactionUser.php deleted file mode 100644 index 82f86d8..0000000 --- a/app/Models/TransactionUser.php +++ /dev/null @@ -1,57 +0,0 @@ - "NPA-9876", - "orderId" => "INV-1234", - "Customer" => "Nurul Prima", - "seller" => "Jilhan", - "total" => "Rp.500.000", - "dueDate"=>"29 juni 2023", - "status"=>"OnProgress", - "action" => "" - ], - [ - "userId" => "NPA-9879", - "orderId" => "INV-1234", - "Customer" => "Nurul Prima Annisa", - "seller" => "Raihan", - "total" => "Rp.500.000", - "dueDate"=>"29 juni 2025", - "status"=>"Diterima", - "action" => "" - ], - - // [ - // "userId" => "NPA-9877", - // "orderId" => "INV-1235", - // "Customer" => "Nurul Annisa", - // "seller" => "Rayhan", - // "total" => "Rp.900.000", - // "dueDate"=>"29 Juli 2023", - // "status"=>"Pembeli", - // "action" => "" - // ], - - // [ - // "userId" => "NPA-9878", - // "orderId" => "INV-1236", - // "Customer" => "Nurul Prima Annisa", - // "seller" => "Rayhan", - // "total" => "Rp.900.000", - // "dueDate"=>"29 Juli 2023", - // "status"=>"Pembeli", - // "action" => "" - // ], - ]; - public static function HistoryTransaction(){ - return self::$history_transaction; - } -} diff --git a/app/Models/Transactions.php b/app/Models/Transactions.php deleted file mode 100644 index b424369..0000000 --- a/app/Models/Transactions.php +++ /dev/null @@ -1,90 +0,0 @@ - '1', - 'orderId' => 'INV-1234', - 'customer' => 'Jilhan', - 'seller' => 'dodo', - 'total' => 'Rp. 15000', - 'date' => 'July 19, 2023 ', - 'status' => 'paid', - ], - [ - 'no' => '2', - 'orderId' => 'INV-0000', - 'customer' => 'hmmm', - 'seller' => 'dodo', - 'total' => 'Rp. 11000', - 'date' => 'August 19, 2023 ', - 'status' => 'pending', - ], - [ - 'no' => '3', - 'orderId' => 'INV-2313', - 'customer' => 'nurul', - 'seller' => 'dido', - 'total' => 'Rp. 15000', - 'date' => 'July 29, 2023 ', - 'status' => 'unpaid', - ], - [ - 'no' => '4', - 'orderId' => 'INV-5664', - 'customer' => 'raihan', - 'seller' => 'dedo', - 'total' => 'Rp. 14000', - 'date' => 'July 18, 2023 ', - 'status' => 'pending', - ], - [ - 'no' => '5', - 'orderId' => 'INV-9090', - 'customer' => 'testing', - 'seller' => 'dado', - 'total' => 'Rp. 45000', - 'date' => 'June 19, 2023 ', - 'status' => 'paid', - ], - ]; - - private static $detail_transaction = [ - [ - 'idTransaction' => 'INV-76899', - 'side' => 'SELL', - 'marketPair' => 'IDR', - 'email' => 'JilhanHaura07@gmail.com', - 'amountTransaction' => 'Rp. 900000', - 'feeTransaction' => '10%', - 'total' => '68,00989.00 IDR', - 'paymentDetail' => 'Bank', - 'bankName' => 'BNI', - 'accountNumber' => '123', - 'statusTransaction' => 'Success', - - // "tracking_number" => "09102919209", - // "orderId" => "INV-9090", - // "status"=>"Pending", - // "estimated" => "June 20, 2023", - // "tracking_detail1"=> "August 10: processed payment", - // "tracking_detail2"=> "August 12: payment in system", - // "tracking_detail3"=> "August 14: payment has been received by the seller", - ], - ]; - public static function allTransactions() - { - return self::$list_transaction; - } - - public static function allDetailTransactions() - { - return self::$detail_transaction; - } -} diff --git a/app/Models/transaction.php b/app/Models/transaction.php index 9213d15..2472671 100644 --- a/app/Models/transaction.php +++ b/app/Models/transaction.php @@ -57,11 +57,11 @@ class Transaction extends Model } public function refunds(){ - return $this->hasMany(Refund::class, 'transaction_id', 'id'); + return $this->hasMany(Refund::class, 'id', 'transaction_id'); } public function transactionDescription(){ - return $this->hasMany(TransactionDescription::class, 'transaction_id', 'id'); + return $this->hasMany(TransactionDescription::class, 'id', 'transaction_id'); } //Relasi } 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 7480ed5..e1c9da9 100644 --- a/database/migrations/2023_08_01_073859_create_transactions_table.php +++ b/database/migrations/2023_08_01_073859_create_transactions_table.php @@ -38,6 +38,7 @@ return new class extends Migration $table->timestamp('tanggal_transaksi')->nullable(); $table->string('nama_bank_penjual'); $table->string('no_rek_penjual'); + $table->string('keterangan')->nullable(); $table->timestamps(); $table->foreign('pembeli')->on('users')->references('email'); diff --git a/database/migrations/2023_08_16_044527_create_refunds_table.php b/database/migrations/2023_08_16_044527_create_refunds_table.php index fe26600..60ebda4 100644 --- a/database/migrations/2023_08_16_044527_create_refunds_table.php +++ b/database/migrations/2023_08_16_044527_create_refunds_table.php @@ -20,6 +20,7 @@ return new class extends Migration $table->enum('status',['refund','deny','pending'])->default('pending'); $table->text('complaint'); $table->timestamps(); + $table->foreign('transaction_id')->on('transactions')->references('id'); }); } diff --git a/database/migrations/2023_11_22_091953_create_notifications_table.php b/database/migrations/2023_11_22_091953_create_notifications_table.php new file mode 100644 index 0000000..06a104a --- /dev/null +++ b/database/migrations/2023_11_22_091953_create_notifications_table.php @@ -0,0 +1,31 @@ +uuid('id')->default(DB::raw('uuid_generate_v4()'))->primary(); + $table->string('title'); // judul notifikasi + $table->string('teaser'); // cuplikan dari isi notifikasi + $table->string('content'); // isi notifikasi + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('notifications'); + } +}; diff --git a/database/migrations/2023_11_22_112309_create_notification_receivers_table.php b/database/migrations/2023_11_22_112309_create_notification_receivers_table.php new file mode 100644 index 0000000..155607e --- /dev/null +++ b/database/migrations/2023_11_22_112309_create_notification_receivers_table.php @@ -0,0 +1,34 @@ +uuid('id')->default(DB::raw('uuid_generate_v4()'))->primary(); + $table->foreignUuid('notification_id'); + $table->string('receiver'); + $table->enum('status',['unread', 'read'])->default('unread'); + $table->timestamps(); + + $table->foreign('receiver')->on('users')->references('email'); + $table->foreign('notification_id')->on('notifications')->references('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('notification_receivers'); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 1591301..be654e3 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -5,6 +5,8 @@ namespace Database\Seeders; // use Illuminate\Database\Console\Seeds\WithoutModelEvents; use App\Models\Contact; +use App\Models\Notification; +use App\Models\NotificationReceiver; use App\Models\Refund; use App\Models\RefundDescription; use Illuminate\Database\Seeder; @@ -190,6 +192,22 @@ class DatabaseSeeder extends Seeder 'relasi_kontak' => $user1->email ]); + $notification1 = Notification::create([ + 'title' => 'Selamat Datang di Rekber', + 'content' => 'Hai, selamat datang di Rekber. Anda dapat menikmati bertransaksi disini', + 'teaser' => 'Hai, selamat datang di Rekber. ...' + ]); + + NotificationReceiver::create([ + 'notification_id' => $notification1->id, + 'receiver' => $user1->email + ]); + + NotificationReceiver::create([ + 'notification_id' => $notification1->id, + 'receiver' => $user2->email + ]); + $this->call([ProvincesSeeder::class, CitiesSeeder::class, DistrictsSeeder::class, VillagesSeeder::class]); } } diff --git a/public/assets/css/main.css b/public/assets/css/main.css index e29ef20..c77561d 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -1,54 +1,53 @@ - /*-------------------------------------------------------------- # Profie Page --------------------------------------------------------------*/ .profile .profile-card img { - max-width: 120px; + max-width: 120px; } .profile .profile-card h2 { - font-size: 24px; - font-weight: 700; - color: #2c384e; - margin: 10px 0 0 0; + font-size: 24px; + font-weight: 700; + color: #2c384e; + margin: 10px 0 0 0; } .profile .profile-card h3 { - font-size: 18px; + font-size: 18px; } .profile .profile-card .social-links a { - font-size: 20px; - display: inline-block; - color: rgba(1, 41, 112, 0.5); - line-height: 0; - margin-right: 10px; - transition: 0.3s; + font-size: 20px; + display: inline-block; + color: rgba(1, 41, 112, 0.5); + line-height: 0; + margin-right: 10px; + transition: 0.3s; } .profile .profile-card .social-links a:hover { - color: #012970; + color: #012970; } .profile .profile-overview .row { - margin-bottom: 20px; - font-size: 15px; + margin-bottom: 20px; + font-size: 15px; } .profile .profile-overview .card-title { - color: #012970; + color: #012970; } .profile .profile-overview .label { - font-weight: 600; - color: rgba(1, 41, 112, 0.6); + font-weight: 600; + color: rgba(1, 41, 112, 0.6); } .profile .profile-edit label { - font-weight: 600; - color: rgba(1, 41, 112, 0.6); + font-weight: 600; + color: rgba(1, 41, 112, 0.6); } .profile .profile-edit img { - max-width: 120px; + max-width: 120px; } diff --git a/public/assets/css/style.css b/public/assets/css/style.css index c15a25f..daad49a 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -1776,7 +1776,7 @@ h6 .badge { .btn { font-weight: 600; - font-size: 12px; + font-size: 18px; line-height: 24px; padding: 0.3rem 0.8rem; letter-spacing: 0.5px; @@ -3090,7 +3090,7 @@ a.dropdown-item.active { body { background-color: #fafdfb; - font-size: 14px; + font-size: 18px; font-weight: 400; font-family: "Nunito", "Segoe UI", arial; color: #6c757d; diff --git a/resources/views/Admin/notification/create.blade.php b/resources/views/Admin/notification/create.blade.php new file mode 100644 index 0000000..aae1c32 --- /dev/null +++ b/resources/views/Admin/notification/create.blade.php @@ -0,0 +1,214 @@ +@extends('layouts.main') +@section('content') + +
+
+
+

Tambah Notifikasi

+
+ + + +
+
+
+
+
+
+
+ + +
+
+ + +
+
+ Daftar akun akan yang mendapatkan notifikasi +
+
+ + + + + + + + + + + +
+ # + + Nama Lengkap + + Email +
+
+
+ +
+
+
+
+
+
+
+@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