From ee131e7bc8aa2ed6e651af8369bb61e7ecf6b92a Mon Sep 17 00:00:00 2001 From: jilhanhaura Date: Sun, 27 Aug 2023 15:21:20 +0700 Subject: [PATCH] dashboard admin --- app/Http/Controllers/SettingController.php | 66 +++++ app/Http/Requests/StoreSettingRequest.php | 28 +++ app/Http/Requests/UpdateSettingRequest.php | 28 +++ app/Models/Refund.php | 5 + app/Models/Setting.php | 50 ++++ app/Models/Users.php | 5 +- app/Models/transaction.php | 5 + app/Policies/SettingPolicy.php | 66 +++++ database/factories/SettingFactory.php | 23 ++ ...023_08_27_074453_create_settings_table.php | 27 +++ database/seeders/SettingSeeder.php | 17 ++ public/assets/css/style.css | 8 +- resources/views/Admin/profile/index.blade.php | 10 +- .../Admin/refund/history-refund.blade.php | 211 +--------------- resources/views/Admin/setting/index.blade.php | 154 ++---------- .../Detail_History_Transaction.blade.php | 178 -------------- .../transaction/History_Transaction.blade.php | 212 +--------------- .../transaction/List_Transaction.blade.php | 93 ------- .../views/Admin/users/list-user.blade.php | 228 +++--------------- resources/views/index.blade.php | 178 +++----------- routes/web.php | 10 +- 21 files changed, 439 insertions(+), 1163 deletions(-) create mode 100644 app/Http/Controllers/SettingController.php create mode 100644 app/Http/Requests/StoreSettingRequest.php create mode 100644 app/Http/Requests/UpdateSettingRequest.php create mode 100644 app/Models/Setting.php create mode 100644 app/Policies/SettingPolicy.php create mode 100644 database/factories/SettingFactory.php create mode 100644 database/migrations/2023_08_27_074453_create_settings_table.php create mode 100644 database/seeders/SettingSeeder.php delete mode 100644 resources/views/Admin/transaction/Detail_History_Transaction.blade.php delete mode 100644 resources/views/Admin/transaction/List_Transaction.blade.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php new file mode 100644 index 00000000..45a8ef75 --- /dev/null +++ b/app/Http/Controllers/SettingController.php @@ -0,0 +1,66 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdateSettingRequest.php b/app/Http/Requests/UpdateSettingRequest.php new file mode 100644 index 00000000..c131370f --- /dev/null +++ b/app/Http/Requests/UpdateSettingRequest.php @@ -0,0 +1,28 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Models/Refund.php b/app/Models/Refund.php index 91851e91..7aa59d94 100644 --- a/app/Models/Refund.php +++ b/app/Models/Refund.php @@ -9,6 +9,7 @@ class Refund { private static $history_refund=[ [ + "no"=>"1", "orderId" => "INV-1234", "customer" => "Okta", "seller" => "dodo", @@ -17,6 +18,7 @@ class Refund "status"=>"Process Refund" ], [ + "no"=>"2", "orderId" => "INV-0000", "customer" => "Selvi", "seller" => "dedo", @@ -25,6 +27,7 @@ class Refund "status"=>"Refund Success" ], [ + "no"=>"3", "orderId" => "INV-2313", "customer" => "Septa", "seller" => "dido", @@ -33,6 +36,7 @@ class Refund "status"=>"Process Refund" ], [ + "no"=>"4", "orderId" => "INV-5664", "customer" => "Padia", "seller" => "dedo", @@ -41,6 +45,7 @@ class Refund "status"=>"Refunds Refused" ], [ + "no"=>"5", "orderId" => "INV-9090", "customer" => "hantu", "seller" => "dado", diff --git a/app/Models/Setting.php b/app/Models/Setting.php new file mode 100644 index 00000000..69ddea04 --- /dev/null +++ b/app/Models/Setting.php @@ -0,0 +1,50 @@ + "1", + "month" => "January", + "year" =>"2021", + "persentase" =>"50%", + "status" =>"Active" + ], + [ + "no" => "2", + "month" => "February", + "year" =>"2022", + "persentase" =>"40%", + "status" =>"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" =>"Active" + ] + ]; + public static function HistorySetting(){ + return self::$History_Setting; + } +} \ No newline at end of file diff --git a/app/Models/Users.php b/app/Models/Users.php index 3887a478..af244430 100644 --- a/app/Models/Users.php +++ b/app/Models/Users.php @@ -9,6 +9,7 @@ class Users { private static $list_users=[ [ + "no" => "1", "userId" => "U1290", "fullname" => "Tsalsabila Jilhan Haura", "email" => "jilhanhaura07@gmail.com", @@ -17,13 +18,15 @@ class Users "status" => "Finished" ], [ + "no" => "2", "userId" => "U4567", "fullname" => "Boncel", "email" => "boncel@gmail.com", "gender" => "Male", "date" => "August 22, 2023", "status" => "Progress" - ] + ], + ]; public static function listUsers(){ return self::$list_users; diff --git a/app/Models/transaction.php b/app/Models/transaction.php index 62f65faa..b7bb85e7 100644 --- a/app/Models/transaction.php +++ b/app/Models/transaction.php @@ -9,6 +9,7 @@ class transaction { private static $list_transaction =[ [ + "no"=>"1", "orderId" => "INV-1234", "customer" => "Jilhan", "seller" => "dodo", @@ -17,6 +18,7 @@ class transaction "status"=>"paid" ], [ + "no"=>"2", "orderId" => "INV-0000", "customer" => "hmmm", "seller" => "dodo", @@ -25,6 +27,7 @@ class transaction "status"=>"pending" ], [ + "no"=>"3", "orderId" => "INV-2313", "customer" => "nurul", "seller" => "dido", @@ -33,6 +36,7 @@ class transaction "status"=>"unpaid" ], [ + "no"=>"4", "orderId" => "INV-5664", "customer" => "raihan", "seller" => "dedo", @@ -41,6 +45,7 @@ class transaction "status"=>"pending" ], [ + "no"=>"5", "orderId" => "INV-9090", "customer" => "testing", "seller" => "dado", diff --git a/app/Policies/SettingPolicy.php b/app/Policies/SettingPolicy.php new file mode 100644 index 00000000..96c2871e --- /dev/null +++ b/app/Policies/SettingPolicy.php @@ -0,0 +1,66 @@ + + */ +class SettingFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2023_08_27_074453_create_settings_table.php b/database/migrations/2023_08_27_074453_create_settings_table.php new file mode 100644 index 00000000..3f09f882 --- /dev/null +++ b/database/migrations/2023_08_27_074453_create_settings_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('settings'); + } +}; diff --git a/database/seeders/SettingSeeder.php b/database/seeders/SettingSeeder.php new file mode 100644 index 00000000..9a6d9b67 --- /dev/null +++ b/database/seeders/SettingSeeder.php @@ -0,0 +1,17 @@ +
-
-
About

Lorem, ipsum dolor sit amet consectetur @@ -97,11 +93,7 @@

- - - -
- +
diff --git a/resources/views/Admin/refund/history-refund.blade.php b/resources/views/Admin/refund/history-refund.blade.php index 5642c6b6..7d4b6bf0 100644 --- a/resources/views/Admin/refund/history-refund.blade.php +++ b/resources/views/Admin/refund/history-refund.blade.php @@ -30,188 +30,9 @@ - - - 1 - - inv-0390 - Tsalsabila Jilhan Haura - Boncel - Rp. 15000 - 29 july 2023 - -
Refund Success
- - -
- - -
- - - - - 2 - - INV-9219 - Koko - Memei - Rp. 50010 - 19 july 2023 - -
Process Refund
- - -
- - -
- - - - - 3 - - INV-6385 - Memei - Snowy - Rp.900000 - 19 August 2023 - -
Refunds Refused
- - -
- - -
- - - - - 4 - - INV-6385 - Black Panther - Koko - Rp.789000 - 19 January 2023 - -
Process Refund
- - -
- - -
- - - - - 5 - - INV-8327 - Snowy - Black - Rp. 12910190 - 19 May 2023 - -
Refund Success
- - -
- - -
- - - - - - - - - {{--
-
-
-
- Show: - - entries -
-
-
-
- -
- -
-
-
-
-
-
-
- - - - - - - - - - - - - @foreach ($history_refund as $HistoryRefund) - + @foreach ($history_refund as $HistoryRefund) + @@ -244,33 +65,11 @@ - - @endforeach + @endforeach +
Order IDCustomerSellerTotalDue DateStatusAction
{{ $HistoryRefund['no'] }} {{ $HistoryRefund['orderId'] }} {{ $HistoryRefund['customer'] }} {{ $HistoryRefund['seller'] }}
-
-
-
- -
-
-
-
--}} + @endsection diff --git a/resources/views/Admin/setting/index.blade.php b/resources/views/Admin/setting/index.blade.php index 8cfa95eb..d79bde63 100644 --- a/resources/views/Admin/setting/index.blade.php +++ b/resources/views/Admin/setting/index.blade.php @@ -29,141 +29,37 @@ - - 1 - July - 2023 - 10% - -
Active
- - - - - - - 2 - August - 2023 - 30% - -
Active
- - - - - - - 3 - January - 2023 - 20% - -
Active
- - - - - + @foreach ($setting as $settings) + + {{ $settings['no'] }} + {{ $settings['month'] }} + {{ $settings['year'] }} + {{ $settings['persentase'] }} + + @php + $statusClass = ''; + if ($settings['status'] === 'Active') { + $statusClass = 'badge-success'; + } elseif ($settings['status'] === 'Non Active') { + $statusClass = 'badge-danger'; + } + @endphp +
{{ $settings['status'] }}
+ + + + + + @endforeach - {{--
-
-
-
- Show: - - entries -
-
-
-
- -
- -
-
-
-
-
-
-
- - -
-
- - - - - - - - - - - - - - - - - - - - -
#BulanTahunPersentaseStatusAction
1 July202310% -
Active
-
- -
-
-
-
- -
-
-
-
-
-
-
--}} @include('Admin.setting.add-Data') diff --git a/resources/views/Admin/transaction/Detail_History_Transaction.blade.php b/resources/views/Admin/transaction/Detail_History_Transaction.blade.php deleted file mode 100644 index 7c124f61..00000000 --- a/resources/views/Admin/transaction/Detail_History_Transaction.blade.php +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - -{{-- @extends('layout.main') -@section('content') - @foreach ($detail_transaction as $detail_transactions) -
-
-
-

Tracking Information

-
-

Tracking Number: {{ $detail_transactions['tracking_number'] }}

-

Order ID: {{ $detail_transactions['orderId'] }}

-

Status: {{ $detail_transactions['status'] }}

-

Estimated: {{ $detail_transactions['estimated'] }}

-
-

Tracking Details

-
    -
  • {{ $detail_transactions['tracking_detail1'] }}
  • -
  • {{ $detail_transactions['tracking_detail2'] }}
  • -
  • {{ $detail_transactions['tracking_detail3'] }}
  • -
-
-
-
- @endforeach -@endsection --}} diff --git a/resources/views/Admin/transaction/History_Transaction.blade.php b/resources/views/Admin/transaction/History_Transaction.blade.php index 2c1fd16a..76336b0f 100644 --- a/resources/views/Admin/transaction/History_Transaction.blade.php +++ b/resources/views/Admin/transaction/History_Transaction.blade.php @@ -30,188 +30,9 @@ - - - 1 - - inv-0390 - Tsalsabila Jilhan Haura - Boncel - Rp. 15000 - 29 july 2023 - -
Paid
- - -
- - -
- - - - - 2 - - INV-9219 - Koko - Memei - Rp. 50010 - 19 july 2023 - -
Pending
- - -
- - -
- - - - - 3 - - INV-6385 - Memei - Snowy - Rp.900000 - 19 August 2023 - -
Unpaid
- - -
- - -
- - - - - 4 - - INV-6385 - Black Panther - Koko - Rp.789000 - 19 January 2023 - -
Pending
- - -
- - -
- - - - - 5 - - INV-8327 - Snowy - Black - Rp. 12910190 - 19 May 2023 - -
Paid
- - -
- - -
- - - - - - - - - {{--
-
-
-
- Show: - - entries -
-
-
-
- -
- -
-
-
-
-
-
-
- - - - - - - - - - - - - @foreach ($transaction as $transactions) - + @foreach ($transaction as $transactions) + @@ -245,36 +66,13 @@ - - @endforeach - + @endforeach +
Order IDCustomerSellerTotalDue DateStatusAction
{{ $transactions['no'] }} {{ $transactions['orderId'] }} {{ $transactions['customer'] }} {{ $transactions['seller'] }}
-
-
-
- -
-
-
-
--}} + @include('Admin.transaction.Tracking') @endsection diff --git a/resources/views/Admin/transaction/List_Transaction.blade.php b/resources/views/Admin/transaction/List_Transaction.blade.php deleted file mode 100644 index 09ca946f..00000000 --- a/resources/views/Admin/transaction/List_Transaction.blade.php +++ /dev/null @@ -1,93 +0,0 @@ -@extends('layout.main') - -@section('content') -
-
-
-
-
-

List Transaction

-
-
-
- Show: - - entries -
-
-
-
- -
- -
-
-
-
-
-
-
- - - - - - - - - - - @foreach ($transaction as $transactions) - - - - - - - - - - @endforeach -
Order IDCustomerSellerTotalDue DateStatusAction
{{ $transactions['orderId'] }}{{ $transactions['customer'] }}{{ $transactions['seller'] }}{{ $transactions['total'] }}{{ $transactions['date'] }} -
{{ $transactions['status'] }}
-
- - -
-
-
-
- -
-
-
-
-
-
-
-
-
-@endsection diff --git a/resources/views/Admin/users/list-user.blade.php b/resources/views/Admin/users/list-user.blade.php index 4381420a..b3dd8e17 100644 --- a/resources/views/Admin/users/list-user.blade.php +++ b/resources/views/Admin/users/list-user.blade.php @@ -16,9 +16,7 @@ - + @@ -29,195 +27,47 @@ - {{-- @foreach ($list_users as $list_user) --}} - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{-- - - - - - - - - --}} + + + @endforeach - {{-- @endforeach --}}
- # - # User Id Avatar FullnameAction
- 1 - U03901381080 - image - Tsalsabila Jilhan Haurajilhan@gmail.comfemale29 july 2023 -
Finished
-
-
- -
{{ $list_user['no'] }}{{ $list_user['userId'] }} +
+ ... +
+
{{ $list_user['fullname'] }}{{ $list_user['email'] }}{{ $list_user['gender'] }}{{ $list_user['date'] }} + @php + $statusClass = ''; + if ($list_user['status'] === 'Finished') { + $statusClass = 'badge-success'; + } elseif ($list_user['status'] === 'Progress') { + $statusClass = 'badge-danger'; + } + @endphp +
{{ $list_user['status'] }}
+
+
+ +
- -
- 2 - U921983889 - image - Kokokoko@gmail.commale19 july 2023 -
Finished
-
-
- - -
-
- 3 - U6385735334737 - image - Memeimemei@gmail.comfemale19 August 2023 -
Pending
-
-
- - -
-
- 4 - U6385735334737 - image - Black Pantherblack@gmail.commale19 January 2023 -
Finished
-
-
- - -
-
- 5 - U832746382477 - image - Snowysnowy@gmail.comfemale19 May 2023 -
Pending
-
-
- - -
-
{{ $list_user['userId'] }} -
- ... -
-
{{ $list_user['fullname'] }}{{ $list_user['email'] }}{{ $list_user['date'] }} - @php - $statusClass = ''; - if ($list_user['status'] === 'Finished') { - $statusClass = 'badge-success'; - } elseif ($list_user['status'] === 'Progress') { - $statusClass = 'badge-danger'; - } - @endphp -
{{ $list_user['status'] }}
-
-
- - -
-
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 627c038d..928bf69c 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -321,155 +321,53 @@ Action - {{-- @foreach ($list_users as $list_user) --}} - - - 1 - - inv-0390 - Tsalsabila Jilhan Haura - Boncel - Rp. 15000 - 29 july 2023 - -
Paid
- - -
- - - - - - - 2 - - INV-9219 - Koko - Memei - Rp. 50010 - 19 july 2023 - -
Pending
- - -
- - - - - - - 3 - - INV-6385 - Memei - Snowy - Rp.900000 - 19 August 2023 - -
Unpaid
- - -
- - -
- - - - - 4 - - INV-6385 - Black Panther - Koko - Rp.789000 - 19 January 2023 - -
Pending
- - -
- - -
- - - - - 5 - - INV-8327 - Snowy - Black - Rp. 12910190 - 19 May 2023 - -
Paid
- - -
- - -
- - + + + @endforeach
- diff --git a/routes/web.php b/routes/web.php index 7dba682c..ca24bb95 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; use App\Models\Refund; +use App\Models\Setting; use App\Models\transaction; use App\Models\Users; use Illuminate\Foundation\Auth\User; @@ -28,7 +29,7 @@ Route::get('/', function () { }); Route::get('/detail_transaction', function () { return view('Admin/transaction/detail-transaction',[ - 'name'=>'Jilhan Haura', + 'name'=>'Jilhn Haura', 'detail_transaction' => transaction::allDetailTransactions() ]); }); @@ -38,12 +39,6 @@ Route::get('/history_transaction', function () { "transaction"=> transaction::allTransactions() ]); }); -// Route::get('/tracking_transaction', function () { -// return view('Admin/transaction/Tracking',[ -// 'name'=>'Jilhan Haura', -// "detail_transaction"=> transaction::allDetailTransactions() -// ]); -// }); Route::get('/history_refund', function () { return view('Admin/refund/history-refund',[ 'name'=>'Jilhan Haura', @@ -81,6 +76,7 @@ Route::get('/profile',function() { Route::get('/setting',function() { return view('Admin/setting/index',[ 'name'=>"Jilhan Haura", + "setting" => Setting:: HistorySetting() ]); });