Revisi user transaksi
This commit is contained in:
parent
ebd309e471
commit
1e13f9d925
@ -89,9 +89,9 @@ class UserContactController extends Controller
|
|||||||
|
|
||||||
public function cekEmail($email)
|
public function cekEmail($email)
|
||||||
{
|
{
|
||||||
$result = User::where('email', $email)->first();
|
$result = User::where('email', $email)->where('role','User')->first();
|
||||||
if ($result->isNotEmpty() && $result[0]->role == 'User' && $result[0]->status != 'Rejected') {
|
if ($result) {
|
||||||
if ($result[0]->status == 'Finished') {
|
if ($result->status == 'Finished') {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => true,
|
'status' => true,
|
||||||
'message' => $result,
|
'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>
|
<thead>
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
|
<th>Nama</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Name</th>
|
<th>No. HP</th>
|
||||||
<th>Phone</th>
|
<th>Aksi</th>
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -107,13 +107,24 @@
|
|||||||
showDenyButton: true,
|
showDenyButton: true,
|
||||||
denyButtonText: 'Tidak, jangan hapus',
|
denyButtonText: 'Tidak, jangan hapus',
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
|
||||||
if (result.isConfirmed) {
|
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({
|
$.ajaxSetup({
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRF-TOKEN': csrfToken
|
'X-CSRF-TOKEN': csrfToken
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{{ route('user-contact.destroy', ':id') }}".replace(
|
url: "{{ route('user-contact.destroy', ':id') }}".replace(
|
||||||
':id',
|
':id',
|
||||||
@ -129,6 +140,7 @@
|
|||||||
icon: response.status ? 'success' : 'error',
|
icon: response.status ? 'success' : 'error',
|
||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
if (response.status == true) {
|
if (response.status == true) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@ -141,6 +153,8 @@
|
|||||||
.message,
|
.message,
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -150,6 +164,8 @@
|
|||||||
text: 'Tidak ada kontak yang dihapus',
|
text: 'Tidak ada kontak yang dihapus',
|
||||||
icon: 'info',
|
icon: 'info',
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -160,6 +176,15 @@
|
|||||||
const email = document.querySelector('[name="email"]').value;
|
const email = document.querySelector('[name="email"]').value;
|
||||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
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({
|
$.ajaxSetup({
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRF-TOKEN': csrfToken
|
'X-CSRF-TOKEN': csrfToken
|
||||||
@ -170,8 +195,9 @@
|
|||||||
url: "{{ route('user-contact.email', ':email') }}".replace(':email', email),
|
url: "{{ route('user-contact.email', ':email') }}".replace(':email', email),
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
if (response.status) {
|
if (response.status) {
|
||||||
let status = response.message[0].status
|
let status = response.message.status
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: response.status ? 'Akun ditemukan' :
|
title: response.status ? 'Akun ditemukan' :
|
||||||
'Akun tidak ditemukan',
|
'Akun tidak ditemukan',
|
||||||
@ -181,7 +207,8 @@
|
|||||||
icon: response.status ? 'success' : 'error',
|
icon: response.status ? 'success' : 'error',
|
||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
});
|
});
|
||||||
let messages = response.message[0];
|
Swal.close();
|
||||||
|
let messages = response.message;
|
||||||
let hasil = "Nama : " + messages.nama_depan + " " + messages
|
let hasil = "Nama : " + messages.nama_depan + " " + messages
|
||||||
.nama_belakang +
|
.nama_belakang +
|
||||||
"\n" + "Email : " + messages.email + "\n" + "No. HP : " +
|
"\n" + "Email : " + messages.email + "\n" + "No. HP : " +
|
||||||
@ -195,6 +222,8 @@
|
|||||||
text: response.message,
|
text: response.message,
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
});
|
});
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
@ -205,7 +234,10 @@
|
|||||||
text: 'Gagal memuat data karena ' + error,
|
text: 'Gagal memuat data karena ' + error,
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
});
|
});
|
||||||
|
console.log(error.responseText)
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -219,6 +251,15 @@
|
|||||||
formData.append('email', email);
|
formData.append('email', email);
|
||||||
|
|
||||||
if (check) {
|
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({
|
$.ajaxSetup({
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRF-TOKEN': csrfToken
|
'X-CSRF-TOKEN': csrfToken
|
||||||
@ -238,6 +279,7 @@
|
|||||||
icon: response.status ? 'success' : 'error',
|
icon: response.status ? 'success' : 'error',
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
if (response.status == true) {
|
if (response.status == true) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@ -250,6 +292,8 @@
|
|||||||
title: 'Gagal',
|
title: 'Gagal',
|
||||||
text: 'Silahkan check email terlebih dahulu',
|
text: 'Silahkan check email terlebih dahulu',
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
}).then(function() {
|
||||||
|
Swal.close();
|
||||||
});
|
});
|
||||||
check = false;
|
check = false;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="modal fade" id="modalForm" role="dialog">
|
<div class="modal fade" id="modalForm" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@ -34,8 +34,7 @@
|
|||||||
<!-- Modal Footer -->
|
<!-- Modal Footer -->
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-primary submitBtn"
|
<button type="button" class="btn btn-primary submitBtn" id="tambahkanContact">Tambahkan Data</button>
|
||||||
id="tambahkanContact">Tambahkan Data</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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 fade" id="modaldetail" tabindex="-1" role="dialog" aria-labelledby="modalcontact" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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
|
Contact
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
|
@ -173,7 +173,7 @@
|
|||||||
'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
|
||||||
Chart.defaults.global.defaultFontColor = '#858796';
|
Chart.defaults.global.defaultFontColor = '#858796';
|
||||||
|
|
||||||
var ctx = document.getElementById("myChart1").getContext('2d');
|
var ctx = document.getElementById("myChart").getContext('2d');
|
||||||
var myChart = new Chart(ctx, {
|
var myChart = new Chart(ctx, {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||||
data-toggle="dropdown" aria-haspopup="true"
|
data-toggle="dropdown" aria-haspopup="true"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
Aksi
|
...
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item"
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="hero bg-primary text-white">
|
<div class="hero bg-primary text-white">
|
||||||
<div class="hero-inner">
|
<div class="hero-inner">
|
||||||
<h1>Selamat Datang! {{ Auth::user()->nama_depan }}</h1>
|
<h1>Halo!!!</h1>
|
||||||
<p class="lead">Mau belanja apa hari ini?</p>
|
<p class="lead">Selamat Datang {{ Auth::user()->nama_depan }}!</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
</label>
|
</label>
|
||||||
<h6>Pilih dari kontak</h6>
|
<h6>Pilih dari kontak</h6>
|
||||||
<div class="input-group">
|
<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>
|
</select>
|
||||||
<button class="btn btn-danger" type="button" id="deleteOption">Hapus</button>
|
<button class="btn btn-danger" type="button" id="deleteOption">Hapus</button>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="hero bg-primary text-white">
|
<div class="hero bg-primary text-white">
|
||||||
<div class="hero-inner">
|
<div class="hero-inner">
|
||||||
<h1>Hallo!!</h1>
|
<h1>Halo!!!</h1>
|
||||||
<p class="lead">Selamat Datang {{ Auth::user()->nama_depan }}!</p>
|
<p class="lead">Selamat Datang {{ Auth::user()->nama_depan }}!</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
{{-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> --}}
|
{{-- <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/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"
|
{{-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous">
|
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"> --}}
|
||||||
</script>
|
</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/popper.js') }}"></script>
|
||||||
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.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::post('user-contact','store')->name('user-contact.store');
|
||||||
Route::delete('user-contact/delete/{id}','destroy')->name('user-contact.destroy');
|
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/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
|
// Tampilan transaksi, bayar, update status pengiriman dan refund
|
||||||
|
Loading…
Reference in New Issue
Block a user