Revisi user transaksi
This commit is contained in:
parent
ebd309e471
commit
1e13f9d925
@ -89,9 +89,9 @@ class UserContactController extends Controller
|
||||
|
||||
public function cekEmail($email)
|
||||
{
|
||||
$result = User::where('email', $email)->first();
|
||||
if ($result->isNotEmpty() && $result[0]->role == 'User' && $result[0]->status != 'Rejected') {
|
||||
if ($result[0]->status == 'Finished') {
|
||||
$result = User::where('email', $email)->where('role','User')->first();
|
||||
if ($result) {
|
||||
if ($result->status == 'Finished') {
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => $result,
|
||||
|
3157
public/assets/modules/bootstrap/js/bootstrap.min.js
vendored
3157
public/assets/modules/bootstrap/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@ -27,10 +27,10 @@
|
||||
<thead>
|
||||
<tr class="text-center">
|
||||
<th>#</th>
|
||||
<th>Nama</th>
|
||||
<th>Email</th>
|
||||
<th>Name</th>
|
||||
<th>Phone</th>
|
||||
<th>Action</th>
|
||||
<th>No. HP</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -107,13 +107,24 @@
|
||||
showDenyButton: true,
|
||||
denyButtonText: 'Tidak, jangan hapus',
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
Swal.fire({
|
||||
html: '<div class="mt-3"><lord-icon src="https://cdn.lordicon.com/etwtznjn.json" trigger="loop" colors="primary:#0ab39c,secondary:#405189" style="width:120px;height:120px"></lord-icon><div class="mt-4 pt-2 fs-15"><h4>Form Anda sedang diproses!</h4><p class="text-muted mx-4 mb-0">Mohon tunggu...</p></div></div>',
|
||||
allowEscapeKey: false,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('user-contact.destroy', ':id') }}".replace(
|
||||
':id',
|
||||
@ -129,6 +140,7 @@
|
||||
icon: response.status ? 'success' : 'error',
|
||||
confirmButtonText: 'OK'
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
if (response.status == true) {
|
||||
location.reload();
|
||||
}
|
||||
@ -141,6 +153,8 @@
|
||||
.message,
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -150,6 +164,8 @@
|
||||
text: 'Tidak ada kontak yang dihapus',
|
||||
icon: 'info',
|
||||
confirmButtonText: 'OK',
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -160,6 +176,15 @@
|
||||
const email = document.querySelector('[name="email"]').value;
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
|
||||
Swal.fire({
|
||||
html: '<div class="mt-3"><lord-icon src="https://cdn.lordicon.com/etwtznjn.json" trigger="loop" colors="primary:#0ab39c,secondary:#405189" style="width:120px;height:120px"></lord-icon><div class="mt-4 pt-2 fs-15"><h4>Form Anda sedang diproses!</h4><p class="text-muted mx-4 mb-0">Mohon tunggu...</p></div></div>',
|
||||
allowEscapeKey: false,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
@ -170,8 +195,9 @@
|
||||
url: "{{ route('user-contact.email', ':email') }}".replace(':email', email),
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if (response.status) {
|
||||
let status = response.message[0].status
|
||||
let status = response.message.status
|
||||
Swal.fire({
|
||||
title: response.status ? 'Akun ditemukan' :
|
||||
'Akun tidak ditemukan',
|
||||
@ -181,7 +207,8 @@
|
||||
icon: response.status ? 'success' : 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
let messages = response.message[0];
|
||||
Swal.close();
|
||||
let messages = response.message;
|
||||
let hasil = "Nama : " + messages.nama_depan + " " + messages
|
||||
.nama_belakang +
|
||||
"\n" + "Email : " + messages.email + "\n" + "No. HP : " +
|
||||
@ -195,6 +222,8 @@
|
||||
text: response.message,
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
});
|
||||
check = false;
|
||||
}
|
||||
@ -205,7 +234,10 @@
|
||||
text: 'Gagal memuat data karena ' + error,
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK',
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
});
|
||||
console.log(error.responseText)
|
||||
check = false;
|
||||
}
|
||||
});
|
||||
@ -219,6 +251,15 @@
|
||||
formData.append('email', email);
|
||||
|
||||
if (check) {
|
||||
Swal.fire({
|
||||
html: '<div class="mt-3"><lord-icon src="https://cdn.lordicon.com/etwtznjn.json" trigger="loop" colors="primary:#0ab39c,secondary:#405189" style="width:120px;height:120px"></lord-icon><div class="mt-4 pt-2 fs-15"><h4>Form Anda sedang diproses!</h4><p class="text-muted mx-4 mb-0">Mohon tunggu...</p></div></div>',
|
||||
allowEscapeKey: false,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
@ -238,6 +279,7 @@
|
||||
icon: response.status ? 'success' : 'error',
|
||||
confirmButtonText: 'OK',
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
if (response.status == true) {
|
||||
location.reload();
|
||||
}
|
||||
@ -250,6 +292,8 @@
|
||||
title: 'Gagal',
|
||||
text: 'Silahkan check email terlebih dahulu',
|
||||
icon: 'error',
|
||||
}).then(function() {
|
||||
Swal.close();
|
||||
});
|
||||
check = false;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div class="modal fade" id="modalForm" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
@ -34,8 +34,7 @@
|
||||
<!-- Modal Footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary submitBtn"
|
||||
id="tambahkanContact">Tambahkan Data</button>
|
||||
<button type="button" class="btn btn-primary submitBtn" id="tambahkanContact">Tambahkan Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,34 +1,9 @@
|
||||
{{-- @extends('user.layout.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section"> --}}
|
||||
{{-- <div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Detail Contact</h2>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="container">
|
||||
@foreach ($detail_contact as $detail)
|
||||
<p><strong>Name:</strong> {{ $detail_contact->inputNama }}</p>
|
||||
<p><strong>No HP:</strong> {{ $detail_contact->inputNoHP }}</p>
|
||||
<p><strong>Email:</strong> {{ $detail_contact->inputEmail }}</p>
|
||||
<p><strong>Alamat:</strong> {{ $detail_contact->inputAlamat }}</p>
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
{{-- </section>
|
||||
</div>
|
||||
@endsection --}}
|
||||
|
||||
<div class="modal fade" id="modaldetail" tabindex="-1" role="dialog" aria-labelledby="modalcontact" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mx-auto" style="margin-right: auto; margin-left: auto; font-size: 1.2em;" id="modalcontact">Detail
|
||||
<h4 class="modal-title mx-auto" style="margin-right: auto; margin-left: auto; font-size: 1.2em;"
|
||||
id="modalcontact">Detail
|
||||
Contact
|
||||
</h4>
|
||||
</div>
|
||||
|
@ -173,7 +173,7 @@
|
||||
'-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 ctx = document.getElementById("myChart").getContext('2d');
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
|
@ -46,7 +46,7 @@
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
Aksi
|
||||
...
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item"
|
||||
|
@ -15,8 +15,8 @@
|
||||
<div class="col-12 mb-4">
|
||||
<div class="hero bg-primary text-white">
|
||||
<div class="hero-inner">
|
||||
<h1>Selamat Datang! {{ Auth::user()->nama_depan }}</h1>
|
||||
<p class="lead">Mau belanja apa hari ini?</p>
|
||||
<h1>Halo!!!</h1>
|
||||
<p class="lead">Selamat Datang {{ Auth::user()->nama_depan }}!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +31,8 @@
|
||||
</label>
|
||||
<h6>Pilih dari kontak</h6>
|
||||
<div class="input-group">
|
||||
<select class="form-control" id="selectContact" name="select_penjual">
|
||||
<select class="form-control" id="selectContact" name="select_penjual"
|
||||
style="width: 89%">
|
||||
|
||||
</select>
|
||||
<button class="btn btn-danger" type="button" id="deleteOption">Hapus</button>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div class="col-12 mb-4">
|
||||
<div class="hero bg-primary text-white">
|
||||
<div class="hero-inner">
|
||||
<h1>Hallo!!</h1>
|
||||
<h1>Halo!!!</h1>
|
||||
<p class="lead">Selamat Datang {{ Auth::user()->nama_depan }}!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,9 +6,10 @@
|
||||
{{-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> --}}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous">
|
||||
{{-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"> --}}
|
||||
</script>
|
||||
{{-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> --}}
|
||||
<script src="{{ asset('assets/modules/popper.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
|
||||
|
@ -142,7 +142,7 @@ Route::middleware(['auth'])->group(function(){
|
||||
Route::post('user-contact','store')->name('user-contact.store');
|
||||
Route::delete('user-contact/delete/{id}','destroy')->name('user-contact.destroy');
|
||||
Route::get('user-contact/get-user-contact','getContact')->name('user-contact.get');
|
||||
Route::get('user-contact/cek-contact/{email}','checkEmail')->name('user-contact.email');
|
||||
Route::get('user-contact/cek-contact/{email}','cekEmail')->name('user-contact.email');
|
||||
});
|
||||
|
||||
// Tampilan transaksi, bayar, update status pengiriman dan refund
|
||||
|
Loading…
Reference in New Issue
Block a user