diff --git a/TODO.md b/TODO.md index 1b4ed9f..829af7f 100644 --- a/TODO.md +++ b/TODO.md @@ -18,10 +18,10 @@ - [x] tambah biaya admin di deposit manual transfer - [x] info di ubah jadi html - [ ] tambahan detail customer untuk detail mitra wbb -- [ ] detail customer level untuk tampilan screen level customer di depan -- [ ] rombak fitur affiliasi +- [x] detail customer level untuk tampilan screen level customer di depan +- [x] rombak fitur affiliasi - [x] tambah detail di user admin - [x] tambah logo bank - [x] tambah setor tunai -- [ ] pengaturan share dapat menggunakan html +- [x] pengaturan share dapat menggunakan html - [ ] menu mitrawbb diff --git a/app/Http/Controllers/Customer/CustomerLevelController.php b/app/Http/Controllers/Customer/CustomerLevelController.php new file mode 100644 index 0000000..292a9fc --- /dev/null +++ b/app/Http/Controllers/Customer/CustomerLevelController.php @@ -0,0 +1,17 @@ + CustomerLevel::all(), + ]); + } +} diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 1cde4dd..ff7126a 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -16,7 +16,6 @@ class SettingController extends Controller return inertia('Setting/Index', [ 'setting' => $setting, - 'midtrans_notification_url' => route('api.midtrans.notification'), ]); } @@ -24,26 +23,14 @@ class SettingController extends Controller { $request->validate([ 'OPEN_WEBSITE_NAME' => 'required|string', - 'AFFILATE_ENABLED' => 'required|in:0,1', - 'AFFILATE_POIN_AMOUNT' => 'required|numeric', - 'MIDTRANS_SERVER_KEY' => 'required|string', - 'MIDTRANS_CLIENT_KEY' => 'required|string', - 'MIDTRANS_MERCHANT_ID' => 'required|string', - 'MIDTRANS_ENABLED' => 'required|in:0,1', - 'midtrans_logo_file' => 'nullable|image', + 'SHARE_TEXT' => 'required|string', ]); DB::beginTransaction(); - foreach ($request->except(['midtrans_logo_file']) as $key => $value) { + foreach ($request->input() as $key => $value) { Setting::where('key', $key)->update(['value' => $value]); } - if ($request->hasFile('midtrans_logo_file')) { - $file = $request->file('midtrans_logo_file'); - $file->store('uploads', 'public'); - Setting::where('key', 'MIDTRANS_LOGO')->update(['value' => $file->hashName('uploads')]); - } - Cache::flush(); DB::commit(); diff --git a/database/seeders/DummySeeder.php b/database/seeders/DummySeeder.php index 99d1f31..9c6f1cd 100644 --- a/database/seeders/DummySeeder.php +++ b/database/seeders/DummySeeder.php @@ -98,7 +98,7 @@ class DummySeeder extends Seeder ]; $count = 0; - $locations = Location::limit(3)->get(); + $locations = Location::orderBy('name', 'asc')->limit(3)->get(); foreach ($locations as $location) { //ada 3 lokasi di tiap lokasi ada 3 profile $count += 1; foreach ($profiles as $expired => $quota) { @@ -111,7 +111,7 @@ class DummySeeder extends Seeder 'location_id' => $location->id, 'name' => 'Profile ' . $quota, 'quota' => $quota, - 'display_note' => 'bisa semua', + 'display_note' => rand(0, 1) == 1 ? 'bisa semua' : null, 'expired' => rand(1, 3), 'expired_unit' => $expired, 'description' => '', diff --git a/database/seeders/InstallationSeed.php b/database/seeders/InstallationSeed.php index cecc0a8..f3773c7 100644 --- a/database/seeders/InstallationSeed.php +++ b/database/seeders/InstallationSeed.php @@ -61,7 +61,13 @@ class InstallationSeed extends Seeder 'name' => 'Basic', 'key' => 'basic', 'logo' => 'sample/basic.png', - 'description' => '-', + 'description' => '
Level Ini Basic
+deskripsi berikut menjelaskan tentang level
++
ini adalah sample deskripsi :
+1. contoh 1+
2. contoh 2+
', 'min_amount' => '100000', 'max_amount' => '500000' @@ -70,7 +76,13 @@ class InstallationSeed extends Seeder 'name' => 'Silver', 'key' => 'silver', 'logo' => 'sample/silver.png', - 'description' => '-', + 'description' => '
Level Ini Silver
+deskripsi berikut menjelaskan tentang level
++
ini adalah sample deskripsi :
+1. contoh 1+
2. contoh 2+
', 'min_amount' => '100000', 'max_amount' => '1000000' ], @@ -78,7 +90,13 @@ class InstallationSeed extends Seeder 'name' => 'Gold', 'key' => 'gold', 'logo' => 'sample/gold.png', - 'description' => '-', + 'description' => '
Level Ini Gold
+deskripsi berikut menjelaskan tentang level
++
ini adalah sample deskripsi :
+1. contoh 1+
2. contoh 2+
', 'min_amount' => '100000', 'max_amount' => '2000000' ], @@ -86,7 +104,13 @@ class InstallationSeed extends Seeder 'name' => 'Platinum', 'key' => 'platinum', 'logo' => 'sample/platinum.png', - 'description' => '-', + 'description' => '
Level Ini Platinum
+deskripsi berikut menjelaskan tentang level
++
ini adalah sample deskripsi :
+1. contoh 1+
2. contoh 2+
', 'min_amount' => '100000', 'max_amount' => '3000000' ], diff --git a/resources/js/Customer/CustomerLevel/Index.jsx b/resources/js/Customer/CustomerLevel/Index.jsx new file mode 100644 index 0000000..fab8ec5 --- /dev/null +++ b/resources/js/Customer/CustomerLevel/Index.jsx @@ -0,0 +1,87 @@ +import React, { useState } from 'react' +import Carousel from 'nuka-carousel' +import { Head, router } from '@inertiajs/react' +import { HiChevronLeft } from 'react-icons/hi2' + +import CustomerLayout from '@/Layouts/CustomerLayout' + +export default function Index(props) { + const { + levels, + auth: { user }, + } = props + + const levelIndex = levels.findIndex((l) => l.id === user.level.id) + const [selectedIndex] = useState(levelIndex) + const [index, setIndex] = useState(selectedIndex) + + return ( +