update kode
This commit is contained in:
parent
b180dcb437
commit
090a423485
|
|
@ -48,7 +48,7 @@ public function login(Request $request)
|
|||
return redirect()->route('admin.welcome');
|
||||
}
|
||||
|
||||
return redirect()->route('halaman-katalog');
|
||||
return redirect()->route('welcome');
|
||||
}
|
||||
|
||||
return back()->withErrors([
|
||||
|
|
@ -67,16 +67,14 @@ public function redirectToGoogle()
|
|||
public function handleGoogleCallback()
|
||||
{
|
||||
try {
|
||||
|
||||
$googleUser = Socialite::driver('google')->user();
|
||||
|
||||
$user = User::where('email_user', $googleUser->email)->first();
|
||||
|
||||
if (!$user) {
|
||||
|
||||
$user = User::create([
|
||||
'nama_user' => $googleUser->name,
|
||||
'email_user' => $googleUser->email,
|
||||
'no_hp' => null,
|
||||
'password_user' => bcrypt('google-login'),
|
||||
'role_user' => 'customer',
|
||||
'google_id' => $googleUser->id,
|
||||
|
|
@ -102,11 +100,10 @@ public function handleGoogleCallback()
|
|||
'tipe' => 'login'
|
||||
]);
|
||||
|
||||
return redirect()->route('halaman-katalog');
|
||||
return redirect()->route('welcome');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return redirect()->route('login')->with('error', 'Login Google gagal.');
|
||||
dd($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,13 +131,9 @@ public function kirim(Request $request)
|
|||
$apiKey = env('GROQ_API_KEY');
|
||||
|
||||
if (!$apiKey) {
|
||||
|
||||
return response()->json([
|
||||
|
||||
'reply' => 'API key tidak ditemukan!',
|
||||
|
||||
'options' => [],
|
||||
|
||||
'properti' => []
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public function approveBukti($id)
|
|||
|
||||
/**
|
||||
* ======================================
|
||||
* ADMIN - TOLAK BUKTI
|
||||
* ADMIN - TOLAK BUKTI PEMBAYARAN
|
||||
* ======================================
|
||||
*/
|
||||
public function rejectBukti($id)
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ public function update(Request $request, $id)
|
|||
|
||||
// KHUSUS PELUNASAN
|
||||
if (
|
||||
strtolower($request->progres) == 'pelunasan' &&
|
||||
strtolower($request->tahap_saat_ini) == 'pelunasan' &&
|
||||
$request->status != 'Selesai'
|
||||
) {
|
||||
|
||||
|
|
|
|||
|
|
@ -54,14 +54,21 @@ public function destroy($id)
|
|||
public function updateProfile(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|email|max:255'
|
||||
'nama_user' => 'required|string|max:255',
|
||||
'email_user' => 'required|email|max:255',
|
||||
'no_hp' => 'nullable|string|max:20',
|
||||
'password_user' => 'nullable|min:8',
|
||||
]);
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$user->name = $request->name;
|
||||
$user->email = $request->email;
|
||||
$user->nama_user = $request->nama_user;
|
||||
$user->email_user = $request->email_user;
|
||||
$user->no_hp = $request->no_hp;
|
||||
|
||||
if ($request->filled('password_user')) {
|
||||
$user->password_user = Hash::make($request->password_user);
|
||||
}
|
||||
|
||||
$user->save();
|
||||
|
||||
|
|
|
|||
|
|
@ -501,6 +501,24 @@
|
|||
border-color: #4a90b7;
|
||||
}
|
||||
|
||||
|
||||
.btn-delete-preview{
|
||||
position:absolute;
|
||||
top:8px;
|
||||
right:8px;
|
||||
width:30px;
|
||||
height:30px;
|
||||
border:none;
|
||||
border-radius:50%;
|
||||
background:#dc3545;
|
||||
color:#fff;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.btn-delete-preview:hover{
|
||||
background:#bb2d3b;
|
||||
}
|
||||
|
||||
.img-modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
|
|
@ -965,9 +983,9 @@ class="form-control"
|
|||
multiple>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="cekFile()">
|
||||
<!-- <button type="button" onclick="cekFile()">
|
||||
Cek File
|
||||
</button>
|
||||
</button> -->
|
||||
|
||||
<!-- Tombol -->
|
||||
<div class="form-actions">
|
||||
|
|
@ -1010,19 +1028,31 @@ function cekFile() {
|
|||
|
||||
function renderPreview() {
|
||||
container.innerHTML = '';
|
||||
|
||||
// Update isi input file
|
||||
const dataTransfer = new DataTransfer();
|
||||
|
||||
fileBuffer.forEach(file => {
|
||||
dataTransfer.items.add(file);
|
||||
});
|
||||
|
||||
fileInput.files = dataTransfer.files;
|
||||
fileBuffer.forEach((file, index) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e){
|
||||
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.classList.add('preview-item');
|
||||
|
||||
const img = document.createElement('img');
|
||||
img.src = e.target.result;
|
||||
img.classList.add('preview-img');
|
||||
|
||||
img.onclick = () => openModal(e.target.result);
|
||||
|
||||
const delBtn = document.createElement('button');
|
||||
delBtn.innerText = '×';
|
||||
delBtn.type = 'button';
|
||||
delBtn.classList.add('btn-delete-preview');
|
||||
delBtn.innerHTML = '<i class="fas fa-trash"></i>';
|
||||
|
||||
delBtn.onclick = () => {
|
||||
fileBuffer.splice(index,1);
|
||||
|
|
@ -1033,6 +1063,7 @@ function renderPreview() {
|
|||
wrapper.appendChild(delBtn);
|
||||
|
||||
container.appendChild(wrapper);
|
||||
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
|
|
|
|||
|
|
@ -778,23 +778,15 @@ class="profile-avatar"
|
|||
elseif ($index == $currentIndex) {
|
||||
|
||||
if ($pemesanan->status == 'Selesai') {
|
||||
|
||||
$class = 'done';
|
||||
|
||||
}
|
||||
elseif ($pemesanan->status == 'Ditolak') {
|
||||
|
||||
$class = 'rejected';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$class = 'active';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@endphp
|
||||
|
||||
<div class="timeline-step {{ $class }}">
|
||||
|
|
@ -844,8 +836,10 @@ class="profile-avatar"
|
|||
@endif
|
||||
|
||||
{{-- Tombol Invoice --}}
|
||||
@if($step['title'] == 'Pelunasan Pembayaran')
|
||||
|
||||
@if(
|
||||
$step['title'] == 'Pelunasan Pembayaran'
|
||||
&& $currentIndex >= $index
|
||||
)
|
||||
<div style="margin-top:10px;">
|
||||
<a href="{{ route('invoice', $pemesanan->transaksi->id_transaksi) }}"
|
||||
class="btn-invoice">
|
||||
|
|
@ -854,6 +848,16 @@ class="btn-invoice">
|
|||
</a>
|
||||
</div>
|
||||
@endif
|
||||
<!-- @if($step['title'] == 'Pelunasan Pembayaran')
|
||||
|
||||
<div style="margin-top:10px;">
|
||||
<a href="{{ route('invoice', $pemesanan->transaksi->id_transaksi) }}"
|
||||
class="btn-invoice">
|
||||
<i class="fas fa-file-invoice"></i>
|
||||
Lihat Invoice
|
||||
</a>
|
||||
</div>
|
||||
@endif -->
|
||||
</div>
|
||||
|
||||
<!-- TANGGAL / STATUS -->
|
||||
|
|
|
|||
|
|
@ -1254,7 +1254,7 @@ class="form-control"
|
|||
<span class="payment-detail-label">Nomor Rekening</span>
|
||||
|
||||
<span class="payment-detail-value rekening-highlight">
|
||||
1234567890
|
||||
1430033363555
|
||||
|
||||
<button type="button"
|
||||
class="copy-btn"
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@ class="profile-avatar"
|
|||
|
||||
}
|
||||
|
||||
$link = '#';
|
||||
$link = '';
|
||||
|
||||
/* =====================================================
|
||||
AMBIL DATA DASAR
|
||||
|
|
@ -721,14 +721,13 @@ class="profile-avatar"
|
|||
$pemesanan = \App\Models\Pemesanan::find($dokumen->id_pemesanan);
|
||||
|
||||
if ($dokumen->status_verifikasi == 'ditolak') {
|
||||
|
||||
$link = route('form-pemesanan', $dokumen->id_pemesanan);
|
||||
|
||||
} else {
|
||||
|
||||
$link = route('detail-pemesanan', $dokumen->id_pemesanan);
|
||||
}
|
||||
|
||||
|
||||
/* =====================================================
|
||||
MONITORING / TAHAP LAIN → DETAIL PEMESANAN
|
||||
===================================================== */
|
||||
|
|
|
|||
|
|
@ -775,9 +775,12 @@ class="profile-avatar-img">
|
|||
value="{{ $user->email_user }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div class="info-item full">
|
||||
<span class="info-label">Alamat</span>
|
||||
<textarea name="alamat" class="form-input">{{ $user->alamat }}</textarea>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Password</span>
|
||||
<input type="password"
|
||||
value="********"
|
||||
class="form-input"
|
||||
disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ class="form-control password-input @error('password') is-invalid @enderror"
|
|||
<span>atau</span>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('google.login') }}" class="btn btn-light w-100"
|
||||
<a href="{{ route('google.welcome') }}" class="btn btn-light w-100"
|
||||
style="
|
||||
border:2px solid #e2e8f0;
|
||||
padding:14px;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Mail\NotifikasiEmail;
|
||||
use App\Models\LeadEmail;
|
||||
use App\Http\Controllers\Auth\GoogleController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -198,10 +197,6 @@
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// LOGIN GOOGLE
|
||||
Route::get('/auth/google', [GoogleController::class, 'redirect'])->name('google.login');
|
||||
Route::get('/auth/google/callback', [GoogleController::class, 'callback']);
|
||||
|
||||
Route::get('/login', [AuthController::class, 'index'])->name('login');
|
||||
Route::post('/login', [AuthController::class, 'login'])->name('login.proses');
|
||||
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
|
||||
|
|
@ -322,7 +317,7 @@ function ($id) {
|
|||
|
||||
// EMAILLL
|
||||
Route::get('/auth/google', [AuthController::class, 'redirectToGoogle'])
|
||||
->name('google.login');
|
||||
->name('google.welcome');
|
||||
|
||||
Route::get('/auth/google/callback', [AuthController::class, 'handleGoogleCallback'])
|
||||
->name('google.callback');
|
||||
|
|
@ -1694,9 +1689,5 @@ function($message) use ($user){
|
|||
'pesan' => 'Ini email dari sistem 🚀'
|
||||
])
|
||||
);
|
||||
|
||||
return 'Email terkirim!';
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue