updating purchase history

Cette révision appartient à :
Ibrahim Khail Shakil 2023-12-12 10:51:30 +06:00
Parent 04f1bcbc50
révision af5824acaf
7 fichiers modifiés avec 22 ajouts et 66 suppressions

Voir le fichier

@ -1,52 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class CheckoutController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('frontend.checkout');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
$instructor = new Instructor;
$instructor->name_en = $request->fullName_en;
$instructor->name_bn = $request->fullName_bn;
$instructor->contact_en = $request->contactNumber_en;
$instructor->contact_bn = $request->contactNumber_bn;
$instructor->email = $request->emailAddress;
$instructor->role_id = $request->roleId;
$instructor->bio = $request->bio;
$instructor->designation = $request->designation;
$instructor->title = $request->title;
$instructor->status = $request->status;
$instructor->password = Hash::make($request->fullName_bn);
$instructor->language = 'en';
$instructor->access_block = $request->access_block;
if ($request->hasFile('image')) {
$imageName = rand(111, 999) . time() . '.' . $request->image->extension();
$request->image->move(public_path('uploads/instructors'), $imageName);
$instructor->image = $imageName;
}
if ($instructor->save())
return redirect()->route('instructor.index')->with('success', 'Data Saved');
else
return redirect()->back()->withInput()->with('error', 'Please try again');
} catch (Exception $e) {
// dd($e);
return redirect()->back()->withInput()->with('error', 'Please try again');
}
}
}

Voir le fichier

@ -13,6 +13,7 @@ public function index()
{ {
$enrollment = Enrollment::get(); $enrollment = Enrollment::get();
$course = Course::get(); $course = Course::get();
return view('students.dashboard', compact('enrollment', 'course')); $purchaseHistory = Enrollment::with(['course'])->orderBy('enrollment_date', 'desc')->get();
return view('students.dashboard', compact('enrollment', 'course', 'purchaseHistory'));
} }
} }

Voir le fichier

@ -53,11 +53,11 @@ public function store(Request $request){
# CUSTOMER INFORMATION # CUSTOMER INFORMATION
$post_data['cus_name'] = $user->name_en; $post_data['cus_name'] = $user->name_en;
$post_data['cus_email'] = $user->email; $post_data['cus_email'] = $user->email;
$post_data['cus_add1'] = "2no Gate"; $post_data['cus_add1'] = "$user->address";
$post_data['cus_city'] = "Chattogram"; $post_data['cus_city'] = "$user->city";
$post_data['cus_state'] = "Chattogram"; $post_data['cus_state'] = "$user->state";
$post_data['cus_postcode'] = "4100"; $post_data['cus_postcode'] = "$user->postcode";
$post_data['cus_country'] = "Bangladesh"; $post_data['cus_country'] = "$user->country";
$post_data['cus_phone'] = $user->contact_en; $post_data['cus_phone'] = $user->contact_en;
$post_data['cus_fax'] = $user->contact_en; $post_data['cus_fax'] = $user->contact_en;

Voir le fichier

@ -24,6 +24,11 @@ public function up(): void
$table->text('bio')->nullable(); $table->text('bio')->nullable();
$table->string('profession')->nullable(); $table->string('profession')->nullable();
$table->string('nationality')->default('Bangladeshi')->nullable(); $table->string('nationality')->default('Bangladeshi')->nullable();
$table->text('address')->nullable();
$table->string('city')->nullable();
$table->string('state')->nullable();
$table->string('postcode')->nullable();
$table->string('country')->nullable();
$table->boolean('status')->default(1)->comment('1 active, 0 inactive'); $table->boolean('status')->default(1)->comment('1 active, 0 inactive');
$table->string('password'); $table->string('password');
$table->string('language')->default('en'); $table->string('language')->default('en');

Voir le fichier

@ -504,9 +504,11 @@ 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 ($purchaseHistory as $enrollment)
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="purchase-area"> <div class="purchase-area">
<!-- Display course details using $enrollment->course and $enrollment->student -->
<div class="purchase-area-close"> <div class="purchase-area-close">
<a href="#"> <a href="#">
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" <svg width="12" height="12" viewBox="0 0 12 12" fill="none"
@ -531,10 +533,9 @@ class="purchase-area-items-start d-flex align-items-lg-center flex-column flex-l
<div class="text d-flex flex-column flex-lg-row"> <div class="text d-flex flex-column flex-lg-row">
<div class="text-main"> <div class="text-main">
<h6> <h6>
<a href="#">Advanced Digital Comic Coloring Concepts & <a href="#">{{$enrollment->course?->title_en}}</a>
Techniques</a>
</h6> </h6>
<p>By <a href="instructorcourses.html">Kevin Gilbert</a></p> <p>By <a href="instructorcourses.html">{{$enrollment->course?->instructor?->name_en}}</a></p>
</div> </div>
<p>$87</p> <p>$87</p>
</div> </div>
@ -598,6 +599,7 @@ class="purchase-area-items-start mb-0 pb-2 d-flex align-items-lg-center flex-col
</div> </div>
</div> </div>
</div> </div>
@endforeach
<div class="row mt-3"> <div class="row mt-3">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="purchase-area"> <div class="purchase-area">