345 lines
19 KiB
PHP
345 lines
19 KiB
PHP
@if($getInfoOrders->is_status == enum('isOrderRequested'))
|
|
@section('additional')
|
|
<div class="ms-auto me-2">
|
|
<button type="button" class="btn btn-light-danger btn-active-light-danger btn-outline-dashed cancelOrder">Tolak</button>
|
|
</div>
|
|
<div class="ms-1">
|
|
<button type="button" class="btn btn-light-primary btn-active-light-primary btn-outline-dashed acceptOrder">Terima</button>
|
|
</div>
|
|
@endsection
|
|
@endif
|
|
@if($getInfoOrders->is_status == enum('isOrderOnWorking'))
|
|
@section('additional')
|
|
<div class="ms-auto">
|
|
<button type="button" class="btn btn-light-success btn-active-light-success btn-outline-dashed jobDone"><i class="ki-outline ki-check fs-4"></i> Tandai Selesai</button>
|
|
</div>
|
|
@endsection
|
|
@endif
|
|
@if($getInfoOrders->is_status == enum('isOrderRevision'))
|
|
@section('additional')
|
|
<div class="ms-auto">
|
|
<button type="button" class="btn btn-light-success btn-active-light-success btn-outline-dashed revisionDone"><i class="ki-outline ki-check fs-4"></i> Tandai Selesai</button>
|
|
</div>
|
|
@endsection
|
|
@endif
|
|
@if($getInfoOrders->is_status == enum('isOrderCompleted') && $getInfoOrders->last_seller_message == null)
|
|
@section('additional')
|
|
<div class="ms-auto">
|
|
<button type="button" class="btn btn-light-primary btn-active-light-primary btn-outline-dashed feedback">Ulasan untuk Buyer</button>
|
|
</div>
|
|
@endsection
|
|
@endif
|
|
@include('components.theme.pages.header')
|
|
<section class="invoice">
|
|
<div class="row">
|
|
<div class="col-md-5 mb-5">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">Detil</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">Penjual</div>
|
|
<span class="text-gray-900 fw-bolder fs-6">
|
|
<div class="d-flex align-items-center">
|
|
<div class="symbol symbol-25px symbol-circle">
|
|
<div class="symbol-label" style="background-image:url({{ gravatar_team(!empty($getInfoOrders->seller->first()->email) ? $getInfoOrders->seller->first()->email : 'random' . rand(111, 999) . '@gmail.com') }}"></div>
|
|
</div>
|
|
<div class="ms-3"><span>{{ $getInfoOrders->seller->first()->name }}</span></div>
|
|
</div>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="separator separator-dashed my-3"></div>
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">URL</div>
|
|
<span class="text-gray-900 fw-bolder fs-6">{{ removeUrlPrefix($getInfoOrders->website_url) }}</span>
|
|
</div>
|
|
|
|
<div class="separator separator-dashed my-3"></div>
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">Total Harga</div>
|
|
<span class="text-gray-900 fw-bolder fs-6">{{ 'Rp. ' . number_format($getInfoOrders->total, 0, ',', '.') }}</span>
|
|
</div>
|
|
|
|
<div class="separator separator-dashed my-3"></div>
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">Status Pengerjaan</div>
|
|
<span class="text-gray-900 fw-bolder fs-6">
|
|
@if($getInfoOrders->is_status == enum('isOrderRequested'))
|
|
Sedang Ditinjau Reseller
|
|
@elseif($getInfoOrders->is_status == enum('isOrderOnWorking'))
|
|
Sedang Dikerjakan
|
|
@elseif($getInfoOrders->is_status == enum('isOrderSubmitted'))
|
|
Dikirim
|
|
@elseif($getInfoOrders->is_status == enum('isOrderRevision'))
|
|
Revisi
|
|
@elseif($getInfoOrders->is_status == enum('isOrderCompleted'))
|
|
Selesai
|
|
@elseif($getInfoOrders->is_status == enum('isOrderReqCancel'))
|
|
Permintaan Dibatalkan
|
|
@elseif($getInfoOrders->is_status == enum('isOrderCancelled'))
|
|
Dibatalkan
|
|
@else
|
|
Ditolak
|
|
@endif
|
|
</span>
|
|
</div>
|
|
|
|
<div class="separator separator-dashed my-3"></div>
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">Jenis Pesanan</div>
|
|
<span class="text-gray-900 fw-bolder fs-6">
|
|
@if($getInfoOrders->is_type == 1)
|
|
Website
|
|
@else
|
|
Domain
|
|
@endif
|
|
</span>
|
|
</div>
|
|
|
|
<div class="separator separator-dashed my-3"></div>
|
|
<div class="d-flex flex-stack">
|
|
<div class="text-gray-700 fw-semibold fs-6 me-2">Request Konten</div>
|
|
<span class="d-flex text-gray-900 fw-bolder fs-6">
|
|
@if($getInfoOrders->is_content_included == 0)
|
|
<i class="ki-outline ki-cross fs-2 text-danger me-2"></i> Tidak
|
|
@else
|
|
<i class="ki-outline ki-check fs-2 text-success me-2"></i> Ya
|
|
@endif
|
|
</span>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<button type="button" class="btn btn-light-primary mt-5 border-dashed border-1 border border-primary w-100 viewAdditional">Tambahan</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-7">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">Riwayat Pesanan</h3>
|
|
</div>
|
|
@if($getInfoOrders->is_content_included == 1)
|
|
<div class="card-body p-0" style="height: 26.55em !important">
|
|
@else
|
|
<div class="card-body p-0" style="height: 21.83em !important">
|
|
@endif
|
|
<div class="table-responsive" data-simplebar>
|
|
<table class="table table-row-bordered align-middle mb-0 gs-9">
|
|
<thead class="border-bottom border-gray-200 fs-6 text-gray-600 fw-bold bg-light bg-opacity-75">
|
|
<tr>
|
|
<td class="min-w-80px">User</td>
|
|
<td class="min-w-150px">Status</td>
|
|
<td class="min-w-250px">Komentar</td>
|
|
<td class="min-w-100px">URL</td>
|
|
<td class="min-w-150px">Waktu</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if($getInfoOrders->history->count() == 0)
|
|
<tr class="text-gray-600">
|
|
<td colspan="4" class="text-center pt-5">Tidak ada riwayat</td>
|
|
</tr>
|
|
@else
|
|
@foreach($getInfoOrders->history as $history)
|
|
@php
|
|
if($history->asActor == 1) {
|
|
$nameOfActor = findUser($getInfoOrders->buy_id)->name;
|
|
} elseif($history->asActor == 2) {
|
|
$nameOfActor = findUser($getInfoOrders->sell_id)->name;
|
|
} else {
|
|
$nameOfActor = auth()->user()->name;
|
|
}
|
|
@endphp
|
|
<tr>
|
|
<td>{{ $nameOfActor }}</td>
|
|
<td>
|
|
@if($history->is_status == enum('isHistoryDone'))
|
|
<i class="ki-outline ki-dots-horizontal fs-6 text-primary me-2"></i>
|
|
Tugas dikirim
|
|
@elseif($history->is_status == enum('isHistoryRevision'))
|
|
<i class="ki-outline ki-arrow-circle-left fs-6 text-warning me-2"></i>
|
|
Tugas Direvisi
|
|
@elseif($history->is_status == enum('isHistoryJobDone'))
|
|
<i class="ki-outline ki-double-check fs-6 text-success me-2"></i>
|
|
Tugas Selesai
|
|
@elseif($history->is_status == enum('isHistoryReqCancel'))
|
|
<i class="ki-outline ki-cross fs-6 text-danger me-2"></i>
|
|
Permintaan Dibatalkan
|
|
@elseif($history->is_status == enum('isHistoryCanceled'))
|
|
<i class="ki-outline ki-cross fs-6 text-danger me-2"></i>
|
|
<span class="">Dibatalkan</span>
|
|
@else
|
|
<i class="ki-outline ki-check fs-6 text-success me-2"></i>
|
|
<span class="">Sedang proses</span>
|
|
@endif
|
|
</td>
|
|
<td>{{ $history->comment }}</td>
|
|
<td>
|
|
@if(empty($history->url))
|
|
-
|
|
@else
|
|
<a href="{{ $history->url }}" target="_blank" class="badge font-medium bg-light-primary text-primary py-2 px-3 fs-8">klik</a>
|
|
@endif
|
|
</td>
|
|
<td data-bs-toggle="tooltip" data-bs-placement="top" title="{{ date_format(date_create($history->created_at), 'd M Y H:i') }}">{{ date_formatting($history->created_at, 'timeago') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@push('scripts')
|
|
<script src="{{ frontend('js/custom/documentation.js') }}"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.viewAdditional').on('click', () => {
|
|
$('#generalModal').modal('show');
|
|
$('#generalModalLabel').text('Detail Permintaan Tambahan');
|
|
$('.result').html(`
|
|
<div class="mb-2">
|
|
<span class="text-gray-700 fw-semibold fs-6">Badan Konten</span>
|
|
<p class="text-gray-900 fw-bolder fs-6 mb-0 mt-2">{{ empty($getInfoOrders->is_post_content) ? '-' : $getInfoOrders->is_post_content }}</p>
|
|
</div>
|
|
<div class="separator separator-dashed my-3"></div>
|
|
|
|
<div class="mb-2">
|
|
<span class="text-gray-700 fw-semibold fs-6">Permintaan Khusus</span>
|
|
<p class="text-gray-900 fw-bolder fs-6 mb-0 mt-2">{{ $getInfoOrders->special_requirement }}</p>
|
|
</div>
|
|
<div class="separator separator-dashed my-3"></div>
|
|
|
|
@if($getInfoOrders->is_content_included == 1)
|
|
<div class="mb-2">
|
|
<span class="text-gray-700 fw-semibold fs-6">Tulisan pada Link <span class="text-muted fs-7 mb-0 mt-2">Anchor Text</span></span>
|
|
<p class="text-gray-900 fw-bolder fs-6 mb-0 mt-2">{{ $getInfoOrders->anchor_text }}</p>
|
|
</div>
|
|
<div class="separator separator-dashed my-3"></div>
|
|
|
|
<div class="mb-2">
|
|
<span class="text-gray-700 fw-semibold fs-6">Penyisipan Link Forward <span class="text-muted fs-7 mb-0 mt-2">Webpage URL</span></span>
|
|
<p class="text-gray-900 fw-bolder fs-6 mb-0 mt-2">{{ $getInfoOrders->webpage_url }}</p>
|
|
</div>
|
|
<div class="separator separator-dashed my-3"></div>
|
|
@endif
|
|
`);
|
|
})
|
|
|
|
$('.cancelOrder').click(function() {
|
|
var url = $(this).data('url');
|
|
$('#generalModal').modal('show', {
|
|
backdrop: 'static'
|
|
});
|
|
$('#generalModalLabel').text('Tolak Permintaan');
|
|
$('.result').html(`
|
|
<form method="POST" action="{{ route('orders.cancel', $getInfoOrders->id) }}">
|
|
@csrf
|
|
<div class="form-group mb-4">
|
|
<label for="name">Alasan Penolakan</label>
|
|
<textarea name="cancel_reason" id="comment" style="resize: none" rows="5" class="mt-3 form-control form-control-solid"></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Tolak</button>
|
|
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
|
|
</div>
|
|
</form>
|
|
`);
|
|
})
|
|
|
|
$('.jobDone').click(function() {
|
|
var url = $(this).data('url');
|
|
$('#generalModal').modal('show', {
|
|
backdrop: 'static'
|
|
});
|
|
$('#generalModalLabel').text('Kirim Tugas');
|
|
$('.result').html(`
|
|
<form method="POST" action="{{ route('orders.process', $getInfoOrders->id) }}">
|
|
@csrf
|
|
<div class="form-group mb-4">
|
|
<label for="name">URL Tugas</label>
|
|
<input type="text" name="url" id="url" class="mt-3 form-control form-control-solid" placeholder="eg: https://play.id/content-basjnajsnaj">
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Kirim</button>
|
|
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
|
|
</div>
|
|
</form>
|
|
`);
|
|
})
|
|
|
|
$('.revisionDone').click(function() {
|
|
var url = $(this).data('url');
|
|
$('#generalModal').modal('show', {
|
|
backdrop: 'static'
|
|
});
|
|
$('#generalModalLabel').text('Kirim Tugas');
|
|
$('.result').html(`
|
|
<form method="POST" action="{{ route('orders.revision', $getInfoOrders->id) }}">
|
|
@csrf
|
|
<div class="form-group mb-4">
|
|
<label for="name">URL Tugas</label>
|
|
<input type="text" name="url" id="url" class="mt-3 form-control form-control-solid" placeholder="eg: https://play.id/content-basjnajsnaj">
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Kirim</button>
|
|
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
|
|
</div>
|
|
</form>
|
|
`);
|
|
})
|
|
|
|
$('.feedback').click(function() {
|
|
$('#generalModal').modal('show', {
|
|
backdrop: 'static'
|
|
});
|
|
$('#generalModalLabel').text('Kirim Ulasan untuk Pemesan');
|
|
$('.result').html(`
|
|
<form method="POST" action="{{ route('orders.feedback', $getInfoOrders->id) }}">
|
|
@csrf
|
|
<div class="form-group mb-4">
|
|
<label for="name">Ulasan</label>
|
|
<textarea name="feedback" id="comment" style="resize: none" rows="5" class="mt-3 form-control form-control-solid"></textarea>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Kirim</button>
|
|
<button type="button" class="btn btn-light btn-light" data-bs-dismiss="modal">Tutup</button>
|
|
</div>
|
|
</form>
|
|
`);
|
|
})
|
|
|
|
$('.acceptOrder').click(function() {
|
|
Swal.fire({
|
|
title: 'Apakah anda yakin?',
|
|
text: "Anda akan menerima permintaan ini dan akan segera memproses transaksi customer ini!",
|
|
icon: 'info',
|
|
buttonsStyling: false,
|
|
showCancelButton: true,
|
|
confirmButtonText: 'Saya yakin!',
|
|
cancelButtonText: 'Saya tidak yakin',
|
|
customClass: {
|
|
confirmButton: 'btn btn-primary',
|
|
cancelButton: 'btn btn-danger'
|
|
}
|
|
}).then((result) => {
|
|
if(result.isConfirmed) {
|
|
Swal.fire("Berhasil!", "Laman akan direfresh dalam 4 detik", "success");
|
|
setTimeout(() => {
|
|
window.location = "{{ route('orders.accept', $getInfoOrders->id) }}"
|
|
}, 4000)
|
|
} else {
|
|
Swal.fire("Aksi Dibatalkan!", "", "error");
|
|
}
|
|
})
|
|
})
|
|
})
|
|
</script>
|
|
@endpush
|
|
@include('components.theme.pages.footer') |