s
This commit is contained in:
commit
7cfa1dd8df
59
.env.example
59
.env.example
@ -1,59 +0,0 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailpit
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
127
app/Http/Controllers/API/LoginApiController.php
Normal file
127
app/Http/Controllers/API/LoginApiController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\API;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
|
||||
class LoginApiController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new AuthController instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth:api', ['except' => ['login', 'register', 'hai']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a JWT via given credentials.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
// $request->validate([
|
||||
// 'email' => 'required|string|email',
|
||||
// 'password' => 'required',
|
||||
// ]);
|
||||
|
||||
$credentials = request(['email', 'password']);
|
||||
|
||||
if (!($token = auth()->attempt($credentials))) {
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
}
|
||||
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the authenticated User.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function me()
|
||||
{
|
||||
return response()->json(Auth::user());
|
||||
}
|
||||
|
||||
public function hai()
|
||||
{
|
||||
return response()->json([
|
||||
'message' => 'Hello from API',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the user out (Invalidate the token).
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
auth()->logout();
|
||||
|
||||
return response()->json(['message' => 'Successfully logged out']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh a token.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function refresh()
|
||||
{
|
||||
return $this->respondWithToken(Auth::refresh());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the token array structure.
|
||||
*
|
||||
* @param string $token
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function respondWithToken($token)
|
||||
{
|
||||
return response()->json([
|
||||
'user' => auth()->user(),
|
||||
'access_token' => $token,
|
||||
'token_type' => 'bearer',
|
||||
'expires_in' => Auth::factory()->getTTL() * 60,
|
||||
// 'status' => auth()->check(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|unique:users',
|
||||
'password' => 'required|string|min:8',
|
||||
]);
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'User created successfully',
|
||||
'user' => $user,
|
||||
]);
|
||||
}
|
||||
|
||||
// public function check()
|
||||
// {
|
||||
// return response()->json([
|
||||
// 'status' => auth()->check(),
|
||||
// ]);
|
||||
// }
|
||||
}
|
21
app/Http/Controllers/Admin/AdminDashboardController.php
Normal file
21
app/Http/Controllers/Admin/AdminDashboardController.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Transactions;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class AdminDashboardController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
return view('admin.index',[
|
||||
"transaction"=>Transactions::allTransactions()
|
||||
]);
|
||||
}
|
||||
|
||||
public function profile(){
|
||||
return view('admin.profile.index');
|
||||
}
|
||||
}
|
@ -1,20 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\Refund;
|
||||
use App\Http\Requests\StoreRefundRequest;
|
||||
use App\Http\Requests\UpdateRefundRequest;
|
||||
use App\Models\Refunds;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RefundController extends Controller
|
||||
class AdminRefundController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$refundData = Refund::all();
|
||||
return view('Admin.refund.history-refund', ['history_refund' => $refundData]);
|
||||
// $refundData = Refund::all();
|
||||
// return view('Admin.refund.history-refund', ['history_refund' => $refundData]);
|
||||
return view('admin.refund.index',[
|
||||
"refunds" => Refunds::HistoryRefund()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,7 +32,7 @@ class RefundController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreRefundRequest $request)
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -38,7 +42,9 @@ class RefundController extends Controller
|
||||
*/
|
||||
public function show(Refund $refund)
|
||||
{
|
||||
//
|
||||
return view('admin.refund.detail-refund',[
|
||||
"detail_refund"=> Refunds::DetailRefund()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +58,7 @@ class RefundController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateRefundRequest $request, Refund $refund)
|
||||
public function update(Request $request, Refund $refund)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -64,4 +70,4 @@ class RefundController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
101
app/Http/Controllers/Admin/AdminSettingController.php
Normal file
101
app/Http/Controllers/Admin/AdminSettingController.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class AdminSettingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$settings = Setting::all();
|
||||
return view('admin.setting.index', [
|
||||
'settings' => $settings,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
// dd($request->persentase);
|
||||
[$tahun, $bulan] = explode('-', $request->bulan_tahun);
|
||||
Setting::create([
|
||||
'bulan' => $bulan,
|
||||
'tahun' => $tahun,
|
||||
'persentase' => $request->persentase,
|
||||
'status' => 'Active',
|
||||
]);
|
||||
return redirect()->route('admin-setting.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Setting $setting)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Setting $setting)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// dd($setting['status'] );
|
||||
$setting = Setting::findOrFail($id);
|
||||
if ($setting->status == 'Active') {
|
||||
$setting->status = 'Nonactive';
|
||||
$result = $setting->save();
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => "Berhasil update kebijakan",
|
||||
'status' => true,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'message' => "Gagal update kebijakan",
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$setting->status = 'Active';
|
||||
$result = $setting->save();
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => "Berhasil update kebijakan",
|
||||
'status' => true,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'message' => "Gagal update kebijakan",
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// return response()->json($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Setting $setting)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -1,19 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\transaction;
|
||||
use App\Http\Requests\StoretransactionRequest;
|
||||
use App\Http\Requests\UpdatetransactionRequest;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Transactions;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TransactionController extends Controller
|
||||
class AdminTransactionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
return view('admin.transaction.index', [
|
||||
'transactions' => Transaction::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -27,7 +30,7 @@ class TransactionController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoretransactionRequest $request)
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -37,7 +40,9 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function show(transaction $transaction)
|
||||
{
|
||||
//
|
||||
return view('admin.transaction.detail-transaction',[
|
||||
'detail_transaction' => Transactions::allDetailTransactions()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +56,7 @@ class TransactionController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdatetransactionRequest $request, transaction $transaction)
|
||||
public function update(Request $request, transaction $transaction)
|
||||
{
|
||||
//
|
||||
}
|
127
app/Http/Controllers/Admin/AdminUserController.php
Normal file
127
app/Http/Controllers/Admin/AdminUserController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminUserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// $users = User::where('role', 'User')
|
||||
// ->orderByRaw("FIELD(status, 'Progress', 'Finished', 'Rejected') ASC")
|
||||
// ->latest()
|
||||
// ->get();
|
||||
$users = User::where('role', 'User')
|
||||
->orderByRaw("CASE WHEN status = 'Progress' THEN 1 WHEN status = 'Finished' THEN 2 WHEN status = 'Rejected' THEN 3 ELSE 4 END ASC")
|
||||
->latest()
|
||||
->get();
|
||||
return view('admin.users.index', ['users' => $users]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$user = User::find($id);
|
||||
return view('admin.users.detail-user', ['user' => $user]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(User $user)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
return response()->json([
|
||||
'user' => $request,
|
||||
'id' => $id,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$result = User::destroy($id);
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => 'Berhasil hapus data',
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'message' => 'Gagal hapus data, karena ' . $e,
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function approveUser($id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->status = 'Finished';
|
||||
$result = $user->save();
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => 'Akun telah disetujui dan dapat digunakan',
|
||||
'status' => true,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'message' => 'Akun gagal disetujui karena ' + $result,
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function denyUser($id)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
$user->status = 'Rejected';
|
||||
$result = $user->save();
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => 'Akun telah ditolak dan tidak dapat digunakan',
|
||||
'status' => true,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'message' => 'Akun gagal ditolak karena ' + $result,
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
268
app/Http/Controllers/Login/LoginController.php
Normal file
268
app/Http/Controllers/Login/LoginController.php
Normal file
@ -0,0 +1,268 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Login;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use thiagoalessio\TesseractOCR\TesseractOCR;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Laravolt\Indonesia\Models\City;
|
||||
use Laravolt\Indonesia\Models\District;
|
||||
use Laravolt\Indonesia\Models\Province;
|
||||
use Laravolt\Indonesia\Models\Village;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
// /**
|
||||
// * Create a new AuthController instance.
|
||||
// *
|
||||
// * @return void
|
||||
// */
|
||||
// public function __construct()
|
||||
// {
|
||||
// $this->middleware('auth:api', ['except' => ['login', 'authenticate', 'register', 'hai']]);
|
||||
// }
|
||||
|
||||
public function login()
|
||||
{
|
||||
$provinces = Province::all();
|
||||
$cities = City::all();
|
||||
$districts = District::all();
|
||||
$villages = Village::all();
|
||||
return view('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a JWT via given credentials.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function authenticate(Request $request)
|
||||
{
|
||||
// dd($request);
|
||||
$credentials = $request->validate([
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'min:8'],
|
||||
]);
|
||||
|
||||
if (Auth::attempt($credentials)) {
|
||||
if (Auth::user()->status == 'Finished') {
|
||||
$request->session()->regenerate();
|
||||
if (ucwords(Auth::user()->role) == 'Admin') {
|
||||
// return redirect()->route('admin.index');
|
||||
return redirect()->intended('admin');
|
||||
} else {
|
||||
return redirect()->intended('user');
|
||||
}
|
||||
} else {
|
||||
Session::flash('message', 'Akun tidak ditemukan atau sedang dalam pengajuan');
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->back()
|
||||
->withErrors([
|
||||
'email' => 'Email dengan' . $credentials['email'] . ' tidak tersedia.',
|
||||
])
|
||||
->onlyInput('email');
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the user out (Invalidate the token).
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function logout(Request $request)
|
||||
{
|
||||
Auth::logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
// input
|
||||
$nama_depan = $request->get('nama-depan');
|
||||
$nama_belakang = $request->get('nama-belakang');
|
||||
$tanggal_lahir = $request->get('tanggal-lahir');
|
||||
$new_password = $request->get('new-password');
|
||||
$nik = $request->get('nik');
|
||||
$email = $request->get('email');
|
||||
$nohp = $request->get('nohp');
|
||||
$alamat = $request->get('alamat');
|
||||
$foto_ktp = '';
|
||||
$foto_wajah = '';
|
||||
$persentase_kemiripan = '0%';
|
||||
$gender = $request->get('gender');
|
||||
$kode_kelurahan = $request->get('kode-kelurahan');
|
||||
|
||||
$ktpBase64 = $request->request->get('ktp');
|
||||
$wajahBase64 = $request->request->get('wajah');
|
||||
|
||||
$validatedData['email_verified_at'] = now();
|
||||
|
||||
if ($ktpBase64 && $wajahBase64) {
|
||||
// Konversi string Base64 ke file gambar
|
||||
$ktpFile = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $ktpBase64));
|
||||
$wajahFile = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $wajahBase64));
|
||||
|
||||
$foto_ktp = 'Foto-KTP-' . $nama_depan . '-' . $nama_belakang . '.jpg';
|
||||
$foto_wajah = 'Foto-Wajah-' . $nama_depan . '-' . $nama_belakang . '.jpg';
|
||||
|
||||
file_put_contents(public_path('storage/foto-ktp/' . $foto_ktp), $ktpFile);
|
||||
file_put_contents(public_path('storage/foto-wajah/' . $foto_wajah), $wajahFile);
|
||||
}
|
||||
|
||||
//OCR
|
||||
try {
|
||||
$fotoKTP = public_path('storage/foto-ktp/' . $foto_ktp);
|
||||
|
||||
$image = Image::make($fotoKTP);
|
||||
|
||||
$image->greyscale(); // Convert to grayscale
|
||||
$image->contrast(10); // Increase contrast, adjust the value as needed
|
||||
|
||||
$preprocessedfotoKTP = storage_path('preprocessed_image.jpg');
|
||||
$image->save($preprocessedfotoKTP);
|
||||
|
||||
$result = (new TesseractOCR($preprocessedfotoKTP))->run();
|
||||
|
||||
// (5) Normalize
|
||||
|
||||
$lines = explode("\n", $result);
|
||||
$nikOCR = '';
|
||||
$nikInputan = $nik;
|
||||
$namaInputan = $nama_depan.' '.$nama_belakang;
|
||||
|
||||
foreach ($lines as $line) {
|
||||
// Mencari NIK
|
||||
if (strpos($line, $nikInputan) !== false) {
|
||||
$nikOCR = preg_replace('/[^0-9]/', '', $line);
|
||||
}
|
||||
|
||||
// Mencari nama
|
||||
if (strpos($line, $namaInputan) !== false) {
|
||||
$namaOCR = trim(substr($line, strpos($line, ':') + 1));
|
||||
}
|
||||
}
|
||||
|
||||
//Selesai
|
||||
|
||||
$persentase_kemiripan = (similar_text($nikInputan, $nikOCR, $percent) + similar_text($namaOCR, $namaOCR, $percent))/2;
|
||||
// $status = 'Progress';
|
||||
|
||||
// if (similar_text($nikInputan, $nikOCR, $percent) >= 70 && similar_text($namaOCR, $namaOCR, $percent) >= 70) {
|
||||
// $status = 'Progress';
|
||||
// } else {
|
||||
// $status = 'Progress';
|
||||
// }
|
||||
|
||||
} catch (\Exception $e) {
|
||||
// $status = 'Progress';
|
||||
}
|
||||
//OCR
|
||||
|
||||
//Deteksi wajah belum
|
||||
|
||||
$password = Hash::make($new_password);
|
||||
|
||||
|
||||
// return response()->json([
|
||||
// 'status' => true,
|
||||
// 'message' => Uuid::uuid4(),
|
||||
// ]);
|
||||
$result = User::create([
|
||||
'id' => Uuid::uuid4(),
|
||||
'nama_depan' => $nama_depan,
|
||||
'nama_belakang' => $nama_belakang,
|
||||
'tanggal_lahir' => $tanggal_lahir,
|
||||
'email' => $email,
|
||||
'email_verified_at' => now(),
|
||||
'password' => $password,
|
||||
'nohp' => $nohp,
|
||||
'nik' => $nik,
|
||||
'alamat' => $alamat,
|
||||
'foto_ktp' => $foto_ktp,
|
||||
'foto_wajah' => $foto_wajah,
|
||||
'foto_profil' => null,
|
||||
'persentase_kemiripan' => $persentase_kemiripan,
|
||||
'gender' => $gender,
|
||||
'kode_kelurahan' => $kode_kelurahan,
|
||||
'remember_token' => Str::random(10),
|
||||
]);
|
||||
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Akun anda sudah terdaftar dan butuh verifikasi hingga maksimal 1 hari kerja',
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Akun anda gagal terdaftar. Coba lagi! ' + $result,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function statusAkun($email)
|
||||
{
|
||||
$result = User::where('email', $email)->get();
|
||||
if ($result->isNotEmpty()) {
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => $result,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => $result,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function cariProvinsi()
|
||||
{
|
||||
$data = Province::where('name', 'LIKE', '%' . strtoupper(request('q')) . '%')->paginate(10);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function cariKota($code)
|
||||
{
|
||||
$data = City::where('province_code', $code)
|
||||
->where('name', 'LIKE', '%' . strtoupper(request('q')) . '%')
|
||||
->paginate(10);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function cariKecamatan($code)
|
||||
{
|
||||
$data = District::where('city_code', $code)
|
||||
->where('name', 'LIKE', '%' . strtoupper(request('q')) . '%')
|
||||
->paginate(10);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function cariKelurahan($code)
|
||||
{
|
||||
$data = Village::where('district_code', $code)
|
||||
->where('name', 'LIKE', '%' . strtoupper(request('q')) . '%')
|
||||
->paginate(10);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
}
|
@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Users;
|
||||
use App\Http\Requests\StoreUsersRequest;
|
||||
use App\Http\Requests\UpdateUsersRequest;
|
||||
use App\Models\RefundDescription;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UsersController extends Controller
|
||||
class RefundDescriptionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
@ -27,7 +26,7 @@ class UsersController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreUsersRequest $request)
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -35,7 +34,7 @@ class UsersController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Users $users)
|
||||
public function show(RefundDescription $refundDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -43,7 +42,7 @@ class UsersController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Users $users)
|
||||
public function edit(RefundDescription $refundDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -51,7 +50,7 @@ class UsersController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateUsersRequest $request, Users $users)
|
||||
public function update(Request $request, RefundDescription $refundDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -59,7 +58,7 @@ class UsersController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Users $users)
|
||||
public function destroy(RefundDescription $refundDescription)
|
||||
{
|
||||
//
|
||||
}
|
@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Setting;
|
||||
use App\Http\Requests\StoreSettingRequest;
|
||||
use App\Http\Requests\UpdateSettingRequest;
|
||||
use App\Models\TransactionDescription;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SettingController extends Controller
|
||||
class TransactionDescriptionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
@ -27,7 +26,7 @@ class SettingController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StoreSettingRequest $request)
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -35,7 +34,7 @@ class SettingController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Setting $setting)
|
||||
public function show(TransactionDescription $transactionDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -43,7 +42,7 @@ class SettingController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Setting $setting)
|
||||
public function edit(TransactionDescription $transactionDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -51,7 +50,7 @@ class SettingController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(UpdateSettingRequest $request, Setting $setting)
|
||||
public function update(Request $request, TransactionDescription $transactionDescription)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -59,7 +58,7 @@ class SettingController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Setting $setting)
|
||||
public function destroy(TransactionDescription $transactionDescription)
|
||||
{
|
||||
//
|
||||
}
|
134
app/Http/Controllers/User/UserContactController.php
Normal file
134
app/Http/Controllers/User/UserContactController.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\User;
|
||||
|
||||
use App\Models\Contact;
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class UserContactController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$contacts = Contact::where('pemilik_kontak', Auth::user()->email)->get();
|
||||
return view('user.contact.index', ['contacts' => $contacts]);
|
||||
// dd($contacts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$email_relasi = $request->input('email');
|
||||
if($email_relasi == Auth::user()->email){
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Kontak yang ingin didaftarkan tidak boleh sama',
|
||||
]);
|
||||
}else{
|
||||
$result = Contact::create([
|
||||
'pemilik_kontak' => Auth::user()->email,
|
||||
'relasi_kontak' => $request->input('email'),
|
||||
]);
|
||||
|
||||
if($result){
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Akun berhasil masuk ke kontak',
|
||||
]);
|
||||
}else{
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Akun gagal masuk ke kontak',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Contact $contact)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Contact $contact)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, Contact $contact)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Contact $contact, $id)
|
||||
{
|
||||
try {
|
||||
$result = Contact::destroy($id);
|
||||
if($result){
|
||||
return response()->json([
|
||||
'message' => 'Berhasil hapus data',
|
||||
'status' => true,
|
||||
]);
|
||||
}else{
|
||||
return response()->json([
|
||||
'message' => 'Gagal hapus data karena '.$result,
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'message' => 'Gagal hapus data, karena ' . $e,
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function cekEmail($email)
|
||||
{
|
||||
$result = User::where('email', $email)->get();
|
||||
if ($result->isNotEmpty() && $result[0]->role == 'User') {
|
||||
if($result[0]->status == 'Finished'){
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => $result,
|
||||
]);
|
||||
}else{
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Akun dengen email ' . $email . ' tersedia dan belum diverifikasi',
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Akun dengen email ' . $email . ' tidak tersedia',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
20
app/Http/Controllers/User/UserDashboardController.php
Normal file
20
app/Http/Controllers/User/UserDashboardController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\User;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\RefundUser;
|
||||
|
||||
class UserDashboardController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
return view('user.index',[
|
||||
"refundUserss"=>RefundUser::HistoryRefundUser()
|
||||
]);
|
||||
}
|
||||
|
||||
public function profile(){
|
||||
return view('user.profile.index');
|
||||
}
|
||||
}
|
30
app/Http/Controllers/User/UserRefundController.php
Normal file
30
app/Http/Controllers/User/UserRefundController.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\User;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\RefundUser;
|
||||
|
||||
class UserRefundController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('user.refund.index', [
|
||||
'name' => 'npannisa',
|
||||
'refundUserss' => RefundUser::HistoryRefundUser(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function createRefund(Request $request)
|
||||
{
|
||||
return view('user.refund.new-refund');
|
||||
}
|
||||
|
||||
public function historyRefund($id){
|
||||
return view('user.transaction.pembeli.history-refund',[
|
||||
'name'=>'npannisa',
|
||||
"refundUserss"=>RefundUser::HistoryRefundUser()
|
||||
]);
|
||||
}
|
||||
}
|
94
app/Http/Controllers/User/UserTransactionController.php
Normal file
94
app/Http/Controllers/User/UserTransactionController.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\User;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\TransactionUser;
|
||||
|
||||
class UserTransactionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function indexPembeli()
|
||||
{
|
||||
return view('user.transaction.pembeli.transaction-pembeli',[
|
||||
'name'=>'npannisa',
|
||||
'TransactionUser'=>TransactionUser::HistoryTransaction()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function indexPenjual()
|
||||
{
|
||||
return view('user.transaction.penjual.transaction-penjual',[
|
||||
'name'=>'npannisa',
|
||||
"TransactionUser"=>TransactionUser::HistoryTransaction()
|
||||
]);
|
||||
}
|
||||
|
||||
public function detailTransaction($id){
|
||||
return view('user.transaction.pembeli.detail-transaction',[
|
||||
'name'=>'npannisa',
|
||||
"TransactionUser"=>TransactionUser::HistoryTransaction()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function createTransaction(Request $request)
|
||||
{
|
||||
return view('user.transaction.pembeli.new-transaction',[
|
||||
'name'=>'npannisa',
|
||||
"TransactionUser"=>TransactionUser::HistoryTransaction()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function invoiceTransaction($id)
|
||||
{
|
||||
return view('user.transaction.pembeli.invoice-transaction',[
|
||||
'name'=>'npannisa',
|
||||
"TransactionUser"=>TransactionUser::HistoryTransaction()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Transaction $transaction)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Transaction $transaction)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, Transaction $transaction)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Transaction $transaction)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -64,5 +64,7 @@ class Kernel extends HttpKernel
|
||||
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'admin' => \App\Http\Middleware\Admin::class,
|
||||
'user' => \App\Http\Middleware\User::class,
|
||||
];
|
||||
}
|
||||
|
24
app/Http/Middleware/Admin.php
Normal file
24
app/Http/Middleware/Admin.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class Admin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if(Auth::user()->role != 'Admin'){
|
||||
return redirect()->back();
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
24
app/Http/Middleware/User.php
Normal file
24
app/Http/Middleware/User.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class User
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if(Auth::user()->role != 'User'){
|
||||
return redirect()->back();
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
32
app/Models/Contact.php
Normal file
32
app/Models/Contact.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'pemilik_kontak',
|
||||
'relasi_kontak',
|
||||
];
|
||||
|
||||
//Relasi
|
||||
public function pemilikKontak(){
|
||||
return $this->belongsTo(User::class, 'pemilik_kontak', 'email');
|
||||
}
|
||||
|
||||
public function relasiKontak(){
|
||||
return $this->belongsTo(User::class, 'relasi_kontak', 'email');
|
||||
}
|
||||
|
||||
//Relasi
|
||||
}
|
@ -5,76 +5,25 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// class Refund extends Model{
|
||||
// protected $table = 'refund';
|
||||
// use HasFactory;
|
||||
// }
|
||||
class Refund
|
||||
class Refund extends Model
|
||||
{
|
||||
private static $history_refund=[
|
||||
[
|
||||
"no"=>"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"
|
||||
]
|
||||
];
|
||||
use HasFactory;
|
||||
|
||||
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;
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'order_id',
|
||||
'total',
|
||||
'due_date',
|
||||
'status',
|
||||
];
|
||||
|
||||
}
|
||||
public static function DetailRefund(){
|
||||
return self::$detail_refund;
|
||||
}
|
||||
}
|
||||
//Relasi
|
||||
public function orders(){
|
||||
return $this->belongsTo(Transaction::class, 'order_id', 'order_id');
|
||||
}
|
||||
//Relasi
|
||||
}
|
||||
|
28
app/Models/RefundDescription.php
Normal file
28
app/Models/RefundDescription.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RefundDescription extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'refund_id',
|
||||
'filename',
|
||||
'type',
|
||||
];
|
||||
|
||||
//Relasi
|
||||
public function refunds(){
|
||||
return $this->belongsTo(Refund::class, 'refund_id', 'id');
|
||||
}
|
||||
//Relasi
|
||||
}
|
44
app/Models/RefundUser.php
Normal file
44
app/Models/RefundUser.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RefundUser
|
||||
{
|
||||
// use HasFactory;
|
||||
|
||||
private static $history_refundUser=[
|
||||
[
|
||||
"orderId" => "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;
|
||||
}
|
||||
}
|
80
app/Models/Refunds.php
Normal file
80
app/Models/Refunds.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// class Refund extends Model{
|
||||
// protected $table = 'refund';
|
||||
// use HasFactory;
|
||||
// }
|
||||
class Refunds
|
||||
{
|
||||
private static $history_refund=[
|
||||
[
|
||||
"no"=>"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;
|
||||
}
|
||||
}
|
@ -5,46 +5,19 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Setting
|
||||
class Setting extends Model
|
||||
{
|
||||
static $History_Setting=[
|
||||
[
|
||||
"no" => "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;
|
||||
}
|
||||
}
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'bulan',
|
||||
'tahun',
|
||||
'persentase',
|
||||
'status',
|
||||
];
|
||||
}
|
||||
|
50
app/Models/Settings.php
Normal file
50
app/Models/Settings.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Settings
|
||||
{
|
||||
static $History_Setting=[
|
||||
[
|
||||
"no" => "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;
|
||||
}
|
||||
}
|
33
app/Models/TransactionDescription.php
Normal file
33
app/Models/TransactionDescription.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TransactionDescription extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'order_id',
|
||||
'user',
|
||||
'judul',
|
||||
'deskripsi'
|
||||
];
|
||||
|
||||
//Relasi
|
||||
public function order(){
|
||||
return $this->belongsTo(Transaction::class, 'order_id', 'order_id');
|
||||
}
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo(User::class, 'email', 'user');
|
||||
}
|
||||
//Relasi
|
||||
}
|
57
app/Models/TransactionUser.php
Normal file
57
app/Models/TransactionUser.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
|
||||
class TransactionUser
|
||||
{
|
||||
private static $history_transaction=[
|
||||
[
|
||||
"userId" => "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;
|
||||
}
|
||||
}
|
90
app/Models/Transactions.php
Normal file
90
app/Models/Transactions.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Transactions
|
||||
{
|
||||
private static $list_transaction = [
|
||||
[
|
||||
'no' => '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;
|
||||
}
|
||||
}
|
@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Tymon\JWTAuth\Contracts\JWTSubject;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@ -18,9 +20,24 @@ class User extends Authenticatable
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'id',
|
||||
'nama_depan',
|
||||
'nama_belakang',
|
||||
'tanggal_lahir',
|
||||
'nik',
|
||||
'email',
|
||||
'password',
|
||||
'role',
|
||||
'nohp',
|
||||
'alamat',
|
||||
'foto_ktp',
|
||||
'foto_wajah',
|
||||
'foto_profil',
|
||||
'persentase_kemiripan',
|
||||
'status',
|
||||
'gender',
|
||||
'kode_kelurahan',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -41,5 +58,72 @@ class User extends Authenticatable
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'id' => 'string',
|
||||
'status' => 'string',
|
||||
];
|
||||
|
||||
//JWT
|
||||
|
||||
/**
|
||||
* Get the identifier that will be stored in the subject claim of the JWT.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getJWTIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a key value array, containing any custom claims to be added to the JWT.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getJWTCustomClaims()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
//JWT
|
||||
|
||||
|
||||
//Relasi
|
||||
public function pemilik_kontak(){
|
||||
return $this->hasMany(Contact::class, 'email', 'pemilik_kontak');
|
||||
}
|
||||
|
||||
public function relasi_kontak(){
|
||||
return $this->hasMany(Contact::class, 'email', 'relasi_kontak');
|
||||
}
|
||||
|
||||
public function pembeli(){
|
||||
return $this->hasMany(Transaction::class, 'email', 'pembeli');
|
||||
}
|
||||
|
||||
public function penjual(){
|
||||
return $this->hasMany(Transaction::class, 'email', 'penjual');
|
||||
}
|
||||
|
||||
public function village(){
|
||||
return $this->belongsTo('Laravolt\Indonesia\Models\Village', 'kode_kelurahan', 'code');
|
||||
}
|
||||
//Relasi
|
||||
|
||||
//function alamat
|
||||
public function getVillageName(){
|
||||
return $this->village->name;
|
||||
}
|
||||
|
||||
public function getDistrictName(){
|
||||
return $this->village->district->name;
|
||||
}
|
||||
|
||||
public function getCityName(){
|
||||
return $this->village->district->city->name;
|
||||
}
|
||||
|
||||
public function getProvinceName(){
|
||||
return $this->village->district->city->province->name;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Users
|
||||
{
|
||||
private static $list_users=[
|
||||
[
|
||||
"no" => "1",
|
||||
"userId" => "U1290",
|
||||
"fullname" => "Tsalsabila Jilhan Haura",
|
||||
"email" => "jilhanhaura07@gmail.com",
|
||||
"gender" => "Female",
|
||||
"date" => "August 23, 2023",
|
||||
"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;
|
||||
}
|
||||
|
||||
private static $detail_user=[
|
||||
[
|
||||
"userId" => "91029138",
|
||||
"nik" => "214141413414131414",
|
||||
"name" => "Jilhan Haura",
|
||||
"gender" => "Female",
|
||||
"religion" => "Muslim",
|
||||
"bloodType" => "AB",
|
||||
"email" => "jilhanhaura07@gmail.com",
|
||||
"phoneNumber" => "08909098102099",
|
||||
"province" => "Sumatera Barat",
|
||||
"city" => "Padang",
|
||||
"district" => "Padang",
|
||||
"village" => "Balai Baru",
|
||||
"detail" => "Jl Simpang komplek polda balai baru"
|
||||
]
|
||||
];
|
||||
public static function detailUser(){
|
||||
return self::$detail_user;
|
||||
}
|
||||
}
|
@ -5,89 +5,54 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class transaction
|
||||
class Transaction extends Model
|
||||
{
|
||||
private static $list_transaction =[
|
||||
[
|
||||
"no"=>"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"
|
||||
]
|
||||
use HasFactory;
|
||||
|
||||
];
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'pembeli',
|
||||
'penjual',
|
||||
'judul_transaksi',
|
||||
'deskripsi transaksi',
|
||||
'persentase_keuntungan',
|
||||
'total_keuntungan',
|
||||
'harga',
|
||||
'biaya_admin',
|
||||
'total_harga',
|
||||
'signature_key',
|
||||
'metode_pembayaran',
|
||||
'status',
|
||||
'batas_pembayaran',
|
||||
'batas_pengiriman_barang',
|
||||
];
|
||||
|
||||
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"
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'batas_pembayaran' => 'datetime',
|
||||
'batas_pengiriman_barang' => 'datetime',
|
||||
'order_id' => 'string',
|
||||
];
|
||||
|
||||
//Relasi
|
||||
public function pembeli(){
|
||||
return $this->belongsTo(User::class, 'email', 'pembeli');
|
||||
}
|
||||
|
||||
// "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 function penjual(){
|
||||
return $this->belongsTo(User::class, 'email', 'penjual');
|
||||
}
|
||||
|
||||
];
|
||||
public static function allTransactions()
|
||||
{
|
||||
return self::$list_transaction;
|
||||
}
|
||||
|
||||
public static function allDetailTransactions()
|
||||
{
|
||||
return self::$detail_transaction;
|
||||
}
|
||||
}
|
||||
public function refunds(){
|
||||
return $this->hasMany(Refund::class, 'order_id', 'order_id');
|
||||
}
|
||||
//Relasi
|
||||
}
|
||||
|
@ -2,14 +2,24 @@
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"framework"
|
||||
],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"intervention/image": "^2.7",
|
||||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.2",
|
||||
"laravel/tinker": "^2.8"
|
||||
"laravel/tinker": "^2.8",
|
||||
"laravolt/indonesia": "^0.34.0",
|
||||
"nesbot/carbon": "^2.69",
|
||||
"pusher/pusher-php-server": "^7.2",
|
||||
"ramsey/uuid": "^4.7",
|
||||
"thiagoalessio/tesseract_ocr": "^2.12",
|
||||
"tymon/jwt-auth": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
|
1219
composer.lock
generated
1219
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -109,7 +109,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'faker_locale' => 'en_US',
|
||||
'faker_locale' => 'id_ID',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -40,6 +40,10 @@ return [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
'api' => [
|
||||
'driver' => 'jwt',
|
||||
'provider' => 'users',
|
||||
]
|
||||
],
|
||||
|
||||
/*
|
||||
|
@ -35,13 +35,17 @@ return [
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
// 'options' => [
|
||||
// 'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
// 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
// 'port' => env('PUSHER_PORT', 443),
|
||||
// 'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
// 'encrypted' => true,
|
||||
// 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
// ],
|
||||
'options' => [
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
'port' => env('PUSHER_PORT', 443),
|
||||
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
'cluster' => 'ap1',
|
||||
'useTLS' => true,
|
||||
],
|
||||
'client_options' => [
|
||||
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||
|
80
config/flare.php
Normal file
80
config/flare.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
use Spatie\FlareClient\FlareMiddleware\AddGitInformation;
|
||||
use Spatie\FlareClient\FlareMiddleware\RemoveRequestIp;
|
||||
use Spatie\FlareClient\FlareMiddleware\CensorRequestBodyFields;
|
||||
use Spatie\FlareClient\FlareMiddleware\CensorRequestHeaders;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddDumps;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddEnvironmentInformation;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddExceptionInformation;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddJobs;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddLogs;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddQueries;
|
||||
use Spatie\LaravelIgnition\FlareMiddleware\AddNotifierName;
|
||||
|
||||
return [
|
||||
/*
|
||||
|
|
||||
|--------------------------------------------------------------------------
|
||||
| Flare API key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify Flare's API key below to enable error reporting to the service.
|
||||
|
|
||||
| More info: https://flareapp.io/docs/general/projects
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => env('FLARE_KEY'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These middleware will modify the contents of the report sent to Flare.
|
||||
|
|
||||
*/
|
||||
|
||||
'flare_middleware' => [
|
||||
RemoveRequestIp::class,
|
||||
AddGitInformation::class,
|
||||
AddNotifierName::class,
|
||||
AddEnvironmentInformation::class,
|
||||
AddExceptionInformation::class,
|
||||
AddDumps::class,
|
||||
AddLogs::class => [
|
||||
'maximum_number_of_collected_logs' => 200,
|
||||
],
|
||||
AddQueries::class => [
|
||||
'maximum_number_of_collected_queries' => 200,
|
||||
'report_query_bindings' => true,
|
||||
],
|
||||
AddJobs::class => [
|
||||
'max_chained_job_reporting_depth' => 5,
|
||||
],
|
||||
CensorRequestBodyFields::class => [
|
||||
'censor_fields' => [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
],
|
||||
],
|
||||
CensorRequestHeaders::class => [
|
||||
'headers' => [
|
||||
'API-KEY',
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Reporting log statements
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If this setting is `false` log statements won't be sent as events to Flare,
|
||||
| no matter which error level you specified in the Flare log channel.
|
||||
|
|
||||
*/
|
||||
|
||||
'send_logs_as_events' => true,
|
||||
];
|
279
config/ignition.php
Normal file
279
config/ignition.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?php
|
||||
|
||||
use Spatie\Ignition\Solutions\SolutionProviders\BadMethodCallSolutionProvider;
|
||||
use Spatie\Ignition\Solutions\SolutionProviders\MergeConflictSolutionProvider;
|
||||
use Spatie\Ignition\Solutions\SolutionProviders\UndefinedPropertySolutionProvider;
|
||||
use Spatie\LaravelIgnition\Recorders\DumpRecorder\DumpRecorder;
|
||||
use Spatie\LaravelIgnition\Recorders\JobRecorder\JobRecorder;
|
||||
use Spatie\LaravelIgnition\Recorders\LogRecorder\LogRecorder;
|
||||
use Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\DefaultDbNameSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\GenericLaravelExceptionSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\IncorrectValetDbCredentialsSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingAppKeySolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingColumnSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingImportSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingLivewireComponentSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingMixManifestSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingViteManifestSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\RunningLaravelDuskInProductionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\TableNotFoundSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\UndefinedViewVariableSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\UnknownValidationSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\ViewNotFoundSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\OpenAiSolutionProvider;
|
||||
use Spatie\LaravelIgnition\Solutions\SolutionProviders\SailNetworkSolutionProvider;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Editor
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Choose your preferred editor to use when clicking any edit button.
|
||||
|
|
||||
| Supported: "phpstorm", "vscode", "vscode-insiders", "textmate", "emacs",
|
||||
| "sublime", "atom", "nova", "macvim", "idea", "netbeans",
|
||||
| "xdebug", "phpstorm-remote"
|
||||
|
|
||||
*/
|
||||
|
||||
'editor' => env('IGNITION_EDITOR', 'phpstorm'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Theme
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which theme Ignition should use.
|
||||
|
|
||||
| Supported: "light", "dark", "auto"
|
||||
|
|
||||
*/
|
||||
|
||||
'theme' => env('IGNITION_THEME', 'auto'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sharing
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can share local errors with colleagues or others around the world.
|
||||
| Sharing is completely free and doesn't require an account on Flare.
|
||||
|
|
||||
| If necessary, you can completely disable sharing below.
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_share_button' => env('IGNITION_SHARING_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Ignition commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition comes with an additional make command that lets you create
|
||||
| new solution classes more easily. To keep your default Laravel
|
||||
| installation clean, this command is not registered by default.
|
||||
|
|
||||
| You can enable the command registration below.
|
||||
|
|
||||
*/
|
||||
|
||||
'register_commands' => env('REGISTER_IGNITION_COMMANDS', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Solution Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify a list of solution providers (as fully qualified class
|
||||
| names) that shouldn't be loaded. Ignition will ignore these classes
|
||||
| and possible solutions provided by them will never be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'solution_providers' => [
|
||||
// from spatie/ignition
|
||||
BadMethodCallSolutionProvider::class,
|
||||
MergeConflictSolutionProvider::class,
|
||||
UndefinedPropertySolutionProvider::class,
|
||||
|
||||
// from spatie/laravel-ignition
|
||||
IncorrectValetDbCredentialsSolutionProvider::class,
|
||||
MissingAppKeySolutionProvider::class,
|
||||
DefaultDbNameSolutionProvider::class,
|
||||
TableNotFoundSolutionProvider::class,
|
||||
MissingImportSolutionProvider::class,
|
||||
InvalidRouteActionSolutionProvider::class,
|
||||
ViewNotFoundSolutionProvider::class,
|
||||
RunningLaravelDuskInProductionProvider::class,
|
||||
MissingColumnSolutionProvider::class,
|
||||
UnknownValidationSolutionProvider::class,
|
||||
MissingMixManifestSolutionProvider::class,
|
||||
MissingViteManifestSolutionProvider::class,
|
||||
MissingLivewireComponentSolutionProvider::class,
|
||||
UndefinedViewVariableSolutionProvider::class,
|
||||
GenericLaravelExceptionSolutionProvider::class,
|
||||
OpenAiSolutionProvider::class,
|
||||
SailNetworkSolutionProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignored Solution Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify a list of solution providers (as fully qualified class
|
||||
| names) that shouldn't be loaded. Ignition will ignore these classes
|
||||
| and possible solutions provided by them will never be displayed.
|
||||
|
|
||||
*/
|
||||
|
||||
'ignored_solution_providers' => [
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Runnable Solutions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some solutions that Ignition displays are runnable and can perform
|
||||
| various tasks. By default, runnable solutions are only enabled when your
|
||||
| app has debug mode enabled and the environment is `local` or
|
||||
| `development`.
|
||||
|
|
||||
| Using the `IGNITION_ENABLE_RUNNABLE_SOLUTIONS` environment variable, you
|
||||
| can override this behaviour and enable or disable runnable solutions
|
||||
| regardless of the application's environment.
|
||||
|
|
||||
| Default: env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS')
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Path Mapping
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using a remote dev server, like Laravel Homestead, Docker, or
|
||||
| even a remote VPS, it will be necessary to specify your path mapping.
|
||||
|
|
||||
| Leaving one, or both of these, empty or null will not trigger the remote
|
||||
| URL changes and Ignition will treat your editor links as local files.
|
||||
|
|
||||
| "remote_sites_path" is an absolute base path for your sites or projects
|
||||
| in Homestead, Vagrant, Docker, or another remote development server.
|
||||
|
|
||||
| Example value: "/home/vagrant/Code"
|
||||
|
|
||||
| "local_sites_path" is an absolute base path for your sites or projects
|
||||
| on your local computer where your IDE or code editor is running on.
|
||||
|
|
||||
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
|
||||
|
|
||||
*/
|
||||
|
||||
'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', base_path()),
|
||||
'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Housekeeping Endpoint Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition registers a couple of routes when it is enabled. Below you may
|
||||
| specify a route prefix that will be used to host all internal links.
|
||||
|
|
||||
*/
|
||||
|
||||
'housekeeping_endpoint_prefix' => '_ignition',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Settings File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition allows you to save your settings to a specific global file.
|
||||
|
|
||||
| If no path is specified, a file with settings will be saved to the user's
|
||||
| home directory. The directory depends on the OS and its settings but it's
|
||||
| typically `~/.ignition.json`. In this case, the settings will be applied
|
||||
| to all of your projects where Ignition is used and the path is not
|
||||
| specified.
|
||||
|
|
||||
| However, if you want to store your settings on a project basis, or you
|
||||
| want to keep them in another directory, you can specify a path where
|
||||
| the settings file will be saved. The path should be an existing directory
|
||||
| with correct write access.
|
||||
| For example, create a new `ignition` folder in the storage directory and
|
||||
| use `storage_path('ignition')` as the `settings_file_path`.
|
||||
|
|
||||
| Default value: '' (empty string)
|
||||
*/
|
||||
|
||||
'settings_file_path' => '',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Recorders
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition registers a couple of recorders when it is enabled. Below you may
|
||||
| specify a recorders will be used to record specific events.
|
||||
|
|
||||
*/
|
||||
|
||||
'recorders' => [
|
||||
DumpRecorder::class,
|
||||
JobRecorder::class,
|
||||
LogRecorder::class,
|
||||
QueryRecorder::class,
|
||||
],
|
||||
|
||||
/*
|
||||
* When a key is set, we'll send your exceptions to Open AI to generate a solution
|
||||
*/
|
||||
'open_ai_key' => env('IGNITION_OPEN_AI_KEY'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Include arguments
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition show you stack traces of exceptions with the arguments that were
|
||||
| passed to each method. This feature can be disabled here.
|
||||
|
|
||||
*/
|
||||
|
||||
'with_stack_frame_arguments' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argument reducers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ignition show you stack traces of exceptions with the arguments that were
|
||||
| passed to each method. To make these variables more readable, you can
|
||||
| specify a list of classes here which summarize the variables.
|
||||
|
|
||||
*/
|
||||
'argument_reducers' => [
|
||||
\Spatie\Backtrace\Arguments\Reducers\BaseTypeArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\ArrayArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\StdClassArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\EnumArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\ClosureArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\DateTimeArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\DateTimeZoneArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\SymphonyRequestArgumentReducer::class,
|
||||
\Spatie\LaravelIgnition\ArgumentReducers\ModelArgumentReducer::class,
|
||||
\Spatie\LaravelIgnition\ArgumentReducers\CollectionArgumentReducer::class,
|
||||
\Spatie\Backtrace\Arguments\Reducers\StringableArgumentReducer::class,
|
||||
],
|
||||
];
|
20
config/image.php
Normal file
20
config/image.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Image Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Intervention Image supports "GD Library" and "Imagick" to process images
|
||||
| internally. You may choose one of them according to your PHP
|
||||
| configuration. By default PHP's "GD Library" implementation is used.
|
||||
|
|
||||
| Supported: "gd", "imagick"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'gd'
|
||||
|
||||
];
|
301
config/jwt.php
Normal file
301
config/jwt.php
Normal file
@ -0,0 +1,301 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of jwt-auth.
|
||||
*
|
||||
* (c) Sean Tymon <tymon148@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT Authentication Secret
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Don't forget to set this in your .env file, as it will be used to sign
|
||||
| your tokens. A helper command is provided for this:
|
||||
| `php artisan jwt:secret`
|
||||
|
|
||||
| Note: This will be used for Symmetric algorithms only (HMAC),
|
||||
| since RSA and ECDSA use a private/public key combo (See below).
|
||||
|
|
||||
*/
|
||||
|
||||
'secret' => env('JWT_SECRET'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT Authentication Keys
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The algorithm you are using, will determine whether your tokens are
|
||||
| signed with a random string (defined in `JWT_SECRET`) or using the
|
||||
| following public & private keys.
|
||||
|
|
||||
| Symmetric Algorithms:
|
||||
| HS256, HS384 & HS512 will use `JWT_SECRET`.
|
||||
|
|
||||
| Asymmetric Algorithms:
|
||||
| RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below.
|
||||
|
|
||||
*/
|
||||
|
||||
'keys' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Public Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| A path or resource to your public key.
|
||||
|
|
||||
| E.g. 'file://path/to/public/key'
|
||||
|
|
||||
*/
|
||||
|
||||
'public' => env('JWT_PUBLIC_KEY'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Private Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| A path or resource to your private key.
|
||||
|
|
||||
| E.g. 'file://path/to/private/key'
|
||||
|
|
||||
*/
|
||||
|
||||
'private' => env('JWT_PRIVATE_KEY'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Passphrase
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The passphrase for your private key. Can be null if none set.
|
||||
|
|
||||
*/
|
||||
|
||||
'passphrase' => env('JWT_PASSPHRASE'),
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT time to live
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the length of time (in minutes) that the token will be valid for.
|
||||
| Defaults to 1 hour.
|
||||
|
|
||||
| You can also set this to null, to yield a never expiring token.
|
||||
| Some people may want this behaviour for e.g. a mobile app.
|
||||
| This is not particularly recommended, so make sure you have appropriate
|
||||
| systems in place to revoke the token if necessary.
|
||||
| Notice: If you set this to null you should remove 'exp' element from 'required_claims' list.
|
||||
|
|
||||
*/
|
||||
|
||||
'ttl' => env('JWT_TTL', 60),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Refresh time to live
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the length of time (in minutes) that the token can be refreshed
|
||||
| within. I.E. The user can refresh their token within a 2 week window of
|
||||
| the original token being created until they must re-authenticate.
|
||||
| Defaults to 2 weeks.
|
||||
|
|
||||
| You can also set this to null, to yield an infinite refresh time.
|
||||
| Some may want this instead of never expiring tokens for e.g. a mobile app.
|
||||
| This is not particularly recommended, so make sure you have appropriate
|
||||
| systems in place to revoke the token if necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'refresh_ttl' => env('JWT_REFRESH_TTL', 20160),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT hashing algorithm
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the hashing algorithm that will be used to sign the token.
|
||||
|
|
||||
*/
|
||||
|
||||
'algo' => env('JWT_ALGO', Tymon\JWTAuth\Providers\JWT\Provider::ALGO_HS256),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Required Claims
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the required claims that must exist in any token.
|
||||
| A TokenInvalidException will be thrown if any of these claims are not
|
||||
| present in the payload.
|
||||
|
|
||||
*/
|
||||
|
||||
'required_claims' => [
|
||||
'iss',
|
||||
'iat',
|
||||
'exp',
|
||||
'nbf',
|
||||
'sub',
|
||||
'jti',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Persistent Claims
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the claim keys to be persisted when refreshing a token.
|
||||
| `sub` and `iat` will automatically be persisted, in
|
||||
| addition to the these claims.
|
||||
|
|
||||
| Note: If a claim does not exist then it will be ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
'persistent_claims' => [
|
||||
// 'foo',
|
||||
// 'bar',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Lock Subject
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This will determine whether a `prv` claim is automatically added to
|
||||
| the token. The purpose of this is to ensure that if you have multiple
|
||||
| authentication models e.g. `App\User` & `App\OtherPerson`, then we
|
||||
| should prevent one authentication request from impersonating another,
|
||||
| if 2 tokens happen to have the same id across the 2 different models.
|
||||
|
|
||||
| Under specific circumstances, you may want to disable this behaviour
|
||||
| e.g. if you only have one authentication model, then you would save
|
||||
| a little on token size.
|
||||
|
|
||||
*/
|
||||
|
||||
'lock_subject' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Leeway
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This property gives the jwt timestamp claims some "leeway".
|
||||
| Meaning that if you have any unavoidable slight clock skew on
|
||||
| any of your servers then this will afford you some level of cushioning.
|
||||
|
|
||||
| This applies to the claims `iat`, `nbf` and `exp`.
|
||||
|
|
||||
| Specify in seconds - only if you know you need it.
|
||||
|
|
||||
*/
|
||||
|
||||
'leeway' => env('JWT_LEEWAY', 0),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Blacklist Enabled
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| In order to invalidate tokens, you must have the blacklist enabled.
|
||||
| If you do not want or need this functionality, then set this to false.
|
||||
|
|
||||
*/
|
||||
|
||||
'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------------
|
||||
| Blacklist Grace Period
|
||||
| -------------------------------------------------------------------------
|
||||
|
|
||||
| When multiple concurrent requests are made with the same JWT,
|
||||
| it is possible that some of them fail, due to token regeneration
|
||||
| on every request.
|
||||
|
|
||||
| Set grace period in seconds to prevent parallel request failure.
|
||||
|
|
||||
*/
|
||||
|
||||
'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cookies encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default Laravel encrypt cookies for security reason.
|
||||
| If you decide to not decrypt cookies, you will have to configure Laravel
|
||||
| to not encrypt your cookie token by adding its name into the $except
|
||||
| array available in the middleware "EncryptCookies" provided by Laravel.
|
||||
| see https://laravel.com/docs/master/responses#cookies-and-encryption
|
||||
| for details.
|
||||
|
|
||||
| Set it to true if you want to decrypt cookies.
|
||||
|
|
||||
*/
|
||||
|
||||
'decrypt_cookies' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the various providers used throughout the package.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to create and decode the tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to authenticate users.
|
||||
|
|
||||
*/
|
||||
|
||||
'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to store tokens in the blacklist.
|
||||
|
|
||||
*/
|
||||
|
||||
'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
|
||||
|
||||
],
|
||||
|
||||
];
|
16
config/laravolt/indonesia.php
Normal file
16
config/laravolt/indonesia.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'table_prefix' => 'indonesia_',
|
||||
'route' => [
|
||||
'enabled' => false,
|
||||
'middleware' => ['web', 'auth'],
|
||||
'prefix' => 'indonesia',
|
||||
],
|
||||
'view' => [
|
||||
'layout' => 'ui::layouts.app',
|
||||
],
|
||||
'menu' => [
|
||||
'enabled' => false,
|
||||
],
|
||||
];
|
50
config/tinker.php
Normal file
50
config/tinker.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to add additional Artisan commands that should
|
||||
| be available within the Tinker environment. Once the command is in
|
||||
| this array you may execute the command in Tinker using its name.
|
||||
|
|
||||
*/
|
||||
|
||||
'commands' => [
|
||||
// App\Console\Commands\ExampleCommand::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto Aliased Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Tinker will not automatically alias classes in your vendor namespaces
|
||||
| but you may explicitly allow a subset of classes to get aliased by
|
||||
| adding the names of each of those classes to the following list.
|
||||
|
|
||||
*/
|
||||
|
||||
'alias' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Classes That Should Not Be Aliased
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Typically, Tinker automatically aliases classes as you require them in
|
||||
| Tinker. However, you may wish to never alias certain classes, which
|
||||
| you may accomplish by listing the classes in the following array.
|
||||
|
|
||||
*/
|
||||
|
||||
'dont_alias' => [
|
||||
'App\Nova',
|
||||
],
|
||||
|
||||
];
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Refund>
|
||||
*/
|
||||
class RefundFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Setting>
|
||||
*/
|
||||
class SettingFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\transaction>
|
||||
*/
|
||||
class TransactionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -18,11 +18,22 @@ class UserFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'id' => Str::uuid(),
|
||||
'nama_depan' => $this->faker->firstName,
|
||||
'nama_belakang' => $this->faker->lastName,
|
||||
'tanggal_lahir' => $this->faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
'remember_token' => Str::random(10),
|
||||
'role' => 'User',
|
||||
'nik' => $this->faker->nik($this->faker->randomElement(['male', 'female']),$this->faker->dateTimeBetween('-65 years', '-18 years')),
|
||||
'alamat'=> $this->faker->address,
|
||||
'nohp'=> $this->faker->phoneNumber(),
|
||||
'persentase_kemiripan' => random_int(0, 100).'%',
|
||||
'status'=> $this->faker->randomElement(['Progress', 'Finished', 'Rejected']),
|
||||
'gender' => $this->faker->randomElement(['Laki-laki', 'Perempuan']),
|
||||
'kode_kelurahan' => '1101012002',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Users>
|
||||
*/
|
||||
class UsersFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -12,13 +12,28 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->uuid('id')->primary;
|
||||
$table->string('nama_depan',255);
|
||||
$table->string('nama_belakang',255);
|
||||
$table->date('tanggal_lahir');
|
||||
$table->string('email',50)->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->enum('role',['Admin','User'])->default('User');
|
||||
$table->string('nohp',20);
|
||||
$table->string('nik',20);
|
||||
$table->string('alamat',255);
|
||||
$table->string('foto_ktp')->nullable();
|
||||
$table->string('foto_wajah')->nullable();
|
||||
$table->string('foto_profil')->nullable();
|
||||
$table->string('persentase_kemiripan')->nullable();
|
||||
$table->enum('status',['Finished','Progress','Rejected'])->default('Progress');
|
||||
$table->string('gender',15);
|
||||
$table->char('kode_kelurahan',10);
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
|
||||
// $table->foreign('kode_kelurahan')->on('villages')->references('code');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateProvincesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create(config('laravolt.indonesia.table_prefix').'provinces', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->char('code', 2)->unique();
|
||||
$table->string('name', 255);
|
||||
$table->text('meta')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop(config('laravolt.indonesia.table_prefix').'provinces');
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCitiesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create(config('laravolt.indonesia.table_prefix').'cities', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->char('code', 4)->unique();
|
||||
$table->char('province_code', 2);
|
||||
$table->string('name', 255);
|
||||
$table->text('meta')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('province_code')
|
||||
->references('code')
|
||||
->on(config('laravolt.indonesia.table_prefix').'provinces')
|
||||
->onUpdate('cascade')->onDelete('restrict');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop(config('laravolt.indonesia.table_prefix').'cities');
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateDistrictsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create(config('laravolt.indonesia.table_prefix').'districts', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->char('code', 7)->unique();
|
||||
$table->char('city_code', 4);
|
||||
$table->string('name', 255);
|
||||
$table->text('meta')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('city_code')
|
||||
->references('code')
|
||||
->on(config('laravolt.indonesia.table_prefix').'cities')
|
||||
->onUpdate('cascade')->onDelete('restrict');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop(config('laravolt.indonesia.table_prefix').'districts');
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateVillagesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create(config('laravolt.indonesia.table_prefix').'villages', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->char('code', 10)->unique();
|
||||
$table->char('district_code', 7);
|
||||
$table->string('name', 255);
|
||||
$table->text('meta')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('district_code')
|
||||
->references('code')
|
||||
->on(config('laravolt.indonesia.table_prefix').'districts')
|
||||
->onUpdate('cascade')->onDelete('restrict');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop(config('laravolt.indonesia.table_prefix').'villages');
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('transactions', function (Blueprint $table) {
|
||||
$table->uuid('order_id')->primary(); //order_id
|
||||
$table->string('pembeli'); // untuk customer_details
|
||||
$table->string('penjual'); //merchant_name
|
||||
$table->string('judul_transaksi'); // item_details -> item_name
|
||||
$table->string('deskripsi_transaksi');
|
||||
$table->double('persentase_keuntungan'); // persentase keuntungan
|
||||
$table->double('total_keuntungan'); // perolehan keuntungan
|
||||
$table->double('harga'); // harga sebelum penambahan
|
||||
$table->double('biaya_admin'); // biaya tambahan
|
||||
$table->double('total_harga'); // gross amount
|
||||
$table->string('signature_key');
|
||||
$table->string('metode_pembayaran');
|
||||
$table->enum('status',['Settlement','Capture','Pending','Cancel','Refund','Expire','Failure','Progress','Failed'])->default('Pending'); // transaction_status
|
||||
$table->timestamp('batas_pembayaran');
|
||||
$table->timestamp('batas_pengiriman_barang');
|
||||
$table->timestamps();
|
||||
$table->foreign('pembeli')->on('users')->references('email');
|
||||
$table->foreign('penjual')->on('users')->references('email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('transactions');
|
||||
}
|
||||
};
|
@ -13,12 +13,12 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('refunds', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('orderId');
|
||||
$table->string('customerName');
|
||||
$table->string('sellerName');
|
||||
$table->string('total');
|
||||
$table->timestamp('dueDate');
|
||||
$table->string('status');
|
||||
$table->foreignUuid('order_id');
|
||||
$table->double('total',10);
|
||||
$table->timestamp('due_date');
|
||||
$table->enum('status',['Partial Refund','Deny','Pending'])->default('Pending');
|
||||
|
||||
$table->foreign('order_id')->on('transactions')->references('order_id');
|
||||
});
|
||||
}
|
||||
|
||||
@ -29,4 +29,4 @@ return new class extends Migration
|
||||
{
|
||||
Schema::dropIfExists('refunds');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -13,6 +13,10 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('bulan',20);
|
||||
$table->string('tahun',5);
|
||||
$table->string('persentase',5);
|
||||
$table->string('status',15);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
@ -11,8 +11,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
Schema::create('contacts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('pemilik_kontak');
|
||||
$table->string('relasi_kontak');
|
||||
$table->foreign('pemilik_kontak')->on('users')->references('email');
|
||||
$table->foreign('relasi_kontak')->on('users')->references('email');
|
||||
$table->unique(['pemilik_kontak','relasi_kontak']);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@ -22,6 +27,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('contacts');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('transaction_descriptions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignUuid('order_id');
|
||||
$table->string('status',15);
|
||||
$table->string('user');
|
||||
$table->string('judul');
|
||||
$table->string('deskripsi');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('order_id')->on('transactions')->references('order_id');
|
||||
$table->foreign('user')->on('users')->references('email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('transaction_descriptions');
|
||||
}
|
||||
};
|
@ -11,9 +11,14 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('transactions', function (Blueprint $table) {
|
||||
Schema::create('refund_descriptions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('refund_id');
|
||||
$table->string('filename');
|
||||
$table->string('type');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('refund_id')->on('refunds')->references('id');
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,6 +27,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('transactions');
|
||||
Schema::dropIfExists('refund_descriptions');
|
||||
}
|
||||
};
|
@ -4,6 +4,14 @@ namespace Database\Seeders;
|
||||
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Str;
|
||||
use Faker\Factory as FakerFactory;
|
||||
use Faker\Provider\id_ID\Person as Person;
|
||||
use Laravolt\Indonesia\Seeds\CitiesSeeder;
|
||||
use Laravolt\Indonesia\Seeds\VillagesSeeder;
|
||||
use Laravolt\Indonesia\Seeds\DistrictsSeeder;
|
||||
use Laravolt\Indonesia\Seeds\ProvincesSeeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
@ -12,11 +20,35 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// \App\Models\User::factory(10)->create();
|
||||
$faker = FakerFactory::create();
|
||||
$faker->addProvider(new Person($faker));
|
||||
|
||||
User::factory()->create([
|
||||
'id' => Str::uuid(),
|
||||
'nama_depan' => $faker->firstName,
|
||||
'nama_belakang' => $faker->lastName,
|
||||
'tanggal_lahir' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
'remember_token' => Str::random(10),
|
||||
'role' => 'Admin',
|
||||
'nik' => $faker->nik($faker->randomElement(['male','female']), $faker->dateTimeBetween('-65 years', '-18 years')),
|
||||
'alamat'=> $faker->address,
|
||||
'nohp'=> $faker->phoneNumber(),
|
||||
'status'=> 'Finished',
|
||||
'persentase_kemiripan' => '100%',
|
||||
'gender' => $faker->randomElement(['Laki-laki', 'Perempuan']),
|
||||
'kode_kelurahan' => '1101012002',
|
||||
]);
|
||||
User::factory(20)->create();
|
||||
|
||||
$this->call([
|
||||
ProvincesSeeder::class,
|
||||
CitiesSeeder::class,
|
||||
DistrictsSeeder::class,
|
||||
VillagesSeeder::class,
|
||||
]);
|
||||
|
||||
// \App\Models\User::factory()->create([
|
||||
// 'name' => 'Test User',
|
||||
// 'email' => 'test@example.com',
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class RefundSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class TransactionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UsersSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
59
docker/8.0/Dockerfile
Normal file
59
docker/8.0/Dockerfile
Normal file
@ -0,0 +1,59 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL maintainer="Taylor Otwell"
|
||||
|
||||
ARG WWWGROUP
|
||||
ARG NODE_VERSION=16
|
||||
ARG POSTGRES_VERSION=13
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch \
|
||||
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y php8.0-cli php8.0-dev \
|
||||
php8.0-pgsql php8.0-sqlite3 php8.0-gd php8.0-imagick \
|
||||
php8.0-curl php8.0-memcached \
|
||||
php8.0-imap php8.0-mysql php8.0-mbstring \
|
||||
php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap \
|
||||
php8.0-intl php8.0-readline php8.0-pcov \
|
||||
php8.0-msgpack php8.0-igbinary php8.0-ldap \
|
||||
php8.0-redis php8.0-swoole php8.0-xdebug \
|
||||
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
|
||||
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm \
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y yarn \
|
||||
&& apt-get install -y mysql-client \
|
||||
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN update-alternatives --set php /usr/bin/php8.0
|
||||
|
||||
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.0
|
||||
|
||||
RUN groupadd --force -g $WWWGROUP sail
|
||||
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY php.ini /etc/php/8.0/cli/conf.d/99-sail.ini
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["start-container"]
|
7
docker/8.0/php.ini
Normal file
7
docker/8.0/php.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[PHP]
|
||||
post_max_size = 100M
|
||||
upload_max_filesize = 100M
|
||||
variables_order = EGPCS
|
||||
|
||||
[opcache]
|
||||
opcache.enable_cli=1
|
17
docker/8.0/start-container
Normal file
17
docker/8.0/start-container
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z "$WWWUSER" ]; then
|
||||
usermod -u $WWWUSER sail
|
||||
fi
|
||||
|
||||
if [ ! -d /.composer ]; then
|
||||
mkdir /.composer
|
||||
fi
|
||||
|
||||
chmod -R ugo+rw /.composer
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
exec gosu $WWWUSER "$@"
|
||||
else
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
fi
|
14
docker/8.0/supervisord.conf
Normal file
14
docker/8.0/supervisord.conf
Normal file
@ -0,0 +1,14 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:php]
|
||||
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
|
||||
user=sail
|
||||
environment=LARAVEL_SAIL="1"
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
58
docker/8.1/Dockerfile
Normal file
58
docker/8.1/Dockerfile
Normal file
@ -0,0 +1,58 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
LABEL maintainer="Taylor Otwell"
|
||||
|
||||
ARG WWWGROUP
|
||||
ARG NODE_VERSION=18
|
||||
ARG POSTGRES_VERSION=15
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch \
|
||||
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y php8.1-cli php8.1-dev \
|
||||
php8.1-pgsql php8.1-sqlite3 php8.1-gd php8.1-imagick \
|
||||
php8.1-curl \
|
||||
php8.1-imap php8.1-mysql php8.1-mbstring \
|
||||
php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap \
|
||||
php8.1-intl php8.1-readline \
|
||||
php8.1-ldap \
|
||||
php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole \
|
||||
php8.1-memcached php8.1-pcov php8.1-xdebug \
|
||||
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
|
||||
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm \
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y yarn \
|
||||
&& apt-get install -y mysql-client \
|
||||
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.1
|
||||
|
||||
RUN groupadd --force -g $WWWGROUP sail
|
||||
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["start-container"]
|
7
docker/8.1/php.ini
Normal file
7
docker/8.1/php.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[PHP]
|
||||
post_max_size = 100M
|
||||
upload_max_filesize = 100M
|
||||
variables_order = EGPCS
|
||||
|
||||
[opcache]
|
||||
opcache.enable_cli=1
|
17
docker/8.1/start-container
Normal file
17
docker/8.1/start-container
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z "$WWWUSER" ]; then
|
||||
usermod -u $WWWUSER sail
|
||||
fi
|
||||
|
||||
if [ ! -d /.composer ]; then
|
||||
mkdir /.composer
|
||||
fi
|
||||
|
||||
chmod -R ugo+rw /.composer
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
exec gosu $WWWUSER "$@"
|
||||
else
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
fi
|
14
docker/8.1/supervisord.conf
Normal file
14
docker/8.1/supervisord.conf
Normal file
@ -0,0 +1,14 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:php]
|
||||
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
|
||||
user=sail
|
||||
environment=LARAVEL_SAIL="1"
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
59
docker/8.2/Dockerfile
Normal file
59
docker/8.2/Dockerfile
Normal file
@ -0,0 +1,59 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
LABEL maintainer="Taylor Otwell"
|
||||
|
||||
ARG WWWGROUP
|
||||
ARG NODE_VERSION=18
|
||||
ARG POSTGRES_VERSION=15
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch \
|
||||
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y php8.2-cli php8.2-dev \
|
||||
php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
|
||||
php8.2-curl \
|
||||
php8.2-imap php8.2-mysql php8.2-mbstring \
|
||||
php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \
|
||||
php8.2-intl php8.2-readline \
|
||||
php8.2-ldap \
|
||||
php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole \
|
||||
php8.2-memcached php8.2-pcov php8.2-xdebug \
|
||||
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
|
||||
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm \
|
||||
&& npm install -g pnpm \
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y yarn \
|
||||
&& apt-get install -y mysql-client \
|
||||
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2
|
||||
|
||||
RUN groupadd --force -g $WWWGROUP sail
|
||||
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["start-container"]
|
7
docker/8.2/php.ini
Normal file
7
docker/8.2/php.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[PHP]
|
||||
post_max_size = 100M
|
||||
upload_max_filesize = 100M
|
||||
variables_order = EGPCS
|
||||
|
||||
[opcache]
|
||||
opcache.enable_cli=1
|
17
docker/8.2/start-container
Normal file
17
docker/8.2/start-container
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z "$WWWUSER" ]; then
|
||||
usermod -u $WWWUSER sail
|
||||
fi
|
||||
|
||||
if [ ! -d /.composer ]; then
|
||||
mkdir /.composer
|
||||
fi
|
||||
|
||||
chmod -R ugo+rw /.composer
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
exec gosu $WWWUSER "$@"
|
||||
else
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
fi
|
14
docker/8.2/supervisord.conf
Normal file
14
docker/8.2/supervisord.conf
Normal file
@ -0,0 +1,14 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:php]
|
||||
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
|
||||
user=sail
|
||||
environment=LARAVEL_SAIL="1"
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
6
docker/mysql/create-testing-database.sh
Normal file
6
docker/mysql/create-testing-database.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mysql --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
|
||||
CREATE DATABASE IF NOT EXISTS testing;
|
||||
GRANT ALL PRIVILEGES ON \`testing%\`.* TO '$MYSQL_USER'@'%';
|
||||
EOSQL
|
2
docker/pgsql/create-testing-database.sql
Normal file
2
docker/pgsql/create-testing-database.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT 'CREATE DATABASE testing'
|
||||
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'testing')\gexec
|
File diff suppressed because it is too large
Load Diff
940
public/assets/css/login_register/style.css
Normal file
940
public/assets/css/login_register/style.css
Normal file
@ -0,0 +1,940 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap");
|
||||
|
||||
:root {
|
||||
--primary: #900c3e;
|
||||
--secondary: #bfc0c0;
|
||||
--white: #fff;
|
||||
--text-clr: #5b6475;
|
||||
--header-clr: #25273d;
|
||||
--next-btn-hover: #900c3e;
|
||||
--back-btn-hover: #8b8c8c;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body,
|
||||
input {
|
||||
font-family: "Poppins", sans-serif;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
border: none;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
video {
|
||||
background: primary;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.forms-container {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.signin-signup {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
left: 75%;
|
||||
width: 50%;
|
||||
transition: 1s 0.7s ease-in-out;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
form.sign-up-form {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
padding: 0rem 2rem 0 5rem;
|
||||
transition: all 0.2s 0.7s;
|
||||
overflow: hidden;
|
||||
grid-column: 1 / 2;
|
||||
grid-row: 1 / 2;
|
||||
opacity: 0;
|
||||
width: 110%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
form.sign-in-form {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
padding: 0 3rem;
|
||||
transition: all 0.2s 0.7s;
|
||||
overflow: hidden;
|
||||
grid-column: 1 / 2;
|
||||
grid-row: 1 / 2;
|
||||
width: 100%;
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
form p {
|
||||
font-size: 0.9rem;
|
||||
width: 110%;
|
||||
margin-bottom: 2%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 2.2rem;
|
||||
color: #444;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.input-field-signin-flex,
|
||||
.input-field-signup-flex {
|
||||
width: 100%;
|
||||
height: 55px;
|
||||
background-color: #f0f0f0;
|
||||
margin-top: 10px;
|
||||
border-radius: 1rem;
|
||||
display: grid;
|
||||
grid-template-columns: 15% 85%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-field-signin-flex input,
|
||||
.input-field-signup-flex input {
|
||||
width: 82%;
|
||||
height: 100%;
|
||||
background: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
line-height: 1;
|
||||
font-weight: 600;
|
||||
margin-right: 1rem;
|
||||
font-size: 0.8rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input-field-signin-flex i,
|
||||
.input-field-signup-flex i {
|
||||
padding: 0 1.5rem;
|
||||
color: #acacac;
|
||||
transition: 0.5s;
|
||||
}
|
||||
|
||||
.input-field {
|
||||
width: 100%;
|
||||
height: 55px;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 1rem;
|
||||
display: grid;
|
||||
grid-template-columns: 15% 85%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.input-field i,
|
||||
.input-field box-icon {
|
||||
padding: 0 1.5rem;
|
||||
color: #acacac;
|
||||
transition: 0.5s;
|
||||
}
|
||||
|
||||
.input-field input {
|
||||
width: 110%;
|
||||
height: 100%;
|
||||
background: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
line-height: 1;
|
||||
font-weight: 600;
|
||||
margin-right: 1rem;
|
||||
font-size: 0.8rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input-field input::placeholder {
|
||||
color: #aaa;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.error {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.validate {
|
||||
width: 120%;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0.1rem;
|
||||
color: red;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.validate-text {
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
background-color: #900c3e;
|
||||
border: none;
|
||||
outline: none;
|
||||
height: 49px;
|
||||
border-radius: 1rem;
|
||||
color: #fff;
|
||||
text-transform: uppercase;
|
||||
font-weight: 600;
|
||||
margin: 10px 0;
|
||||
cursor: pointer;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
-webkit-transform: translateY(-0.22em);
|
||||
transform: translateY(-0.252m);
|
||||
}
|
||||
|
||||
.btn-otp,
|
||||
.btn-foto {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
margin-left: 2%;
|
||||
font-size: 0.7rem;
|
||||
padding: 0.85rem 0.9rem;
|
||||
border: 1px solid #900c3e;
|
||||
color: #900c3e;
|
||||
background: none;
|
||||
outline: none;
|
||||
border-radius: 0.7rem;
|
||||
text-transform: uppercase;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.btn-otp:hover {
|
||||
-webkit-transform: translateY(-0.22em);
|
||||
transform: translateY(-0.252m);
|
||||
}
|
||||
|
||||
.panels-container {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.container:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
height: 2000px;
|
||||
width: 2000px;
|
||||
top: -10%;
|
||||
right: 48%;
|
||||
transform: translateY(-50%);
|
||||
background-image: linear-gradient(-45deg, #900c3e 0%, #900c3e 100%);
|
||||
transition: 1.8s ease-in-out;
|
||||
border-radius: 50%;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 100%;
|
||||
transition: transform 1.1s ease-in-out;
|
||||
transition-delay: 0.4s;
|
||||
}
|
||||
|
||||
.panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: space-around;
|
||||
text-align: center;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
pointer-events: all;
|
||||
padding: 3rem 17% 2rem 12%;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
pointer-events: none;
|
||||
padding: 3rem 12% 2rem 17%;
|
||||
}
|
||||
|
||||
.panel .content {
|
||||
color: #fff;
|
||||
transition: transform 0.9s ease-in-out;
|
||||
transition-delay: 0.6s;
|
||||
}
|
||||
|
||||
.content a {
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.panel h3 {
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.panel p {
|
||||
font-size: 1rem;
|
||||
padding: 0.7rem 0;
|
||||
}
|
||||
|
||||
.btn.transparent {
|
||||
margin: 0;
|
||||
background: none;
|
||||
border: 2px solid #fff;
|
||||
width: 130px;
|
||||
height: 41px;
|
||||
font-weight: 600;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.right-panel .image,
|
||||
.right-panel .content {
|
||||
transform: translateX(800px);
|
||||
}
|
||||
|
||||
/* ANIMATION */
|
||||
|
||||
.container.sign-up-mode:before {
|
||||
transform: translate(100%, -50%);
|
||||
right: 52%;
|
||||
}
|
||||
|
||||
.container.sign-up-mode .left-panel .image,
|
||||
.container.sign-up-mode .left-panel .content {
|
||||
transform: translateX(-800px);
|
||||
}
|
||||
|
||||
.container.sign-up-mode .signin-signup {
|
||||
left: 25%;
|
||||
}
|
||||
|
||||
.container.sign-up-mode form.sign-up-form {
|
||||
opacity: 1;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.container.sign-up-mode form.sign-in-form {
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.container.sign-up-mode .right-panel .image,
|
||||
.container.sign-up-mode .right-panel .content {
|
||||
transform: translateX(0%);
|
||||
}
|
||||
|
||||
.container.sign-up-mode .left-panel {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.container.sign-up-mode .right-panel {
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.container {
|
||||
min-height: 1000px;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
form.sign-in-form {
|
||||
justify-content: start;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.header ul li div {
|
||||
padding: 0 1.2rem;
|
||||
}
|
||||
|
||||
.signin-signup {
|
||||
width: 100%;
|
||||
top: 95%;
|
||||
transform: translate(-50%, -100%);
|
||||
transition: 1s 0.8s ease-in-out;
|
||||
}
|
||||
|
||||
.signin-signup,
|
||||
.container.sign-up-mode .signin-signup {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.panels-container {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: 1fr 2fr 1fr;
|
||||
}
|
||||
|
||||
.panel {
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
grid-column: 1 / 2;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
grid-row: 3 / 4;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
grid-row: 1 / 2;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 200px;
|
||||
transition: transform 0.9s ease-in-out;
|
||||
transition-delay: 0.6s;
|
||||
}
|
||||
|
||||
.panel .content {
|
||||
padding-right: 15%;
|
||||
transition: transform 0.9s ease-in-out;
|
||||
transition-delay: 0.8s;
|
||||
}
|
||||
|
||||
.panel h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.panel p {
|
||||
font-size: 0.7rem;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.btn.transparent {
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.container:before {
|
||||
width: 1500px;
|
||||
height: 1500px;
|
||||
transform: translateX(-50%);
|
||||
left: 30%;
|
||||
bottom: 68%;
|
||||
right: initial;
|
||||
top: initial;
|
||||
transition: 2s ease-in-out;
|
||||
}
|
||||
|
||||
.container.sign-up-mode:before {
|
||||
transform: translate(-50%, 100%);
|
||||
bottom: 26%;
|
||||
right: initial;
|
||||
}
|
||||
|
||||
.container.sign-up-mode .left-panel .image,
|
||||
.container.sign-up-mode .left-panel .content {
|
||||
transform: translateY(-300px);
|
||||
}
|
||||
|
||||
.container.sign-up-mode .right-panel .image,
|
||||
.container.sign-up-mode .right-panel .content {
|
||||
transform: translateY(0px);
|
||||
}
|
||||
|
||||
.right-panel .image,
|
||||
.right-panel .content {
|
||||
transform: translateY(300px);
|
||||
}
|
||||
|
||||
.container.sign-up-mode .signin-signup {
|
||||
top: 5%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.form_4 div {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns.form_4_btns {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.image {
|
||||
display: none;
|
||||
}
|
||||
.panel .content {
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
.container {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.container:before {
|
||||
bottom: 72%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.container.sign-up-mode:before {
|
||||
bottom: 28%;
|
||||
left: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* // MULTIPLE PROGGRESS BAR */
|
||||
.wrapper {
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
background: var(--white);
|
||||
margin: 0 auto 0;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.header ul {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.header ul li {
|
||||
margin-right: 50px;
|
||||
position: relative;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.header ul li:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.header ul li:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
left: 55px;
|
||||
width: 130%;
|
||||
height: 4px;
|
||||
background: var(--secondary);
|
||||
}
|
||||
|
||||
.header ul li:last-child:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header ul li div {
|
||||
padding: 1.2rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.header ul li p {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: var(--secondary);
|
||||
color: var(--white);
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.header ul li.active:before {
|
||||
background: var(--primary);
|
||||
}
|
||||
|
||||
.header ul li.active p {
|
||||
background: var(--primary);
|
||||
}
|
||||
|
||||
.form_wrap h2 {
|
||||
color: var(--header-clr);
|
||||
text-align: start;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form_wrap .input_wrap {
|
||||
width: 350px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto 20px;
|
||||
}
|
||||
|
||||
.form_wrap .input_wrap:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.form_wrap .input_wrap label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.form_wrap .input_wrap .input {
|
||||
border: 2px solid var(--secondary);
|
||||
border-radius: 3px;
|
||||
padding: 10px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
transition: 0.5s ease;
|
||||
}
|
||||
|
||||
.form_wrap .input_wrap .input:focus {
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
.btns_wrap {
|
||||
width: 100%;
|
||||
margin: 4% auto;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns.form_1_btns {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns.form_2_btns {
|
||||
width: 190%;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns.form_3_btns {
|
||||
width: 60%;
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button {
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: 12px 15px;
|
||||
background: var(--primary);
|
||||
color: var(--white);
|
||||
width: 135px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 0.8rem;
|
||||
border-radius: 1rem;
|
||||
transition: 0.5s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_back {
|
||||
background: var(--secondary);
|
||||
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_next {
|
||||
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_done {
|
||||
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_next .icon {
|
||||
display: flex;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_back .icon {
|
||||
display: flex;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_next:hover,
|
||||
.btns_wrap .common_btns button.btn_done:hover {
|
||||
background: var(--next-btn-hover);
|
||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px,
|
||||
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
|
||||
-webkit-transform: translateY(-0.22em);
|
||||
transform: translateY(-0.252m);
|
||||
}
|
||||
|
||||
.btns_wrap .common_btns button.btn_back:hover {
|
||||
background: var(--back-btn-hover);
|
||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px,
|
||||
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
|
||||
-webkit-transform: translateY(-0.22em);
|
||||
transform: translateY(-0.252m);
|
||||
}
|
||||
|
||||
.modal_wrapper {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
visibility: hidden;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.modal_wrapper .shadow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
opacity: 0;
|
||||
transition: 0.2s ease;
|
||||
}
|
||||
|
||||
.modal_wrapper .success_wrap {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -800px);
|
||||
background: var(--white);
|
||||
padding: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
transition: 0.5s ease;
|
||||
}
|
||||
|
||||
.modal_wrapper .success_wrap .modal_icon {
|
||||
margin-right: 20px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: var(--primary);
|
||||
color: var(--white);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.modal_wrapper.active {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.modal_wrapper.active .shadow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.modal_wrapper.active .success_wrap {
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
/******************************************
|
||||
/* END DROPDOWN INPUT
|
||||
==================================================*/
|
||||
.select2-container .select2-selection--single {
|
||||
border: none;
|
||||
background: none;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single:focus {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single .select2-selection__arrow {
|
||||
border: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--open .select2-selection--single {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.select2-results {
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.select2-results__option {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.select2-container--default
|
||||
.select2-results
|
||||
> .select2-results__options
|
||||
.select2-results__option--highlighted {
|
||||
background-color: #900c3e !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.gender-select-menu,
|
||||
.select-menu {
|
||||
height: 100%;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.gender-select-menu .gender-select-input,
|
||||
.select-menu .select-btn {
|
||||
width: 100%;
|
||||
height: 55px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 1rem;
|
||||
grid-template-columns: 15% 85%;
|
||||
display: flex;
|
||||
padding: 0 1.2rem;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
.select-btn i {
|
||||
font-size: 25px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.gender-select,
|
||||
.sBtn-text {
|
||||
font-size: 0.8rem;
|
||||
color: #aaa;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.gender-select-menu.active .select-btn i,
|
||||
.select-menu.active .select-btn i {
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
.gender-select-menu .gender-options,
|
||||
.select-menu .options {
|
||||
width: 100%;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
padding: 0.5rem 0;
|
||||
margin-top: 10px;
|
||||
border-radius: 1rem;
|
||||
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
|
||||
display: none;
|
||||
background: white;
|
||||
z-index: 7;
|
||||
}
|
||||
|
||||
.gender-select-menu.active .gender-options,
|
||||
.select-menu.active .options {
|
||||
display: block;
|
||||
}
|
||||
.options .gender-option,
|
||||
.options .option {
|
||||
display: flex;
|
||||
height: 55px;
|
||||
cursor: pointer;
|
||||
padding: 0 1.4rem;
|
||||
border-radius: 8px;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
}
|
||||
.options .gender-option:hover,
|
||||
.options .option:hover {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.option .gender-option-text,
|
||||
.option .option-text {
|
||||
font-size: 0.8rem;
|
||||
color: #333;
|
||||
}
|
||||
/******************************************
|
||||
/* END DROPDOWN INPUT
|
||||
==================================================*/
|
||||
|
||||
/******************************************
|
||||
/* SLIDER
|
||||
==================================================*/
|
||||
.slider-container {
|
||||
position: relative;
|
||||
max-width: 60%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.slider {
|
||||
display: flex;
|
||||
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.slide {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
|
||||
.slider h3 {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.slide img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.dot {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin: 0 5px;
|
||||
background-color: #bbb;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.prev,
|
||||
.next {
|
||||
font-size: 1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.dot.active {
|
||||
background-color: #900c3e;
|
||||
}
|
||||
|
||||
#webcamKtp,
|
||||
#webcamEkyc {
|
||||
height: 30vh;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
/******************************************
|
||||
/* END SLIDER
|
||||
==================================================*/
|
54
public/assets/css/main.css
Normal file
54
public/assets/css/main.css
Normal file
@ -0,0 +1,54 @@
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Profie Page
|
||||
--------------------------------------------------------------*/
|
||||
.profile .profile-card img {
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
.profile .profile-card h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #2c384e;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.profile .profile-card h3 {
|
||||
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;
|
||||
}
|
||||
|
||||
.profile .profile-card .social-links a:hover {
|
||||
color: #012970;
|
||||
}
|
||||
|
||||
.profile .profile-overview .row {
|
||||
margin-bottom: 20px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.profile .profile-overview .card-title {
|
||||
color: #012970;
|
||||
}
|
||||
|
||||
.profile .profile-overview .label {
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
}
|
||||
|
||||
.profile .profile-edit label {
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
}
|
||||
|
||||
.profile .profile-edit img {
|
||||
max-width: 120px;
|
||||
}
|
BIN
public/assets/images/dashboard/Asset 3.png
Normal file
BIN
public/assets/images/dashboard/Asset 3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
public/assets/images/foto-ktp.jpg
Normal file
BIN
public/assets/images/foto-ktp.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
public/assets/img/avatar/ok.jpg
Normal file
BIN
public/assets/img/avatar/ok.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 183 KiB |
BIN
public/assets/img/avatar/rusak.jpeg
Normal file
BIN
public/assets/img/avatar/rusak.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 70 KiB |
585
public/assets/js/login_register/app.js
Normal file
585
public/assets/js/login_register/app.js
Normal file
@ -0,0 +1,585 @@
|
||||
/******************************************
|
||||
* ANIMATION BTN SIGN IN & SIGN UP
|
||||
******************************************/
|
||||
const sign_in_btn = document.querySelector("#sign-in-btn");
|
||||
const sign_up_btn = document.querySelector("#sign-up-btn");
|
||||
const container = document.querySelector(".container");
|
||||
|
||||
sign_up_btn.addEventListener("click", () => {
|
||||
container.classList.add("sign-up-mode");
|
||||
});
|
||||
|
||||
sign_in_btn.addEventListener("click", () => {
|
||||
container.classList.remove("sign-up-mode");
|
||||
});
|
||||
/******************************************
|
||||
* END ANIMATION BTN SIGN IN & SIGN UP
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* PRELOADER
|
||||
******************************************/
|
||||
setTimeout(function () {
|
||||
$("#preloader").fadeToggle();
|
||||
}, 200);
|
||||
/******************************************
|
||||
* END PRELOADER
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* MULTIPLE FORM
|
||||
******************************************/
|
||||
var form_1 = document.querySelector(".form_1");
|
||||
var form_2 = document.querySelector(".form_2");
|
||||
var form_3 = document.querySelector(".form_3");
|
||||
var form_4 = document.querySelector(".form_4");
|
||||
|
||||
var form_1_btns = document.querySelector(".form_1_btns");
|
||||
var form_2_btns = document.querySelector(".form_2_btns");
|
||||
var form_3_btns = document.querySelector(".form_3_btns");
|
||||
var form_4_btns = document.querySelector(".form_4_btns");
|
||||
|
||||
var form_1_next_btn = document.querySelector(".form_1_btns .btn_next");
|
||||
var form_2_back_btn = document.querySelector(".form_2_btns .btn_back");
|
||||
var form_2_next_btn = document.querySelector(".form_2_btns .btn_next");
|
||||
var form_3_back_btn = document.querySelector(".form_3_btns .btn_back");
|
||||
var form_3_next_btn = document.querySelector(".form_3_btns .btn_next");
|
||||
var form_4_back_btn = document.querySelector(".form_4_btns .btn_back");
|
||||
|
||||
var form_2_progessbar = document.querySelector(".form_2_progessbar");
|
||||
var form_3_progessbar = document.querySelector(".form_3_progessbar");
|
||||
var form_4_progessbar = document.querySelector(".form_4_progessbar");
|
||||
|
||||
var btn_done = document.querySelector(".btn_done");
|
||||
var modal_wrapper = document.querySelector(".modal_wrapper");
|
||||
var shadow = document.querySelector(".shadow");
|
||||
|
||||
form_1_next_btn.addEventListener("click", function () {
|
||||
form_1.style.display = "none";
|
||||
form_2.style.display = "block";
|
||||
|
||||
form_1_btns.style.display = "none";
|
||||
form_2_btns.style.display = "flex";
|
||||
|
||||
form_2_progessbar.classList.add("active");
|
||||
});
|
||||
|
||||
form_2_back_btn.addEventListener("click", function () {
|
||||
form_1.style.display = "block";
|
||||
form_2.style.display = "none";
|
||||
|
||||
form_1_btns.style.display = "flex";
|
||||
form_2_btns.style.display = "none";
|
||||
|
||||
form_2_progessbar.classList.remove("active");
|
||||
});
|
||||
|
||||
form_2_next_btn.addEventListener("click", function () {
|
||||
form_2.style.display = "none";
|
||||
form_3.style.display = "block";
|
||||
|
||||
form_3_btns.style.display = "flex";
|
||||
form_2_btns.style.display = "none";
|
||||
|
||||
form_3_progessbar.classList.add("active");
|
||||
});
|
||||
|
||||
form_3_next_btn.addEventListener("click", function () {
|
||||
form_3.style.display = "none";
|
||||
form_4.style.display = "block";
|
||||
|
||||
form_4_btns.style.display = "flex";
|
||||
form_3_btns.style.display = "none";
|
||||
|
||||
form_4_progessbar.classList.add("active");
|
||||
});
|
||||
|
||||
form_3_back_btn.addEventListener("click", function () {
|
||||
form_2.style.display = "block";
|
||||
form_3.style.display = "none";
|
||||
|
||||
form_3_btns.style.display = "none";
|
||||
form_2_btns.style.display = "flex";
|
||||
|
||||
form_3_progessbar.classList.remove("active");
|
||||
});
|
||||
|
||||
form_4_back_btn.addEventListener("click", function () {
|
||||
form_3.style.display = "block";
|
||||
form_4.style.display = "none";
|
||||
|
||||
form_4_btns.style.display = "none";
|
||||
form_3_btns.style.display = "flex";
|
||||
|
||||
form_4_progessbar.classList.remove("active");
|
||||
});
|
||||
|
||||
// btn_done.addEventListener("click", function () {
|
||||
// modal_wrapper.classList.add("active");
|
||||
// });
|
||||
|
||||
// shadow.addEventListener("click", function () {
|
||||
// modal_wrapper.classList.remove("active");
|
||||
// });
|
||||
/******************************************
|
||||
* MULTIPLE FORM END
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* KTP & E-KYC CAMERA
|
||||
******************************************/
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const videoElementKtp = document.getElementById("webcamKtp");
|
||||
const captureButtonKtp = document.getElementById("captureButtonKtp");
|
||||
const fotoInputKtp = document.getElementById("fotoKtp");
|
||||
const startButtonKtp = document.getElementById("startButtonKtp");
|
||||
const refreshButtonKtp = document.getElementById("refreshButtonKtp");
|
||||
const imageHolderKtp = document.getElementById("imageHolderKtp");
|
||||
|
||||
const videoElementEkyc = document.getElementById("webcamEkyc");
|
||||
const captureButtonEkyc = document.getElementById("captureButtonEkyc");
|
||||
const fotoInputEkyc = document.getElementById("fotoEkyc");
|
||||
const startButtonEkyc = document.getElementById("startButtonEkyc");
|
||||
const refreshButtonEkyc = document.getElementById("refreshButtonEkyc");
|
||||
const imageHolderEkyc = document.getElementById("imageHolderEkyc");
|
||||
|
||||
// Inisialisasi status kamera
|
||||
let ktpStream = null;
|
||||
let ekycStream = null;
|
||||
|
||||
// Tampilan tombol capture dan refresh
|
||||
captureButtonKtp.style.display = "none";
|
||||
refreshButtonKtp.style.display = "none";
|
||||
videoElementKtp.style.display = "none";
|
||||
imageHolderKtp.style.display = "block";
|
||||
|
||||
captureButtonEkyc.style.display = "none";
|
||||
refreshButtonEkyc.style.display = "none";
|
||||
videoElementEkyc.style.display = "none";
|
||||
imageHolderEkyc.style.display = "block";
|
||||
|
||||
// Fungsi untuk menyalakan kamera
|
||||
function turnOnCamera(stream, videoElement, startButton) {
|
||||
videoElement.srcObject = stream;
|
||||
startButton.textContent = "Matikan Kamera";
|
||||
videoElement.style.display = "block"; // Tampilkan video
|
||||
}
|
||||
|
||||
// Fungsi untuk mematikan kamera
|
||||
function turnOffCamera(stream, videoElement, startButton) {
|
||||
if (stream) {
|
||||
stream.getTracks().forEach((track) => track.stop());
|
||||
videoElement.srcObject = null;
|
||||
}
|
||||
startButton.textContent = "Nyalakan Kamera";
|
||||
videoElement.style.display = "none"; // Sembunyikan video
|
||||
}
|
||||
|
||||
// Fungsi untuk menghapus hasil foto
|
||||
function clearPhoto(fotoInput, fotoPreview) {
|
||||
fotoInput.value = "";
|
||||
fotoPreview.innerHTML = "";
|
||||
}
|
||||
|
||||
startButtonKtp.addEventListener("click", function () {
|
||||
if (ktpStream) {
|
||||
// Matikan kamera jika sudah aktif
|
||||
turnOffCamera(ktpStream, videoElementKtp, startButtonKtp);
|
||||
// Hapus hasil foto
|
||||
clearPhoto(
|
||||
fotoInputKtp,
|
||||
document.getElementById("foto-preview-ktp")
|
||||
);
|
||||
ktpStream = null;
|
||||
imageHolderKtp.style.display = "block";
|
||||
captureButtonKtp.style.display = "none";
|
||||
} else {
|
||||
// Aktifkan kamera jika belum aktif
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ video: true })
|
||||
.then(function (stream) {
|
||||
ktpStream = stream;
|
||||
turnOnCamera(ktpStream, videoElementKtp, startButtonKtp);
|
||||
imageHolderKtp.style.display = "none";
|
||||
captureButtonKtp.style.display = "block";
|
||||
})
|
||||
.catch(function (error) {
|
||||
Swal.fire({
|
||||
title: "Gagal",
|
||||
text: "Gagal mengakses kamera, karena " + error,
|
||||
icon: "error",
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
startButtonEkyc.addEventListener("click", function () {
|
||||
if (ekycStream) {
|
||||
// Matikan kamera jika sudah aktif
|
||||
turnOffCamera(ekycStream, videoElementEkyc, startButtonEkyc);
|
||||
// Hapus hasil foto
|
||||
clearPhoto(
|
||||
fotoInputEkyc,
|
||||
document.getElementById("foto-preview-ekyc")
|
||||
);
|
||||
ekycStream = null;
|
||||
imageHolderEkyc.style.display = "block";
|
||||
captureButtonEkyc.style.display = "none";
|
||||
} else {
|
||||
// Aktifkan kamera jika belum aktif
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ video: true })
|
||||
.then(function (stream) {
|
||||
ekycStream = stream;
|
||||
turnOnCamera(ekycStream, videoElementEkyc, startButtonEkyc);
|
||||
imageHolderEkyc.style.display = "none";
|
||||
captureButtonEkyc.style.display = "block";
|
||||
})
|
||||
.catch(function (error) {
|
||||
Swal.fire({
|
||||
title: "Gagal",
|
||||
text: "Gagal mengakses kamera, karena " + error,
|
||||
icon: "error",
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
refreshButtonKtp.addEventListener("click", function () {
|
||||
// Hapus hasil foto jika tombol "Ulang Foto" ditekan
|
||||
clearPhoto(fotoInputKtp, document.getElementById("foto-preview-ktp"));
|
||||
|
||||
if (ktpStream) {
|
||||
|
||||
turnOffCamera(ktpStream, videoElementKtp, startButtonKtp);
|
||||
ktpStream = null;
|
||||
}
|
||||
|
||||
// Menyalakan kembali kamera
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ video: true })
|
||||
.then(function (stream) {
|
||||
ktpStream = stream;
|
||||
turnOnCamera(ktpStream, videoElementKtp, startButtonKtp);
|
||||
})
|
||||
.catch(function (error) {
|
||||
Swal.fire({
|
||||
title: "Gagal",
|
||||
text: "Gagal mengakses kamera, karena " + error,
|
||||
icon: "error",
|
||||
});
|
||||
});
|
||||
refreshButtonKtp.style.display = "none";
|
||||
captureButtonKtp.style.display = "block";
|
||||
startButtonKtp.style.display = "block";
|
||||
});
|
||||
|
||||
refreshButtonEkyc.addEventListener("click", function () {
|
||||
// Hapus hasil foto jika tombol "Ulang Foto" ditekan
|
||||
clearPhoto(fotoInputEkyc, document.getElementById("foto-preview-ekyc"));
|
||||
|
||||
if (ekycStream) {
|
||||
// Matikan kamera jika sedang aktif
|
||||
turnOffCamera(ekycStream, videoElementEkyc, startButtonEkyc);
|
||||
ekycStream = null;
|
||||
}
|
||||
|
||||
// Menyalakan kembali kamera
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ video: true })
|
||||
.then(function (stream) {
|
||||
ekycStream = stream;
|
||||
turnOnCamera(ekycStream, videoElementEkyc, startButtonEkyc);
|
||||
})
|
||||
.catch(function (error) {
|
||||
Swal.fire({
|
||||
title: "Gagal",
|
||||
text: "Gagal mengakses kamera, karena " + error,
|
||||
icon: "error",
|
||||
});
|
||||
});
|
||||
refreshButtonEkyc.style.display = "none";
|
||||
captureButtonEkyc.style.display = "block";
|
||||
startButtonEkyc.style.display = "block";
|
||||
});
|
||||
|
||||
captureButtonKtp.addEventListener("click", function () {
|
||||
if (ktpStream) {
|
||||
const canvas = document.createElement("canvas");
|
||||
const context = canvas.getContext("2d");
|
||||
canvas.width = videoElementKtp.videoWidth;
|
||||
canvas.height = videoElementKtp.videoHeight;
|
||||
context.drawImage(
|
||||
videoElementKtp,
|
||||
0,
|
||||
0,
|
||||
canvas.width,
|
||||
canvas.height
|
||||
);
|
||||
const fotoDataUrl = canvas.toDataURL("image/jpeg");
|
||||
|
||||
fotoInputKtp.value = fotoDataUrl;
|
||||
|
||||
const fotoPreview = document.getElementById("foto-preview-ktp");
|
||||
fotoPreview.innerHTML =
|
||||
'<img src="' + fotoDataUrl + '" alt="Foto">';
|
||||
|
||||
// Matikan kamera setelah mengambil foto
|
||||
turnOffCamera(ktpStream, videoElementKtp, startButtonKtp);
|
||||
// Tombol ulang muncul
|
||||
refreshButtonKtp.style.display = "block";
|
||||
captureButtonKtp.style.display = "none";
|
||||
startButtonKtp.style.display = "none";
|
||||
}
|
||||
});
|
||||
|
||||
captureButtonEkyc.addEventListener("click", function () {
|
||||
if (ekycStream) {
|
||||
const canvas = document.createElement("canvas");
|
||||
const context = canvas.getContext("2d");
|
||||
canvas.width = videoElementEkyc.videoWidth;
|
||||
canvas.height = videoElementEkyc.videoHeight;
|
||||
context.drawImage(
|
||||
videoElementEkyc,
|
||||
0,
|
||||
0,
|
||||
canvas.width,
|
||||
canvas.height
|
||||
);
|
||||
const fotoDataUrl = canvas.toDataURL("image/jpeg");
|
||||
|
||||
fotoInputEkyc.value = fotoDataUrl;
|
||||
|
||||
const fotoPreview = document.getElementById("foto-preview-ekyc");
|
||||
fotoPreview.innerHTML =
|
||||
'<img src="' + fotoDataUrl + '" alt="Foto">';
|
||||
|
||||
// Matikan kamera setelah mengambil foto
|
||||
turnOffCamera(ekycStream, videoElementEkyc, startButtonEkyc);
|
||||
|
||||
refreshButtonEkyc.style.display = "block";
|
||||
captureButtonEkyc.style.display = "none";
|
||||
startButtonEkyc.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
/******************************************
|
||||
* END KTP & E-KYC CAMERA
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* SLIDE KTP & E-KYC FORM 3
|
||||
******************************************/
|
||||
let slideIndex = 1;
|
||||
showSlide(slideIndex);
|
||||
|
||||
function plusSlide(n) {
|
||||
showSlide((slideIndex += n));
|
||||
}
|
||||
|
||||
function currentSlide(n) {
|
||||
showSlide((slideIndex = n));
|
||||
}
|
||||
|
||||
function showSlide(n) {
|
||||
let slides = document.querySelectorAll(".slide");
|
||||
let dots = document.querySelectorAll(".dot");
|
||||
|
||||
if (n > slides.length) {
|
||||
slideIndex = 1;
|
||||
}
|
||||
|
||||
if (n < 1) {
|
||||
slideIndex = slides.length;
|
||||
}
|
||||
|
||||
for (let i = 0; i < slides.length; i++) {
|
||||
slides[i].style.transform =
|
||||
"translateX(-" + (slideIndex - 1) * 100 + "%)";
|
||||
}
|
||||
|
||||
for (let i = 0; i < dots.length; i++) {
|
||||
dots[i].classList.remove("active");
|
||||
}
|
||||
|
||||
dots[slideIndex - 1].classList.add("active");
|
||||
}
|
||||
/******************************************
|
||||
* END SLIDE KTP & E-KYC FORM 3
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* DROPDOWN SELECT GENDER
|
||||
******************************************/
|
||||
$(document).ready(function () {
|
||||
$("#gender-select").select2();
|
||||
});
|
||||
/******************************************
|
||||
* END DROPDOWN SELECT GENDER
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* AJAX DROPDOWN SELECT PROVINSI, KABUPATEN & KECAMATAN
|
||||
******************************************/
|
||||
$(document).ready(function () {
|
||||
$("#selectProvince").select2({
|
||||
placeholder: "Pilih Provinsi",
|
||||
ajax: {
|
||||
url: $("#selectProvince").data("url"),
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$("#selectCity").select2({
|
||||
placeholder: "Pilih Kabupaten/Kota",
|
||||
ajax: {
|
||||
url: "", // Isi dengan URL yang sesuai
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$("#selectDistrict").select2({
|
||||
placeholder: "Pilih Kecamatan",
|
||||
ajax: {
|
||||
url: "", // Isi dengan URL yang sesuai
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$("#selectVillage").select2({
|
||||
placeholder: "Pilih Kelurahan",
|
||||
ajax: {
|
||||
url: "", // Isi dengan URL yang sesuai
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// Event Listener untuk selectProvince
|
||||
$("#selectProvince").change(function () {
|
||||
let code = $("#selectProvince").val();
|
||||
|
||||
// Mengosongkan pilihan di selectCity dan selectDistrict dan selectVillage
|
||||
$("#selectCity", "#selectDistrict", "#selectVillage").empty();
|
||||
|
||||
// Menghapus properti 'disabled' pada selectCity dan selectDistrict dan selectVillage
|
||||
$("#selectCity", "#selectDistrict", "#selectVillage").prop(
|
||||
"disable",
|
||||
false
|
||||
);
|
||||
|
||||
// Muat ulang data berdasarkan provinsi yang baru dipilih di selectProvince
|
||||
$("#selectCity").select2({
|
||||
placeholder: "Pilih Kabupaten/Kota",
|
||||
ajax: {
|
||||
url: "/cari-kota/" + code,
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Event Listener untuk perubahan pada selectCity
|
||||
$("#selectCity").change(function () {
|
||||
let code = $("#selectCity").val();
|
||||
|
||||
// Mengosongkan pilihan di selectDistrict dan selectVillage
|
||||
$("#selectDristrict", "#selectVillage").empty();
|
||||
|
||||
// Menghapus properti 'disable' pada selectDistrict dan selectVillage
|
||||
$("#selectDistrict", "#selectVillage").prop("disabled", false);
|
||||
|
||||
// Memuat ulang data berdasarkan wilayah yang baru dipilih di selectCity
|
||||
$("#selectDistrict").select2({
|
||||
placeholder: "Pilih Kecamatan",
|
||||
ajax: {
|
||||
url: "/cari-kecamatan/" + code, // Isi dengan URL yang sesuai
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Event Listener untuk selectDistrict
|
||||
$("#selectDistrict").change(function () {
|
||||
let code = $("#selectDistrict").val();
|
||||
|
||||
// Mengosongkan pilihan di selectVillage
|
||||
$("#selectVillage").empty();
|
||||
|
||||
// Menghapus properti 'disabled' pada selectVillage
|
||||
$("#selectVillage").prop("disabled", false);
|
||||
|
||||
// Memuat ulang data berdasarkan wilayah yang baru dipilih di selectDistrict
|
||||
$("#selectVillage").select2({
|
||||
placeholder: "Pilih Kelurahan",
|
||||
ajax: {
|
||||
url: "/cari-kelurahan/" + code, // Isi dengan URL yang sesuai
|
||||
processResults: function ({ data }) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
id: item.code,
|
||||
text: item.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
/******************************************
|
||||
* END AJAX DROPDOWN SELECT PROVINSI, KABUPATEN & KECAMATAN
|
||||
******************************************/
|
5791
public/assets/js/login_register/jquery.js
vendored
Normal file
5791
public/assets/js/login_register/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
70
public/assets/js/login_register/script.js
Normal file
70
public/assets/js/login_register/script.js
Normal file
@ -0,0 +1,70 @@
|
||||
/******************************************
|
||||
* PROGRESS BAR MULTIPLE FORM
|
||||
******************************************/
|
||||
"use strict";
|
||||
//jQuery time
|
||||
var current_fs, next_fs, previous_fs; //fieldsets
|
||||
var left, opacity, scale; //fieldset properties which we will animate
|
||||
var animating; //flag to prevent quick multi-click glitches
|
||||
|
||||
$(".next").click(function () {
|
||||
if (animating) return false;
|
||||
animating = true;
|
||||
|
||||
current_fs = $(this).parent();
|
||||
next_fs = $(this).parent().next();
|
||||
|
||||
//activate next step on progressbar using the index of next_fs
|
||||
$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
|
||||
|
||||
//show the next fieldset
|
||||
next_fs.show();
|
||||
});
|
||||
|
||||
$(".previous").click(function () {
|
||||
if (animating) return false;
|
||||
animating = true;
|
||||
|
||||
current_fs = $(this).parent();
|
||||
previous_fs = $(this).parent().prev();
|
||||
|
||||
//de-activate current step on progressbar
|
||||
$("#progressbar li")
|
||||
.eq($("fieldset").index(current_fs))
|
||||
.removeClass("active");
|
||||
});
|
||||
/******************************************
|
||||
* END PROGRESS BAR MULTIPLE FORM
|
||||
******************************************/
|
||||
|
||||
/******************************************
|
||||
* HIDE & SEE PASSWORD PIN DAN KONFIR PIN
|
||||
******************************************/
|
||||
function togglePinVisibility() {
|
||||
var pin = document.getElementById("pin");
|
||||
var toggleIconPin = document.getElementById("toggle-pin");
|
||||
|
||||
if (pin.type === "password") {
|
||||
pin.type = "text";
|
||||
toggleIconPin.className = "fa fa-eye-slash password-toggle-icon";
|
||||
} else {
|
||||
pin.type = "password";
|
||||
toggleIconPin.className = "fa fa-eye password-toggle-icon";
|
||||
}
|
||||
}
|
||||
|
||||
function toggleKonfirPinVisibility() {
|
||||
var pin = document.getElementById("konfir-pin");
|
||||
var toggleIconKonfirPin = document.getElementById("toggle-konfir-pin");
|
||||
|
||||
if (pin.type === "password") {
|
||||
pin.type = "text";
|
||||
toggleIconKonfirPin.className = "fa fa-eye-slash password-toggle-icon";
|
||||
} else {
|
||||
pin.type = "password";
|
||||
toggleIconKonfirPin.className = "fa fa-eye password-toggle-icon";
|
||||
}
|
||||
}
|
||||
/******************************************
|
||||
* END HIDE & SEE PASSWORD PIN DAN KONFIR PIN
|
||||
******************************************/
|
321
public/assets/js/main.js
Normal file
321
public/assets/js/main.js
Normal file
@ -0,0 +1,321 @@
|
||||
/**
|
||||
* Template Name: NiceAdmin
|
||||
* Updated: Aug 30 2023 with Bootstrap v5.3.1
|
||||
* Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
|
||||
* Author: BootstrapMade.com
|
||||
* License: https://bootstrapmade.com/license/
|
||||
*/
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Easy selector helper function
|
||||
*/
|
||||
const select = (el, all = false) => {
|
||||
el = el.trim()
|
||||
if (all) {
|
||||
return [...document.querySelectorAll(el)]
|
||||
} else {
|
||||
return document.querySelector(el)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy event listener function
|
||||
*/
|
||||
const on = (type, el, listener, all = false) => {
|
||||
if (all) {
|
||||
select(el, all).forEach(e => e.addEventListener(type, listener))
|
||||
} else {
|
||||
select(el, all).addEventListener(type, listener)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Easy on scroll event listener
|
||||
*/
|
||||
const onscroll = (el, listener) => {
|
||||
el.addEventListener('scroll', listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidebar toggle
|
||||
*/
|
||||
if (select('.toggle-sidebar-btn')) {
|
||||
on('click', '.toggle-sidebar-btn', function(e) {
|
||||
select('body').classList.toggle('toggle-sidebar')
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Search bar toggle
|
||||
*/
|
||||
if (select('.search-bar-toggle')) {
|
||||
on('click', '.search-bar-toggle', function(e) {
|
||||
select('.search-bar').classList.toggle('search-bar-show')
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Navbar links active state on scroll
|
||||
*/
|
||||
let navbarlinks = select('#navbar .scrollto', true)
|
||||
const navbarlinksActive = () => {
|
||||
let position = window.scrollY + 200
|
||||
navbarlinks.forEach(navbarlink => {
|
||||
if (!navbarlink.hash) return
|
||||
let section = select(navbarlink.hash)
|
||||
if (!section) return
|
||||
if (position >= section.offsetTop && position <= (section.offsetTop + section.offsetHeight)) {
|
||||
navbarlink.classList.add('active')
|
||||
} else {
|
||||
navbarlink.classList.remove('active')
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', navbarlinksActive)
|
||||
onscroll(document, navbarlinksActive)
|
||||
|
||||
/**
|
||||
* Toggle .header-scrolled class to #header when page is scrolled
|
||||
*/
|
||||
let selectHeader = select('#header')
|
||||
if (selectHeader) {
|
||||
const headerScrolled = () => {
|
||||
if (window.scrollY > 100) {
|
||||
selectHeader.classList.add('header-scrolled')
|
||||
} else {
|
||||
selectHeader.classList.remove('header-scrolled')
|
||||
}
|
||||
}
|
||||
window.addEventListener('load', headerScrolled)
|
||||
onscroll(document, headerScrolled)
|
||||
}
|
||||
|
||||
/**
|
||||
* Back to top button
|
||||
*/
|
||||
let backtotop = select('.back-to-top')
|
||||
if (backtotop) {
|
||||
const toggleBacktotop = () => {
|
||||
if (window.scrollY > 100) {
|
||||
backtotop.classList.add('active')
|
||||
} else {
|
||||
backtotop.classList.remove('active')
|
||||
}
|
||||
}
|
||||
window.addEventListener('load', toggleBacktotop)
|
||||
onscroll(document, toggleBacktotop)
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate tooltips
|
||||
*/
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
})
|
||||
|
||||
/**
|
||||
* Initiate quill editors
|
||||
*/
|
||||
if (select('.quill-editor-default')) {
|
||||
new Quill('.quill-editor-default', {
|
||||
theme: 'snow'
|
||||
});
|
||||
}
|
||||
|
||||
if (select('.quill-editor-bubble')) {
|
||||
new Quill('.quill-editor-bubble', {
|
||||
theme: 'bubble'
|
||||
});
|
||||
}
|
||||
|
||||
if (select('.quill-editor-full')) {
|
||||
new Quill(".quill-editor-full", {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{
|
||||
font: []
|
||||
}, {
|
||||
size: []
|
||||
}],
|
||||
["bold", "italic", "underline", "strike"],
|
||||
[{
|
||||
color: []
|
||||
},
|
||||
{
|
||||
background: []
|
||||
}
|
||||
],
|
||||
[{
|
||||
script: "super"
|
||||
},
|
||||
{
|
||||
script: "sub"
|
||||
}
|
||||
],
|
||||
[{
|
||||
list: "ordered"
|
||||
},
|
||||
{
|
||||
list: "bullet"
|
||||
},
|
||||
{
|
||||
indent: "-1"
|
||||
},
|
||||
{
|
||||
indent: "+1"
|
||||
}
|
||||
],
|
||||
["direction", {
|
||||
align: []
|
||||
}],
|
||||
["link", "image", "video"],
|
||||
["clean"]
|
||||
]
|
||||
},
|
||||
theme: "snow"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate TinyMCE Editor
|
||||
*/
|
||||
const useDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
const isSmallScreen = window.matchMedia('(max-width: 1023.5px)').matches;
|
||||
|
||||
tinymce.init({
|
||||
selector: 'textarea.tinymce-editor',
|
||||
plugins: 'preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons',
|
||||
editimage_cors_hosts: ['picsum.photos'],
|
||||
menubar: 'file edit view insert format tools table help',
|
||||
toolbar: 'undo redo | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
|
||||
toolbar_sticky: true,
|
||||
toolbar_sticky_offset: isSmallScreen ? 102 : 108,
|
||||
autosave_ask_before_unload: true,
|
||||
autosave_interval: '30s',
|
||||
autosave_prefix: '{path}{query}-{id}-',
|
||||
autosave_restore_when_empty: false,
|
||||
autosave_retention: '2m',
|
||||
image_advtab: true,
|
||||
link_list: [{
|
||||
title: 'My page 1',
|
||||
value: 'https://www.tiny.cloud'
|
||||
},
|
||||
{
|
||||
title: 'My page 2',
|
||||
value: 'http://www.moxiecode.com'
|
||||
}
|
||||
],
|
||||
image_list: [{
|
||||
title: 'My page 1',
|
||||
value: 'https://www.tiny.cloud'
|
||||
},
|
||||
{
|
||||
title: 'My page 2',
|
||||
value: 'http://www.moxiecode.com'
|
||||
}
|
||||
],
|
||||
image_class_list: [{
|
||||
title: 'None',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
title: 'Some class',
|
||||
value: 'class-name'
|
||||
}
|
||||
],
|
||||
importcss_append: true,
|
||||
file_picker_callback: (callback, value, meta) => {
|
||||
/* Provide file and text for the link dialog */
|
||||
if (meta.filetype === 'file') {
|
||||
callback('https://www.google.com/logos/google.jpg', {
|
||||
text: 'My text'
|
||||
});
|
||||
}
|
||||
|
||||
/* Provide image and alt text for the image dialog */
|
||||
if (meta.filetype === 'image') {
|
||||
callback('https://www.google.com/logos/google.jpg', {
|
||||
alt: 'My alt text'
|
||||
});
|
||||
}
|
||||
|
||||
/* Provide alternative source and posted for the media dialog */
|
||||
if (meta.filetype === 'media') {
|
||||
callback('movie.mp4', {
|
||||
source2: 'alt.ogg',
|
||||
poster: 'https://www.google.com/logos/google.jpg'
|
||||
});
|
||||
}
|
||||
},
|
||||
templates: [{
|
||||
title: 'New Table',
|
||||
description: 'creates a new table',
|
||||
content: '<div class="mceTmpl"><table width="98%%" border="0" cellspacing="0" cellpadding="0"><tr><th scope="col"> </th><th scope="col"> </th></tr><tr><td> </td><td> </td></tr></table></div>'
|
||||
},
|
||||
{
|
||||
title: 'Starting my story',
|
||||
description: 'A cure for writers block',
|
||||
content: 'Once upon a time...'
|
||||
},
|
||||
{
|
||||
title: 'New list with dates',
|
||||
description: 'New List with dates',
|
||||
content: '<div class="mceTmpl"><span class="cdate">cdate</span><br><span class="mdate">mdate</span><h2>My List</h2><ul><li></li><li></li></ul></div>'
|
||||
}
|
||||
],
|
||||
template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',
|
||||
template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
|
||||
height: 600,
|
||||
image_caption: true,
|
||||
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
||||
noneditable_class: 'mceNonEditable',
|
||||
toolbar_mode: 'sliding',
|
||||
contextmenu: 'link image table',
|
||||
skin: useDarkMode ? 'oxide-dark' : 'oxide',
|
||||
content_css: useDarkMode ? 'dark' : 'default',
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
|
||||
});
|
||||
|
||||
/**
|
||||
* Initiate Bootstrap validation check
|
||||
*/
|
||||
var needsValidation = document.querySelectorAll('.needs-validation')
|
||||
|
||||
Array.prototype.slice.call(needsValidation)
|
||||
.forEach(function(form) {
|
||||
form.addEventListener('submit', function(event) {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
|
||||
/**
|
||||
* Initiate Datatables
|
||||
*/
|
||||
const datatables = select('.datatable', true)
|
||||
datatables.forEach(datatable => {
|
||||
new simpleDatatables.DataTable(datatable);
|
||||
})
|
||||
|
||||
/**
|
||||
* Autoresize echart charts
|
||||
*/
|
||||
const mainContainer = select('#main');
|
||||
if (mainContainer) {
|
||||
setTimeout(() => {
|
||||
new ResizeObserver(function() {
|
||||
select('.echart', true).forEach(getEchart => {
|
||||
echarts.getInstanceByDom(getEchart).resize();
|
||||
})
|
||||
}).observe(mainContainer);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
})();
|
@ -28,11 +28,14 @@ $("[data-checkboxes]").each(function () {
|
||||
});
|
||||
});
|
||||
|
||||
// User
|
||||
$("#table-1").dataTable({
|
||||
"columnDefs": [
|
||||
{ "sortable": false, "targets": [2] }
|
||||
]
|
||||
});
|
||||
|
||||
// Refund, Setting, Transaction
|
||||
$("#table-2").dataTable({
|
||||
"columnDefs": [
|
||||
{ "sortable": false, "targets": [0, 2, 3] }
|
||||
|
966
public/assets/modules/datatables/datatables.min.css
vendored
966
public/assets/modules/datatables/datatables.min.css
vendored
File diff suppressed because one or more lines are too long
572
resources/views/Admin/index.blade.php
Normal file
572
resources/views/Admin/index.blade.php
Normal file
@ -0,0 +1,572 @@
|
||||
@extends('admin.layout.main')
|
||||
@section('content')
|
||||
<!-- Main Content -->
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-4 col-sm-12">
|
||||
<div class="card card-statistic-2">
|
||||
<div class="card-stats">
|
||||
<div class="card-stats-title">List Transaction -
|
||||
<div class="dropdown d-inline">
|
||||
<a class="font-weight-600 dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
id="orders-month">August</a>
|
||||
<ul class="dropdown-menu dropdown-menu-sm">
|
||||
<li class="dropdown-title">Select Month</li>
|
||||
<li><a href="#" class="dropdown-item">January</a></li>
|
||||
<li><a href="#" class="dropdown-item">February</a></li>
|
||||
<li><a href="#" class="dropdown-item">March</a></li>
|
||||
<li><a href="#" class="dropdown-item">April</a></li>
|
||||
<li><a href="#" class="dropdown-item">May</a></li>
|
||||
<li><a href="#" class="dropdown-item">June</a></li>
|
||||
<li><a href="#" class="dropdown-item">July</a></li>
|
||||
<li><a href="#" class="dropdown-item active">August</a></li>
|
||||
<li><a href="#" class="dropdown-item">September</a></li>
|
||||
<li><a href="#" class="dropdown-item">October</a></li>
|
||||
<li><a href="#" class="dropdown-item">November</a></li>
|
||||
<li><a href="#" class="dropdown-item">December</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-stats-items">
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">114</div>
|
||||
<div class="card-stats-item-label">Success</div>
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">12</div>
|
||||
<div class="card-stats-item-label">Pending</div>
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">23</div>
|
||||
<div class="card-stats-item-label">Canceled</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-icon shadow-primary bg-primary">
|
||||
<i class="fas fa-exchange-alt"></i>
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total Transaction</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
159
|
||||
</div>
|
||||
</div>
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success me-2"><span class="mdi mdi-arrow-up-bold"></span>
|
||||
1.08%</span>
|
||||
<span class="text-nowrap">Since last week</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-12">
|
||||
<div class="card card-statistic-2">
|
||||
<div class="card-chart">
|
||||
<canvas id="balance-chart" height="80"></canvas>
|
||||
</div>
|
||||
<div class="card-icon shadow-primary bg-primary">
|
||||
<i class="fas fa-money-check"></i>
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total Refund</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
100
|
||||
</div>
|
||||
</div>
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success me-2"><span class="mdi mdi-arrow-up-bold"></span>
|
||||
5.27%</span>
|
||||
<span class="text-nowrap">Since last month</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-12">
|
||||
<div class="card card-statistic-2">
|
||||
<div class="card-chart">
|
||||
<canvas id="sales-chart" height="80"></canvas>
|
||||
</div>
|
||||
<div class="card-icon shadow-primary bg-primary">
|
||||
<i class="fas fa-user"></i>
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total user</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
100 </div>
|
||||
</div>
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-danger me-2"><span class="mdi mdi-arrow-down-bold"></span>
|
||||
1.08%</span>
|
||||
<span class="text-nowrap">Since previous week</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-end d-flex">
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 ml-auto">
|
||||
<div class="input-group">
|
||||
<input type="text" name="from-to" class="form-control" id="date-range">
|
||||
<span class="input-group-text bg-primary text-white align-items-center">
|
||||
<i class="mdi mdi-calendar-range font-13"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="alert alert-primary alert-dismissible fade show mb-3" role="alert">
|
||||
Pendapatan Hari Ini meningkat <span class="mdi mdi-arrow-up-bold"></span>
|
||||
5.27%</span>
|
||||
</div>
|
||||
<div class="card-header">
|
||||
<h4>Statistics</h4>
|
||||
<div class="card-header-action">
|
||||
<div class="btn-group">
|
||||
<a href="#" class="btn btn-primary">Week</a>
|
||||
<a href="#" class="btn">Month</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<canvas id="myChart1"></canvas>
|
||||
{{-- <div class="statistic-details mt-sm-4">
|
||||
<div class="statistic-details-item">
|
||||
<span class="text-muted"><span class="text-primary"><i
|
||||
class="fas fa-caret-up"></i></span> 7%</span>
|
||||
<div class="detail-value">$243</div>
|
||||
<div class="detail-name">Today's Sales</div>
|
||||
</div>
|
||||
<div class="statistic-details-item">
|
||||
<span class="text-muted"><span class="text-danger"><i
|
||||
class="fas fa-caret-down"></i></span> 23%</span>
|
||||
<div class="detail-value">$2,902</div>
|
||||
<div class="detail-name">This Week's Sales</div>
|
||||
</div>
|
||||
<div class="statistic-details-item">
|
||||
<span class="text-muted"><span class="text-primary"><i
|
||||
class="fas fa-caret-up"></i></span>9%</span>
|
||||
<div class="detail-value">$12,821</div>
|
||||
<div class="detail-name">This Month's Sales</div>
|
||||
</div>
|
||||
<div class="statistic-details-item">
|
||||
<span class="text-muted"><span class="text-primary"><i
|
||||
class="fas fa-caret-up"></i></span> 19%</span>
|
||||
<div class="detail-value">$92,142</div>
|
||||
<div class="detail-name">This Year's Sales</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card gradient-bottom">
|
||||
<div class="card-header">
|
||||
<h4>Top 5 Users</h4>
|
||||
<div class="card-header-action dropdown">
|
||||
<a href="#" data-toggle="dropdown"
|
||||
class="btn btn-primary dropdown-toggle">Month</a>
|
||||
<ul class="dropdown-menu dropdown-menu-sm dropdown-menu-right">
|
||||
<li class="dropdown-title">Select Period</li>
|
||||
<li><a href="#" class="dropdown-item">Today</a></li>
|
||||
<li><a href="#" class="dropdown-item">Week</a></li>
|
||||
<li><a href="#" class="dropdown-item active">Month</a></li>
|
||||
<li><a href="#" class="dropdown-item">This Year</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" id="top-5-scroll">
|
||||
<ul class="list-unstyled list-unstyled-border">
|
||||
<li class="media">
|
||||
<img class="mr-3 rounded" width="55" src="{{asset('assets/img/avatar/avatar-6.png')}}"
|
||||
alt="product">
|
||||
<div class="media-body">
|
||||
<div class="float-right">
|
||||
<div class="font-weight-600 text-muted text-small">86 Sales</div>
|
||||
</div>
|
||||
<div class="media-title">Jilhan Haura</div>
|
||||
<div class="mt-1">
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-primary" data-width="64%"></div>
|
||||
<div class="budget-price-label">$68,714</div>
|
||||
</div>
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-danger" data-width="43%"></div>
|
||||
<div class="budget-price-label">$38,700</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="media">
|
||||
<img class="mr-3 rounded" width="55" src="{{asset('assets/img/avatar/avatar-1.png')}}"
|
||||
alt="product">
|
||||
<div class="media-body">
|
||||
<div class="float-right">
|
||||
<div class="font-weight-600 text-muted text-small">67 Sales</div>
|
||||
</div>
|
||||
<div class="media-title">Nurul Prima</div>
|
||||
<div class="mt-1">
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-primary" data-width="84%"></div>
|
||||
<div class="budget-price-label">$107,133</div>
|
||||
</div>
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-danger" data-width="60%"></div>
|
||||
<div class="budget-price-label">$91,455</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="media">
|
||||
<img class="mr-3 rounded" width="55" src="{{asset('assets/img/avatar/avatar-2.png')}}"
|
||||
alt="product">
|
||||
<div class="media-body">
|
||||
<div class="float-right">
|
||||
<div class="font-weight-600 text-muted text-small">63 Sales</div>
|
||||
</div>
|
||||
<div class="media-title">Muhammad Raihan</div>
|
||||
<div class="mt-1">
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-primary" data-width="34%"></div>
|
||||
<div class="budget-price-label">$3,717</div>
|
||||
</div>
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-danger" data-width="28%"></div>
|
||||
<div class="budget-price-label">$2,835</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="media">
|
||||
<img class="mr-3 rounded" width="55" src="{{asset('assets/img/avatar/avatar-3.png')}}"
|
||||
alt="product">
|
||||
<div class="media-body">
|
||||
<div class="float-right">
|
||||
<div class="font-weight-600 text-muted text-small">28 Sales</div>
|
||||
</div>
|
||||
<div class="media-title">Hantu</div>
|
||||
<div class="mt-1">
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-primary" data-width="45%"></div>
|
||||
<div class="budget-price-label">$13,972</div>
|
||||
</div>
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-danger" data-width="30%"></div>
|
||||
<div class="budget-price-label">$9,660</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="media">
|
||||
<img class="mr-3 rounded" width="55" src="{{asset('assets/img/avatar/avatar-4.png')}}"
|
||||
alt="product">
|
||||
<div class="media-body">
|
||||
<div class="float-right">
|
||||
<div class="font-weight-600 text-muted text-small">19 Sales</div>
|
||||
</div>
|
||||
<div class="media-title">Testing</div>
|
||||
<div class="mt-1">
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-primary" data-width="35%"></div>
|
||||
<div class="budget-price-label">$7,391</div>
|
||||
</div>
|
||||
<div class="budget-price">
|
||||
<div class="budget-price-square bg-danger" data-width="28%"></div>
|
||||
<div class="budget-price-label">$5,472</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-footer pt-3 d-flex justify-content-center">
|
||||
<div class="budget-price justify-content-center">
|
||||
<div class="budget-price-square bg-primary" data-width="20"></div>
|
||||
<div class="budget-price-label">Selling Price</div>
|
||||
</div>
|
||||
<div class="budget-price justify-content-center">
|
||||
<div class="budget-price-square bg-danger" data-width="20"></div>
|
||||
<div class="budget-price-label">Budget Price</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>History Transaction</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th>Order Id</th>
|
||||
<th>Customer</th>
|
||||
<th>Seller</th>
|
||||
<th>Total</th>
|
||||
<th>Due Date</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($transaction as $transactions)
|
||||
<tr>
|
||||
<td>{{ $transactions['no'] }}</td>
|
||||
<td><a href="#">{{ $transactions['orderId'] }}</a></td>
|
||||
<td class="font-weight-600">{{ $transactions['customer'] }}</td>
|
||||
<td class="font-weight-600">{{ $transactions['seller'] }}</td>
|
||||
<td class="font-weight-600">{{ $transactions['total'] }}</td>
|
||||
<td>{{ $transactions['date'] }}</td>
|
||||
<td>
|
||||
@php
|
||||
$statusClass = '';
|
||||
if ($transactions['status'] === 'pending') {
|
||||
$statusClass = 'badge-warning';
|
||||
} elseif ($transactions['status'] === 'paid') {
|
||||
$statusClass = 'badge-success';
|
||||
} elseif ($transactions['status'] === 'unpaid') {
|
||||
$statusClass = 'badge-danger';
|
||||
}
|
||||
@endphp
|
||||
<div class="badge {{ $statusClass }}">{{ $transactions['status'] }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
Action
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item"
|
||||
href="/detail_transaction">Details</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal"
|
||||
data-target="#ModalTransaction">Tracking</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@include('admin.transaction.modal-tracking')
|
||||
<script>
|
||||
// Set new default font family and font color to mimic Bootstrap's default styling
|
||||
Chart.defaults.global.defaultFontFamily = 'Nunito',
|
||||
'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||
Chart.defaults.global.defaultFontColor = '#858796';
|
||||
|
||||
var ctx = document.getElementById("myChart1").getContext('2d');
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "Oktober", "November", "December"],
|
||||
datasets: [{
|
||||
label: 'Transaction',
|
||||
data: [3200, 18009, 4305, 3022, 6310, 5120, 5880, 6154, 0],
|
||||
borderWidth: 2,
|
||||
backgroundColor: 'rgba(63,82,227,.8)',
|
||||
borderWidth: 0,
|
||||
borderColor: 'transparent',
|
||||
pointBorderWidth: 0,
|
||||
pointRadius: 3.5,
|
||||
pointBackgroundColor: 'transparent',
|
||||
pointHoverBackgroundColor: 'rgba(63,82,227,.8)',
|
||||
},
|
||||
{
|
||||
label: 'Refund',
|
||||
data: [2207, 3403, 220000, 5025, 2302, 4208, 3880, 4880, 5000],
|
||||
borderWidth: 2,
|
||||
backgroundColor: 'rgba(254,86,83,.7)',
|
||||
borderWidth: 0,
|
||||
borderColor: 'transparent',
|
||||
pointBorderWidth: 0,
|
||||
pointRadius: 3.5,
|
||||
pointBackgroundColor: 'transparent',
|
||||
pointHoverBackgroundColor: 'rgba(254,86,83,.8)',
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
layout:{
|
||||
padding: 20,
|
||||
},
|
||||
legend: {
|
||||
display: true,
|
||||
labels:{
|
||||
padding: 20,
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
gridLines: {
|
||||
// display: false,
|
||||
drawBorder: false,
|
||||
color: '#f2f2f2',
|
||||
},
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
stepSize: 15000,
|
||||
callback: function(value, index, values) {
|
||||
// return 'Rp.' + value;
|
||||
return new Intl.NumberFormat('id-ID', {
|
||||
style: 'currency',
|
||||
currency: 'IDR',
|
||||
}).format(value);
|
||||
}
|
||||
}
|
||||
}],
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
display: true,
|
||||
tickMarkLength: 15,
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var balance_chart = document.getElementById("balance-chart").getContext('2d');
|
||||
|
||||
var balance_chart_bg_color = balance_chart.createLinearGradient(0, 0, 0, 70);
|
||||
balance_chart_bg_color.addColorStop(0, 'rgba(63,82,227,.2)');
|
||||
balance_chart_bg_color.addColorStop(1, 'rgba(63,82,227,0)');
|
||||
|
||||
var myChart = new Chart(balance_chart, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['16-07-2018', '17-07-2018', '18-07-2018', '19-07-2018', '20-07-2018', '21-07-2018',
|
||||
'22-07-2018', '23-07-2018', '24-07-2018', '25-07-2018', '26-07-2018', '27-07-2018',
|
||||
'28-07-2018', '29-07-2018', '30-07-2018', '31-07-2018'
|
||||
],
|
||||
datasets: [{
|
||||
label: 'Balance',
|
||||
data: [50, 61, 80, 50, 72, 52, 60, 41, 30, 45, 70, 40, 93, 63, 50, 62],
|
||||
backgroundColor: balance_chart_bg_color,
|
||||
borderWidth: 3,
|
||||
borderColor: 'rgba(63,82,227,1)',
|
||||
pointBorderWidth: 0,
|
||||
pointBorderColor: 'transparent',
|
||||
pointRadius: 3,
|
||||
pointBackgroundColor: 'transparent',
|
||||
pointHoverBackgroundColor: 'rgba(63,82,227,1)',
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
layout: {
|
||||
padding: {
|
||||
bottom: -1,
|
||||
left: -1
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false,
|
||||
},
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
display: false
|
||||
}
|
||||
}],
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
drawBorder: false,
|
||||
display: false,
|
||||
},
|
||||
ticks: {
|
||||
display: false
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var sales_chart = document.getElementById("sales-chart").getContext('2d');
|
||||
|
||||
var sales_chart_bg_color = sales_chart.createLinearGradient(0, 0, 0, 80);
|
||||
balance_chart_bg_color.addColorStop(0, 'rgba(63,82,227,.2)');
|
||||
balance_chart_bg_color.addColorStop(1, 'rgba(63,82,227,0)');
|
||||
|
||||
var myChart = new Chart(sales_chart, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ['16-07-2018', '17-07-2018', '18-07-2018', '19-07-2018', '20-07-2018', '21-07-2018',
|
||||
'22-07-2018', '23-07-2018', '24-07-2018', '25-07-2018', '26-07-2018', '27-07-2018',
|
||||
'28-07-2018', '29-07-2018', '30-07-2018', '31-07-2018'
|
||||
],
|
||||
datasets: [{
|
||||
label: 'Sales',
|
||||
data: [70, 62, 44, 40, 21, 63, 82, 52, 50, 31, 70, 50, 91, 63, 51, 60],
|
||||
borderWidth: 2,
|
||||
backgroundColor: balance_chart_bg_color,
|
||||
borderWidth: 3,
|
||||
borderColor: 'rgba(63,82,227,1)',
|
||||
pointBorderWidth: 0,
|
||||
pointBorderColor: 'transparent',
|
||||
pointRadius: 3,
|
||||
pointBackgroundColor: 'transparent',
|
||||
pointHoverBackgroundColor: 'rgba(63,82,227,1)',
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
layout: {
|
||||
padding: {
|
||||
bottom: -1,
|
||||
left: -1
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
gridLines: {
|
||||
display: false,
|
||||
drawBorder: false,
|
||||
},
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
display: false
|
||||
}
|
||||
}],
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
drawBorder: false,
|
||||
display: false,
|
||||
},
|
||||
ticks: {
|
||||
display: false
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
@ -19,7 +19,7 @@
|
||||
<div class="dropdown-list-content dropdown-list-message">
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="assets/img/avatar/avatar-1.png" class="rounded-circle">
|
||||
<img alt="image" src="{{asset('assets/img/avatar/avatar-1.png')}}" class="rounded-circle">
|
||||
<div class="is-online"></div>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
@ -30,7 +30,7 @@
|
||||
</a>
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="assets/img/avatar/avatar-2.png" class="rounded-circle">
|
||||
<img alt="image" src="{{asset('assets/img/avatar/avatar-2.png')}}" class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Dedik Sugiharto</b>
|
||||
@ -40,7 +40,7 @@
|
||||
</a>
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="assets/img/avatar/avatar-3.png" class="rounded-circle">
|
||||
<img alt="image" src="{{asset('assets/img/avatar/avatar-3.png')}}" class="rounded-circle">
|
||||
<div class="is-online"></div>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
@ -51,7 +51,7 @@
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="assets/img/avatar/avatar-4.png" class="rounded-circle">
|
||||
<img alt="image" src="{{asset('assets/img/avatar/avatar-4.png')}}" class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Ardian Rahardiansyah</b>
|
||||
@ -61,7 +61,7 @@
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="assets/img/avatar/avatar-5.png" class="rounded-circle">
|
||||
<img alt="image" src="{{asset('assets/img/avatar/avatar-5.png')}}" class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Alfa Zulkarnain</b>
|
||||
@ -137,8 +137,8 @@
|
||||
</li>
|
||||
<li class="dropdown"><a href="#" data-toggle="dropdown"
|
||||
class="nav-link dropdown-toggle nav-link-lg nav-link-user">
|
||||
<img alt="image" src="assets/img/avatar/avatar-1.png" class="rounded-circle mr-1">
|
||||
<div class="d-sm-none d-lg-inline-block">Hi, {{ $name }}</div>
|
||||
<img alt="image" src="{{asset('assets/img/avatar/ok.jpg')}}" class="rounded-circle mr-1">
|
||||
<div class="d-sm-none d-lg-inline-block">Hi, {{ Auth::user()->nama_depan }}</div>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<div class="dropdown-title">Logged in 5 min ago</div>
|
||||
@ -152,7 +152,7 @@
|
||||
<i class="fas fa-cog"></i> Settings
|
||||
</a> --}}
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="#" class="dropdown-item has-icon text-danger">
|
||||
<a href="{{route('logout')}}" class="dropdown-item has-icon text-danger">
|
||||
<i class="fas fa-sign-out-alt"></i> Logout
|
||||
</a>
|
||||
</div>
|
||||
|
@ -33,27 +33,29 @@
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" name="viewport">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>REKBER</title>
|
||||
|
||||
<!-- General CSS Files -->
|
||||
<link rel="stylesheet" href="assets/modules/bootstrap/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/fontawesome/css/all.min.css">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/bootstrap/css/bootstrap.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/fontawesome/css/all.min.css') }}">
|
||||
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/5.4.55/css/materialdesignicons.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/jqvmap/dist/jqvmap.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/summernote/summernote-bs4.css">
|
||||
<link rel="stylesheet" href="assets/modules/owlcarousel2/dist/assets/owl.carousel.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/owlcarousel2/dist/assets/owl.theme.default.min.css">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/jqvmap/dist/jqvmap.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/summernote/summernote-bs4.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/owlcarousel2/dist/assets/owl.carousel.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/owlcarousel2/dist/assets/owl.theme.default.min.css') }}">
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.css" />
|
||||
<!-- Template CSS -->
|
||||
<link rel="stylesheet" href="assets/css/style.css">
|
||||
<link rel="stylesheet" href="assets/css/components.css">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/style.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/components.css') }}">
|
||||
<!-- CSS Libraries -->
|
||||
<link rel="stylesheet" href="assets/modules/datatables/datatables.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/datatables/DataTables-1.10.16/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="assets/modules/datatables/Select-1.2.4/css/select.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/datatables/datatables.min.css') }}">
|
||||
<link rel="stylesheet"
|
||||
href="{{ asset('assets/modules/datatables/DataTables-1.10.16/css/dataTables.bootstrap4.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/modules/datatables/Select-1.2.4/css/select.bootstrap4.min.css') }}">
|
||||
<!-- Start GA -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-94034622-3"></script>
|
||||
{{-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-94034622-3"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
@ -63,9 +65,36 @@
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-94034622-3');
|
||||
<<<<<<< HEAD
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
=======
|
||||
</script> --}}
|
||||
|
||||
<!-- /END GA -->
|
||||
|
||||
{{-- JS --}}
|
||||
>>>>>>> c6e7e74f2a6981b808e6ad8dc9499362fdf9f043
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="{{ asset('assets/modules/chart.min.js') }}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="header-area header-sticky">
|
||||
@include('admin.layout.header')
|
||||
</header>
|
||||
|
||||
<main id="main" style="min-height: 100vh;">
|
||||
@include('admin.layout.sidebar')
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
<footer id="footer">
|
||||
@include('admin.layout.footer')
|
||||
</footer>
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@ -109,57 +138,38 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- /END GA -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="header-area header-sticky">
|
||||
@include('Admin.layout.header')
|
||||
</header>
|
||||
|
||||
<main id="main" style="min-height: 100vh;">
|
||||
@include('Admin.layout.sidebar')
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
<footer id="footer">
|
||||
@include('Admin.layout.footer')
|
||||
</footer>
|
||||
|
||||
<!-- General JS Scripts -->
|
||||
<script src="assets/modules/jquery.min.js"></script>
|
||||
<script src="assets/modules/popper.js"></script>
|
||||
<script src="assets/modules/tooltip.js"></script>
|
||||
<script src="assets/modules/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="assets/modules/nicescroll/jquery.nicescroll.min.js"></script>
|
||||
<script src="assets/modules/moment.min.js"></script>
|
||||
<script src="assets/js/stisla.js"></script>
|
||||
<script src="{{ asset('assets/modules/jquery.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/popper.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/tooltip.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/nicescroll/jquery.nicescroll.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/moment.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/stisla.js') }}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
<!-- JS Libraies -->
|
||||
<script src="assets/modules/jquery.sparkline.min.js"></script>
|
||||
<script src="assets/modules/chart.min.js"></script>
|
||||
<script src="assets/modules/owlcarousel2/dist/owl.carousel.min.js"></script>
|
||||
<script src="assets/modules/summernote/summernote-bs4.js"></script>
|
||||
<script src="assets/modules/chocolat/dist/js/jquery.chocolat.min.js"></script>
|
||||
<script src="{{ asset('assets/modules/jquery.sparkline.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/owlcarousel2/dist/owl.carousel.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/summernote/summernote-bs4.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/chocolat/dist/js/jquery.chocolat.min.js') }}"></script>
|
||||
|
||||
<!-- Page Specific JS File -->
|
||||
<script src="assets/js/page/index.js"></script>
|
||||
<script src="assets/js/page/index-0.js"></script>
|
||||
<!-- JS Libraies -->
|
||||
<script src="assets/modules/datatables/datatables.min.js"></script>
|
||||
<script src="assets/modules/datatables/DataTables-1.10.16/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="assets/modules/datatables/Select-1.2.4/js/dataTables.select.min.js"></script>
|
||||
<script src="assets/modules/jquery-ui/jquery-ui.min.js"></script>
|
||||
<script src="{{ asset('assets/modules/datatables/datatables.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/datatables/DataTables-1.10.16/js/dataTables.bootstrap4.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/datatables/Select-1.2.4/js/dataTables.select.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/jquery-ui/jquery-ui.min.js') }}"></script>
|
||||
|
||||
<!-- Page Specific JS File -->
|
||||
<script src="assets/js/page/modules-datatables.js"></script>
|
||||
<script src="{{ asset('assets/js/page/modules-datatables.js') }}"></script>
|
||||
|
||||
<!-- Template JS File -->
|
||||
<script src="assets/js/scripts.js"></script>
|
||||
<script src="assets/js/custom.js"></script>
|
||||
<script src="{{ asset('assets/js/scripts.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/custom.js') }}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.min.js"></script>
|
||||
<script src="assets/js/tablesort.js"></script>
|
||||
<script src="{{ asset('assets/js/tablesort.js') }}"></script>
|
||||
{{-- <script src="{{ asset('assets/js/main.js') }}"></script> --}}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const alertCloseButtons = document.querySelectorAll('.alert .btn-close');
|
||||
@ -196,11 +206,10 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="assets/modules/sweetalert/sweetalert.min.js"></script>
|
||||
|
||||
<script src="/assets/modules/sweetalert/sweetalert.min.js"></script>
|
||||
<!-- Page Specific JS File -->
|
||||
<script src="assets/js/page/modules-sweetalert.js"></script>
|
||||
<script>
|
||||
<script src="/assets/js/page/modules-sweetalert.js"></script>
|
||||
{{-- <script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
@ -238,7 +247,7 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script> --}}
|
||||
|
||||
</body>
|
||||
|
||||
|
@ -1,19 +1,22 @@
|
||||
<div class="main-sidebar sidebar-style-2">
|
||||
<aside id="sidebar-wrapper">
|
||||
<div class="sidebar-brand">
|
||||
<a href="index.html">REKBER</a>
|
||||
<a href="{{ route('admin.index') }}">REKBER</a>
|
||||
</div>
|
||||
<div class="sidebar-brand sidebar-brand-sm">
|
||||
<a href="index.html">RK</a>
|
||||
<a href="{{ route('admin.index') }}">RK</a>
|
||||
</div>
|
||||
<ul class="sidebar-menu">
|
||||
<li class="menu-header">Dashboard</li>
|
||||
<li><a class="nav-link active" href="/"><i class="fas fa-fire"></i> <span>Dashboard</span></a></li>
|
||||
<li><a class="nav-link active" href="{{ route('admin.index') }}"><i class="fas fa-fire"></i>
|
||||
<span>Dashboard</span></a></li>
|
||||
<li class="menu-header">Starter</li>
|
||||
<li><a class="nav-link" href="/list_user"><i class="far fa-user"></i> <span>User</span></a></li>
|
||||
<li><a class="nav-link" href="/history_transaction"><i
|
||||
<li><a class="nav-link" href="{{ route('admin-user.index') }}"><i class="far fa-user"></i>
|
||||
<span>User</span></a></li>
|
||||
<li><a class="nav-link" href="{{ route('admin-transaction.index') }}"><i
|
||||
class="fas fa-columns"></i><span>Transaction</span></a></li>
|
||||
<li><a class="nav-link" href="/history_refund"><i class="far fa-square"></i> <span>List Refund</span></a>
|
||||
<li><a class="nav-link" href="{{ route('admin-refund.index') }}"><i class="far fa-square"></i> <span>List
|
||||
Refund</span></a>
|
||||
</li>
|
||||
<li><a class="nav-link" href="/setting"><i class="fas fa-cog"></i> <span>Setting</span></a></li>
|
||||
</ul>
|
||||
|
62
resources/views/Admin/profile/index-2.blade.php
Normal file
62
resources/views/Admin/profile/index-2.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('Admin.layout.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Profile</h1>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-head">
|
||||
<img id="card_head" src="/assets/images/sampul.jpg"></img>
|
||||
</div>
|
||||
{{-- <div class="card-head"></div> --}}
|
||||
<div class="image-crop">
|
||||
<img id="avatar" src="/assets/images/dashboard/img_1.jpg"></img>
|
||||
</div><br>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div>
|
||||
<strong style="font-size: 20px; color: black;"><b>Tsalsabila Jilhan
|
||||
Haura</b></strong><br>
|
||||
Super Admin<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-id-card"></i></div>
|
||||
<div class="col-lg-9 col-md-8">94894893848</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-user"></i></div>
|
||||
<div class="col-lg-9 col-md-8">jilhan Haura</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-user-tag"></i></div>
|
||||
<div class="col-lg-9 col-md-8">Super Admin</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-map-marker-alt"></i></div>
|
||||
<div class="col-lg-9 col-md-8">Jl simpang komplek polda</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-phone"></i></div>
|
||||
<div class="col-lg-9 col-md-8">+62 1209 0120 02</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-1"><i class="fas fa-envelope"></i></div>
|
||||
<div class="col-lg-9 col-md-8">jilhan@gmail.com</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
@ -1,4 +1,4 @@
|
||||
@extends('Admin.layout.main')
|
||||
@extends('admin.layout.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
@ -60,11 +60,101 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</div>
|
||||
</form><!-- End settings Form -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade pt-3" id="profile-change-password">
|
||||
<!-- Change Password Form -->
|
||||
<form>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="currentPassword" class="col-md-4 col-lg-3 col-form-label">Current
|
||||
Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="password" type="password" class="form-control"
|
||||
id="currentPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="newPassword" class="col-md-4 col-lg-3 col-form-label">New
|
||||
Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="newpassword" type="password" class="form-control" id="newPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="renewPassword" class="col-md-4 col-lg-3 col-form-label">Re-enter New
|
||||
Password</label>
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<input name="renewpassword" type="password" class="form-control"
|
||||
id="renewPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Change Password</button>
|
||||
</div>
|
||||
</form><!-- End Change Password Form -->
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- End Bordered Tabs -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{{-- profile --}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Mendapatkan elemen-elemen tombol tab
|
||||
const editProfileTab = document.querySelector('[data-bs-target="#profile-edit"]');
|
||||
const settingsTab = document.querySelector('[data-bs-target="#profile-settings"]');
|
||||
const changePasswordTab = document.querySelector('[data-bs-target="#profile-change-password"]');
|
||||
const overviewTab = document.querySelector('[data-bs-target="#profile-overview"]');
|
||||
|
||||
// Menambahkan event listener untuk mengubah tab saat tombol diklik
|
||||
editProfileTab.addEventListener("click", function() {
|
||||
activateTabAndContent(editProfileTab, "#profile-edit");
|
||||
});
|
||||
|
||||
settingsTab.addEventListener("click", function() {
|
||||
activateTabAndContent(settingsTab, "#profile-settings");
|
||||
});
|
||||
|
||||
changePasswordTab.addEventListener("click", function() {
|
||||
activateTabAndContent(changePasswordTab, "#profile-change-password");
|
||||
});
|
||||
|
||||
// Menambahkan event listener untuk kembali ke tab "Overview"
|
||||
overviewTab.addEventListener("click", function() {
|
||||
activateTabAndContent(overviewTab, "#profile-overview");
|
||||
});
|
||||
|
||||
// Fungsi untuk mengaktifkan tab dan konten
|
||||
function activateTabAndContent(tabButton, tabContentId) {
|
||||
// Nonaktifkan tab aktif saat ini
|
||||
const activeTabButton = document.querySelector(".nav-link.active");
|
||||
const activeTabContent = document.querySelector(".tab-pane.active");
|
||||
|
||||
activeTabButton.classList.remove("active");
|
||||
activeTabContent.classList.remove("show", "active");
|
||||
|
||||
// Aktifkan tab yang dipilih
|
||||
tabButton.classList.add("active");
|
||||
|
||||
// Tampilkan konten tab yang dipilih
|
||||
const selectedTabContent = document.querySelector(tabContentId);
|
||||
selectedTabContent.classList.add("show", "active");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{-- profile --}}
|
||||
@endsection
|
||||
|
@ -1,4 +1,4 @@
|
||||
@extends('Admin.layout.main')
|
||||
@extends('admin.layout.main')
|
||||
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
@ -62,5 +62,5 @@
|
||||
|
||||
</section>
|
||||
</div>
|
||||
@include('Admin.refund.next-detail-refund')
|
||||
@include('admin.refund.modal-next-detail-refund')
|
||||
@endsection
|
||||
|
@ -1,11 +1,11 @@
|
||||
@extends('Admin.layout.main')
|
||||
@extends('admin.layout.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>History Refund</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="#">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{route('index')}}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item">Refund</div>
|
||||
<div class="breadcrumb-item">History</div>
|
||||
</div>
|
||||
@ -14,7 +14,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-1">
|
||||
<table class="table table-striped" id="table-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
@ -30,26 +30,16 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($history_refund as $HistoryRefund)
|
||||
@foreach ($refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $HistoryRefund['no'] }}</td>
|
||||
<td class="font-weight-600">{{ $HistoryRefund['orderId'] }}</a></td>
|
||||
<td class="font-weight-600">{{ $HistoryRefund['customer'] }}</td>
|
||||
<td class="font-weight-600">{{ $HistoryRefund['seller'] }}</td>
|
||||
<td class="font-weight-600">{{ $HistoryRefund['total'] }}</td>
|
||||
<td>{{ $HistoryRefund['date'] }}</td>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td class="font-weight-600">{{ $refund->orderId }}</a></td>
|
||||
<td class="font-weight-600">{{ $refund['customer'] }}</td>
|
||||
<td class="font-weight-600">{{ $refund['seller'] }}</td>
|
||||
<td class="font-weight-600">{{ $refund['total'] }}</td>
|
||||
<td>{{ $refund['date'] }}</td>
|
||||
<td>
|
||||
@php
|
||||
$refundStatus = '';
|
||||
if ($HistoryRefund['status'] === 'Refund Success') {
|
||||
$refundStatus = 'badge-success';
|
||||
} elseif ($HistoryRefund['status'] === 'Process Refund') {
|
||||
$refundStatus = 'badge-warning';
|
||||
} elseif ($HistoryRefund['status'] === 'Refunds Refused') {
|
||||
$refundStatus = 'badge-danger';
|
||||
}
|
||||
@endphp
|
||||
<div class="badge {{ $refundStatus }}">{{ $HistoryRefund['status'] }}</div>
|
||||
<div class="badge {{ $refund->status == 'Partial Refund' ? 'badge-succes' : ($refund->status == 'Pending' ? 'badge-info' : 'badge-warning') }}">{{ $refund->status }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
|
||||
<a href="/history_refund" class="btn btn-primary mx-1">Accept Refund</a>
|
||||
<a href="{{route('refund.index')}}" class="btn btn-primary mx-1">Accept Refund</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,11 +1,11 @@
|
||||
@extends('Admin.layout.main')
|
||||
@extends('admin.layout.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Setting</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="#">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{ route('index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item">Setting</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -17,39 +17,36 @@
|
||||
data-target="#ModalSetting">Add Data</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-1">
|
||||
<table class="table table-striped" id="table-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Bulan</th>
|
||||
<th>Tahun</th>
|
||||
<th>Persentase</th>
|
||||
<th>Persentase (%)</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($setting as $settings)
|
||||
@foreach ($settings as $setting)
|
||||
<tr>
|
||||
<td>{{ $settings['no'] }}</td>
|
||||
<td>{{ $settings['month'] }}</td>
|
||||
<td>{{ $settings['year'] }}</td>
|
||||
<td>{{ $settings['persentase'] }}</td>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ DateTime::createFromFormat('!m', $setting->bulan)->format('F') }}</td>
|
||||
<td>{{ $setting->tahun }}</td>
|
||||
<td>{{ $setting->persentase }}</td>
|
||||
{{-- <td hidden>{{$setting->id}}</td> --}}
|
||||
<td>
|
||||
@php
|
||||
$statusClass = '';
|
||||
if ($settings['status'] === 'Active') {
|
||||
$statusClass = 'badge-success';
|
||||
} elseif ($settings['status'] === 'Non Active') {
|
||||
$statusClass = 'badge-danger';
|
||||
}
|
||||
@endphp
|
||||
<div class="badge {{ $statusClass }}">{{ $settings['status'] }}</div>
|
||||
<div
|
||||
class="badge {{ $setting->status == 'Active' ? 'badge-success' : 'badge-danger' }}">
|
||||
{{ $setting->status }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" @if ($settings['status'] === 'Active') checked @endif>
|
||||
<span class="slider round" data-on-text="Yes" data-off-text="No"></span>
|
||||
<input type="checkbox" @if ($setting->status === 'Active') checked @endif
|
||||
data-id="{{ $setting->id }}">
|
||||
<span class="slider round" data-on-text="Yes" data-off-text="No"
|
||||
id="checkOnOf"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
@ -62,5 +59,59 @@
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@include('Admin.setting.add-Data')
|
||||
@include('admin.setting.modal-add-setting')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const table = $('#table-2').DataTable(); // Inisialisasi DataTable
|
||||
|
||||
$('#table-2').on('change', '.switch input[type="checkbox"]', function() {
|
||||
const parentRow = $(this).closest('tr');
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
const statusBadge = parentRow.find('.badge');
|
||||
const onText = $(this).next().data('on-text');
|
||||
const offText = $(this).next().data('off-text');
|
||||
const isChecked = $(this).prop('checked');
|
||||
let dataId = $(this).data("id");
|
||||
|
||||
const rowData = table.row(parentRow).data(); // Dapatkan data baris dari DataTable
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('admin-setting.update', ':admin_setting') }}".replace(':admin_setting', dataId),
|
||||
type: 'PUT',
|
||||
data: {
|
||||
_token: csrfToken,
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire({
|
||||
title: response.status ? 'Berhasil!' : 'Gagal!',
|
||||
text: response.message,
|
||||
icon: response.status ? 'success' : 'error',
|
||||
confirmButtonText: 'OK'
|
||||
}).then(function() {
|
||||
if (isChecked) {
|
||||
// location.reload();
|
||||
statusBadge.text(onText === 'Yes' ? 'Active' :
|
||||
'Nonactive');
|
||||
statusBadge.removeClass('badge-danger').addClass(
|
||||
'badge-success');
|
||||
} else {
|
||||
statusBadge.text(offText === 'No' ? 'Nonactive' :
|
||||
'Active');
|
||||
statusBadge.removeClass('badge-success').addClass(
|
||||
'badge-danger');
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(error) {
|
||||
Swal.fire({
|
||||
title:'Error!',
|
||||
text:'Terjadi error, '+error,
|
||||
icon:'error',
|
||||
confirmButtonText : 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user