Merge branch 'master' of https://git.abbauf.com/MAGANG_TB_dan_PNP_2023/Aplikasi_Rekber into oktaaa
This commit is contained in:
commit
783c542f2d
@ -191,6 +191,7 @@ class PembeliApiController extends Controller
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil menambahkan transaksi. Silahkan lakukan pembayaran.',
|
||||
'url' => $result['redirect_url']
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
@ -243,6 +244,7 @@ class PembeliApiController extends Controller
|
||||
|
||||
public function payPayment(Request $request)
|
||||
{
|
||||
|
||||
$auth = base64_encode(env('MIDTRANS_SERVER_KEY'));
|
||||
|
||||
$response = Http::withOptions([
|
||||
@ -351,8 +353,6 @@ class PembeliApiController extends Controller
|
||||
'message' => 'Transaksi pembayaran gagal.',
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json();
|
||||
}
|
||||
|
||||
public function cancelPayment(Request $request)
|
||||
@ -574,7 +574,7 @@ class PembeliApiController extends Controller
|
||||
'status' => false,
|
||||
'message' => 'Pembayaran sudah expire, silahkan buat transaksi baru.',
|
||||
]);
|
||||
} elseif ($result['transaction'] == 'failure') {
|
||||
} elseif ($result['transaction_status'] == 'failure') {
|
||||
TransactionDescription::create([
|
||||
'transaction_id' => $request->input('id'),
|
||||
'status' => 'failure',
|
||||
|
@ -59,7 +59,7 @@ class PenjualApiController extends Controller
|
||||
$params = [
|
||||
'refund_key' => $request->input('id') . '-ref1',
|
||||
'amount' => $transaction->total_bayar,
|
||||
'reason' => $request->complaint,
|
||||
'reason' => $request->input('complaint'),
|
||||
];
|
||||
|
||||
$auth = base64_encode(env('MIDTRANS_SERVER_KEY'));
|
||||
@ -91,7 +91,7 @@ class PenjualApiController extends Controller
|
||||
'total' => $transaction->total_bayar,
|
||||
'due_date' => now(),
|
||||
'status' => 'refund',
|
||||
'complaint' => $request->complaint,
|
||||
'complaint' => $request->input('complaint'),
|
||||
]);
|
||||
|
||||
TransactionDescription::create([
|
||||
@ -100,7 +100,7 @@ class PenjualApiController extends Controller
|
||||
'background' => 'bg-seller',
|
||||
'user' => auth()->user()->email,
|
||||
'judul' => 'fas fa-times',
|
||||
'deskripsi' => 'Transaksi ditolak ' . auth()->user()->nama_depan . ', uang akan dikembalikan ke pembeli. Alasan : ' . $request->complaint,
|
||||
'deskripsi' => 'Transaksi ditolak ' . auth()->user()->nama_depan . ', uang akan dikembalikan ke pembeli. Alasan : ' . $request->input('complaint'),
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
@ -339,4 +339,39 @@ class PenjualApiController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function acceptResult(Request $request){
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
|
||||
Transaction::where('id', $request->input('id'))->update([
|
||||
'status_transaction' => 'done'
|
||||
]);
|
||||
|
||||
TransactionDescription::create([
|
||||
'transaction_id' => $request->input('id'),
|
||||
'status' => 'sent',
|
||||
'background' => 'bg-seller',
|
||||
'user' => auth()->user()->email,
|
||||
'judul' => 'fas fa-money-bill',
|
||||
'deskripsi' => auth()->user()->nama_depan.' telah menerima uang.',
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Uang akan dikirim ke bank anda. Terima kasih telah menggunakan Rekber.'
|
||||
]);
|
||||
}catch(Throwable $e){
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Gagal update status karena kesalahan server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,25 +20,17 @@ class ProfileApiController extends Controller
|
||||
{
|
||||
public function getProfile()
|
||||
{
|
||||
$provinces = Provinsi::where('code', auth()->user()->village->district->city->province->code)->get();
|
||||
$cities = City::where('province_code', auth()->user()->village->district->city->province->code)->get();
|
||||
$districts = District::where('city_code', auth()->user()->village->district->city->code)->get();
|
||||
$villages = Village::where('district_code', auth()->user()->village->district->code)->get();
|
||||
$token = JWTAuth::getToken();
|
||||
$user = JWTAuth::user($token);
|
||||
return response()->json([
|
||||
'user' => $user,
|
||||
'provinces' => $provinces,
|
||||
'cities' => $cities,
|
||||
'districts' => $districts,
|
||||
'villages' => $villages
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateProfile(Request $request)
|
||||
{
|
||||
$nama_depan = str_replace(' ', '_', $request->input('nama_depan'));
|
||||
$nama_belakang = str_replace(' ', '_', $request->input('nama_belakang'));
|
||||
$nama_depan = $request->input('nama_depan');
|
||||
$nama_belakang = $request->input('nama_belakang');
|
||||
$nohp = $request->input('nohp');
|
||||
$kode_kelurahan = $request->input('kelurahan');
|
||||
$alamat = $request->input('alamat');
|
||||
@ -47,7 +39,7 @@ class ProfileApiController extends Controller
|
||||
$foto_profile = '';
|
||||
if ($request->hasFile('foto')) {
|
||||
$file = $request->file('foto');
|
||||
$foto_profile = 'Foto_Profil_' . $nama_depan . '_' . $nama_belakang .'.'. $file->getClientOriginalExtension();
|
||||
$foto_profile = 'Foto_Profil_' . str_replace(' ', '_', $request->input('nama_depan')) . '_' . str_replace(' ', '_', $request->input('nama_belakang')).'.'. $file->getClientOriginalExtension();
|
||||
$path = 'foto-profile/' . $foto_profile;
|
||||
|
||||
Storage::disk('public')->put($path, file_get_contents($file));
|
||||
@ -80,12 +72,12 @@ class ProfileApiController extends Controller
|
||||
}
|
||||
|
||||
public function updateProfilePassword(Request $request){
|
||||
$currentPassword = $request->input('currentPassword');
|
||||
$newPassword = $request->input('newPassword');
|
||||
$renewPassword = $request->input('renewPassword');
|
||||
$currentPassword = $request->input('current_password');
|
||||
$newPassword = $request->input('new_password');
|
||||
$renewPassword = $request->input('renew_password');
|
||||
|
||||
if(!Hash::check($currentPassword, auth()->user()->password)){
|
||||
return response()->json(['status' => false, 'message' => 'Password sekarang tidak sama','password' => $currentPassword]);
|
||||
return response()->json(['status' => false, 'message' => 'Password sekarang tidak sama']);
|
||||
}
|
||||
|
||||
if($renewPassword != $newPassword){
|
||||
|
@ -12,6 +12,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\TransactionDescription;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class RefundApiController extends Controller
|
||||
{
|
||||
@ -83,7 +84,7 @@ class RefundApiController extends Controller
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,4 +96,75 @@ class RefundApiController extends Controller
|
||||
'descriptions' => $refundDescription
|
||||
]);
|
||||
}
|
||||
|
||||
public function listRefund(Request $request)
|
||||
{
|
||||
try{
|
||||
$subQuery = Refund::join('transactions', 'refunds.transaction_id', '=', 'transactions.id')
|
||||
->join('users as s', 'transactions.penjual','=','s.email')
|
||||
->select(
|
||||
'refunds.id',
|
||||
'refunds.total',
|
||||
'refunds.due_date',
|
||||
'refunds.created_at',
|
||||
'refunds.status',
|
||||
'transactions.nama_barang',
|
||||
DB::raw("CONCAT(s.nama_depan,' ',s.nama_belakang) as nama_penjual"),
|
||||
);
|
||||
|
||||
if($request->has('search') && !empty($request->search['value'])){
|
||||
$searchRefund = $request->search['value'];
|
||||
if(!is_numeric($searchRefund)){
|
||||
$subQuery->where(function($a) use ($searchRefund){
|
||||
$a->whereRaw("LOWER(CONCAT(s.nama_depan,' ',s.nama_belakang)) LIKE ?",['%'.strtolower($searchRefund).'%'])
|
||||
->orWhereRaw('LOWER(transactions.nama_barang) LIKE ?',['%'.strtolower($searchRefund).'%'])
|
||||
->orWhereRaw('LOWER(refunds.status) LIKE ?',['%'.strtolower($searchRefund).'%']);
|
||||
});
|
||||
}else{
|
||||
$subQuery->where(function($a) use ($searchRefund){
|
||||
$a->whereDay('refunds.created_at', '=', $searchRefund)
|
||||
->orWhereMonth('refunds.created_at', '=', $searchRefund)
|
||||
->orWhereYear('refunds.created_at', '=', $searchRefund)
|
||||
->orWhereDay('refunds.due_date', '=', $searchRefund)
|
||||
->orWhereMonth('refunds.due_date', '=', $searchRefund)
|
||||
->orWhereYear('refunds.due_date', '=', $searchRefund)
|
||||
->orWhere('refunds.total', '=', $searchRefund);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$queryRefund = Refund::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
->mergeBindings($subQuery->getQuery()) // Menggabungkan binding parameters
|
||||
->select('*')
|
||||
->get();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return DataTables::of($queryRefund)
|
||||
->addIndexColumn()
|
||||
->addColumn('action', function ($row) {
|
||||
$url = route('user-refund.show', ['id' => $row->id]);
|
||||
$html_code = '
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
....
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item"
|
||||
href="'.$url.'">Detail</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>';
|
||||
return $html_code;
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->make(true);
|
||||
}
|
||||
}catch(Throwable $e){
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers\Admin\Dashboard;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Transactions;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Refund;
|
||||
use App\Models\User;
|
||||
@ -15,7 +14,6 @@ class AdminDashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$transactions = Transactions::allTransactions();
|
||||
$currentMonth = Carbon::now()->month;
|
||||
$currentYear = Carbon::now()->year;
|
||||
|
||||
@ -73,7 +71,7 @@ class AdminDashboardController extends Controller
|
||||
return view('admin.index', compact('transactions', 'countSuccess', 'countPending', 'countCancelled', 'countRefund', 'totalRefund', 'totalUser', 'totalTransaction', 'dataChartTransaction', 'dataChartRefund', 'dataChartTotalUser', 'dataChartTotalRefund', 'transactions'));
|
||||
}
|
||||
|
||||
public function getChartByMonth()
|
||||
public function getSelectedChart()
|
||||
{
|
||||
$dataChartLaporan = [];
|
||||
$tahun = Carbon::now()->year;
|
||||
|
325
app/Http/Controllers/Admin/Notification/AdminNotification.php
Normal file
325
app/Http/Controllers/Admin/Notification/AdminNotification.php
Normal file
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Notification;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Notification;
|
||||
use App\Models\NotificationReceiver;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
use Illuminate\Support\Str;
|
||||
use Pusher\Pusher;
|
||||
|
||||
class AdminNotification extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('admin.notification.index');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('admin.notification.create');
|
||||
}
|
||||
|
||||
public function show(Request $request)
|
||||
{
|
||||
$notification = Notification::where('id', $request->id)->first();
|
||||
return view('admin.notification.show', compact('notification'));
|
||||
}
|
||||
|
||||
public function selectAllUser()
|
||||
{
|
||||
$users = User::where('role', 'User')
|
||||
->where('status', 'Finished')
|
||||
->pluck('email')
|
||||
->toArray();
|
||||
return response()->json([
|
||||
'users' => $users,
|
||||
]);
|
||||
}
|
||||
|
||||
public function listNotification(Request $request)
|
||||
{
|
||||
try {
|
||||
$subQuery = Notification::latest()->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notifications.created_at');
|
||||
|
||||
if ($request->has('search') && !empty($request->search['value'])) {
|
||||
$searchNotif = $request->search['value'];
|
||||
$subQuery->where(function ($a) use ($searchNotif) {
|
||||
$a->whereRaw('LOWER(notifications.title) LIKE ?', ['%' . strtolower($searchNotif) . '%'])
|
||||
->orWhereRaw('LOWER(notifications.teaser) LIKE ?', ['%' . strtolower($searchNotif) . '%']);
|
||||
});
|
||||
}
|
||||
|
||||
$queryNotif = Notification::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
->mergeBindings($subQuery->getQuery())
|
||||
->select('*')
|
||||
->get();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return DataTables::of($queryNotif)
|
||||
->addIndexColumn()
|
||||
->addColumn('action', function ($row) {
|
||||
$detail = route('admin-notification.show', ['id' => $row->id]);
|
||||
$edit = route('admin-notification.edit', ['id' => $row->id]);
|
||||
$html_code =
|
||||
'
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
....
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item" href="' .
|
||||
$detail .
|
||||
'">Detail</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="' .
|
||||
$edit .
|
||||
'">Edit</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" id="deleteNotif" data-id="' .
|
||||
$row->id .
|
||||
'">Hapus</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
';
|
||||
return $html_code;
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->make(true);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
|
||||
public function listUserForShow(Request $request)
|
||||
{
|
||||
try {
|
||||
$subQuery = NotificationReceiver::join('users', 'notification_receivers.receiver', '=', 'users.email')
|
||||
->join('notifications', 'notification_receivers.notification_id', '=', 'notifications.id')
|
||||
->where('notification_receivers.notification_id', $request->id)
|
||||
->latest()
|
||||
->select(DB::raw("CONCAT(users.nama_depan,' ', users.nama_belakang) as nama_lengkap"), 'notification_receivers.created_at', 'notification_receivers.updated_at', 'notification_receivers.receiver');
|
||||
|
||||
if ($request->has('search') && !empty($request->search['value'])) {
|
||||
$searchNotif = $request->search['value'];
|
||||
if (!is_numeric($searchNotif)) {
|
||||
$subQuery->where(function ($a) use ($searchNotif) {
|
||||
$a->whereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchNotif) . '%']);
|
||||
});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
$queryNotif = NotificationReceiver::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
->mergeBindings($subQuery->getQuery())
|
||||
->select('*')
|
||||
->get();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return DataTables::of($queryNotif)
|
||||
->addIndexColumn()
|
||||
->make(true);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
|
||||
public function listUserForCreateEdit(Request $request)
|
||||
{
|
||||
try {
|
||||
$subQuery = User::latest()
|
||||
->where('users.status', '=', 'Finished')
|
||||
->where('users.role', '=', 'User')
|
||||
->select(DB::raw("CONCAT(users.nama_depan,' ', users.nama_belakang) as nama_lengkap"), 'users.email');
|
||||
|
||||
if ($request->has('search') && !empty($request->search['value'])) {
|
||||
$searchUser = $request->search['value'];
|
||||
$subQuery->where(function ($a) use ($searchUser) {
|
||||
$a->whereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchUser) . '%'])->orWhereRaw('LOWER(users.email) LIKE ?', ['%' . strtolower($searchUser) . '%']);
|
||||
});
|
||||
}
|
||||
|
||||
$queryUser = User::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
->mergeBindings($subQuery->getQuery())
|
||||
->select('*')
|
||||
->get();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return DataTables::of($queryUser)
|
||||
->addIndexColumn()
|
||||
->make(true);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$notif = Notification::create([
|
||||
'title' => $request->title,
|
||||
'content' => $request->content,
|
||||
'teaser' => Str::limit($request->content, 20, '...'),
|
||||
]);
|
||||
|
||||
foreach ($request->receivers as $receiver) {
|
||||
NotificationReceiver::create([
|
||||
'receiver' => $receiver,
|
||||
'notification_id' => $notif->id,
|
||||
]);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil membuat notifikasi dan akan dikirim ke pengguna.',
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Terjadi kesalahan di server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
Notification::destroy($request->id);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil menghapus notifikasi.',
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Terjadi kesalahan di server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteAll()
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
Notification::truncate();
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil menghapus semua notifikasi.',
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Terjadi kesalahan di server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function edit(Request $request)
|
||||
{
|
||||
$notification = Notification::where('id', $request->id)->first();
|
||||
$email = NotificationReceiver::where('notification_id', $request->id)
|
||||
->pluck('receiver')
|
||||
->toArray();
|
||||
return view('admin.notification.edit', compact('notification', 'email'));
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
Notification::where('id', $request->id)->update([
|
||||
'title' => $request->title,
|
||||
'content' => $request->content,
|
||||
'teaser' => Str::limit($request->content, 20, '...'),
|
||||
]);
|
||||
|
||||
NotificationReceiver::where('notification_id', $request->id)->delete();
|
||||
|
||||
foreach ($request->receivers as $receiver) {
|
||||
NotificationReceiver::create([
|
||||
'receiver' => $receiver,
|
||||
'notification_id' => $request->id,
|
||||
]);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil update notifikasi dan akan dikirim ke pengguna.',
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Terjadi kesalahan di server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateNewNotification(Request $request)
|
||||
{
|
||||
$options = [
|
||||
'cluster' => 'ap1',
|
||||
'useTLS' => true,
|
||||
];
|
||||
|
||||
$pusher = new Pusher('3e5bdc20dddd7fbc655e', 'f2274c37c616d29ff590', '1659859', $options);
|
||||
|
||||
$payload = [
|
||||
'receivers' => $request->receivers,
|
||||
];
|
||||
|
||||
$pusher->trigger('chanel-update-notifikasi', 'event-update-notifikasi', $payload);
|
||||
}
|
||||
}
|
@ -35,16 +35,23 @@ class AdminUserController extends Controller
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
try {
|
||||
$result = User::destroy($request->id);
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => 'Berhasil hapus data',
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
DB::beginTransaction();
|
||||
|
||||
User::destroy($request->id);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Gagal hapus data, karena ' . $e,
|
||||
'message' => 'Berhasil hapus data',
|
||||
'status' => true,
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Terjadi kesalahan di server',
|
||||
'status' => false,
|
||||
]);
|
||||
}
|
||||
@ -52,11 +59,11 @@ class AdminUserController extends Controller
|
||||
|
||||
public function approveUser(Request $request)
|
||||
{
|
||||
try{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
User::where('id', $request->id)->update([
|
||||
'status' => 'Finished'
|
||||
'status' => 'Finished',
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
@ -65,7 +72,7 @@ class AdminUserController extends Controller
|
||||
'message' => 'Akun telah disetujui dan dapat digunakan',
|
||||
'status' => true,
|
||||
]);
|
||||
}catch(Throwable $e){
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
@ -74,12 +81,12 @@ class AdminUserController extends Controller
|
||||
|
||||
public function denyUser(Request $request)
|
||||
{
|
||||
try{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
User::where('id', $request->id)->update([
|
||||
'status' => 'Rejected',
|
||||
'keterangan' => $request->keterangan
|
||||
'keterangan' => $request->keterangan,
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
@ -88,8 +95,7 @@ class AdminUserController extends Controller
|
||||
'message' => 'Akun telah ditolak dan tidak dapat digunakan',
|
||||
'status' => true,
|
||||
]);
|
||||
|
||||
}catch(Throwable $e){
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
@ -106,16 +112,14 @@ class AdminUserController extends Controller
|
||||
|
||||
if ($request->has('search') && !empty($request->search['value'])) {
|
||||
$searchUser = $request->search['value'];
|
||||
if(!is_numeric($searchUser)){
|
||||
if (!is_numeric($searchUser)) {
|
||||
$subQuery->where(function ($a) use ($searchUser) {
|
||||
$a->whereRaw('LOWER(email) LIKE ?', ['%' . strtolower($searchUser) . '%'])
|
||||
->orWhereRaw("LOWER(CONCAT(users.nama_depan,' ',users.nama_belakang)) LIKE ?", ['%' . strtolower($searchUser) . '%'])
|
||||
->orWhereRaw('LOWER(status) LIKE ?',['%'.strtolower($searchUser).'%']);
|
||||
->orWhereRaw('LOWER(status) LIKE ?', ['%' . strtolower($searchUser) . '%']);
|
||||
});
|
||||
}else{
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$queryUser = User::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
@ -128,7 +132,8 @@ class AdminUserController extends Controller
|
||||
->addIndexColumn()
|
||||
->addColumn('action', function ($row) {
|
||||
$url = route('admin-user.show', ['id' => $row->id]);
|
||||
$html_code = '
|
||||
$html_code =
|
||||
'
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@ -137,7 +142,9 @@ class AdminUserController extends Controller
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item"
|
||||
href="'.$url.'">Detail</a>
|
||||
href="' .
|
||||
$url .
|
||||
'">Detail</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>';
|
||||
|
@ -18,11 +18,11 @@ class InvoiceController extends Controller
|
||||
|
||||
public function exportInvoice(Request $request)
|
||||
{
|
||||
// $transaction = Transaction::findOrFail($request->id);
|
||||
// $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait');
|
||||
// return $pdf->download("invoice-$request->id.pdf");
|
||||
return view('invoice.export-invoice', [
|
||||
'transaction' => Transaction::findOrFail($request->id),
|
||||
]);
|
||||
$transaction = Transaction::findOrFail($request->id);
|
||||
$pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait');
|
||||
return $pdf->download("invoice-".uniqid().".pdf");
|
||||
// return view('invoice.export-invoice', [
|
||||
// 'transaction' => Transaction::findOrFail($request->id),
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
@ -421,6 +421,6 @@ class LoginController extends Controller
|
||||
|
||||
// $transaction = Transaction::findOrFail('80d9b19b-ba17-4aea-8cad-c3b4661d33bc');
|
||||
$pdf = Pdf::loadView('invoice.export-invoice')->setPaper('A4','portrait');
|
||||
return $pdf->download("invoice-80d9b19b-ba17-4aea-8cad-c3b4661d33b-".uniqid().".pdf");
|
||||
return $pdf->download("invoice-".uniqid().".pdf");
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ namespace App\Http\Controllers\User\Dashboard;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\RefundUser;
|
||||
use App\Models\Transaction;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@ -12,9 +14,46 @@ use Throwable;
|
||||
|
||||
class UserDashboardController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
return view('user.index',[
|
||||
"refundUserss"=>RefundUser::HistoryRefundUser(),
|
||||
]);
|
||||
public function index()
|
||||
{
|
||||
$currentMonth = Carbon::now()->month;
|
||||
$currentYear = Carbon::now()->year;
|
||||
$currentRole = 'Pembeli';
|
||||
|
||||
$countCreated = Transaction::where('status_transaksi', 'created')
|
||||
->whereMonth('updated_at', $currentMonth)
|
||||
->whereYear('updated_at', $currentYear)
|
||||
->where('pembeli', auth()->user()->email)
|
||||
->count();
|
||||
|
||||
$countPending = Transaction::where('status_pembayaran', 'pending')
|
||||
->whereMonth('updated_at', $currentMonth)
|
||||
->whereYear('updated_at', $currentYear)
|
||||
->where('pembeli', auth()->user()->email)
|
||||
->count();
|
||||
|
||||
$countFailure = Transaction::whereIn('status_pembayaran', ['cancel', 'expire', 'failure'])
|
||||
->whereMonth('updated_at', $currentMonth)
|
||||
->whereYear('updated_at', $currentYear)
|
||||
->where('pembeli', auth()->user()->email)
|
||||
->count();
|
||||
|
||||
$sumRefund = '';
|
||||
|
||||
$sumTransaksi = '';
|
||||
|
||||
return view('user.index');
|
||||
}
|
||||
|
||||
public function getSelectedChart(){
|
||||
$currentMonth = Carbon::now()->month;
|
||||
$currentYear = Carbon::now()->year;
|
||||
$currentRole = 'Pembeli';
|
||||
|
||||
if($currentRole == 'Pembeli'){
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
126
app/Http/Controllers/User/Notification/UserNotification.php
Normal file
126
app/Http/Controllers/User/Notification/UserNotification.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\User\Notification;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Notification;
|
||||
use App\Models\NotificationReceiver;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class UserNotification extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('user.notification.index');
|
||||
}
|
||||
|
||||
public function ListNotification(Request $request)
|
||||
{
|
||||
try {
|
||||
$subQuery = Notification::join('notification_receivers','notifications.id','=','notification_receivers.notification_id')
|
||||
->where('notification_receivers.receiver','=',auth()->user()->email)
|
||||
->latest()
|
||||
->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notification_receivers.created_at', 'notification_receivers.status');
|
||||
|
||||
if ($request->has('search') && !empty($request->search['value'])) {
|
||||
$searchNotif = $request->search['value'];
|
||||
$subQuery->where(function ($a) use ($searchNotif) {
|
||||
$a->whereRaw('LOWER(notifications.title) LIKE ?', ['%' . strtolower($searchNotif) . '%'])
|
||||
->orWhereRaw('LOWER(notifications.teaser) LIKE ?', ['%' . strtolower($searchNotif) . '%']);
|
||||
});
|
||||
}
|
||||
|
||||
$queryNotif = Notification::from(DB::raw("({$subQuery->toSql()}) as tmp"))
|
||||
->mergeBindings($subQuery->getQuery())
|
||||
->select('*')
|
||||
->get();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return DataTables::of($queryNotif)
|
||||
->addIndexColumn()
|
||||
->addColumn('action', function ($row) {
|
||||
$detail = route('user-notifiaction.detail-notification', ['id' => $row->id]);
|
||||
$html_code =
|
||||
'
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
....
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item" href="' .
|
||||
$detail .
|
||||
'">Detail</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
';
|
||||
return $html_code;
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->make(true);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json(['success' => false, 'message' => 'Terjadi Kesalahan pada sisi server']);
|
||||
}
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$notification = Notification::where('id', $id)->first();
|
||||
|
||||
NotificationReceiver::where('notification_id', $id)
|
||||
->where('receiver', auth()->user()->email)
|
||||
->update([
|
||||
'status' => 'read',
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return view('user.notification.detail-notification', compact('notification'));
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
public function latestNotification()
|
||||
{
|
||||
$notifications = NotificationReceiver::join('notifications', 'notification_receivers.notification_id', '=', 'notifications.id')
|
||||
->where('receiver', auth()->user()->email)
|
||||
->where('status', 'unread')
|
||||
->select('notifications.id', 'notifications.title', 'notifications.teaser', 'notifications.updated_at')
|
||||
->latest('notifications.updated_at')
|
||||
->limit(4)
|
||||
->get();
|
||||
return response()->json([
|
||||
'notifications' => $notifications,
|
||||
]);
|
||||
}
|
||||
|
||||
public function markAllAsRead()
|
||||
{
|
||||
NotificationReceiver::where('receiver', auth()->user()->email)->update([
|
||||
'status' => 'read',
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Berhasil',
|
||||
]);
|
||||
}
|
||||
}
|
@ -228,14 +228,14 @@ class PembeliController extends Controller
|
||||
'background' => 'bg-buyer',
|
||||
'user' => auth()->user()->email,
|
||||
'judul' => 'fas fa-check',
|
||||
'deskripsi' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '.',
|
||||
'deskripsi' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '. Uang akan dikirim ke penjual.',
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Pesanan telah diselesaikan oleh ' . auth()->user()->nama_depan . '.',
|
||||
'message' => 'Pesanan anda selesai dan uang akan dikirim ke penjual. Terima kasih telah menggunakan Rekber.',
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
@ -319,7 +319,7 @@ class PembeliController extends Controller
|
||||
'status' => 'challenge',
|
||||
'background' => 'bg-primary',
|
||||
'judul' => 'fas fa-clock',
|
||||
'deskripsi' => 'Transaksi ' . auth()->user()->email . ' terindikasi masalah, tunggu sesaat hingga admin menyetujui pembayaran.',
|
||||
'deskripsi' => 'Transaksi ' . auth()->user()->email . ' terindikasi masalah/penipuan, tunggu sesaat hingga admin menyetujui pembayaran.',
|
||||
'user' => 'admin@example.net',
|
||||
'keterangan' => $result['status_message'],
|
||||
]);
|
||||
@ -537,11 +537,6 @@ class PembeliController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function complaintTransaction($id)
|
||||
{
|
||||
return view('user.refund.new-refund', compact('id'));
|
||||
}
|
||||
|
||||
public function onErrorTransaction(Request $request)
|
||||
{
|
||||
$auth = base64_encode(env('MIDTRANS_SERVER_KEY'));
|
||||
|
@ -115,7 +115,7 @@ class PenjualController extends Controller
|
||||
';
|
||||
}
|
||||
|
||||
if ($row->status_transaksi == 'sent') {
|
||||
if ($row->status_transaksi == 'sending') {
|
||||
$html_code .=
|
||||
'
|
||||
<li><a class="dropdown-item" data-toggle="modal"
|
||||
@ -127,6 +127,18 @@ class PenjualController extends Controller
|
||||
</li>
|
||||
';
|
||||
}
|
||||
|
||||
if ($row->status_transaksi == 'finished') {
|
||||
$html_code .=
|
||||
'
|
||||
<li><a class="dropdown-item" id="acceptResult"
|
||||
data-id="' .
|
||||
$row->id .
|
||||
'"
|
||||
href="#">Terima Uang</a>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
$html_code .= '
|
||||
</ul>
|
||||
</div>';
|
||||
@ -336,11 +348,41 @@ class PenjualController extends Controller
|
||||
'message' => 'Gagal update status karena kesalahan server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return response([
|
||||
'status' => true,
|
||||
'message' => 'Sukses kirim data.',
|
||||
'data' => $request,
|
||||
]);
|
||||
public function acceptResult(Request $request)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
|
||||
Transaction::where('id', $request->id)->update([
|
||||
'status_transaction' => 'done'
|
||||
]);
|
||||
|
||||
TransactionDescription::create([
|
||||
'transaction_id' => $request->id,
|
||||
'status' => 'sent',
|
||||
'background' => 'bg-seller',
|
||||
'user' => auth()->user()->email,
|
||||
'judul' => 'fas fa-money-bill',
|
||||
'deskripsi' => auth()->user()->nama_depan.' telah menerima uang.',
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Uang akan dikirim ke bank anda. Terima kasih telah menggunakan Rekber.'
|
||||
]);
|
||||
}catch(Throwable $e){
|
||||
DB::rollBack();
|
||||
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Gagal update status karena kesalahan server.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
27
app/Models/Notification.php
Normal file
27
app/Models/Notification.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Notification extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'teaser',
|
||||
'content',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'string',
|
||||
];
|
||||
|
||||
// Relasi
|
||||
public function notifications(){
|
||||
return $this->hasMany(NotificationReceiver::class, 'id', 'notification_id');
|
||||
}
|
||||
// Relasi
|
||||
}
|
30
app/Models/NotificationReceiver.php
Normal file
30
app/Models/NotificationReceiver.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NotificationReceiver extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'notification_id',
|
||||
'receiver',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'string',
|
||||
];
|
||||
|
||||
//Relasi
|
||||
public function data_receiver(){
|
||||
return $this->belongsTo(User::class, 'receiver', 'email');
|
||||
}
|
||||
|
||||
public function notifications(){
|
||||
return $this->belongsTo(Notification::class, 'notification_id', 'id');
|
||||
}
|
||||
//Relasi
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
@ -57,11 +57,11 @@ class Transaction extends Model
|
||||
}
|
||||
|
||||
public function refunds(){
|
||||
return $this->hasMany(Refund::class, 'transaction_id', 'id');
|
||||
return $this->hasMany(Refund::class, 'id', 'transaction_id');
|
||||
}
|
||||
|
||||
public function transactionDescription(){
|
||||
return $this->hasMany(TransactionDescription::class, 'transaction_id', 'id');
|
||||
return $this->hasMany(TransactionDescription::class, 'id', 'transaction_id');
|
||||
}
|
||||
//Relasi
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ return new class extends Migration
|
||||
$table->string('token')->nullable();
|
||||
$table->string('metode_pembayaran')->nullable();
|
||||
$table->string('fraud_status')->nullable();
|
||||
$table->enum('status_transaksi',['success','challenge','failure','process','sending','sent','finished','created', 'refund'])->default('created'); // transaction_status
|
||||
$table->enum('status_transaksi',['success','challenge','failure','process','sending','sent','finished','created', 'refund', 'done'])->default('created'); // transaction_status
|
||||
$table->enum('status_pembayaran',['settlement','capture','pending','expire','failure','cancel','refund'])->nullable(); // status transaksi dari midtrans
|
||||
$table->timestamp('batas_pembayaran')->nullable();
|
||||
$table->timestamp('batas_konfirmasi_transaksi')->nullable();
|
||||
@ -38,6 +38,7 @@ return new class extends Migration
|
||||
$table->timestamp('tanggal_transaksi')->nullable();
|
||||
$table->string('nama_bank_penjual');
|
||||
$table->string('no_rek_penjual');
|
||||
$table->string('keterangan')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('pembeli')->on('users')->references('email');
|
||||
|
@ -20,6 +20,7 @@ return new class extends Migration
|
||||
$table->enum('status',['refund','deny','pending'])->default('pending');
|
||||
$table->text('complaint');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('transaction_id')->on('transactions')->references('id');
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->uuid('id')->default(DB::raw('uuid_generate_v4()'))->primary();
|
||||
$table->string('title'); // judul notifikasi
|
||||
$table->string('teaser'); // cuplikan dari isi notifikasi
|
||||
$table->string('content'); // isi notifikasi
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notification_receivers', function (Blueprint $table) {
|
||||
$table->uuid('id')->default(DB::raw('uuid_generate_v4()'))->primary();
|
||||
$table->foreignUuid('notification_id');
|
||||
$table->string('receiver');
|
||||
$table->enum('status',['unread', 'read'])->default('unread');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('receiver')->on('users')->references('email');
|
||||
$table->foreign('notification_id')->on('notifications')->references('id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notification_receivers');
|
||||
}
|
||||
};
|
@ -5,6 +5,8 @@ namespace Database\Seeders;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
|
||||
use App\Models\Contact;
|
||||
use App\Models\Notification;
|
||||
use App\Models\NotificationReceiver;
|
||||
use App\Models\Refund;
|
||||
use App\Models\RefundDescription;
|
||||
use Illuminate\Database\Seeder;
|
||||
@ -190,6 +192,22 @@ class DatabaseSeeder extends Seeder
|
||||
'relasi_kontak' => $user1->email
|
||||
]);
|
||||
|
||||
$notification1 = Notification::create([
|
||||
'title' => 'Selamat Datang di Rekber',
|
||||
'content' => 'Hai, selamat datang di Rekber. Anda dapat menikmati bertransaksi disini',
|
||||
'teaser' => 'Hai, selamat datang di Rekber. ...'
|
||||
]);
|
||||
|
||||
NotificationReceiver::create([
|
||||
'notification_id' => $notification1->id,
|
||||
'receiver' => $user1->email
|
||||
]);
|
||||
|
||||
NotificationReceiver::create([
|
||||
'notification_id' => $notification1->id,
|
||||
'receiver' => $user2->email
|
||||
]);
|
||||
|
||||
$this->call([ProvincesSeeder::class, CitiesSeeder::class, DistrictsSeeder::class, VillagesSeeder::class]);
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,53 @@
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Profie Page
|
||||
--------------------------------------------------------------*/
|
||||
.profile .profile-card img {
|
||||
max-width: 120px;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
.profile .profile-card h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #2c384e;
|
||||
margin: 10px 0 0 0;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #2c384e;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.profile .profile-card h3 {
|
||||
font-size: 18px;
|
||||
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;
|
||||
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;
|
||||
color: #012970;
|
||||
}
|
||||
|
||||
.profile .profile-overview .row {
|
||||
margin-bottom: 20px;
|
||||
font-size: 15px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.profile .profile-overview .card-title {
|
||||
color: #012970;
|
||||
color: #012970;
|
||||
}
|
||||
|
||||
.profile .profile-overview .label {
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
}
|
||||
|
||||
.profile .profile-edit label {
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
font-weight: 600;
|
||||
color: rgba(1, 41, 112, 0.6);
|
||||
}
|
||||
|
||||
.profile .profile-edit img {
|
||||
max-width: 120px;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
@ -1776,7 +1776,7 @@ h6 .badge {
|
||||
|
||||
.btn {
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
padding: 0.3rem 0.8rem;
|
||||
letter-spacing: 0.5px;
|
||||
@ -3090,7 +3090,7 @@ a.dropdown-item.active {
|
||||
|
||||
body {
|
||||
background-color: #fafdfb;
|
||||
font-size: 14px;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
font-family: "Nunito", "Segoe UI", arial;
|
||||
color: #6c757d;
|
||||
|
@ -130,32 +130,6 @@
|
||||
</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>
|
||||
@ -298,89 +272,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="container">
|
||||
<h2>History Transaction</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th>Nama Barang</th>
|
||||
<th>Pembeli</th>
|
||||
<th>Penjual</th>
|
||||
<th>Total</th>
|
||||
<th>Tanggal Transaksi</th>
|
||||
<th>Tanggal Update</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($transactions as $transaction)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $transaction->nama_barang }}</td>
|
||||
<td>{{ $transaction->data_pembeli->nama_depan . ' ' . $transaction->data_pembeli->nama_belakang }}
|
||||
</td>
|
||||
<td>{{ $transaction->data_penjual->nama_depan . ' ' . $transaction->data_penjual->nama_belakang }}
|
||||
</td>
|
||||
<td>Rp {{ number_format($transaction->total_bayar, 2, ',', '.') }}</td>
|
||||
<td>{{ $transaction->created_at }}</td>
|
||||
<td>{{ $transaction->updated_at }}</td>
|
||||
<td><a href="#" data-toggle="modal"
|
||||
data-target="#modalKeteranganStatus"
|
||||
class="badge {{ in_array($transaction->status, ['pending', 'created'])
|
||||
? 'badge-light'
|
||||
: (in_array($transaction->status, ['settlement', 'capture'])
|
||||
? 'badge-info'
|
||||
: (in_array($transaction->status, ['process', 'sending', 'sended'])
|
||||
? 'badge-warning'
|
||||
: (in_array($transaction->status, ['cancel', 'expire', 'failure', 'refund'])
|
||||
? 'badge-danger'
|
||||
: ($transaction->status == 'finished'
|
||||
? 'badge-success'
|
||||
: '')))) }}">{{ ucwords($transaction->status) }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle"
|
||||
data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
...
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item"
|
||||
href="{{ route('admin-transaction.show', $transaction->id) }}">Detail</a>
|
||||
</li>
|
||||
|
||||
@if (!$transaction->transactionDescription->isEmpty())
|
||||
<li><a class="dropdown-item" data-toggle="modal"
|
||||
data-target="#modalTracking"
|
||||
data-transaction="{{ $transaction->transactionDescription }}">Tracking</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
</section>
|
||||
</div>
|
||||
@include('admin.transaction.modal-tracking')
|
||||
|
214
resources/views/Admin/notification/create.blade.php
Normal file
214
resources/views/Admin/notification/create.blade.php
Normal file
@ -0,0 +1,214 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let selected = [];
|
||||
|
||||
let listUser = $('#table-user').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ route('admin-notification.list-user-for-create-edit') }}",
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'nama_lengkap',
|
||||
name: 'nama_lengkap',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'email',
|
||||
name: 'email',
|
||||
className: 'text-center'
|
||||
}],
|
||||
rowId: 'DT_RowIndex',
|
||||
rowCallback: function(row, data) {
|
||||
selected.forEach(element => {
|
||||
if (element == data.email) {
|
||||
$(row).addClass('selected');
|
||||
}
|
||||
});
|
||||
},
|
||||
createdRow: function(row, data, dataIndex) {
|
||||
$(row).attr('data-email', data.email);
|
||||
},
|
||||
});
|
||||
|
||||
$('#table-user tbody').on('click', 'tr', function() {
|
||||
var email = $(this).data('email');
|
||||
var index = $.inArray(email, selected);
|
||||
|
||||
if (index === -1) {
|
||||
selected.push(email);
|
||||
} else {
|
||||
selected.splice(index, 1);
|
||||
}
|
||||
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
|
||||
$('#selectAll').on('click', function() {
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('admin-notification.select-all-user') }}",
|
||||
type: 'GET',
|
||||
success: function(result) {
|
||||
selected = result.users;
|
||||
listUser.ajax.reload();
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan di server',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#deselectAll').on('click', function() {
|
||||
listUser.rows().deselect();
|
||||
selected = [];
|
||||
});
|
||||
|
||||
$('#formNotif').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
|
||||
let form = this;
|
||||
|
||||
if (!form.checkValidity()) {
|
||||
form.reportValidity();
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData(this);
|
||||
|
||||
if (selected.length > 0) {
|
||||
selected.forEach(element => {
|
||||
formData.append('receivers[]', element);
|
||||
});
|
||||
|
||||
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('admin-notification.store') }}",
|
||||
type: 'POST',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
data: formData,
|
||||
success: function(result) {
|
||||
Swal.fire({
|
||||
title: result.status ? 'Berhasil' : 'Gagal',
|
||||
text: result.message,
|
||||
icon: result.status ? 'success' : 'error'
|
||||
}).then(function() {
|
||||
if (result.status) {
|
||||
location.href =
|
||||
"{{ route('admin-notification.index') }}";
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan di server',
|
||||
icon: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Tambah Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin-notification.index') }}"></a>Notifikasi</div>
|
||||
<div class="breadcrumb-item">Tambah Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="javascript:void(0)" id="formNotif" enctype="multipart/form-data" method="POST">
|
||||
<div class="form-row">
|
||||
<label for="inputTitle">
|
||||
<h5>Judul</h5>
|
||||
</label>
|
||||
<input type="text" class="form-control font-weight-bold" name="title" id="inputTitle"
|
||||
required>
|
||||
</div>
|
||||
<div class="form-row mt-4">
|
||||
<label for="inputContent">
|
||||
<h5>Isi/Konten</h5>
|
||||
</label>
|
||||
<textarea class="form-control" name="content" id="inputContent" required></textarea>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center mt-5 mb-3">
|
||||
Daftar akun akan yang mendapatkan notifikasi
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-user" style="font-size: 16px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th class="text-center">
|
||||
Nama Lengkap
|
||||
</th>
|
||||
<th class="text-center">
|
||||
Email
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-success btn-icon icon-left" id="kirimData">
|
||||
<i class="fa fa-pencil-alt m-2"></i>Buat
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
240
resources/views/Admin/notification/edit.blade.php
Normal file
240
resources/views/Admin/notification/edit.blade.php
Normal file
@ -0,0 +1,240 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let selected = {!! json_encode($email) !!};
|
||||
|
||||
let listUser = $('#table-user').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('admin-notification.list-user-for-create-edit') }}",
|
||||
data: {
|
||||
id: "{{ $notification->id }}",
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'nama_lengkap',
|
||||
name: 'nama_lengkap',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'email',
|
||||
name: 'email',
|
||||
className: 'text-center'
|
||||
}],
|
||||
rowId: 'DT_RowIndex',
|
||||
rowCallback: function(row, data) {
|
||||
selected.forEach(element => {
|
||||
if (element == data.email) {
|
||||
$(row).addClass('selected');
|
||||
}
|
||||
});
|
||||
},
|
||||
createdRow: function(row, data, dataIndex) {
|
||||
$(row).attr('data-email', data.email);
|
||||
},
|
||||
});
|
||||
|
||||
$('#table-user tbody').on('click', 'tr', function() {
|
||||
var email = $(this).data('email');
|
||||
var index = $.inArray(email, selected);
|
||||
|
||||
if (index === -1) {
|
||||
selected.push(email);
|
||||
console.log(index);
|
||||
} else {
|
||||
selected.splice(index, 1);
|
||||
console.log(index);
|
||||
}
|
||||
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
|
||||
$('#selectAll').on('click', function() {
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('admin-notification.select-all-user') }}",
|
||||
type: 'GET',
|
||||
success: function(result) {
|
||||
selected = result.users;
|
||||
listUser.ajax.reload();
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan di server',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#deselectAll').on('click', function() {
|
||||
listUser.rows().deselect();
|
||||
selected = [];
|
||||
});
|
||||
|
||||
$('#formNotif').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
|
||||
let form = this;
|
||||
|
||||
if (!form.checkValidity()) {
|
||||
form.reportValidity();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let formData = new FormData(this);
|
||||
|
||||
console.log(selected);
|
||||
|
||||
if (selected.length > 0) {
|
||||
selected.forEach(element => {
|
||||
formData.append('receivers[]', element);
|
||||
});
|
||||
formData.append('id', "{{ $notification->id }}");
|
||||
|
||||
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('admin-notification.update') }}",
|
||||
type: 'POST',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
data: formData,
|
||||
success: function(result) {
|
||||
Swal.close();
|
||||
Swal.fire({
|
||||
title: result.status ? 'Berhasil' : 'Gagal',
|
||||
text: result.message,
|
||||
icon: result.status ? 'success' : 'error'
|
||||
}).then(function() {
|
||||
if (result.status) {
|
||||
$.ajax({
|
||||
url: "{{ route('admin-notification.update-new-notification') }}",
|
||||
data: formData,
|
||||
type: 'POST',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
});
|
||||
// location.href =
|
||||
// "{{ route('admin-notification.index') }}";
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi kesalahan di server',
|
||||
icon: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Edit Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin-notification.index') }}"></a>Notifikasi</div>
|
||||
<div class="breadcrumb-item">Edit Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="javascript:void(0)" id="formNotif" enctype="multipart/form-data" method="POST">
|
||||
<div class="form-row mb-4">
|
||||
<label for="inputTitle">
|
||||
<h5>Judul</h5>
|
||||
</label>
|
||||
<input type="text" class="form-control font-weight-bold" name="title" id="inputTitle"
|
||||
value="{{ $notification->title }}" required>
|
||||
</div>
|
||||
<div class="form-row mb-4">
|
||||
<label for="inputContent">
|
||||
<h5>Isi/Konten</h5>
|
||||
</label>
|
||||
<textarea class="form-control" name="content" id="inputContent" required>{{ $notification->content }}</textarea>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center mt-5 mb-3">
|
||||
Daftar akun akan yang mendapatkan notifikasi
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<div class="mb-2">
|
||||
<button class="btn btn-primary" id="selectAll">Pilih Semua</button>
|
||||
<button class="btn btn-danger" id="deselectAll">Hapus Semua</button>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped" id="table-user" style="font-size: 16px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th class="text-center">
|
||||
Nama Lengkap
|
||||
</th>
|
||||
<th class="text-center">
|
||||
Email
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-success btn-icon icon-left" id="kirimData">
|
||||
<i class="fa fa-pencil-alt m-2"></i>Update
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
120
resources/views/Admin/notification/index.blade.php
Normal file
120
resources/views/Admin/notification/index.blade.php
Normal file
@ -0,0 +1,120 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let listNotifikasi = $('#table-notifikasi').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ route('admin-notification.list-notification') }}",
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'title',
|
||||
name: 'title',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'teaser',
|
||||
name: 'teaser',
|
||||
orderable: false
|
||||
|
||||
}, {
|
||||
data: 'created_at',
|
||||
name: 'created_at',
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
var date = new Date(data);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year;
|
||||
return formattedDate;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'updated_at',
|
||||
name: 'updated_at',
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
var date = new Date(data);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year;
|
||||
return formattedDate;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item">Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-end mb-3">
|
||||
<a class="btn btn-success active" href="{{ route('admin-notification.create') }}">Tambah
|
||||
Notifikasi</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-notifikasi" style="font-size: 16px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th>
|
||||
Judul
|
||||
</th>
|
||||
<th>
|
||||
Teaser
|
||||
</th>
|
||||
<th>
|
||||
Dibuat pada
|
||||
</th>
|
||||
<th>
|
||||
Diperbarui pada
|
||||
</th>
|
||||
<th>
|
||||
Aksi
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
130
resources/views/Admin/notification/show.blade.php
Normal file
130
resources/views/Admin/notification/show.blade.php
Normal file
@ -0,0 +1,130 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let listUser = $('#table-user').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('admin-notification.list-user-for-show') }}",
|
||||
data: {
|
||||
id: "{{ $notification->id }}"
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'nama_lengkap',
|
||||
name: 'nama_lengkap',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'receiver',
|
||||
name: 'receiver',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'created_at',
|
||||
name: 'created_at',
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
var date = new Date(data);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year;
|
||||
return formattedDate;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'updated_at',
|
||||
name: 'updated_at',
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
var date = new Date(data);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year;
|
||||
return formattedDate;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'text-center'
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Detail Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{ route('admin-notification.index') }}">Notifikasi</a></div>
|
||||
<div class="breadcrumb-item">Detail Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-start mb-3">
|
||||
<h2>{{ $notification->title }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-start mb-3">
|
||||
{{ $notification->content }}
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center mt-5 mb-3">
|
||||
Daftar akun yang mendapatkan notifikasi
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-user" style="font-size: 16px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th>
|
||||
Nama Lengkap
|
||||
</th>
|
||||
<th>
|
||||
Email
|
||||
</th>
|
||||
<th>
|
||||
Tanggal Kirim
|
||||
</th>
|
||||
<th>
|
||||
Tanggal Terima
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-center">
|
||||
<a href="{{ route('admin-notification.edit', ['id' => $notification->id]) }}"
|
||||
class="btn btn-success btn-icon icon-left">
|
||||
<i class="fa fa-pencil-alt m-2"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
@ -2,54 +2,23 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-flex justify-content-center">
|
||||
<h3 class="modal-title fs-5" id="staticBackdropLabel">Keterangan Status Transaksi</h3>
|
||||
<h3 class="modal-title fs-5" id="staticBackdropLabel">Keterangan Status Refund</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-light">Created</label>
|
||||
<p class="form-control">Transaksi baru telah dibuat oleh pembeli.</p>
|
||||
<label class="badge badge-light">Pending</label>
|
||||
<p class="form-control">Pembeli sudah mengajukan refund dan menunggu persetujuan dari admin.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-dark">Challenge</label>
|
||||
<p class="form-control">Transaksi diduga penipuan dan perlu direview oleh admin.</p>
|
||||
<label class="badge badge-success">Refund</label>
|
||||
<p class="form-control">Admin menyetujui pengajuan refund pembeli dan uang akan dikembalikan ke
|
||||
pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-info">Success</label>
|
||||
<p class="form-control">Transaksi sukses dibayar dan akan dilanjutkan ke pihak penjual</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Failure</label>
|
||||
<p class="form-control">Terjadi kesalahan pada transaksi seperti pembatalan, pembayaran sudah
|
||||
kedaluwarsa atau kerusakan di server.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Process</label>
|
||||
<p class="form-control">Transaksi/pesanan pembeli sedang diproses oleh penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Sending</label>
|
||||
<p class="form-control">Pesanan sedang dikirim oleh penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Sent</label>
|
||||
<p class="form-control">Pesanan sudah sampai di tujuan pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-success">Finished</label>
|
||||
<p class="form-control">Transaksi telah selesai dan diselesaikan oleh pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Refund</label>
|
||||
<p class="form-control">Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan
|
||||
kemungkinan barang/jasa yang salah atau terjadi kerusakan.</p>
|
||||
<label class="badge badge-danger">Deny</label>
|
||||
<p class="form-control">Admin menolak pengajuan refund pembeli dan transaksi akan diselesaikan.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -196,7 +196,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-end mb-3">
|
||||
<a class="btn btn-success active" href="#" id="tambahModal">Tambah Data Kebijakan</a>
|
||||
<a class="btn btn-success active" href="#" id="tambahModal">Tambah Kebijakan</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-setting" style="font-size: 16px;">
|
||||
|
@ -97,6 +97,64 @@
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
{{-- batas pembayaran dan pengiriman --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<address>
|
||||
<strong>Batas Pembayaran:</strong><br>
|
||||
{{ date('d F Y', strtotime($transaction->batas_pembayaran)) }}<br>
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-right">
|
||||
<address>
|
||||
<strong>Estimasi Pengiriman:</strong><br>
|
||||
{{ date('Y', strtotime($transaction->batas_pengiriman_barang_awal)) ==
|
||||
date('Y', strtotime($transaction->batas_pengiriman_barang_akhir))
|
||||
? (date('F', strtotime($transaction->batas_pengiriman_barang_awal)) ==
|
||||
date('F', strtotime($transaction->batas_pengiriman_barang_akhir))
|
||||
? date('d', strtotime($transaction->batas_pengiriman_barang_awal)) .
|
||||
'-' .
|
||||
date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir))
|
||||
: date('F', strtotime($transaction->batas_pengiriman_barang_awal)) .
|
||||
'-' .
|
||||
date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir)))
|
||||
: date('d F', strtotime($transaction->batas_pengiriman_barang_awal)) .
|
||||
'-' .
|
||||
date('d F Y', strtotime($transaction->batas_pengiriman_barang_akhir)) }}<br>
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
{{-- Keterangan Pembayaran --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<address>
|
||||
<strong>Status Transaksi:</strong><br>
|
||||
{{ ucwords($transaction->status_transaksi) }}
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-right">
|
||||
<address>
|
||||
<strong>Status Pembayaran:</strong><br>
|
||||
{{ ucwords($transaction->status_pembayaran) }}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Keterangan --}}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<address>
|
||||
<strong>Status Indikasi Penipuan:</strong><br>
|
||||
{{ $transaction->fraud_status == null ? 'Tidak ada' : 'Ada' }}
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-right">
|
||||
<address>
|
||||
<strong>Keterangan:</strong><br>
|
||||
{{ $transaction->keterangan }}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -161,18 +219,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@if ($transaction->status_transaksi == 'challenge')
|
||||
<hr>
|
||||
<div class="text-md-center">
|
||||
<p>Pada transaksi ini terjadi penipuan. Apakah anda ini menerima transaksi ini?</p>
|
||||
<button class="btn btn-primary btn-icon icon-left" data-id="{{ $transaction->id }}"
|
||||
id="acceptTransaction"><i class="fas fa-credit-card" id="payment"></i>Terima
|
||||
id="acceptTransaction"><i class="fa fa-credit-card fa-lg m-2"
|
||||
id="payment"></i>Terima
|
||||
Transaksi</button>
|
||||
<button class="btn btn-danger btn-icon icon-left" data-id="{{ $transaction->id }}"
|
||||
id="denyTransaction"><i class="fas fa-times"></i>
|
||||
id="denyTransaction"><i class="fa fa-times fa-lg m-2"></i>
|
||||
Tolak Transaksi</button>
|
||||
</div>
|
||||
<hr>
|
||||
@endif
|
||||
<div class="text-md-right">
|
||||
<button class="btn btn-warning btn-icon icon-left" id="btnPDF"
|
||||
data-id="{{ $transaction->id }}"><i
|
||||
class="fa fa-print fa-lg m-2"></i>Print</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -334,6 +399,11 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnPDF').on('click', function() {
|
||||
const id = $(this).data('id');
|
||||
location.href = "{{ route('invoice.get', ':id') }}".replace(':id', id);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
@ -120,7 +120,7 @@
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-danger">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
} else if (row.status_transaksi == 'finished') {
|
||||
} else if (['finished', 'done'].includes(row.status_transaksi)) {
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-success">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
|
@ -47,6 +47,11 @@
|
||||
<p class="form-control">Transaksi telah selesai dan diselesaikan oleh pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-success">Done</label>
|
||||
<p class="form-control">Transaksi selesai dan uang akan dikirim ke penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Refund</label>
|
||||
<p class="form-control">Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan
|
||||
|
@ -11,42 +11,53 @@
|
||||
<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>
|
||||
<ul class="dropdown-menu dropdown-menu-sm" aria-labelledby="orders-month"
|
||||
id="dropdownMenu1">
|
||||
<li class="dropdown-title">Pilih Bulan</li>
|
||||
<li><a href="#" class="dropdown-item">Januari</a></li>
|
||||
<li><a href="#" class="dropdown-item">Februari</a></li>
|
||||
<li><a href="#" class="dropdown-item">Maret</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">August</a></li>
|
||||
<li><a href="#" class="dropdown-item">Juni</a></li>
|
||||
<li><a href="#" class="dropdown-item">Juli</a></li>
|
||||
<li><a href="#" class="dropdown-item">Agustus</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">Oktober</a></li>
|
||||
<li><a href="#" class="dropdown-item">November</a></li>
|
||||
<li><a href="#" class="dropdown-item">December</a></li>
|
||||
<li><a href="#" class="dropdown-item">Desember</a></li>
|
||||
</ul>
|
||||
<ul class="dropdown-menu dropdown-menu-sm">
|
||||
<li class="dropdown-title">Select Year</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">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>
|
||||
</div>
|
||||
<div class="dropdown d-inline">
|
||||
<a class="font-weight-600 dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
id="orders-year">2023</a>
|
||||
<ul class="dropdown-menu dropdown-menu-sm" aria-labelledby="orders-year"
|
||||
id="dropdownMenu2">
|
||||
<li class="dropdown-title">Pilih Tahun</li>
|
||||
<li><a href="#" class="dropdown-item">2019</a></li>
|
||||
<li><a href="#" class="dropdown-item">2020</a></li>
|
||||
<li><a href="#" class="dropdown-item">2021</a></li>
|
||||
<li><a href="#" class="dropdown-item">2022</a></li>
|
||||
<li><a href="#" class="dropdown-item">2023</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
Sebagai -
|
||||
<div class="dropdown d-inline">
|
||||
<a class="font-weight-600 dropdown-toggle" data-toggle="dropdown" href="#"
|
||||
id="orders-role">Semua</a>
|
||||
<ul class="dropdown-menu dropdown-menu-sm" aria-labelledby="orders-role"
|
||||
id="dropdownMenu3">
|
||||
<li class="dropdown-title">Pilih Peran</li>
|
||||
<li><a href="#" class="dropdown-item">Semua</a></li>
|
||||
<li><a href="#" class="dropdown-item">Pembeli</a></li>
|
||||
<li><a href="#" class="dropdown-item">Penjual</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 class="card-stats-item-label">Dibuat</div>
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">12</div>
|
||||
@ -54,7 +65,15 @@
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">23</div>
|
||||
<div class="card-stats-item-label">Canceled</div>
|
||||
<div class="card-stats-item-label">Gagal</div>
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">23</div>
|
||||
<div class="card-stats-item-label">Gagal</div>
|
||||
</div>
|
||||
<div class="card-stats-item">
|
||||
<div class="card-stats-item-count">23</div>
|
||||
<div class="card-stats-item-label">Gagal</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -63,10 +82,10 @@
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total Transaction</h4>
|
||||
<h4>Jumlah Transaction</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
159
|
||||
159 Transaksi
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -81,10 +100,10 @@
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total Refund</h4>
|
||||
<h4>Pemasukan</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
190
|
||||
Rp. 35.000.000,00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -99,10 +118,9 @@
|
||||
</div>
|
||||
<div class="card-wrap">
|
||||
<div class="card-header">
|
||||
<h4>Total Transaction </h4>
|
||||
<h4>Pengeluaran</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
109 </div>
|
||||
<div class="card-body">Rp. 35.000.000,00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -110,11 +128,21 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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>INCOME</h4>
|
||||
<h4 style="font-size: 36px;">Transaksi</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="myChart" height="158">1412</canvas>
|
||||
<canvas id="myChart" height="150"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -131,11 +159,11 @@
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September",
|
||||
"Oktober", "November", "December"
|
||||
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Agu", "Sep",
|
||||
"Okt", "Nov", "Des"
|
||||
],
|
||||
datasets: [{
|
||||
label: 'Transaction',
|
||||
label: 'Transaksi',
|
||||
data: [3200, 18009, 4305, 3022, 6310, 5120, 5880, 6154, 0],
|
||||
borderWidth: 2,
|
||||
backgroundColor: 'rgba(63,82,227,.8)',
|
||||
@ -148,7 +176,7 @@
|
||||
},
|
||||
{
|
||||
label: 'Refund',
|
||||
data: [2207, 3403, 220000, 5025, 2302, 4208, 3880, 4880, 5000],
|
||||
data: [2207, 3403, 2200, 5025, 2302, 4208, 3880, 4880, 5000],
|
||||
borderWidth: 2,
|
||||
backgroundColor: 'rgba(254,86,83,.7)',
|
||||
borderWidth: 0,
|
||||
@ -162,12 +190,13 @@
|
||||
},
|
||||
options: {
|
||||
layout: {
|
||||
padding: 20,
|
||||
padding: 10,
|
||||
},
|
||||
legend: {
|
||||
display: true,
|
||||
labels: {
|
||||
padding: 20,
|
||||
padding: 10,
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
@ -186,13 +215,22 @@
|
||||
style: 'currency',
|
||||
currency: 'IDR',
|
||||
}).format(value);
|
||||
}
|
||||
}
|
||||
},
|
||||
fontSize: 14,
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Dalam Ratusan Juta', // Label khusus untuk sumbu Y
|
||||
fontSize: 16 // Ukuran font untuk label sumbu Y
|
||||
},
|
||||
}],
|
||||
xAxes: [{
|
||||
gridLines: {
|
||||
display: true,
|
||||
tickMarkLength: 15,
|
||||
},
|
||||
ticks: {
|
||||
fontSize: 16,
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
@ -0,0 +1,28 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Detail Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('user.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item active"><a href="{{ route('user-notification.index') }}">Notifikasi</a></div>
|
||||
<div class="breadcrumb-item">Detail Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-start mb-3">
|
||||
<h2>{{ $notification->title }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-start mb-3">
|
||||
{{ $notification->content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
108
resources/views/User/notification/index.blade.php
Normal file
108
resources/views/User/notification/index.blade.php
Normal file
@ -0,0 +1,108 @@
|
||||
@extends('layouts.main')
|
||||
@section('content')
|
||||
<style>
|
||||
.unread {
|
||||
background-color: #a3194e;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
let listUser = $('#table-notifikasi').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('user-notification.list-notification') }}",
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'title',
|
||||
name: 'title',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'teaser',
|
||||
name: 'teaser',
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'created_at',
|
||||
name: 'created_at',
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
var date = new Date(data);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year;
|
||||
return formattedDate;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'text-center'
|
||||
}, {
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center'
|
||||
}],
|
||||
rowCallback: function(row, data) {
|
||||
if (data.status == 'unread') {
|
||||
$(row).addClass('unread');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="main-content">
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h1>Notifikasi</h1>
|
||||
<div class="section-header-breadcrumb">
|
||||
<div class="breadcrumb-item active"><a href="{{ route('user.index') }}">Dashboard</a></div>
|
||||
<div class="breadcrumb-item">Notifikasi</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="table-notifikasi" style="font-size: 16px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
#
|
||||
</th>
|
||||
<th>
|
||||
Judul
|
||||
</th>
|
||||
<th>
|
||||
Teaser
|
||||
</th>
|
||||
<th>
|
||||
Tanggal Dibuat
|
||||
</th>
|
||||
<th>
|
||||
Aksi
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
@ -2,54 +2,23 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-flex justify-content-center">
|
||||
<h3 class="modal-title fs-5" id="staticBackdropLabel">Keterangan Status Transaksi</h3>
|
||||
<h3 class="modal-title fs-5" id="staticBackdropLabel">Keterangan Status Refund</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-light">Created</label>
|
||||
<p class="form-control">Transaksi baru telah dibuat oleh pembeli.</p>
|
||||
<label class="badge badge-light">Pending</label>
|
||||
<p class="form-control">Pembeli sudah mengajukan refund dan menunggu persetujuan dari admin.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-dark">Challenge</label>
|
||||
<p class="form-control">Transaksi diduga penipuan dan perlu direview oleh admin.</p>
|
||||
<label class="badge badge-success">Refund</label>
|
||||
<p class="form-control">Admin menyetujui pengajuan refund pembeli dan uang akan dikembalikan ke
|
||||
pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-info">Success</label>
|
||||
<p class="form-control">Transaksi sukses dibayar dan akan dilanjutkan ke pihak penjual</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Failure</label>
|
||||
<p class="form-control">Terjadi kesalahan pada transaksi seperti pembatalan, pembayaran sudah
|
||||
kedaluwarsa atau kerusakan di server.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Process</label>
|
||||
<p class="form-control">Transaksi/pesanan pembeli sedang diproses oleh penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Sending</label>
|
||||
<p class="form-control">Pesanan sedang dikirim oleh penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-warning">Sent</label>
|
||||
<p class="form-control">Pesanan sudah sampai di tujuan pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-success">Finished</label>
|
||||
<p class="form-control">Transaksi telah selesai dan diselesaikan oleh pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Refund</label>
|
||||
<p class="form-control">Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan
|
||||
kemungkinan barang/jasa yang salah atau terjadi kerusakan.</p>
|
||||
<label class="badge badge-danger">Deny</label>
|
||||
<p class="form-control">Admin menolak pengajuan refund pembeli dan transaksi akan diselesaikan.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -143,7 +143,7 @@
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-danger">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
} else if (row.status_transaksi == 'finished') {
|
||||
} else if (['finished', 'done'].includes(row.status_transaksi)) {
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-success">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
|
@ -47,6 +47,11 @@
|
||||
<p class="form-control">Transaksi telah selesai dan diselesaikan oleh pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-success">Done</label>
|
||||
<p class="form-control">Transaksi selesai dan uang akan dikirim ke penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Refund</label>
|
||||
<p class="form-control">Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan
|
||||
|
@ -134,7 +134,7 @@
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-danger">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
} else if (row.status_transaksi == 'finished') {
|
||||
} else if (['finished', 'done'].includes(row.status_transaksi)) {
|
||||
return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-success">
|
||||
${row.status_transaksi.charAt(0).toUpperCase()}${row.status_transaksi.slice(1)}
|
||||
</a>`;
|
||||
@ -532,6 +532,49 @@
|
||||
|
||||
$('#acceptResult').on('click', function() {
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
const id = $(this).data('id');
|
||||
|
||||
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-penjual.accept-result') }}",
|
||||
type: 'PUT',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire({
|
||||
title: response.status ? 'Berhasil' : 'Gagal',
|
||||
text: response.message,
|
||||
icon: response.status ? 'success' : 'error',
|
||||
confirmButtonText: 'OK',
|
||||
}).then(function() {
|
||||
if (response.status) {
|
||||
listPenjual.ajax.reload();
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(error) {
|
||||
Swal.fire({
|
||||
title: 'Gagal',
|
||||
text: 'Terjadi error di server',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -3,6 +3,7 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-flex justify-content-center">
|
||||
<h3 class="modal-title fs-5" id="staticBackdropLabel">Keterangan Status Transaksi</h3>
|
||||
{{-- <a type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">×</a> --}}
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
@ -46,6 +47,11 @@
|
||||
<p class="form-control">Transaksi telah selesai dan diselesaikan oleh pembeli.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-success">Done</label>
|
||||
<p class="form-control">Transaksi selesai dan uang akan dikirim ke penjual.</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="badge badge-danger">Refund</label>
|
||||
<p class="form-control">Transaksi ditandai oleh pembeli untuk dikembalikan/retur dikarenakan
|
||||
|
@ -16,10 +16,8 @@
|
||||
}
|
||||
|
||||
body {
|
||||
width: 80%;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@ -30,8 +28,10 @@
|
||||
}
|
||||
|
||||
.info-user,
|
||||
.data-barang,
|
||||
.info-pembayaran {
|
||||
.data-pesanan,
|
||||
.rincian-pesanan,
|
||||
.info-pembayaran,
|
||||
.judul-rincian {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
@ -39,35 +39,29 @@
|
||||
table p {
|
||||
font-weight: 600;
|
||||
text-transform: capitalize;
|
||||
color: #414141;
|
||||
color: #191919;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
table h3 {
|
||||
h3 {
|
||||
font-size: 1.4rem;
|
||||
color: #414141;
|
||||
color: #191919;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table span {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
table h4 {
|
||||
font-weight: 600;
|
||||
font-size: 1.1rem;
|
||||
color: rgb(31, 31, 31);
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
table label {
|
||||
font-weight: 600;
|
||||
text-transform: capitalize;
|
||||
color: #777777;
|
||||
color: #4d4d4d;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.py-2 {
|
||||
padding: 20px 0;
|
||||
table hr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.pt-0 {
|
||||
@ -78,19 +72,64 @@
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.pt-4 {
|
||||
padding-top: 40px;
|
||||
.pb-2 {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.pr-1 {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.pl-1 {
|
||||
padding-left: 10px;
|
||||
.info-user td,
|
||||
.judul-rincian td {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.data-barang thead {
|
||||
.info-user td:first-child {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-pembayaran {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.info-pembayaran label {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.info-pembayaran p {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.info-pembayaran td:first-child {
|
||||
opacity: 1%;
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.info-pembayaran td:last-child {
|
||||
font-size: 0.8rem;
|
||||
background: whitesmoke;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.data-pesanan {
|
||||
background: whitesmoke;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.data-pesanan th {
|
||||
text-transform: capitalize;
|
||||
font-size: 0.85rem;
|
||||
padding: 15px 30px 5px 30px;
|
||||
}
|
||||
|
||||
.data-pesanan td {
|
||||
text-align: center;
|
||||
font-size: 0.8rem;
|
||||
padding: 20px 25px;
|
||||
}
|
||||
|
||||
.rincian-pesanan thead {
|
||||
height: 40px;
|
||||
text-transform: capitalize;
|
||||
background: #900C3F;
|
||||
@ -98,40 +137,37 @@
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.data-barang thead th:first-child {
|
||||
.rincian-pesanan thead th:first-child {
|
||||
border-top-left-radius: 1rem;
|
||||
}
|
||||
|
||||
.data-barang thead th:last-child {
|
||||
.rincian-pesanan thead th:last-child {
|
||||
border-top-right-radius: 1rem;
|
||||
}
|
||||
|
||||
.data-barang th {
|
||||
.rincian-pesanan th {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.data-barang tbody {
|
||||
.rincian-pesanan tbody {
|
||||
background: whitesmoke;
|
||||
}
|
||||
|
||||
.data-barang tr {
|
||||
.rincian-pesanan tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.data-barang td {
|
||||
.rincian-pesanan td {
|
||||
color: #414141;
|
||||
font-size: 0.8rem;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.data-barang td:nth-child(2) {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.data-barang td:first-child,
|
||||
.data-barang td:nth-child(3),
|
||||
.data-barang td:nth-child(4),
|
||||
.data-barang th:last-child {
|
||||
.rincian-pesanan td:first-child,
|
||||
.rincian-pesanan td:nth-child(3),
|
||||
.rincian-pesanan td:nth-child(4),
|
||||
.rincian-pesanan td:last-child,
|
||||
.rincian-pesanan th:last-child {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@ -139,72 +175,72 @@
|
||||
|
||||
<body>
|
||||
<div class="card">
|
||||
<h3>Nota Pesanan</h3>
|
||||
<table class="info-user">
|
||||
<tr>
|
||||
<td>
|
||||
<h3>Invoice</h3>
|
||||
<td class="pt-0">
|
||||
<p>Pembeli :</p>
|
||||
</td>
|
||||
<td align="end"><label>Order #8shd87ugd-18bg-273v</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pt-4">
|
||||
<p>Pembeli</p>
|
||||
</td>
|
||||
<td align="end" class="pt-4">
|
||||
<p>Penjual</p>
|
||||
<td class="pt-0">
|
||||
<p>Penjual :</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>Septea</span></td>
|
||||
<td align="end"><span>Takapedia Top Up</span></td>
|
||||
<td><span>Takapedia Top Up</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pt-0">
|
||||
<p>Alamat Pembeli</p>
|
||||
</td>
|
||||
<td align="end" class="pt-0">
|
||||
<p>Alamat Penjual</p>
|
||||
<td>
|
||||
<p>Email :</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pr-1"><span>Pondok ponogoro jl.raya bogor no.26 rt 2/2Pondok ponogoro jl.raya bogor no.26
|
||||
rt 2/2</span></td>
|
||||
<td align="end" class="pl-1"><span>Pondok ponogoro jl.raya bogor no.26 rt 2/2Pondok ponogoro
|
||||
jl.raya bogor no.26 rt 2/2</span></td>
|
||||
<td><span>darwin@gmail.com</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pt-4">
|
||||
<p>Payment Method</p>
|
||||
<td align="end" class="pt-4">
|
||||
<p>Tanggal Transaksi</p>
|
||||
<td>
|
||||
<p>Alamat :</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>visa ending ***4352</span></td>
|
||||
<td align="end"><span>11 Nov 2023, 12:06</span></td>
|
||||
<td class="pr-1"><span>Pondok ponogoro jl.raya bogor no.26 rt 2/2Pondok ponogoro jl.raya bogor no.26 rt
|
||||
2/2</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" class="pt-0" colspan="2">
|
||||
<p>email</p>
|
||||
<td colspan="2">
|
||||
<p>no. HP :</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2"><span>ripannisa@gmail.com</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pt-4">
|
||||
<h4>Rangkuman Barang</h4>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="start" colspan="2"><span>Semua barang yang di daftarkan dalam transaksi</span></td>
|
||||
<td colspan="2"><span>6285753478458</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="table">
|
||||
|
||||
</div>
|
||||
<table class="data-barang pt-2">
|
||||
<table class="data-pesanan">
|
||||
<thead>
|
||||
<th>No. Pesanan</th>
|
||||
<th>Tgl Pesanan</th>
|
||||
<th>Metode Pembayaran</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><span>#8shd87ugd-18bg-273v</span></td>
|
||||
<td><span>18/02/2024</span></td>
|
||||
<td><span>Visa ending ***</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="judul-rincian">
|
||||
<tr>
|
||||
<td>
|
||||
<p>Rincian Pesanan</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>Semua pesanan yang di daftarkan dalam transaksi</span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="rincian-pesanan">
|
||||
<thead>
|
||||
<th>#</th>
|
||||
<th>nama barang</th>
|
||||
@ -218,41 +254,44 @@
|
||||
<td>Iphone 17 Pro Max</td>
|
||||
<td>Rp.17.994.592,00</td>
|
||||
<td>2</td>
|
||||
<td align="end">Rp.35.989.184,00</td>
|
||||
<td>Rp.35.989.184,00</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="info-pembayaran">
|
||||
<tr>
|
||||
<td class="pt-4">
|
||||
<h4>metode pembayaran</h4>
|
||||
</td>
|
||||
<td align="end" class="pt-4"><label>subtotal</label></td>
|
||||
<td>[ini kosong]</td>
|
||||
<td style="width: 45%;" class="pt-2"><label>subtotal :</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2">
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;" colspan="2">
|
||||
<p>Rp.35.989.184,00</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2" class="pt-1"><label>biaya admin</label></td>
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;" colspan="2"><label>biaya admin</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2">
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;" colspan="2">
|
||||
<p>Rp.30.000,00</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="py-2">
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;">
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2"><label>total</label></td>
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;" colspan="2"><label>total</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="end" colspan="2">
|
||||
<td>[kosong]</td>
|
||||
<td style="width: 45%;" class="pb-2" colspan="2">
|
||||
<p>Rp.30.000,00</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -114,7 +114,7 @@
|
||||
<hr>
|
||||
<div class="text-md-right">
|
||||
<button class="btn btn-warning btn-icon icon-left" id="btnPDF"
|
||||
data-id="{{ $transaction->id }}"><i class="fas fa-print"></i>Print</button>
|
||||
data-id="{{ $transaction->id }}"><i class="fa fa-print m-2"></i>Print</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,3 +1,10 @@
|
||||
<?php
|
||||
use App\Models\NotificationReceiver;
|
||||
|
||||
$new = NotificationReceiver::where('receiver', auth()->user()->email)
|
||||
->where('status', 'unread')
|
||||
->count();
|
||||
?>
|
||||
<div class="navbar-bg"></div>
|
||||
<nav class="navbar navbar-expand-lg main-navbar">
|
||||
<form class="form-inline mr-auto">
|
||||
@ -8,138 +15,26 @@
|
||||
</ul>
|
||||
</form>
|
||||
<ul class="navbar-nav navbar-right">
|
||||
<li class="dropdown dropdown-list-toggle"><a href="#" data-toggle="dropdown"
|
||||
class="nav-link nav-link-lg message-toggle beep"><i class="far fa-envelope"></i></a>
|
||||
<div class="dropdown-menu dropdown-list dropdown-menu-right">
|
||||
<div class="dropdown-header">Messages
|
||||
<div class="float-right">
|
||||
<a href="#">Mark All As Read</a>
|
||||
@if (auth()->user()->role != 'Admin')
|
||||
<li class="dropdown dropdown-list-toggle"><a href="#" data-toggle="dropdown"
|
||||
class="nav-link notification-toggle nav-link-lg {{ $new > 0 ? 'beep' : '' }}" id="notifBtn"><i
|
||||
class="far fa-bell"></i></a>
|
||||
<div class="dropdown-menu dropdown-list dropdown-menu-right">
|
||||
<div class="dropdown-header">Notifikasi
|
||||
<div class="float-right">
|
||||
<a href="javascript: void(0);" id="markAllAsRead">Mark All As Read</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-list-content dropdown-list-icons" id="notifContent">
|
||||
|
||||
</div>
|
||||
<div class="dropdown-footer text-center">
|
||||
<a href="{{ route('user-notification.index') }}">View All <i
|
||||
class="fas fa-chevron-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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="{{ asset('assets/img/avatar/avatar-1.png') }}"
|
||||
class="rounded-circle">
|
||||
<div class="is-online"></div>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Kusnaedi</b>
|
||||
<p>Hello, Bro!</p>
|
||||
<div class="time">10 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="{{ asset('assets/img/avatar/avatar-2.png') }}"
|
||||
class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Dedik Sugiharto</b>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p>
|
||||
<div class="time">12 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-avatar">
|
||||
<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">
|
||||
<b>Agung Ardiansyah</b>
|
||||
<p>Sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<div class="time">12 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="{{ asset('assets/img/avatar/avatar-4.png') }}"
|
||||
class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Ardian Rahardiansyah</b>
|
||||
<p>Duis aute irure dolor in reprehenderit in voluptate velit ess</p>
|
||||
<div class="time">16 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-avatar">
|
||||
<img alt="image" src="{{ asset('assets/img/avatar/avatar-5.png') }}"
|
||||
class="rounded-circle">
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Alfa Zulkarnain</b>
|
||||
<p>Exercitation ullamco laboris nisi ut aliquip ex ea commodo</p>
|
||||
<div class="time">Yesterday</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="dropdown-footer text-center">
|
||||
<a href="#">View All <i class="fas fa-chevron-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="dropdown dropdown-list-toggle"><a href="#" data-toggle="dropdown"
|
||||
class="nav-link notification-toggle nav-link-lg beep"><i class="far fa-bell"></i></a>
|
||||
<div class="dropdown-menu dropdown-list dropdown-menu-right">
|
||||
<div class="dropdown-header">Notifications
|
||||
<div class="float-right">
|
||||
<a href="#">Mark All As Read</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-list-content dropdown-list-icons">
|
||||
<a href="#" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-icon bg-primary text-white">
|
||||
<i class="fas fa-code"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
Template update is available now!
|
||||
<div class="time text-primary">2 Min Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-icon bg-info text-white">
|
||||
<i class="far fa-user"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>You</b> and <b>Dedik Sugiharto</b> are now friends
|
||||
<div class="time">10 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-icon bg-success text-white">
|
||||
<i class="fas fa-check"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<b>Kusnaedi</b> has moved task <b>Fix bug header</b> to <b>Done</b>
|
||||
<div class="time">12 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-icon bg-danger text-white">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
Low disk space. Let's clean it!
|
||||
<div class="time">17 Hours Ago</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="dropdown-item">
|
||||
<div class="dropdown-item-icon bg-info text-white">
|
||||
<i class="fas fa-bell"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
Welcome to Stisla template!
|
||||
<div class="time">Yesterday</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="dropdown-footer text-center">
|
||||
<a href="#">View All <i class="fas fa-chevron-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
@endif
|
||||
<li class="dropdown"><a href="#" data-toggle="dropdown"
|
||||
class="nav-link dropdown-toggle nav-link-lg nav-link-user">
|
||||
<img alt="image"
|
||||
@ -160,3 +55,125 @@
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var notifBtn = $('#notifBtn');
|
||||
|
||||
function updateNotif() {
|
||||
notifBtn.toggleClass("beep");
|
||||
}
|
||||
|
||||
$('#notifBtn').on('click', function() {
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
var notifContent = $('#notifContent');
|
||||
var activitiesHtml = '';
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('user-notification.latest-notification') }}",
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
var notifications = response.notifications;
|
||||
if (notifications.length > 0) {
|
||||
notifications.forEach(element => {
|
||||
var url =
|
||||
"{{ route('user-notifiaction.detail-notification', ':id') }}"
|
||||
.replace(':id', element.id);
|
||||
|
||||
var date = new Date(element.updated_at);
|
||||
var day = date.getDate();
|
||||
var month = date.toLocaleString('id-ID', {
|
||||
month: 'short'
|
||||
});
|
||||
var year = date.getFullYear();
|
||||
var hours = date.getHours();
|
||||
var minutes = date.getMinutes();
|
||||
|
||||
var formattedDate = day + ' ' + month + ' ' + year +
|
||||
" | " + hours + ":" + +(minutes < 10 ? '0' : '') +
|
||||
minutes;
|
||||
|
||||
activitiesHtml += `
|
||||
<a href="${url}" class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-icon bg-primary text-white">
|
||||
<i class="fas fa-code"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
<h6>${element.title}</h6>
|
||||
${element.teaser}
|
||||
<div class="time text-primary">${formattedDate}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
});
|
||||
} else {
|
||||
activitiesHtml += `
|
||||
<a class="dropdown-item dropdown-item-unread">
|
||||
<div class="dropdown-item-icon bg-primary text-white">
|
||||
<i class="fas fa-code"></i>
|
||||
</div>
|
||||
<div class="dropdown-item-desc">
|
||||
Tidak ada notifikasi baru
|
||||
<div class="time text-primary">--:--</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
notifContent.html(activitiesHtml);
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#markAllAsRead').on('click', function() {
|
||||
const csrfToken = $('meta[name="csrf-token"]').attr('content');
|
||||
console.log("Berhasil");
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('user.notification.mark-all-as-read') }}",
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
updateNotif();
|
||||
console.log(response);
|
||||
} else {
|
||||
console.log(response);
|
||||
}
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Pusher.logToConsole = true;
|
||||
var pusher = new Pusher('3e5bdc20dddd7fbc655e', {
|
||||
cluster: 'ap1'
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('chanel-update-notifikasi');
|
||||
|
||||
channel.bind('event-update-notifikasi', function(data) {
|
||||
let receivers = data.receivers;
|
||||
let userEmail = "{{ auth()->user()->email }}";
|
||||
receivers.forEach(email => {
|
||||
if (email == userEmail) {
|
||||
updateNotif();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<script src="{{ asset('assets/modules/popper.js') }}"></script>
|
||||
<script src="{{ asset('assets/modules/bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
|
||||
|
||||
<script src="https://js.pusher.com/7.2/pusher.min.js"></script>
|
||||
|
||||
<!-- dashboard -->
|
||||
<script src="{{ asset('assets/modules/chart.min.js') }}"></script>
|
||||
|
@ -13,7 +13,7 @@
|
||||
href="{{ route(Auth::user()->role == 'Admin' ? 'admin.index' : 'user.index') }}"><i
|
||||
class="fas fa-fire"></i> <span>Dashboard</span></a></li>
|
||||
|
||||
<li class="menu-header">Starter</li>
|
||||
<li class="menu-header">Menu</li>
|
||||
|
||||
@if (Auth::user()->role == 'Admin')
|
||||
<li><a class="nav-link {{ request()->routeIs('admin-user.index') ? 'active' : '' }}"
|
||||
@ -29,6 +29,9 @@
|
||||
<li><a class="nav-link {{ request()->routeIs('admin-setting.index') ? 'active' : '' }}"
|
||||
href="{{ route('admin-setting.index') }}"><i class="fas fa-cog"></i>
|
||||
<span>Setting</span></a></li>
|
||||
<li><a class="nav-link {{ request()->routeIs('admin-notification.index') ? 'active' : '' }}"
|
||||
href="{{ route('admin-notification.index') }}"><i class="fas fa-bell"></i>
|
||||
<span>Notifikasi</span></a></li>
|
||||
@else
|
||||
<li class="drop-down ">
|
||||
<a class="nav-link {{ request()->routeIs('user-pembeli.index') || request()->routeIs('user-penjual.index') ? 'active' : '' }}"
|
||||
|
@ -26,21 +26,6 @@ use Illuminate\Support\Facades\Auth;
|
||||
// return $request->user();
|
||||
// });
|
||||
|
||||
// Login
|
||||
// Route::group(
|
||||
// [
|
||||
// 'middleware' => 'api',
|
||||
// 'prefix' => 'auth',
|
||||
// ],
|
||||
// function () {
|
||||
|
||||
//
|
||||
// Route::get('me', [LoginApiController::class,'me']);
|
||||
|
||||
// Route::get('status',[LoginApiController::class,'check']);
|
||||
// },
|
||||
// );
|
||||
|
||||
Route::prefix('auth')->group(function () {
|
||||
Route::controller(LoginApiController::class)->group(function () {
|
||||
Route::post('login', 'login')->name('auth.login'); // bisa
|
||||
@ -75,47 +60,48 @@ Route::middleware(['auth:api'])->group(function () {
|
||||
}); // sudah
|
||||
|
||||
Route::controller(TransactionApiController::class)->group(function () {
|
||||
Route::get('get-transaction-tracking', 'getTrackingTransaction')->name('transaction.get-transaction-tracking');
|
||||
Route::get('get-detail-transaction', 'getDetailTransaction')->name('transaction.get-detail-transaction');
|
||||
Route::get('get-transaction-tracking', 'getTrackingTransaction')->name('transaction.get-transaction-tracking'); // Bisa
|
||||
Route::get('get-detail-transaction', 'getDetailTransaction')->name('transaction.get-detail-transaction'); // Bisa
|
||||
}); // sudah
|
||||
|
||||
Route::controller(RefundApiController::class)->group(function () {
|
||||
Route::get('list-refund', 'listRefund')->name('refund.list-refund');
|
||||
Route::get('create-refund','createRefund')->name('refund.create-refund');
|
||||
Route::get('detail-refund','getDetailRefund')->name('refund.get-detail-refund');
|
||||
Route::post('store-refund', 'storeRefund')->name('refund.store-refund');
|
||||
Route::get('list-refund', 'listRefund')->name('refund.list-refund'); // Ragu
|
||||
Route::get('create-refund','createRefund')->name('refund.create-refund'); // Bisa
|
||||
Route::get('detail-refund','getDetailRefund')->name('refund.get-detail-refund'); // Bisa
|
||||
Route::post('store-refund', 'storeRefund')->name('refund.store-refund'); // Bisa
|
||||
}); // sudah
|
||||
|
||||
Route::controller(PembeliApiController::class)->group(function () {
|
||||
Route::get('list-pembeli', 'listPembeli')->name('pembeli.list-pembeli');
|
||||
Route::get('create-transaction', 'createTransaction')->name('pembeli.create-transaction');
|
||||
Route::post('store-transaction', 'storeTransaction')->name('pembeli.store-transaction');
|
||||
Route::post('pay-payment', 'payPayment')->name('pembeli.pay-payment');
|
||||
Route::post('cancel-payment', 'cancelPayment')->name('pembeli.cancel-payment');
|
||||
Route::post('pending-payment', 'pendingPayment')->name('pembeli.pending-payment');
|
||||
Route::post('error-payment', 'errorPayment')->name('pembeli.error-paymennt');
|
||||
Route::post('close-payment', 'closePayment')->name('pembeli.close-payment');
|
||||
Route::post('finish-transaction', 'finishTransaction')->name('pembeli.finish-transaction');
|
||||
Route::post('cancel-transaction', 'cancelTransaction')->name('pembeli.cancel-transaction');
|
||||
Route::get('list-pembeli', 'listPembeli')->name('pembeli.list-pembeli'); // Ragu
|
||||
Route::get('create-transaction', 'createTransaction')->name('pembeli.create-transaction'); // Bisa
|
||||
Route::post('store-transaction', 'storeTransaction')->name('pembeli.store-transaction'); // Bisa
|
||||
Route::post('pay-payment', 'payPayment')->name('pembeli.pay-payment'); // Bisa
|
||||
Route::post('cancel-payment', 'cancelPayment')->name('pembeli.cancel-payment'); // Bisa
|
||||
Route::post('pending-payment', 'pendingPayment')->name('pembeli.pending-payment'); // Bisa
|
||||
Route::post('error-payment', 'errorPayment')->name('pembeli.error-payment'); // Bisa
|
||||
Route::post('close-payment', 'closePayment')->name('pembeli.close-payment'); // Bisa
|
||||
Route::post('finish-transaction', 'finishTransaction')->name('pembeli.finish-transaction'); // Bisa
|
||||
Route::post('cancel-transaction', 'cancelTransaction')->name('pembeli.cancel-transaction'); // Bisa
|
||||
}); // sudah
|
||||
|
||||
Route::controller(PenjualApiController::class)->group(function () {
|
||||
Route::get('list-penjual', 'listPenjual')->name('penjual.list-penjual');
|
||||
Route::post('accept-transaction', 'acceptTransaction')->name('penjual.accept-transaction');
|
||||
Route::post('reject-transaction', 'rejectTransaction')->name('penjual.reject-transaction');
|
||||
Route::post('sending-order', 'sendingOrder')->name('penjual.sending-order');
|
||||
Route::post('sent-order', 'sentOrder')->name('penjual.sent-order');
|
||||
Route::get('list-penjual', 'listPenjual')->name('penjual.list-penjual'); // Ragu
|
||||
Route::post('accept-transaction', 'acceptTransaction')->name('penjual.accept-transaction'); // Bisa
|
||||
Route::post('reject-transaction', 'rejectTransaction')->name('penjual.reject-transaction'); // Bisa
|
||||
Route::post('sending-order', 'sendingOrder')->name('penjual.sending-order'); // Bisa
|
||||
Route::post('sent-order', 'sentOrder')->name('penjual.sent-order'); // Bisa
|
||||
Route::post('accept-result','acceptResult')->name('penjual.accept-result'); // Bisa
|
||||
}); // sudah
|
||||
|
||||
Route::controller(ProfileApiController::class)->group(function () {
|
||||
Route::get('get-profile', 'getProfile')->name('profile.get-profile');
|
||||
Route::post('update-profile', 'updateProfile')->name('profile.update-profile');
|
||||
Route::post('update-profile-password', 'updateProfilePassword')->name('profile.update-profile-password');
|
||||
Route::get('get-profile', 'getProfile')->name('profile.get-profile'); // Bisa
|
||||
Route::post('update-profile', 'updateProfile')->name('profile.update-profile'); // Bisa
|
||||
Route::post('update-profile-password', 'updateProfilePassword')->name('profile.update-profile-password'); // Bisa
|
||||
}); // sudah
|
||||
|
||||
Route::controller(InvoiceApiController::class)->group(function () {
|
||||
Route::get('get-invoice', 'getInvoice')->name('invoice.get-invoice');
|
||||
Route::get('export-invoice', 'exportInvoice')->name('invoice.export-invoice');
|
||||
Route::get('get-invoice', 'getInvoice')->name('invoice.get-invoice'); // Bisa
|
||||
Route::get('export-invoice', 'exportInvoice')->name('invoice.export-invoice'); // Bisa
|
||||
}); // sudah
|
||||
});
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\Admin\User\AdminUserController;
|
||||
use App\Http\Controllers\Admin\Setting\AdminSettingController;
|
||||
use App\Http\Controllers\Admin\Dashboard\AdminDashboardController;
|
||||
use App\Http\Controllers\Admin\Notification\AdminNotification;
|
||||
use App\Http\Controllers\Admin\Transaction\AdminTransactionController;
|
||||
use App\Http\Controllers\Admin\Refund\AdminRefundController;
|
||||
|
||||
@ -24,6 +25,7 @@ use App\Http\Controllers\Profile\ProfileController;
|
||||
|
||||
//Invoice
|
||||
use App\Http\Controllers\Invoice\InvoiceController;
|
||||
use App\Http\Controllers\User\Notification\UserNotification;
|
||||
|
||||
// use Illuminate\Foundation\Auth\User;
|
||||
|
||||
@ -125,6 +127,22 @@ Route::middleware(['auth'])->group(function(){
|
||||
Route::post('admin-setting/store','store')->name('admin-setting.store');
|
||||
Route::put('admin-setting/active/','activeSetting')->name('admin-setting.active-setting');
|
||||
});
|
||||
|
||||
Route::controller(AdminNotification::class)->group(function(){
|
||||
Route::get('admin-notification','index')->name('admin-notification.index');
|
||||
Route::get('admin-notification/show/{id}','show')->name('admin-notification.show');
|
||||
Route::get('admin-notification/create','create')->name('admin-notification.create');
|
||||
Route::get('admin-notification/list-notification','listNotification')->name('admin-notification.list-notification');
|
||||
Route::get('admin-notification/list-user-for-show','listUserForShow')->name('admin-notification.list-user-for-show');
|
||||
Route::get('admin-notification/list-user-for-create-edit','listUserForCreateEdit')->name('admin-notification.list-user-for-create-edit');
|
||||
Route::get('admin-notification/select-all-user','selectAllUser')->name('admin-notification.select-all-user');
|
||||
Route::get('admin-notification/edit','edit')->name('admin-notification.edit');
|
||||
Route::post('admin-notification/update-new-notification','updateNewNotification')->name('admin-notification.update-new-notification');
|
||||
Route::post('admin-notification/store','store')->name('admin-notification.store');
|
||||
Route::post('admin-notification/update','update')->name('admin-notification.update');
|
||||
Route::delete('admin-notification/delete','delete')->name('admin-notification.delete');
|
||||
Route::delete('admin-notification/delete-all','deleteAll')->name('admin-notification.delete-all');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -175,6 +193,7 @@ Route::middleware(['auth'])->group(function(){
|
||||
Route::put('user-penjual/tolak-transaksi','denyTransaction')->name('user-penjual.deny');
|
||||
Route::put('user-penjual/terima-transaksi','acceptTransaction')->name('user-penjual.accept');
|
||||
Route::put('user-penjual/kirim-pesanan','sendingOrder')->name('user-penjual.sending');
|
||||
Route::put('user-penjual/terima-uang','acceptResult')->name('user-penjual.accept-result');
|
||||
Route::post('user-penjual/selesai-kirim-pesanan','sentOrder')->name('user-penjual.sent');
|
||||
});
|
||||
|
||||
@ -182,10 +201,18 @@ Route::middleware(['auth'])->group(function(){
|
||||
Route::controller(UserRefundController::class)->group(function(){
|
||||
Route::get('user-refund','index')->name('user-refund.index');
|
||||
Route::get('user-refund/list-refund','listRefund')->name('user-refund.list-refund');
|
||||
Route::get('user-refund/ajukan-komplain/{id}','create')->name('user-refund.create');
|
||||
Route::get('user-refund/ajukan-komplain','create')->name('user-refund.create');
|
||||
Route::get('user-refund/detail-refund/{id}','show')->name('user-refund.show');
|
||||
Route::post('user-refund','store')->name('user-refund.store');
|
||||
});
|
||||
|
||||
Route::controller(UserNotification::class)->group(function(){
|
||||
Route::get('user-notification','index')->name('user-notification.index');
|
||||
Route::get('user-notification/list-notification','listNotification')->name('user-notification.list-notification'); // untuk di index
|
||||
Route::get('user-notification/detail-notification/{id}','show')->name('user-notifiaction.detail-notification');
|
||||
Route::get('user-notification/latest-notification','latestNotification')->name('user-notification.latest-notification');
|
||||
Route::get('user-notification/mark-all-as-read','markAllAsRead')->name('user.notification.mark-all-as-read');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user