|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/_hpe.edukrypt.in/resources/views/admin/order/ |
Upload File : |
@extends('admin.layout')
@section('content')
<!-- begin::main content -->
<main class="main-content">
<div class="container">
<!-- begin::page header -->
<div class="page-header">
<h3>{{ $invoice->order_no }}</h3>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Dashboard</a></li>
<li class="breadcrumb-item"><a href="{{ asset('admin/order-list') }}">Orders</a></li>
<li class="breadcrumb-item active" aria-current="page">Ordered Product List</li>
</ol>
</nav>
</div>
<!-- end::page header -->
<div class="card">
<div class="card-header">
<form id="extendfrom">
<div class="row">
<div class="col-md-4">
<input type="number" min="1" max="365" class="form-control" id="days"
name="days" placeholder="Course Durations(days)">
@if ($errors->has('days'))
<div class="error">
{{ $errors->first('days') }}
</div>
@endif
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-success pull-left">Update</button>
</div>
<div class="col-md-4">
<a href="{{ asset('admin/order-list') }}"
class="form-group btn btn-primary pull-right text-white"><i
class="fa fa-list-alt"></i> Orders</a>
</div>
</div>
</form>
</div>
<div class="card-body">
@if (isset($billings))
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>Id</th>
<th>Product Name</th>
<th>Mode</th>
<th>Type</th>
<th>Quantity</th>
<th>Days</th>
<th>Views</th>
<th>Duration</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@if (!empty($billings))
@foreach ($billings as $billing)
<tr>
<td>
<input type="checkbox" value="{{ $billing->id }}" name="opg_id"
id="opg_id">
</td>
<td>{{ $billing->id }}</td>
<td>{{ $billing->product_name }}</td>
<td>{{ $billing->product_mode }}</td>
<td>{{ $billing->product_type }}</td>
<td>{{ $billing->quantity }}</td>
<td>{{ $billing->days }}</td>
<td>{{ $billing->views }}</td>
<td>{{ date('d/m/Y', strtotime($billing->start_date)) . '-' . date('d/m/Y', strtotime($billing->expire_date)) }}
</td>
<td>
@if ($billing->expired == 0)
<label for="" class="text-success">Active</label>
@endif
@if ($billing->expired == 1)
<label for="" class="text-danger">Expired</label>
@endif
</td>
<td>
<?php
$permission = App\Helpers\PermissionActivity::getPermissionByAdminId(session('loggedIn')['id'], 6);
?>
@if ($permission == 'read')
<a href="{{ asset('admin/view-product/' . $billing->id) }}"><i
class="fa fa-eye text-primary"></i></a>
@endif
@if ($permission == 'write')
<a href="{{ asset('admin/view-product/' . $billing->id) }}"><i
class="fa fa-eye text-primary"></i></a>
<a href="{{ asset('admin/edit-product/' . $billing->id) }}"><i
class="fa fa-edit text-success"></i></a>
@endif
@if ($permission == 'delete')
<select class="form-control changeStatus"
data-id="{{ $billing->id }}">
<option value="">Select Status</option>
<option value="0"
{{ $billing->expired == 0 ? 'selected' : '' }}>
Active</option>
<option value="1"
{{ $billing->expired == 1 ? 'selected' : '' }}>
Expired</option>
</select>
{{-- <a href="{{asset('admin/view-product/'.$billing->id)}}"><i class="fa fa-eye text-primary"></i></a> --}}
{{-- <a href="{{asset('admin/edit-product/'.$billing->id)}}"><i class="fa fa-edit text-success"></i></a> --}}
{{-- <a href="{{asset('admin/delete-product/'.$billing->id)}}" class="delete-confirm" ><i class="fa fa-trash text-danger"></i></a> --}}
@endif
</td>
</tr>
@endforeach
@else
<h1>No Record Found!!</h1>
@endif
</tbody>
</table>
<div class="pagination-block">
@if (isset($_GET['query']))
{{ $billings->appends(['query' => $_GET['query']])->links('admin.includes.paginationlinks') }}
@else
{{ $billings->links('admin.includes.paginationlinks') }}
@endif
<label>Total Record Found- <?php echo count($billings); ?></label>
</div>
@endif
</div>
</div>
</div>
</main>
<!-- end::main content -->
@endsection
@push('footer-script')
<!-- begin::dataTable -->
<script>
$("#extendfrom").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
swal({
title: "Are you sure? You want to update order",
text: "Once updated, you will not be able to recover!",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then((willDelete) => {
if (willDelete) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "POST",
url: "{{ asset('admin/extend-order') }}",
dataType: "json",
data: {
days: $('#days').val(),
opg_id: $('input[name="opg_id"]:checked').val(),
},
success: function(data) {
swal("Message!", data.message, data.status);
location.reload();
}
});
}
});
});
$(document).on('change', '.changeStatus', function() {
var status = $(this).val();
var id = $(this).data('id');
// alert(id);
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
type: "post",
data: {
"status": status,
"id": id
},
url: "{{ asset('admin/change-order-status') }}",
success: function(result) {
// console.log(result);
location.reload();
}
});
});
</script>
@endpush