purchase history

Cette révision appartient à :
mojahidjouel 2023-12-19 13:43:16 +06:00
Parent 4ad886e7d2
révision 76e826271b
3 fichiers modifiés avec 77 ajouts et 59 suppressions

Voir le fichier

@ -16,8 +16,8 @@ public function index()
$student_info = Student::find(currentUserId()); $student_info = Student::find(currentUserId());
$enrollment = Enrollment::where('student_id', currentUserId())->get(); $enrollment = Enrollment::where('student_id', currentUserId())->get();
$course = Course::get(); $course = Course::get();
$checkout = Checkout::get(); $checkout = Checkout::where('student_id', currentUserId())->get();
// $purchaseHistory = Enrollment::with(['course', 'checkout'])->orderBy('enrollment_date', 'desc')->get(); // $purchaseHistory = Enrollment::with(['course', 'checkout'])->orderBy('enrollment_date', 'desc')->get();
return view('students.dashboard', compact('student_info','enrollment', 'course')); return view('students.dashboard', compact('student_info','enrollment', 'course','checkout'));
} }
} }

Voir le fichier

@ -70,9 +70,9 @@
<div class="col-lg-8"> <div class="col-lg-8">
<div class="course-description-start"> <div class="course-description-start">
<div class="video-area"> <div class="video-area">
<video controls id="my-video" class="video-js w-100" <video controls id="myvideo" class="video-js w-100"
poster="{{asset('public/frontend/dist/images/courses/vthumb.jpg')}}" data-setup="{}"> poster="{{asset('public/frontend/dist/images/courses/vthumb.jpg')}}" >
<source src="{{asset('public/frontend/dist/images/courses/video.mp4')}}" class="w-100" /> <source src="" class="w-100" />
</video> </video>
</div> </div>
<div class="course-description-start-content"> <div class="course-description-start-content">
@ -507,7 +507,7 @@ class="button button-md button--primary float-end">Post
<div class="main-wizard"> <div class="main-wizard">
<div class="main-wizard__wrapper"> <div class="main-wizard__wrapper">
<a class="main-wizard-start"> <a class="main-wizard-start">
<div class="main-wizard-icon"> <div class="main-wizard-icon" onclick="show_video('{{$material->content}}')">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" stroke-linecap="round" stroke-linejoin="round"
@ -754,6 +754,7 @@ class="w-100"></textarea>
</div> </div>
</div> </div>
</div> </div>
<script src="{{asset('public/frontend/src/js/jquery.min.js')}}"></script> <script src="{{asset('public/frontend/src/js/jquery.min.js')}}"></script>
<script src="{{asset('public/frontend/src/js/bootstrap.bundle.min.js')}}"></script> <script src="{{asset('public/frontend/src/js/bootstrap.bundle.min.js')}}"></script>
@ -771,7 +772,16 @@ class="w-100"></textarea>
hoverColor: "#FF7A1A", hoverColor: "#FF7A1A",
ratedColors: ["#FF7A1A", "#FF7A1A", "#FF7A1A", "#FF7A1A", "#FF7A1A"], ratedColors: ["#FF7A1A", "#FF7A1A", "#FF7A1A", "#FF7A1A", "#FF7A1A"],
starShape: "rounded", starShape: "rounded",
}); });
function show_video(e){
let link="{{asset('public/uploads/courses/contents')}}/"+e
var video = document.getElementById('myvideo');
video.src = link;
video.play();
}
</script> </script>
</body> </body>

Voir le fichier

@ -498,64 +498,72 @@ class="contentCard-user d-flex align-items-center">
{{-- Purchase History --}} {{-- Purchase History --}}
<div class="tab-pane fade" id="nav-purchase" role="tabpanel" aria-labelledby="nav-purchase-tab"> <div class="tab-pane fade" id="nav-purchase" role="tabpanel" aria-labelledby="nav-purchase-tab">
@foreach ($enrollment as $e) @foreach ($checkout as $e)
<div class="row"> @if ($e->cart_data)
<div class="col-lg-12"> <div class="row">
<div class="purchase-area"> <div class="col-lg-12">
<div class="purchase-area-close"> <div class="purchase-area">
<a href="#"> <div class="purchase-area-close">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" <a href="#">
xmlns="http://www.w3.org/2000/svg"> <svg width="12" height="12" viewBox="0 0 12 12" fill="none"
<path d="M11 1L1 11" stroke="#F15C4C" stroke-width="1.5" xmlns="http://www.w3.org/2000/svg">
stroke-linecap="round" stroke-linejoin="round" /> <path d="M11 1L1 11" stroke="#F15C4C" stroke-width="1.5"
<path d="M1 1L11 11" stroke="#F15C4C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
stroke-linecap="round" stroke-linejoin="round" /> <path d="M1 1L11 11" stroke="#F15C4C" stroke-width="1.5"
</svg> stroke-linecap="round" stroke-linejoin="round" />
</a> </svg>
</div> </a>
<div class="d-flex align-items-lg-center align-items-start flex-column flex-lg-row"> </div>
<div class="purchase-area-items"> <div class="d-flex align-items-lg-center align-items-start flex-column flex-lg-row">
<div
class="purchase-area-items-start d-flex align-items-lg-center flex-column flex-lg-row">
<div class="image"> <div class="purchase-area-items">
<a href="#"> @php $i=0; @endphp
<img src="{{asset('public/uploads/courses/'.$e->course?->image)}}" @foreach (json_decode(base64_decode($e->cart_data))->cart as $data)
alt="Image" /> @php ++$i; @endphp
</a> <div
</div> class="purchase-area-items-start d-flex align-items-lg-center flex-column flex-lg-row">
<div class="text d-flex flex-column flex-lg-row"> <div class="image">
<div class="text-main"> <a href="#">
<h6> <img src="{{asset('public/uploads/courses/'.$data->image)}}"
<a href="#">{{$e->course?->title_en}}</a> alt="Image" />
</h6> </a>
<p> By <a </div>
href="instructorcourses.html">{{$e->course?->instructor?->name_en}}</a> <div class="text d-flex flex-column flex-lg-row">
</p> <div class="text-main">
<h6>
<a href="#">{{$data->title_en}}</a>
</h6>
<p> By <a
href="instructorcourses.html">{{$e->course?->instructor?->name_en}}</a>
</p>
</div>
<p>৳{{$data->price}}</p>
</div>
</div> </div>
<p>৳{{$e->course?->price}}</p> @endforeach
</div>
<div class="purchase-area-items-end">
<p>{{$e->created_at}}</p>
<dl class="row">
<dt class="col-sm-4">Total</dt>
<dd class="col-sm-8">{{json_decode(base64_decode($e->cart_data))->cart_details->total_amount}}</dd>
<dt class="col-sm-4">Total Courses</dt>
<dd class="col-sm-8">
{{$i}}
</dd>
<dt class="col-sm-4">Payment Type</dt>
<dd class="col-sm-8">
{{$e->txnid}}
</dd>
</dl>
</div> </div>
</div> </div>
</div> </div>
<div class="purchase-area-items-end">
<p>11th Dec, 2020</p>
<dl class="row">
<dt class="col-sm-4">Subtotal</dt>
<dd class="col-sm-8">211 USD</dd>
<dt class="col-sm-4">Total Courses</dt>
<dd class="col-sm-8">
03
</dd>
<dt class="col-sm-4">Payment Type</dt>
<dd class="col-sm-8">
Credit Card
</dd>
</dl>
</div>
</div> </div>
</div> </div>
</div> @endif
</div>
@endforeach @endforeach
<div class="row mt-3"> <div class="row mt-3">
<div class="col-lg-12"> <div class="col-lg-12">