datatable
This commit is contained in:
		
							parent
							
								
									347be989b7
								
							
						
					
					
						commit
						61450d5ccd
					
				| @ -2,16 +2,16 @@ | |||||||
| 
 | 
 | ||||||
| namespace App\Http\Controllers\Admin; | namespace App\Http\Controllers\Admin; | ||||||
| 
 | 
 | ||||||
|  | use Throwable; | ||||||
| use App\Models\Refund; | use App\Models\Refund; | ||||||
| use App\Models\Refunds; |  | ||||||
| use App\Http\Controllers\Controller; |  | ||||||
| use App\Models\RefundDescription; |  | ||||||
| use App\Models\Transaction; | use App\Models\Transaction; | ||||||
| use App\Models\TransactionDescription; |  | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
|  | use Yajra\DataTables\DataTables; | ||||||
|  | use App\Models\RefundDescription; | ||||||
| use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||||
| use Illuminate\Support\Facades\Log; | use Illuminate\Support\Facades\Log; | ||||||
| use Throwable; | use App\Http\Controllers\Controller; | ||||||
|  | use App\Models\TransactionDescription; | ||||||
| 
 | 
 | ||||||
| class AdminRefundController extends Controller | class AdminRefundController extends Controller | ||||||
| { | { | ||||||
| @ -130,4 +130,47 @@ class AdminRefundController extends Controller | |||||||
|             ]); |             ]); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     public function listRefund(Request $request) | ||||||
|  |     { | ||||||
|  |         $subQuery = Refund::with('transaction') | ||||||
|  |         ->select('id', 'pembeli', 'nama_barang', 'penjual', 'total', 'tanggal_transaksi', 'batas_konfirmasi_transaksi', 'status'); | ||||||
|  | 
 | ||||||
|  |         if ($request->has('search') && !empty($request->search['value'])) { | ||||||
|  |             $searchRefund = $request->search['value']; | ||||||
|  |             $subQuery->where(function ($a) use ($searchRefund) { | ||||||
|  |                 $a->whereRaw('pembeli LIKE ?', ['%' . $searchRefund . '%']) | ||||||
|  |                     ->orWhereRaw('nama_barang LIKE ?', ['%' . $searchRefund . '%']) | ||||||
|  |                     ->orWhereRaw('penjual LIKE ?', ['%' . $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('aksi', function ($row) { | ||||||
|  |                 $url = route('admin-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(['aksi']) | ||||||
|  |             ->make(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -2,12 +2,13 @@ | |||||||
| 
 | 
 | ||||||
| namespace App\Http\Controllers\User; | namespace App\Http\Controllers\User; | ||||||
| 
 | 
 | ||||||
| use App\Models\Contact; |  | ||||||
| use App\Models\User; | use App\Models\User; | ||||||
| use App\Http\Controllers\Controller; | use App\Models\Contact; | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
| use Illuminate\Support\Facades\Auth; | use Yajra\DataTables\DataTables; | ||||||
| use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||||
|  | use App\Http\Controllers\Controller; | ||||||
|  | use Illuminate\Support\Facades\Auth; | ||||||
| 
 | 
 | ||||||
| class UserContactController extends Controller | class UserContactController extends Controller | ||||||
| { | { | ||||||
| @ -111,4 +112,54 @@ class UserContactController extends Controller | |||||||
|             ]); |             ]); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     public function show($id) | ||||||
|  |     { | ||||||
|  |         $user = Contact::find($id); | ||||||
|  |         return view('user.contact.modal-detail-contact', ['user' => $user]); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function listContact(Request $request) | ||||||
|  |     { | ||||||
|  |         $subQuery = DB::table('contacts') | ||||||
|  |         ->leftJoin('users', 'contacts.user_id', '=', 'users.id') | ||||||
|  |             ->select('users.nama_depan'); | ||||||
|  | 
 | ||||||
|  |         if ($request->has('search') && !empty($request->search['value'])) { | ||||||
|  |             $searchContact = $request->search['value']; | ||||||
|  |             $subQuery->where(function ($a) use ($searchContact) { | ||||||
|  |                 $a->whereRaw('nama_depan LIKE ?', ['%' . $searchContact . '%']); | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         $queryUser = Contact::from(DB::raw("({$subQuery->toSql()}) as tmp")) | ||||||
|  |             ->mergeBindings($subQuery->getQuery()) // Menggabungkan binding parameters
 | ||||||
|  |             ->select('*') | ||||||
|  |             ->get(); | ||||||
|  | 
 | ||||||
|  |         if ($request->ajax()) { | ||||||
|  |             return DataTables::of($queryUser) | ||||||
|  |             ->addIndexColumn() | ||||||
|  |             ->addColumn('action', function ($user) { | ||||||
|  |                 $url = route('admin-contact.show', ['id' => $user->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"> | ||||||
|  |                             Aksi | ||||||
|  |                         </button> | ||||||
|  |              | ||||||
|  |                         <ul class="dropdown-menu"> | ||||||
|  |                             <li> | ||||||
|  |                                 <a class="dropdown-item" href="' . $url . '">Detail</a> | ||||||
|  |                             </li> | ||||||
|  |                         </ul> | ||||||
|  |                     </div>'; | ||||||
|  |                 return $html_code; | ||||||
|  |             }) | ||||||
|  |              | ||||||
|  |                 ->rawColumns(['action']) | ||||||
|  |                 ->make(true); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -2,17 +2,18 @@ | |||||||
| 
 | 
 | ||||||
| namespace App\Http\Controllers\User; | namespace App\Http\Controllers\User; | ||||||
| 
 | 
 | ||||||
| use Illuminate\Http\Request; | use Throwable; | ||||||
| use App\Http\Controllers\Controller; |  | ||||||
| use App\Models\RefundUser; |  | ||||||
| use App\Models\Refund; |  | ||||||
| use App\Models\RefundDescription; |  | ||||||
| use App\Models\Transaction; |  | ||||||
| use App\Models\TransactionDescription; |  | ||||||
| use Carbon\Carbon; | use Carbon\Carbon; | ||||||
|  | use App\Models\Refund; | ||||||
|  | use App\Models\RefundUser; | ||||||
|  | use App\Models\Transaction; | ||||||
|  | use Illuminate\Http\Request; | ||||||
|  | use Yajra\DataTables\DataTables; | ||||||
|  | use App\Models\RefundDescription; | ||||||
| use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||||
| use Illuminate\Support\Facades\Log; | use Illuminate\Support\Facades\Log; | ||||||
| use Throwable; | use App\Http\Controllers\Controller; | ||||||
|  | use App\Models\TransactionDescription; | ||||||
| 
 | 
 | ||||||
| class UserRefundController extends Controller | class UserRefundController extends Controller | ||||||
| { | { | ||||||
| @ -107,4 +108,47 @@ class UserRefundController extends Controller | |||||||
|             'descriptions' => $refundDescription |             'descriptions' => $refundDescription | ||||||
|         ]); |         ]); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     public function listRefund(Request $request) | ||||||
|  |     { | ||||||
|  |         $subQuery = Refund::with('transaction') | ||||||
|  |         ->select('*'); | ||||||
|  | 
 | ||||||
|  |         if ($request->has('search') && !empty($request->search['value'])) { | ||||||
|  |             $searchRefund = $request->search['value']; | ||||||
|  |             $subQuery->where(function ($a) use ($searchRefund) { | ||||||
|  |                 $a->whereRaw('pembeli LIKE ?', ['%' . $searchRefund . '%']) | ||||||
|  |                     ->orWhereRaw('nama_barang LIKE ?', ['%' . $searchRefund . '%']) | ||||||
|  |                     ->orWhereRaw('penjual LIKE ?', ['%' . $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('aksi', 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(['aksi']) | ||||||
|  |                 ->make(true); | ||||||
|  |             } | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -33,5 +33,10 @@ class Contact extends Model | |||||||
|         return $this->belongsTo(User::class, 'relasi_kontak', 'email'); |         return $this->belongsTo(User::class, 'relasi_kontak', 'email'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function user() | ||||||
|  |     { | ||||||
|  |         return $this->belongsTo(User::class, 'user_id'); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     //Relasi
 |     //Relasi
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -126,4 +126,9 @@ class User extends Authenticatable | |||||||
|         return $this->village->district->city->province->name; |         return $this->village->district->city->province->name; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function contacts() | ||||||
|  |     { | ||||||
|  |         return $this->hasMany(Contact::class, 'user_id'); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							| @ -9350,5 +9350,5 @@ | |||||||
|         "php": "^8.1" |         "php": "^8.1" | ||||||
|     }, |     }, | ||||||
|     "platform-dev": [], |     "platform-dev": [], | ||||||
|     "plugin-api-version": "2.6.0" |     "plugin-api-version": "2.3.0" | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								pp._matsuriasli.pptx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								pp._matsuriasli.pptx
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -13,7 +13,7 @@ | |||||||
|                 <div class="card"> |                 <div class="card"> | ||||||
|                     <div class="card-body"> |                     <div class="card-body"> | ||||||
|                         <div class="table-responsive"> |                         <div class="table-responsive"> | ||||||
|                             <table class="table table-striped" id="table-4"> |                             <table class="table table-striped" id="table-refund"> | ||||||
|                                 <thead> |                                 <thead> | ||||||
|                                     <tr> |                                     <tr> | ||||||
|                                         <th class="text-center"> |                                         <th class="text-center"> | ||||||
| @ -29,7 +29,7 @@ | |||||||
|                                         <th>Aksi</th> |                                         <th>Aksi</th> | ||||||
|                                     </tr> |                                     </tr> | ||||||
|                                 </thead> |                                 </thead> | ||||||
|                                 <tbody> |                                 {{-- <tbody> | ||||||
|                                     @foreach ($refunds as $refund) |                                     @foreach ($refunds as $refund) | ||||||
|                                         <tr> |                                         <tr> | ||||||
|                                             <td>{{ $loop->iteration }}</td> |                                             <td>{{ $loop->iteration }}</td> | ||||||
| @ -59,7 +59,7 @@ | |||||||
|                                             </td> |                                             </td> | ||||||
|                                         </tr> |                                         </tr> | ||||||
|                                     @endforeach |                                     @endforeach | ||||||
|                                 </tbody> |                                 </tbody> --}} | ||||||
|                             </table> |                             </table> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
| @ -67,5 +67,83 @@ | |||||||
|             </div> |             </div> | ||||||
|         </section> |         </section> | ||||||
|     </div> |     </div> | ||||||
|  |     <script> | ||||||
|  |         $(function() { | ||||||
|  |             let listRefund = $('#table-refund').DataTable({ | ||||||
|  |                 processing: true, | ||||||
|  |                 serverSide: true, | ||||||
|  |                 ajax: `{{ route('admin-refund.list-refund') }}`, | ||||||
|  |                 columns: [{ | ||||||
|  |                     data: 'DT_RowIndex', | ||||||
|  |                     name: 'DT_RowIndex', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'id', | ||||||
|  |                     name: 'id', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'pembeli', | ||||||
|  |                     name: 'pembeli', | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'nama_barang', | ||||||
|  |                     name: 'nama_barang', | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'penjual', | ||||||
|  |                     name: 'penjual', | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'total', | ||||||
|  |                     name: 'total', | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'tanggal_pengajuan', | ||||||
|  |                     name: 'tanggal_pengajuan', | ||||||
|  |                     render: function(data, type, row) { | ||||||
|  |                         if (type == 'display') { | ||||||
|  |                             var date = new Date(data); | ||||||
|  |                             var formattedDate = date.toLocaleDateString('en-US', { | ||||||
|  |                                 year: '2-digit', | ||||||
|  |                                 month: '2-digit', | ||||||
|  |                                 day: '2-digit' | ||||||
|  |                             }); | ||||||
|  |                             return formattedDate; | ||||||
|  |                         } | ||||||
|  |                         return data; | ||||||
|  |                     } | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'batas_konfirmasi', | ||||||
|  |                     name: 'batas_konfirmasi', | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: null, | ||||||
|  |                     render: function(data, type, row) { | ||||||
|  |                         if (row.status == 'partial refund') { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-success">${row.status}</a>`; | ||||||
|  |                         }else if (row.status == 'pending') { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-warning">${row.status}</a>`; | ||||||
|  |                         }else { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-danger">${row.status}</a>`; | ||||||
|  |                         } | ||||||
|  |                     }, | ||||||
|  |                     orderable: true, | ||||||
|  |                     searchable: true | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'aksi', | ||||||
|  |                     name: 'aksi', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true | ||||||
|  |                 } | ||||||
|  |                 ], | ||||||
|  |             }) | ||||||
|  |         }) | ||||||
|  |     </script> | ||||||
|     @extends('admin.transaction.modal-keterangan-status') |     @extends('admin.transaction.modal-keterangan-status') | ||||||
| @endsection | @endsection | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ | |||||||
|                         </div> |                         </div> | ||||||
|                         <div class="card-body"> |                         <div class="card-body"> | ||||||
|                             <div class="table-responsive"> |                             <div class="table-responsive"> | ||||||
|                                 <table class="table table-striped" id="table-6"> |                                 <table class="table table-striped" id="table-contact"> | ||||||
|                                     <thead> |                                     <thead> | ||||||
|                                         <tr class="text-center"> |                                         <tr class="text-center"> | ||||||
|                                             <th>#</th>
 |                                             <th>#</th>
 | ||||||
| @ -31,7 +31,7 @@ | |||||||
|                                             <th>Aksi</th> |                                             <th>Aksi</th> | ||||||
|                                         </tr> |                                         </tr> | ||||||
|                                     </thead> |                                     </thead> | ||||||
|                                     <tbody> |                                     {{-- <tbody> | ||||||
|                                         @foreach ($contacts as $contact) |                                         @foreach ($contacts as $contact) | ||||||
|                                             <tr> |                                             <tr> | ||||||
|                                                 <td>{{ $loop->iteration }}</td> |                                                 <td>{{ $loop->iteration }}</td> | ||||||
| @ -51,7 +51,7 @@ | |||||||
|                                                 </td> |                                                 </td> | ||||||
|                                             </tr> |                                             </tr> | ||||||
|                                         @endforeach |                                         @endforeach | ||||||
|                                     </tbody> |                                     </tbody> --}} | ||||||
|                                 </table> |                                 </table> | ||||||
|                             </div> |                             </div> | ||||||
|                         </div> |                         </div> | ||||||
| @ -64,6 +64,37 @@ | |||||||
|     </div> |     </div> | ||||||
|     <script> |     <script> | ||||||
|         $(document).ready(function() { |         $(document).ready(function() { | ||||||
|  |             let listContact = $('#table-contact').DataTable({ | ||||||
|  |                 processing: true, | ||||||
|  |                 serverSide: true, | ||||||
|  |                 ajax: `{{ route('user-contact.list-contact') }}`, | ||||||
|  |                 columns: [{ | ||||||
|  |                     data: 'DT_RowIndex', | ||||||
|  |                     name: 'DT_RowIndex', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'id', | ||||||
|  |                     name: 'id', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'nama', | ||||||
|  |                     name: 'nama' | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'action', | ||||||
|  |                     name: 'action', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: false | ||||||
|  |                 }, | ||||||
|  |                 ] | ||||||
|  |             }) | ||||||
|  |             console.log("Setelah inisialisasi DataTables"); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|             let check = false; |             let check = false; | ||||||
|             var teksArea = document.getElementById('resultArea'); |             var teksArea = document.getElementById('resultArea'); | ||||||
|             var teksNama = document.getElementById('teksNama'); |             var teksNama = document.getElementById('teksNama'); | ||||||
|  | |||||||
| @ -9,27 +9,34 @@ | |||||||
|             </div> |             </div> | ||||||
|             <div class="modal-body"> |             <div class="modal-body"> | ||||||
|                 <div class="card-body"> |                 <div class="card-body"> | ||||||
|  |                     @isset($user) | ||||||
|                     <div class="alert alert-primary" role="alert"> |                     <div class="alert alert-primary" role="alert"> | ||||||
|                         <div class="form-group"> |                         <div class="form-group"> | ||||||
|                             <label for="teksNama" style="font-size: 1.1em;">Nama</label> |                             <label for="teksNama" style="font-size: 1.1em;">Nama</label> | ||||||
|                             <p class="form-control-static" id="teksNama"></p> |                             {{-- <p class="form-control-static" id="teksNama"></p> --}} | ||||||
|  |                             <span | ||||||
|  |                             class="text-muted ">{{ ucwords(strtolower($user->nama_depan . ' ' . $user->nama_belakang)) }}</span> | ||||||
|                         </div> |                         </div> | ||||||
|                         <hr style="border-top: 1px solid #fff;"> |                         <hr style="border-top: 1px solid #fff;"> | ||||||
|                         <div class="form-group"> |                         <div class="form-group"> | ||||||
|                             <label for="teksNoHP" style="font-size: 1.1em;">No HP</label> |                             <label for="teksNoHP" style="font-size: 1.1em;">No HP</label> | ||||||
|                             <p class="form-control-static" id="teksNoHP"></p> |                             {{-- <p class="form-control-static" id="teksNoHP"></p> --}} | ||||||
|  |                             <span class="text-muted ">{{ $user->nohp }}</span> | ||||||
|                         </div> |                         </div> | ||||||
|                         <hr style="border-top: 1px solid #fff;"> |                         <hr style="border-top: 1px solid #fff;"> | ||||||
|                         <div class="form-group"> |                         <div class="form-group"> | ||||||
|                             <label for="teksEmail" style="font-size: 1.1em;">Email</label> |                             <label for="teksEmail" style="font-size: 1.1em;">Email</label> | ||||||
|                             <p class="form-control-static" id="teksEmail"></p> |                             {{-- <p class="form-control-static" id="teksEmail"></p> --}} | ||||||
|  |                             <span class="text-muted ">{{ $user->email }}</span> | ||||||
|                         </div> |                         </div> | ||||||
|                         <hr style="border-top: 1px solid #fff;"> |                         <hr style="border-top: 1px solid #fff;"> | ||||||
|                         <div class="form-group"> |                         <div class="form-group"> | ||||||
|                             <label for="teksAlamat" style="font-size: 1.1em;">Alamat</label> |                             <label for="teksAlamat" style="font-size: 1.1em;">Alamat</label> | ||||||
|                             <p class="form-control-static" id="teksAlamat"></p> |                             {{-- <p class="form-control-static" id="teksAlamat"></p> --}} | ||||||
|  |                             <span class="text-muted ">{{ $user->alamat }}</span> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
|  |                     @endisset | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|             <div class="modal-footer"> |             <div class="modal-footer"> | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|                     <div class="card"> |                     <div class="card"> | ||||||
|                         <div class="card-body"> |                         <div class="card-body"> | ||||||
|                             <div class="table-responsive"> |                             <div class="table-responsive"> | ||||||
|                                 <table class="table table-striped" id="table-7"> |                                 <table class="table table-striped" id="table-refund"> | ||||||
|                                     <thead> |                                     <thead> | ||||||
|                                         <tr> |                                         <tr> | ||||||
|                                             <th class="text-center"> |                                             <th class="text-center"> | ||||||
| @ -30,7 +30,7 @@ | |||||||
|                                             <th>Aksi</th> |                                             <th>Aksi</th> | ||||||
|                                         </tr> |                                         </tr> | ||||||
|                                     </thead> |                                     </thead> | ||||||
|                                     <tbody> |                                     {{-- <tbody> | ||||||
|                                         @foreach ($refunds as $refund) |                                         @foreach ($refunds as $refund) | ||||||
|                                             <tr> |                                             <tr> | ||||||
|                                                 <td>{{ $loop->iteration }}</td> |                                                 <td>{{ $loop->iteration }}</td> | ||||||
| @ -60,7 +60,7 @@ | |||||||
|                                                 </td> |                                                 </td> | ||||||
|                                             </tr> |                                             </tr> | ||||||
|                                         @endforeach |                                         @endforeach | ||||||
|                                     </tbody> |                                     </tbody> --}} | ||||||
|                                 </table> |                                 </table> | ||||||
|                             </div> |                             </div> | ||||||
|                         </div> |                         </div> | ||||||
| @ -69,4 +69,78 @@ | |||||||
|             </div> |             </div> | ||||||
|         </section> |         </section> | ||||||
|     </div> |     </div> | ||||||
|  |     <script> | ||||||
|  |         $(function() { | ||||||
|  |             let listRefund = $('#table-refund').DataTable({ | ||||||
|  |                 processing: true, | ||||||
|  |                 serverSide: true, | ||||||
|  |                 ajax: "{{ route('user-refund.list-refund') }}", | ||||||
|  |                 columns: [{ | ||||||
|  |                     data: 'DT_RowIndex', | ||||||
|  |                     name: 'DT_RowIndex', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'id', | ||||||
|  |                     name: 'id', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true, | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'nama_barang', | ||||||
|  |                     name: 'nama_barang' | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'penjual', | ||||||
|  |                     name: 'penjual' | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     date: 'total', | ||||||
|  |                     name: 'total' | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'tanggal_pengajuan', | ||||||
|  |                     name: 'tanggal_pengajuan', | ||||||
|  |                     render: function(data, type, row) { | ||||||
|  |                         if (type == 'display') { | ||||||
|  |                             var date = new Date(data); | ||||||
|  |                             var formattedDate = date.toLocaleDateString('en-US', { | ||||||
|  |                                 year: '2-digit', | ||||||
|  |                                 month: '2-digit', | ||||||
|  |                                 day: '2-digit' | ||||||
|  |                             }); | ||||||
|  |                             return formattedDate; | ||||||
|  |                         } | ||||||
|  |                         return data; | ||||||
|  |                     } | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'batas_konfirmasi', | ||||||
|  |                     name: 'batas_konfirmasi' | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: null, | ||||||
|  |                     render: function(data, type, row) { | ||||||
|  |                         if (row.status == 'partial refund') { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-success">${row.status}</a>`; | ||||||
|  |                         }else if (row.status == 'pending') { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-warning">${row.status}</a>`; | ||||||
|  |                         }else { | ||||||
|  |                             return `<a href="#" data-toggle="modal" data-target="#modalKeteranganStatus" class="badge badge-danger">${row.status}</a>`; | ||||||
|  |                         } | ||||||
|  |                     }, | ||||||
|  |                     orderable: true, | ||||||
|  |                     searchable: true | ||||||
|  |                 }, | ||||||
|  |                 { | ||||||
|  |                     data: 'aksi', | ||||||
|  |                     name: 'aksi', | ||||||
|  |                     orderable: false, | ||||||
|  |                     searchable: true | ||||||
|  |                 } | ||||||
|  |                 ], | ||||||
|  |             }) | ||||||
|  |         }) | ||||||
|  |     </script> | ||||||
| @endsection | @endsection | ||||||
|  | |||||||
| @ -144,6 +144,7 @@ Route::middleware(['auth'])->group(function(){ | |||||||
|                 Route::get('user-contact','index')->name('user-contact.index'); |                 Route::get('user-contact','index')->name('user-contact.index'); | ||||||
|                 Route::get('user-contact/list-contact','listContact')->name('user-contact.list-contact'); |                 Route::get('user-contact/list-contact','listContact')->name('user-contact.list-contact'); | ||||||
|                 Route::post('user-contact','store')->name('user-contact.store'); |                 Route::post('user-contact','store')->name('user-contact.store'); | ||||||
|  |                 Route::get('admin-contact/{id}','show')->name('admin-contact.show'); | ||||||
|                 Route::delete('user-contact/delete/{id}','destroy')->name('user-contact.destroy'); |                 Route::delete('user-contact/delete/{id}','destroy')->name('user-contact.destroy'); | ||||||
|                 Route::get('user-contact/get-user-contact','getContact')->name('user-contact.get'); |                 Route::get('user-contact/get-user-contact','getContact')->name('user-contact.get'); | ||||||
|                 Route::get('user-contact/cek-contact/{email}','cekEmail')->name('user-contact.email'); |                 Route::get('user-contact/cek-contact/{email}','cekEmail')->name('user-contact.email'); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user