This commit is contained in:
Firdachs08 2024-06-13 14:26:40 +07:00
parent 9672a893ec
commit 0010e11abb
101 changed files with 2149 additions and 2791 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace App\Exports;
use App\Models\Booking;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class BookingsExport implements FromCollection, WithHeadings
{
protected $startDate;
protected $endDate;
public function __construct($startDate, $endDate)
{
$this->startDate = $startDate;
$this->endDate = $endDate;
}
public function collection()
{
return Booking::whereBetween('created_at', [$this->startDate, $this->endDate])
->select('created_at', 'name', 'category', 'service_name', 'total')
->get();
}
public function headings(): array
{
return ['Date', 'User', 'Category', 'Service', 'Price'];
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Exports;
use App\Models\Booking;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\FromCollection;
class RevenueExport implements FromCollection
{
public function collection()
{
// Retrieve data from Booking and Order models
$bookings = Booking::all();
$orders = Order::all();
// Merge data from bookings and orders into one collection
$data = $bookings->merge($orders);
return $data;
}
}

View File

@ -3,20 +3,96 @@
namespace App\Exports; namespace App\Exports;
use App\Models\Booking; use App\Models\Booking;
use App\Models\Order;
use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Events\AfterSheet;
class RevenueExport implements FromCollection class RevenueExport implements FromCollection, WithHeadings, WithMapping, WithEvents
{ {
protected $startDate;
protected $endDate;
protected $totalRevenuePerService;
public function __construct($startDate, $endDate)
{
$this->startDate = $startDate;
$this->endDate = $endDate;
$this->calculateTotalRevenuePerService();
}
public function collection() public function collection()
{ {
// Retrieve data from Booking and Order models return Booking::whereBetween('created_at', [$this->startDate, $this->endDate])
$bookings = Booking::all(); ->select('created_at', 'name', 'category', 'service_name', 'total')
$orders = Order::all(); ->get();
}
// Merge data from bookings and orders into one collection public function headings(): array
$data = $bookings->merge($orders); {
return ['Date', 'User', 'Category', 'Service', 'Price'];
}
return $data; public function map($row): array
{
return [
$row->created_at,
$row->name,
$row->category,
$row->service_name,
$row->total
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$sheet = $event->sheet;
$highestRow = $sheet->getHighestRow();
$row = $highestRow + 2;
// Append total revenue per service headers
$sheet->insertNewRowBefore($row, 2);
$sheet->setCellValue("A{$row}", 'Total Revenue per Service');
$sheet->setCellValue("A" . ($row + 1), 'Service');
$sheet->setCellValue("B" . ($row + 1), 'Total Revenue');
// Append total revenue per service data
$currentRow = $row + 2;
foreach ($this->totalRevenuePerService as $service => $total) {
$sheet->insertNewRowBefore($currentRow, 1);
$sheet->setCellValue("A{$currentRow}", $service);
$sheet->setCellValue("B{$currentRow}", $total);
$currentRow++;
}
// Mengatur format kolom angka
$sheet->getStyle("E2:E{$highestRow}")
->getNumberFormat()
->setFormatCode('#,##0'); // Format angka dengan ribuan pemisah dan tanpa desimal
// Mengatur format untuk kolom Total Revenue
$sheet->getStyle("B{$row}:B{$currentRow}")
->getNumberFormat()
->setFormatCode('#,##0'); // Format angka dengan ribuan pemisah dan tanpa desimal
}
];
}
private function calculateTotalRevenuePerService()
{
$bookings = Booking::whereBetween('created_at', [$this->startDate, $this->endDate])->get();
$this->totalRevenuePerService = [];
foreach ($bookings as $record) {
if (isset($record->service_name)) {
if (!isset($this->totalRevenuePerService[$record->service_name])) {
$this->totalRevenuePerService[$record->service_name] = 0;
}
$this->totalRevenuePerService[$record->service_name] += $record->total;
}
}
} }
} }

View File

@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Validator;
use App\Http\Controllers\API\BaseController; use App\Http\Controllers\API\BaseController;
use App\Http\Resources\Item as ItemResource; use App\Http\Resources\Item as ItemResource;
use App\Models\Review; //use App\Models\Review;
use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\GuzzleException;
use PhpParser\Node\Stmt\TryCatch; use PhpParser\Node\Stmt\TryCatch;

View File

@ -38,8 +38,8 @@ class ProductController extends BaseController
public function show(Request $request){ public function show(Request $request){
$product = Product::with('media', 'category', 'tags') $product = Product::with('media', 'category', 'tags')
->where('slug', $request->slug) ->where('slug', $request->slug)
->withCount('media','approvedReviews') //->withCount('media','approvedReviews')
->withAvg('approvedReviews', 'rating') //->withAvg('approvedReviews', 'rating')
->active() ->active()
->hasQuantity() ->hasQuantity()
->firstOrFail(); ->firstOrFail();

View File

@ -4,13 +4,47 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Booking; use App\Models\Booking;
use App\Models\Schedule;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class BookingController extends Controller class BookingController extends Controller
{ {
public function index() public function index(Request $request)
{ {
$bookings = Booking::orderBy('id', 'DESC')->get(); $search = $request->input('search');
$bookings = Booking::query()
->where('name', 'LIKE', "%{$search}%")
->orWhere('handphone', 'LIKE', "%{$search}%")
->orWhere('service_name', 'LIKE', "%{$search}%")
->orWhere('category', 'LIKE', "%{$search}%")
->orWhere('status', 'LIKE', "%{$search}%")
->orWhereHas('schedule', function ($query) use ($search) {
$query->withTrashed()->where('date', 'LIKE', "%{$search}%")
->orWhere('start_time', 'LIKE', "%{$search}%")
->orWhere('end_time', 'LIKE', "%{$search}%");
})
->paginate(10);
return view('admin.booking.index', compact('bookings')); return view('admin.booking.index', compact('bookings'));
} }
public function view($id)
{
$booking = Booking::with(['schedule' => function($query) {
$query->withTrashed();
}])->findOrFail($id);
return view('admin.booking.view', compact('booking'));
}
public function destroy($id)
{
$booking = Booking::findOrFail($id);
$booking->delete();
return redirect()->route('admin.booking.index')->with('message', 'Booking deleted successfully.');
}
} }

View File

@ -1,7 +1,7 @@
<?php <?php
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Models\Category; use App\Models\Category;
use App\Traits\ImageUploadTrait; use App\Traits\ImageUploadTrait;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
@ -18,12 +18,17 @@ class CategoryController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
//abort_if(Gate::denies('category_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); //abort_if(Gate::denies('category_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$search = $request->input('search');
$categories = Category::with('parent')->withCount('products')->latest()->paginate(5); $categories = Category::with('parent')
->withCount('products')
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->latest()
->paginate(5);
return view('admin.categories.index', compact('categories')); return view('admin.categories.index', compact('categories'));
} }

View File

@ -17,11 +17,15 @@ class ObtainedController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
//abort_if(Gate::denies('obtained_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $search = $request->input('search');
$obtaineds = Obtained::paginate(5); $obtaineds = Obtained::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->paginate(5);
return view('admin.obtaineds.index', compact('obtaineds')); return view('admin.obtaineds.index', compact('obtaineds'));
} }

View File

@ -60,6 +60,60 @@ class OrderController extends Controller
{ {
return view('admin.orders.show', compact('order')); return view('admin.orders.show', compact('order'));
} }
public function savePayment(Request $request, $orderId)
{
$order = Order::find($orderId);
if (!$order) {
return redirect()->back()->with([
'message' => 'Order not found!',
'alert-type' => 'error'
]);
}
$order->update(['payment_status' => 'paid', 'total_paid' => $request->total_paid]);
$changeAmount = $request->total_paid - $order->base_total_price;
$order->change_amount = $changeAmount;
$order->save();
// Simpan total dibayarkan dalam session
session(['total_paid' => $request->total_paid]);
return redirect()->route('admin.orders.show', $order)->with([
'message' => 'Payment status updated to paid!',
'alert-type' => 'success',
'total_paid' => $request->total_paid,
]);
}
public function markAsPaid(Request $request, $orderId)
{
$order = Order::find($orderId);
if (!$order) {
return redirect()->back()->with([
'message' => 'Order not found!',
'alert-type' => 'error'
]);
}
$order->update(['payment_status' => 'paid', 'total_paid' => $request->total_paid]);
$changeAmount = $request->total_paid - $order->base_total_price;
$order->change_amount = $changeAmount;
$order->save();
// Simpan total dibayarkan dalam session
session(['total_paid' => $request->total_paid]);
return redirect()->route('admin.orders.show', $order)->with([
'message' => 'Payment status updated to paid!',
'alert-type' => 'success',
'total_paid' => $request->total_paid,
]);
}
// ...
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.
@ -70,15 +124,6 @@ class OrderController extends Controller
public function destroy(Order $order) public function destroy(Order $order)
{ {
// \DB::transaction(
// function () use ($order) {
// OrderItem::where('order_id', $order->id)->delete();
// $order->shipment->delete();
// $order->forceDelete();
// return true;
// }
// );
OrderItem::where('order_id', $order->id)->delete(); OrderItem::where('order_id', $order->id)->delete();
$order->delete(); $order->delete();

View File

@ -19,11 +19,15 @@ class ProductController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
//abort_if(Gate::denies('product_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); //abort_if(Gate::denies('product_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');
$search = $request->input('search');
$products = Product::with('category', 'tags', 'firstMedia')->latest()->paginate(5); $products = Product::query()
->where('name', 'LIKE', "%{$search}%")
->paginate(10);
//$products = Product::with('category', 'tags', 'firstMedia')->latest()->paginate(5);
return view('admin.products.index', compact('products')); return view('admin.products.index', compact('products'));
} }

View File

@ -2,29 +2,63 @@
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Models\Booking; use Maatwebsite\Excel\Facades\Excel;
use App\Models\Order; use App\Models\Order;
use App\Models\Booking;
use App\Exports\RevenueExport; use App\Exports\RevenueExport;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel; use Carbon\Carbon;
use PDF;
class ReportController extends Controller class ReportController extends Controller
{ {
public function export(Request $request)
public function print(Request $request)
{ {
$exportType = $request->input('export'); $startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
if ($exportType == 'pdf') { $bookings = Booking::whereBetween('created_at', [$startDate, $endDate])->get();
$data = Booking::all()->merge(Order::all());
$startDate = $data->min('created_at')->format('Y-m-d'); // Tanggal pertama
$endDate = $data->max('created_at')->format('Y-m-d');
$pdf = PDF::loadView('admin.reports.exports.revenue_pdf', compact('data', 'startDate', 'endDate')); $totalRevenuePerService = [];
return $pdf->download('revenue_report.pdf'); foreach ($bookings as $record) {
} elseif ($exportType == 'xlsx') { if (isset($record->service_name)) {
return Excel::download(new RevenueExport(), 'revenue_report.xlsx'); if (!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
} }
return view('admin.reports.print', compact('bookings', 'startDate', 'endDate', 'totalRevenuePerService'));
}
public function download(Request $request)
{
$startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
return Excel::download(new RevenueExport($startDate, $endDate), 'revenue_report.xlsx');
}
public function revenue()
{
$bookings = Booking::all();
return view('admin.reports.revenue', compact('bookings'));
}
public function totalRevenue(Request $request)
{
$bookings = Booking::all(); // Ganti sesuai logika bisnis Anda untuk mendapatkan bookings
return view('admin.reports.total-revenue', compact('bookings'));
}
public function orderReport(Request $request)
{
$startDate = Carbon::parse($request->input('start'))->startOfDay();
$endDate = Carbon::parse($request->input('end'))->endOfDay();
$orders = Order::whereBetween('created_at', [$startDate, $endDate])->get();
return view('admin.reports.orders', compact('orders', 'startDate', 'endDate'));
} }
} }

View File

@ -1,77 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Review;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\ReviewRequest;
class ReviewController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$reviews = Review::with('product', 'user')->latest()->paginate(5);
return view('admin.reviews.index', compact('reviews'));
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Review $review)
{
return view('admin.reviews.show', compact('review'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Review $review)
{
return view('admin.reviews.edit', compact('review'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(ReviewRequest $request,Review $review)
{
$review->update($request->validated());
return redirect()->route('admin.reviews.index')->with([
'message' => 'success updated !',
'alert-type' => 'info'
]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Review $review)
{
$review->delete();
return redirect()->route('admin.reviews.index')->with([
'message' => 'success deleted !',
'alert-type' => 'danger'
]);
}
}

View File

@ -16,10 +16,15 @@ class ServiceCategoryController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
//abort_if(Gate::denies('category_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $search = $request->input('search');
$serviceCategories = ServiceCategory::get();
$serviceCategories = ServiceCategory::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
})
->paginate(10);
return view('admin.servicecategory.index', compact('serviceCategories')); return view('admin.servicecategory.index', compact('serviceCategories'));
} }

View File

@ -19,9 +19,18 @@ class ServiceController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
$services = Service::paginate(5); $search = $request->input('search');
$services = Service::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%')
->orWhereHas('obtaineds', function ($query) use ($search) {
$query->where('name', 'like', '%' . $search . '%');
});
})
->paginate(5);
return view('admin.services.index', compact('services')); return view('admin.services.index', compact('services'));
} }

View File

@ -1,74 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Order;
use App\Models\Shipment;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ShipmentController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$shipments = Shipment::latest()->paginate(10);
return view('admin.shipments.index', compact('shipments'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Shipment $shipment)
{
$provinces = $this->getProvinces();
$cities = isset($shipment->province_id) ? $this->getCities($shipment->province_id) : [];
return view('admin.shipments.edit', compact('shipment', 'provinces', 'cities'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Shipment $shipment)
{
$request->validate(
[
'track_number' => 'required|max:255',
]
);
$order = \DB::transaction(
function () use ($shipment, $request) {
$shipment->track_number = $request->input('track_number');
$shipment->status = Shipment::SHIPPED;
$shipment->shipped_at = now();
$shipment->shipped_by = auth()->id();
if ($shipment->save()) {
$shipment->order->status = Order::DELIVERED;
$shipment->order->save();
}
return $shipment->order;
}
);
return redirect()->route('admin.orders.show', $order->id)->with([
'message' => 'success updated shipment !',
'alert-type' => 'info'
]);
}
}

View File

@ -1,185 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\Slide;
use Illuminate\Http\Request;
use App\Traits\ImageUploadTrait;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\File;
use App\Http\Requests\Admin\SlideRequest;
class SlideController extends Controller
{
use ImageUploadTrait;
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$slides = Slide::latest()->paginate(5);
return view('admin.slides.index', compact('slides'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('admin.slides.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(SlideRequest $request)
{
$image = NULL;
if ($request->hasFile('cover')) {
$image = $this->uploadImage($request->title, $request->cover, 'slides', 500, 500);
}
Slide::create([
'title' => $request->title,
'url' => $request->url,
'body' => $request->body,
'cover' => $image,
'position' => Slide::max('position') + 1
]);
return redirect()->route('admin.slides.index')->with([
'message' => 'success created !',
'alert-type' => 'success'
]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show(Slide $slide)
{
return view('admin.slides.show', compact('slide'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(Slide $slide)
{
return view('admin.slides.edit', compact('slide'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request,Slide $slide)
{
$image = $slide->cover;
if ($request->has('cover')) {
if ($slide->cover != null && File::exists('storage/images/slides/'. $slide->cover)) {
unlink('storage/images/slides/'. $slide->cover);
}
$image = $this->uploadImage($request->title, $request->cover, 'slides', 450, 450);
}
$slide->update([
'title' => $request->title,
'url' => $request->url,
'body' => $request->body,
'cover' => $image,
]);
return redirect()->route('admin.slides.index')->with([
'message' => 'success updated !',
'alert-type' => 'info'
]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy(Slide $slide)
{
if ($slide->cover) {
if (File::exists('storage/images/slides/'. $slide->cover)) {
unlink('storage/images/slides/'. $slide->cover);
}
}
$slide->delete();
return redirect()->route('admin.slides.index')->with([
'message' => 'success deleted !',
'alert-type' => 'danger'
]);
}
public function moveUp($slideId){
$slide = Slide::findOrFail($slideId);
if (!$slide->prevSlide()) {
return redirect()->route('admin.slides.index');
}
\DB::transaction(
function () use ($slide) {
$currentPosition = $slide->position;
$prevPosition = $slide->prevSlide()->position;
$prevSlide = Slide::find($slide->prevSlide()->id);
$prevSlide->position = $currentPosition;
$prevSlide->save();
$slide->position = $prevPosition;
$slide->save();
}
);
return redirect()->route('admin.slides.index');
}
public function moveDown($slideId){
$slide = Slide::findOrFail($slideId);
if (!$slide->nextSlide()) {
return redirect()->route('admin.slides.index');
}
\DB::transaction(
function () use ($slide) {
$currentPosition = $slide->position;
$prevPosition = $slide->nextSlide()->position;
$prevSlide = Slide::find($slide->nextSlide()->id);
$prevSlide->position = $currentPosition;
$prevSlide->save();
$slide->position = $prevPosition;
$slide->save();
}
);
return redirect()->route('admin.slides.index');
}
}

View File

@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use App\Http\Requests\Admin\TagRequest; use App\Http\Requests\Admin\TagRequest;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Illuminate\Http\Request;
class TagController extends Controller class TagController extends Controller
{ {
@ -15,11 +16,16 @@ class TagController extends Controller
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function index() public function index(Request $request)
{ {
//abort_if(Gate::denies('tag_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $search = $request->input('search');
$tags = Tag::withCount('products')->latest()->paginate(5); $tags = Tag::query()
->when($search, function ($query) use ($search) {
$query->where('name', 'like', "%{$search}%");
})
->withCount('products') // Menambahkan count relasi products
->paginate(10);
return view('admin.tags.index', compact('tags')); return view('admin.tags.index', compact('tags'));
} }

View File

@ -1,77 +1,69 @@
<?php <?php
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Models\Role;
use App\Models\User; use App\Models\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreUserRequest; use App\Http\Requests\Admin\StoreUserRequest;
use App\Http\Requests\Admin\UpdateUserRequest; use App\Http\Requests\Admin\UpdateUserRequest;
class UserController extends Controller class UserController extends Controller
{ {
/** public function index(Request $request)
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{ {
$users = User::paginate(5); $search = $request->input('search');
$users = User::query()
->where('username', 'LIKE', "%{$search}%")
->orWhere('email', 'LIKE', "%{$search}%")
->orWhere('phone', 'LIKE', "%{$search}%")
->paginate(10);
return view('admin.users.index', compact('users')); return view('admin.users.index', compact('users'));
} }
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create() public function create()
{ {
return view('admin.users.create'); return view('admin.users.create');
} }
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUserRequest $request) public function store(StoreUserRequest $request)
{ {
$user = User::create($request->validated() + ['password' => bcrypt($request->password)]); $data = $request->validated();
$data['password'] = bcrypt($data['password']);
User::create($data);
return redirect()->route('admin.users.index')->with('message', "Successfully Created!");
}
return redirect()->route('admin.users.index')->with('message', "Successfully Created !");
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id) public function edit($id)
{ {
$user = User::findOrFail($id); $user = User::findOrFail($id);
//$roles = Role::all(); // Ganti Role dengan model yang sesuai dengan role Anda return view('admin.users.edit', compact('user'));
return view('admin.users.edit', compact('user'));
} }
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(UpdateUserRequest $request, $id) public function update(UpdateUserRequest $request, $id)
{
$user = User::findOrFail($id);
$data = $request->validated();
if ($request->filled('password')) {
$data['password'] = bcrypt($data['password']);
} else {
unset($data['password']);
}
$user->update($data);
return redirect()->route('admin.users.index')->with('message', "Successfully Updated!");
}
public function destroy($id)
{ {
$user = User::findOrFail($id); $user = User::findOrFail($id);
$user->update($request->validated() + ['password' => bcrypt($request->password)]); $user->delete();
return redirect()->route('admin.users.index')->with('message', "Successfully Updated !"); return redirect()->route('admin.users.index')->with('message', 'User successfully deleted.');
} }
// Methods for deleting users...
} }

View File

@ -53,7 +53,7 @@ class RegisterController extends Controller
'username' => ['required', 'string', 'max:255'], 'username' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'], 'password' => ['required', 'string', 'min:8', 'confirmed'],
//'phone' => ['required', 'string'], 'phone' => ['required', 'string'],
]); ]);
} }
@ -69,7 +69,7 @@ class RegisterController extends Controller
'username' => $data['username'], 'username' => $data['username'],
'email' => $data['email'], 'email' => $data['email'],
'password' => Hash::make($data['password']), 'password' => Hash::make($data['password']),
//'phone' => $data['phone'], 'phone' => $data['phone'],
//'role' => 2, // Menetapkan peran secara langsung //'role' => 2, // Menetapkan peran secara langsung
]); ]);

View File

@ -1,7 +1,7 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Midtrans\Config;
use App\Models\Booking; use App\Models\Booking;
use App\Models\Schedule; use App\Models\Schedule;
use App\Models\Service; use App\Models\Service;
@ -37,24 +37,33 @@ class BookingController extends Controller
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function store(Request $request) public function store(Request $request)
{ {
$request->validate([ $request->validate([
'name' => 'required', 'name' => 'required',
'handphone' => 'required|numeric', 'handphone' => 'required|numeric',
'category' => 'required', 'category' => 'required',
'schedule_id' => 'required|exists:schedules,id', 'schedule_id' => 'required|exists:schedules,id',
]); ]);
$schedule = Schedule::find($request->schedule_id); $schedule = Schedule::find($request->schedule_id);
$scheduleId = $schedule->id; $scheduleId = $schedule->id;
$currentBookings = Booking::where('schedule_id', $request->schedule_id)->count(); $currentBookings = Booking::where('schedule_id', $request->schedule_id)->count();
if ($currentBookings >= $schedule->max_slot) { if ($currentBookings >= $schedule->max_slot) {
return redirect()->back()->with('error', 'Schedule is fully booked'); return redirect()->back()->with('error', 'Schedule is fully booked');
} }
$date = $schedule->date;
$time = $schedule->time;
// Periksa apakah hanya satu metode pembayaran yang dipilih
if ($request->cash && $request->cashless) {
return redirect()->back()->with('error', 'Hanya pilih satu metode pembayaran');
}
// Set status berdasarkan metode pembayaran yang dipilih
$status = $request->cash ? 'Cash' : 'Cashless';
$date = $schedule->date;
$time = $schedule->time;
$booking = Booking::create([ $booking = Booking::create([
'service_name' => $request->service_name, 'service_name' => $request->service_name,
'name' => $request->name, 'name' => $request->name,
@ -63,48 +72,56 @@ $booking = Booking::create([
'date' => $date, 'date' => $date,
'time' => $time, 'time' => $time,
'total' => $request->price, 'total' => $request->price,
'status' => 'Unpaid', 'status' => $status === 'Cashless' ? 'Unpaid' : 'Paid', // Ubah status sesuai dengan metode pembayaran yang dipilih
'schedule_id' => $request->schedule_id, // Assign schedule_id here 'schedule_id' => $request->schedule_id,
'order_id' => Str::uuid(),
]); ]);
if ($request['cash'] === "on" && $request['cashless'] === "on") { if ($currentBookings + 1 >= $schedule->max_slot) {
return '<script>alert("Choose one payment only!!!");window.location.href="/orders/checkout"</script>'; $schedule->status = 'not available';
} $schedule->save();
}
if ($currentBookings + 1 >= $schedule->max_slot) { // Jika pembayaran dilakukan menggunakan cash, langsung tampilkan halaman pembayaran
$schedule->status = 'not available'; if ($status === 'Cash') {
$schedule->save(); $booking->update(['status' => 'Cash']);
} return view('frontend.booking.paycash', compact('booking'));
if ($request['cash'] === "on") { }
$booking->update(['status' => 'Cash']);
// $scheduleData->update(['status' => 'booked']);
return view('frontend.booking.paycash', compact('booking'));
}
// Set your Merchant Server Key // Jika pembayaran dilakukan menggunakan cashless, langsung ubah status menjadi Paid
\Midtrans\Config::$serverKey = config('midtrans.serverKey'); if ($status === 'Cashless') {
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction). $booking->update(['status' => 'Paid']);
\Midtrans\Config::$isProduction = false; // Lanjutkan dengan logika untuk pembayaran cashless
// Set sanitization on (default) }
\Midtrans\Config::$isSanitized = true;
// Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true;
$params = array(
'transaction_details' => array(
'order_id' => Str::random(15),
'gross_amount' => $request->price,
),
'customer_details' => array(
'name' => $request->name,
'handphone' => $request->handphone,
),
);
$snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.booking.detail', compact('snapToken', 'booking', 'scheduleId')); // Set your Merchant Server Key
} \Midtrans\Config::$serverKey = config('midtrans.serverKey');
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
\Midtrans\Config::$isProduction = false;
// Set sanitization on (default)
\Midtrans\Config::$isSanitized = true;
// Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true;
$params = array(
'transaction_details' => array(
'order_id' => Str::random(15),
'gross_amount' => $request->price,
),
'customer_details' => array(
'name' => $request->name,
'handphone' => $request->handphone,
),
);
$snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.booking.detail', compact('snapToken', 'booking', 'scheduleId'));
}
/** /**
* Display the specified resource. * Display the specified resource.
@ -169,11 +186,23 @@ $booking = Booking::create([
public function payment_success($bookingId, $scheduleId) public function payment_success($bookingId, $scheduleId)
{ {
$booking = Booking::findOrFail($bookingId); $booking = Booking::findOrFail($bookingId);
$booking->update(['status' => 'Paid']); $booking->update(['status' => 'Paid']); // Update status pembayaran menjadi "Paid"
$schedule = Schedule::findOrFail($scheduleId); $schedule = Schedule::findOrFail($scheduleId);
//$schedule->update(['status' => 'booked']); //$schedule->update(['status' => 'booked']);
return redirect()->route('service.index'); return redirect()->route('booking.print', ['bookingId' => $booking->id]); // Redirect ke halaman struk pembayaran
} }
public function showBooking($bookingId)
{
$booking = Booking::findOrFail($bookingId);
return view('frontend.booking.show', compact('booking'));
}
public function printBill($bookingId)
{
$booking = Booking::findOrFail($bookingId);
return view('frontend.booking.show', compact('booking'));
}
} }

View File

@ -4,7 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Category; use App\Models\Category;
use App\Models\Product; use App\Models\Product;
use App\Models\Slide; //use App\Models\Slide;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use phpDocumentor\Reflection\Types\Null_; use phpDocumentor\Reflection\Types\Null_;
@ -20,8 +20,8 @@ class HomeController extends Controller
{ {
$products = Product::latest()->get(); $products = Product::latest()->get();
$categories = Category::whereNull('category_id')->take(4)->get(); $categories = Category::whereNull('category_id')->take(4)->get();
$slides = Slide::latest()->get(); //$slides = Slide::latest()->get();
return view('frontend.homepage', compact('products', 'categories','slides')); return view('frontend.homepage', compact('products', 'categories'));
} }
} }

View File

@ -21,18 +21,8 @@ class OrderController extends Controller
return redirect()->route('cart.index'); return redirect()->route('cart.index');
} }
// \Cart::removeConditionsByType('shipping');
$items = \Cart::getContent(); $items = \Cart::getContent();
// $totalWeight = 0;
// foreach ($items as $item) {
// $totalWeight += ($item->quantity * $item->associatedModel->weight);
// }
// $provinces = $this->getProvinces();
// $cities = isset(auth()->user()->city_id) ? $this->getCities(auth()->user()->province_id) : [];
return view('frontend.orders.checkout', compact('items')); return view('frontend.orders.checkout', compact('items'));
} }
@ -190,40 +180,12 @@ class OrderController extends Controller
$token = $request->except('_token'); $token = $request->except('_token');
$order = \DB::transaction(function () use ($token) { $order = \DB::transaction(function () use ($token) {
// $destination = isset($params['ship_to']) ? $params['shipping_city_id'] : $params['city_id'];
// $items = \Cart::getContent();
// $totalWeight = 0;
// foreach ($items as $item) {
// $totalWeight += ($item->quantity * $item->associatedModel->weight);
// }
// $selectedShipping = $this->getSelectedShipping($destination, $totalWeight, $params['shipping_service']);
$baseTotalPrice = \Cart::getSubTotal(); $baseTotalPrice = \Cart::getSubTotal();
// $shippingCost = $selectedShipping['cost'];
// $discountAmount = 0;
// $discountPercent = 0;
// $grandTotal = ($baseTotalPrice + $shippingCost) - $discountAmount;
$orderDate = date('Y-m-d H:i:s'); $orderDate = date('Y-m-d H:i:s');
$paymentDue = (new \DateTime($orderDate))->modify('+3 day')->format('Y-m-d H:i:s'); $paymentDue = (new \DateTime($orderDate))->modify('+3 day')->format('Y-m-d H:i:s');
// $user_profile = [
// 'username' => $params['username'],
// 'first_name' => $params['first_name'],
// 'last_name' => $params['last_name'],
// 'address1' => $params['address1'],
// 'address2' => $params['address2'],
// 'province_id' => $params['province_id'],
// 'city_id' => $params['city_id'],
// 'postcode' => $params['postcode'],
// 'phone' => $params['phone'],
// 'email' => $params['email'],
// ];
// auth()->user()->update($user_profile);
$orderParams = [ $orderParams = [
'user_id' => auth()->id(), 'user_id' => auth()->id(),
'code' => Order::generateCode(), 'code' => Order::generateCode(),
@ -232,23 +194,15 @@ class OrderController extends Controller
'payment_due' => $paymentDue, 'payment_due' => $paymentDue,
'payment_status' => Order::UNPAID, 'payment_status' => Order::UNPAID,
'base_total_price' => $baseTotalPrice, 'base_total_price' => $baseTotalPrice,
// 'discount_amount' => $discountAmount,
// 'discount_percent' => $discountPercent,
// 'shipping_cost' => $shippingCost,
// 'grand_total' => $grandTotal,
'customer_first_name' => $token['username'], 'customer_first_name' => $token['username'],
// 'customer_last_name' => $params['last_name'],
// 'customer_address1' => $params['address1'],
// 'customer_address2' => $params['address2'],
'customer_phone' => $token['phone'], 'customer_phone' => $token['phone'],
// 'customer_email' => $params['email'],
// 'customer_city_id' => $params['city_id'],
// 'customer_province_id' => $params['province_id'],
// 'customer_postcode' => $params['postcode'],
'note' => $token['note'], 'note' => $token['note'],
// 'shipping_courier' => $selectedShipping['courier'],
// 'shipping_service_name' => $selectedShipping['service'],
]; ];
if (!empty($token['reseller']) && $token['reseller'] === 'on') {
$orderParams['customer_first_name'] = $token['customer_first_name']; // Simpan reseller name jika checkbox reseller dicentang
$orderParams['customer_phone'] = $token['customer_phone']; // Simpan reseller phone jika checkbox reseller dicentang
}
$order = Order::create($orderParams); $order = Order::create($orderParams);
@ -285,46 +239,14 @@ class OrderController extends Controller
} }
} }
} }
// $shippingFirstName = isset($params['ship_to']) ? $params['shipping_first_name'] : $params['first_name'];
// $shippingLastName = isset($params['ship_to']) ? $params['shipping_last_name'] : $params['last_name'];
// $shippingAddress1 = isset($params['ship_to']) ? $params['shipping_address1'] : $params['address1'];
// $shippingAddress2 = isset($params['ship_to']) ? $params['shipping_address2'] : $params['address2'];
// $shippingPhone = isset($params['ship_to']) ? $params['shipping_phone'] : $params['phone'];
// $shippingEmail = isset($params['ship_to']) ? $params['shipping_email'] : $params['email'];
// $shippingCityId = isset($params['ship_to']) ? $params['shipping_city_id'] : $params['city_id'];
// $shippingProvinceId = isset($params['ship_to']) ? $params['shipping_province_id'] : $params['province_id'];
// $shippingPostcode = isset($params['ship_to']) ? $params['shipping_postcode'] : $params['postcode'];
// $shipmentParams = [
// 'user_id' => auth()->id(),
// 'order_id' => $order->id,
// 'status' => Shipment::PENDING,
// 'total_qty' => \Cart::getTotalQuantity(),
// 'total_weight' => $totalWeight,
// 'first_name' => $shippingFirstName,
// 'last_name' => $shippingLastName,
// 'address1' => $shippingAddress1,
// 'address2' => $shippingAddress2,
// 'phone' => $shippingPhone,
// 'email' => $shippingEmail,
// 'city_id' => $shippingCityId,
// 'province_id' => $shippingProvinceId,
// 'postcode' => $shippingPostcode,
// ];
// Shipment::create($shipmentParams);
return $order; return $order;
}); });
if (!isset($order)) { if (!isset($order)) {
return redirect()->back()->with([ return redirect()->back()->with([
'message' => 'something went wrong !', 'message' => 'something went wrong!',
'alert-type' => 'danger' 'alert-type' => 'danger'
]); ]);
// return redirect()->route('checkout.received', $order->id);
} }
if ($request['cash'] === "on" && $request['cashless'] === "on") { if ($request['cash'] === "on" && $request['cashless'] === "on") {
@ -333,7 +255,7 @@ class OrderController extends Controller
if ($request['cash'] === "on") { if ($request['cash'] === "on") {
\Cart::clear(); \Cart::clear();
$order->update(['payment_status' => 'cash']); $order->update(['payment_status' => 'unpaid']);
return view('frontend.orders.cash', compact('order')); return view('frontend.orders.cash', compact('order'));
} }
@ -346,58 +268,23 @@ class OrderController extends Controller
// Set 3DS transaction for credit card to true // Set 3DS transaction for credit card to true
\Midtrans\Config::$is3ds = true; \Midtrans\Config::$is3ds = true;
$params = array( $params = [
'transaction_details' => array( 'transaction_details' => [
'order_id' => Str::random(15), 'order_id' => Str::random(15),
'gross_amount' => $order->base_total_price, 'gross_amount' => $order->base_total_price,
), ],
'customer_details' => array( 'customer_details' => [
'name' => $request->username, 'name' => $request->username,
'handphone' => $request->phone, 'handphone' => $request->phone,
), ],
); ];
$snapToken = \Midtrans\Snap::getSnapToken($params); $snapToken = \Midtrans\Snap::getSnapToken($params);
return view('frontend.orders.confirmation', compact('snapToken', 'order')); return view('frontend.orders.confirmation', compact('snapToken', 'order'));
// $this->initPaymentGateway();
// $customerDetails = [
// 'first_name' => $order->customer_first_name,
// 'last_name' => $order->customer_last_name,
// 'email' => $order->customer_email,
// 'phone' => $order->customer_phone,
// ];
// $transaction_details = [
// 'enable_payments' => Payment::PAYMENT_CHANNELS,
// 'transaction_details' => [
// 'order_id' => $order->code,
// 'gross_amount' => $order->grand_total,
// ],
// 'customer_details' => $customerDetails,
// 'expiry' => [
// 'start_time' => date('Y-m-d H:i:s T'),
// 'unit' => Payment::EXPIRY_UNIT,
// 'duration' => Payment::EXPIRY_DURATION,
// ]
// ];
// try {
// $snap = Snap::createTransaction($transaction_details);
// $order->payment_token = $snap->token;
// $order->payment_url = $snap->redirect_url;
// $order->save();
// header('Location: ' . $order->payment_url);
// exit;
// } catch (Exception $e) {
// echo $e->getMessage();
// }
} }
public function order_success($orderId) public function order_success($orderId)
{ {
$order = Order::find($orderId); $order = Order::find($orderId);

View File

@ -11,8 +11,8 @@ class ProductController extends Controller
{ {
$product = Product::with('media', 'category', 'tags') $product = Product::with('media', 'category', 'tags')
->where('slug', $slug) ->where('slug', $slug)
->withCount('media','approvedReviews') ->withCount('media')
->withAvg('approvedReviews', 'rating')
->active() ->active()
->hasQuantity() ->hasQuantity()
->firstOrFail(); ->firstOrFail();

View File

@ -21,6 +21,7 @@ class ServiceController extends Controller
return view('frontend.service.index', compact('serviceCategories')); return view('frontend.service.index', compact('serviceCategories'));
} }
/** /**
* Show the form for creating a new resource. * Show the form for creating a new resource.
* *

View File

@ -1,110 +0,0 @@
<?php
namespace App\Http\Livewire\Shop;
use App\Models\Order;
use App\Models\Review;
use Illuminate\Http\Request;
use Livewire\Component;
class SingleProductReviewComponent extends Component
{
public $showForm = true;
public $canRate = false;
public $product;
public $content;
public $rating;
public $checkProduct;
public $currentRatingId;
protected $listeners = [
'update_rating' => 'mount',
];
public function mount()
{
$this->checkProduct = Order::whereHas('orderItems', function ($query) {
$query->where('product_id', $this->product->id);
})->where('user_id', auth()->id())->where('status', Order::COMPLETED)->first();
if ($this->checkProduct) {
$this->canRate = true;
}
if(auth()->user()){
$rating = Review::where('user_id', auth()->id())->where('product_id', $this->product->id)->first();
if (!empty($rating)) {
$this->rating = $rating->rating;
$this->content = $rating->content;
$this->currentRatingId = $rating->id;
}
}
}
public function rules()
{
return [
'rating' => ['required'],
'content' => ['required', 'string']
];
}
public function rate(Request $request)
{
if (!$this->checkProduct){
$this->alert('error', 'You must buy this item first');
return false;
}
$rating = Review::where('user_id', auth()->id())->where('product_id', $this->product->id)->first();
$this->validate();
if (empty($rating)) {
$rating = new Review();
$rating->user_id = auth()->id();
$rating->product_id = $this->product->id;
$rating->rating = $this->rating;
$rating->content = $this->content;
$rating->status = 1;
$rating->save();
} else {
if ($rating->status == 'Inactive'){
$this->alert('error', 'already rating this item');
return false;
}
$rating->user_id = auth()->id();
$rating->product_id = $this->product->id;
$rating->rating = $this->rating;
$rating->content = $this->content;
$rating->ip_address = $request->ip();
$rating->status = 1;
$rating->update();
}
$this->showForm = false;
$this->emit('update_rating');
}
public function delete($id)
{
$rating = Review::where('id', $id)->first();
if ($rating && ($rating->user_id == auth()->id())) {
$rating->delete();
}
if ($this->currentRatingId) {
$this->currentRatingId = '';
$this->rating = '';
$this->content = '';
}
$this->emit('update_rating');
$this->showForm = true;
}
public function render()
{
return view('livewire.shop.single-product-review-component');
}
}

View File

@ -35,7 +35,7 @@ class ProductRequest extends FormRequest
'status' => ['required'], 'status' => ['required'],
'weight' => ['required', 'numeric'], 'weight' => ['required', 'numeric'],
'description' => ['required', 'max:1000'], 'description' => ['required', 'max:1000'],
'details' => ['required', 'max:10000'], //'details' => ['required', 'max:10000'],
'images' => ['required'], 'images' => ['required'],
'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000'] 'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000']
]; ];
@ -50,8 +50,8 @@ class ProductRequest extends FormRequest
'quantity' => ['required', 'numeric'], 'quantity' => ['required', 'numeric'],
'category_id' => ['required'], 'category_id' => ['required'],
'tags.*' => ['required'], 'tags.*' => ['required'],
'details' => ['required', 'max:10000'], //'details' => ['required', 'max:10000'],
'review_able' => ['nullable'],
'status' => ['required'], 'status' => ['required'],
'images' => ['nullable'], 'images' => ['nullable'],
'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000'] 'images.*' => ['mimes:jpg,jpeg,png,gif', 'max:4000']

View File

@ -1,30 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class ReviewRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'status' => ['required'],
];
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class SlideRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
switch ($this->method()) {
case 'POST':
{
return [
'title' => ['required', 'max:255'],
'url' => ['required', 'max:255'],
'body' => ['required', 'max:255'],
'cover' => ['required','mimes:jpg,jpeg,png,gif', 'max:3000']
];
}
case 'PUT':
case 'PATCH':
{
return [
'title' => ['required', 'max:255'],
'url' => ['required', 'max:255'],
'body' => ['required', 'max:255'],
'cover' => ['mimes:jpg,jpeg,png,gif', 'max:3000']
];
}
default: break;
}
}
}

View File

@ -24,10 +24,11 @@ class StoreUserRequest extends FormRequest
public function rules() public function rules()
{ {
return [ return [
'username' => ['required'], 'username' => ['required', 'unique:users'],
'email' => ['required', 'unique:users',], 'email' => ['required', 'unique:users'],
'roles.*' => ['integer',], 'phone' => ['required', 'unique:users'],
'roles' => ['required', 'array',], 'password' => ['required'],
'role' => ['required', 'in:admin,user'],
]; ];
} }
} }

View File

@ -1,38 +0,0 @@
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class UpdateRoleRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title' => 'required',
'permissions.*' => [
'integer',
],
'permissions' => [
'required',
'array',
],
];
}
}

View File

@ -3,6 +3,7 @@
namespace App\Http\Requests\Admin; namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateUserRequest extends FormRequest class UpdateUserRequest extends FormRequest
{ {
@ -24,20 +25,11 @@ class UpdateUserRequest extends FormRequest
public function rules() public function rules()
{ {
return [ return [
'username' => [ 'username' => ['required', Rule::unique('users')->ignore($this->user)],
'required', 'email' => ['required', Rule::unique('users')->ignore($this->user)],
], 'phone' => ['required', Rule::unique('users')->ignore($this->user)],
'email' => [ 'password' => ['nullable'],
'required', 'role' => ['required', 'in:admin,user'],
'unique:users,email,' . request()->route('user')->id,
],
'roles.*' => [
'integer',
],
'roles' => [
'required',
'array',
],
]; ];
} }
} }

View File

@ -21,7 +21,7 @@ class Product extends JsonResource
'price' => $this->price, 'price' => $this->price,
'quantity' => $this->quantity, 'quantity' => $this->quantity,
'description' => $this->description, 'description' => $this->description,
'details' => $this->details, //'details' => $this->details,
'image' => $image, 'image' => $image,
]; ];
} }

View File

@ -12,6 +12,6 @@ class Booking extends Model
protected $guarded = ['id']; protected $guarded = ['id'];
public function schedule() public function schedule()
{ {
return $this->belongsTo(Schedule::class); return $this->belongsTo(Schedule::class)->withTrashed();
} }
} }

View File

@ -63,24 +63,11 @@ class Product extends Model
->orderBy('file_sort', 'asc'); ->orderBy('file_sort', 'asc');
} }
public function reviews()
{
return $this->hasMany(Review::class);
}
public function approvedReviews()
{
return $this->hasMany(Review::class)->whereStatus(1);
}
public function ratings()
{
return $this->hasMany(Rating::class);
}
public function rate()
{
return $this->ratings->isNotEmpty() ? $this->ratings()->sum('value') / $this->ratings()->count() : 0;
}
} }

View File

@ -1,11 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Rating extends Model
{
use HasFactory;
}

View File

@ -1,27 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Review extends Model
{
use HasFactory;
protected $guarded = ['id','created_at','updated_at'];
public function getStatusAttribute()
{
return $this->attributes['status'] == 0 ? 'Inactive' : 'Active';
}
public function user(){
return $this->belongsTo(User::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
}

View File

@ -4,10 +4,11 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Schedule extends Model class Schedule extends Model
{ {
use HasFactory; use HasFactory, SoftDeletes;
protected $guarded = ['id']; protected $guarded = ['id'];

View File

@ -1,26 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Shipment extends Model
{
use HasFactory;
protected $guarded = ['id', 'created_at', 'updated_at'];
public const PENDING = 'pending';
public const SHIPPED = 'shipped';
/**
* Relationship to the order model
*
* @return void
*/
public function order()
{
return $this->belongsTo(Order::class);
}
}

View File

@ -1,27 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Slide extends Model
{
use HasFactory;
protected $guarded = ['id', 'created_at', 'updated_at'];
public function prevSlide()
{
return self::where('position', '<', $this->position)
->orderBy('position', 'DESC')
->first();
}
public function nextSlide()
{
return self::where('position', '>', $this->position)
->orderBy('position', 'ASC')
->first();
}
}

View File

@ -21,9 +21,14 @@ class User extends Authenticatable
'username', 'username',
'email', 'email',
'password', 'password',
'phone',
'role', // Add the role attribute here 'role', // Add the role attribute here
]; ];
public function assignRole($role)
{
$this->role = $role; // Anggaplah kolom peran pada tabel pengguna adalah 'role'
$this->save();
}
/** /**
* The attributes that should be hidden for serialization. * The attributes that should be hidden for serialization.

View File

@ -4,7 +4,7 @@ namespace App\Providers;
use App\Models\Tag; use App\Models\Tag;
use App\Models\Category; use App\Models\Category;
use App\Models\Review; //use App\Models\Review;
use Illuminate\Pagination\Paginator; use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
@ -32,7 +32,7 @@ class AppServiceProvider extends ServiceProvider
View::composer('*', function ($view) { View::composer('*', function ($view) {
$view->with('categories_menu', Category::with('children')->whereNull('category_id')->get()); $view->with('categories_menu', Category::with('children')->whereNull('category_id')->get());
$view->with('tags_menu', Tag::withCount('products')->get()); $view->with('tags_menu', Tag::withCount('products')->get());
$view->with('recent_reviews', Review::with('product','user')->whereStatus(true)->latest()->limit(5)->get()); //$view->with('recent_reviews', Review::with('product','user')->whereStatus(true)->latest()->limit(5)->get());
}); });
} }
} }

View File

@ -20,7 +20,7 @@ class CreateProductsTable extends Migration
$table->string('slug'); $table->string('slug');
$table->integer('price'); $table->integer('price');
$table->text('description'); $table->text('description');
$table->longText('details'); //$table->longText('details');
$table->integer('weight'); $table->integer('weight');
$table->integer('quantity')->default(0); $table->integer('quantity')->default(0);
$table->boolean('status')->default(false); $table->boolean('status')->default(false);

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSlidesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('slides', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('url')->nullable();
$table->integer('position')->default(0);
$table->text('body')->nullable();
$table->text('cover');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('slides');
}
}

View File

@ -1,53 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateShipmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shipments', function (Blueprint $table) {
$table->id();
// $table->foreignId('user_id')->nullable()->constrained();
//$table->foreignId('order_id')->nullable()->constrained();
$table->string('track_number')->nullable();
$table->string('status');
$table->integer('total_qty');
$table->integer('total_weight');
$table->string('first_name');
$table->string('last_name');
$table->string('address1')->nullable();
$table->string('address2')->nullable();
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->string('city_id')->nullable();
$table->string('province_id')->nullable();
$table->integer('postcode')->nullable();
$table->datetime('shipped_at')->nullable();
$table->unsignedBigInteger('shipped_by')->nullable();
//$table->foreign('shipped_by')->references('id')->on('users');
$table->index('track_number');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shipments');
}
}

View File

@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReviewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('reviews', function (Blueprint $table) {
$table->id();
//$table->foreignId('user_id')->nullable()->constrained()->cascadeOnDelete();
$table->foreignId('product_id')->constrained()->cascadeOnDelete();
$table->text('content');
$table->boolean('status')->default(false);
$table->unsignedTinyInteger('rating');
$table->string('ip_address')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('reviews');
}
}

View File

@ -15,7 +15,7 @@ class CreateOrdersTable extends Migration
{ {
Schema::create('orders', function (Blueprint $table) { Schema::create('orders', function (Blueprint $table) {
$table->id(); $table->id();
//$table->foreignId('user_id')->nullable()->constrained(); $table->foreignId('user_id')->nullable()->constrained();
$table->string('code')->unique(); $table->string('code')->unique();
$table->string('status'); $table->string('status');
$table->datetime('order_date'); $table->datetime('order_date');

View File

@ -15,10 +15,10 @@ class CreateFavoritesTable extends Migration
{ {
Schema::create('favorites', function (Blueprint $table) { Schema::create('favorites', function (Blueprint $table) {
$table->id(); $table->id();
//$table->foreignId('user_id')->constrained(); $table->foreignId('user_id')->constrained();
$table->foreignId('product_id')->constrained(); $table->foreignId('product_id')->constrained();
$table->timestamps(); $table->timestamps();
//$table->index(['user_id', 'product_id']); $table->index(['user_id', 'product_id']);
}); });
} }

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddDeletedAtToSchedulesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('schedules', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('schedules', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
}

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTotalPaidAndChangeAmountToOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('orders', function (Blueprint $table) {
$table->decimal('total_paid', 15, 2)->nullable();
$table->decimal('change_amount', 15, 2)->nullable();
});
}
public function down()
{
Schema::table('orders', function (Blueprint $table) {
$table->dropColumn('total_paid');
$table->dropColumn('change_amount');
});
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddPhoneToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
//$table->string('phone')->after('email');
$table->string('phone')->nullable()->after('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('phone');
});
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -19,73 +19,84 @@
</div> </div>
<!-- Content Row --> <!-- Content Row -->
<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-bordered" cellspacing="0" width="100%"> <form action="{{ route('admin.booking.index') }}" method="GET" class="form-inline">
<thead> <div class="input-group">
<tr> <input type="text" name="search" class="form-control" placeholder="Search..." value="{{ request('search') }}">
<th>No</th> <div class="input-group-append">
<th>Payment</th> <button class="btn btn-primary" type="submit">
<th>Date</th> <i class="fas fa-search"></i>
<th>Time</th> </button>
<th>Service</th> </div>
</div>
<th>Customer Name</th> </form>
<th>Contact</th> <table class="table table-bordered" cellspacing="0" width="100%">
<thead>
{{-- <th>Action</th> --}} <tr>
</tr> <th>No</th>
</thead> <th>Payment</th>
<tbody> <th>Date</th>
@forelse($bookings as $booking) <th>Time</th>
<tr> <th>Service</th>
<td>{{ $loop->iteration }}</td> <th>Customer Name</th>
<td> <th>Contact</th>
@if ($booking->status === 'Cash') <th>Actions</th>
{{ $booking->status }} {{-- <th>Action</th> --}}
@else </tr>
@if ($booking->status === 'Paid') </thead>
<span class="text-success">Cashless - Paid</span> <tbody>
@elseif ($booking->status === 'Unpaid') @forelse($bookings as $booking)
<span class="text-danger">Cashless - Unpaid</span> <tr>
@endif <td>{{ $loop->iteration }}</td>
@endif <td>
</td> @if ($booking->status === 'Cash')
<td>{{ $booking->date }}</td> {{ $booking->status }}
<td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td> @else
<td>{{ $booking->category }} - {{ $booking->service_name }} ({{ number_format($booking->total, 0, '.', '.') }})</td> @if ($booking->status === 'Paid')
<span class="text-success">Cashless - Paid</span>
<td>{{ $booking->name }}</td> @elseif ($booking->status === 'Unpaid')
<td>{{ $booking->handphone }}</td> <span class="text-danger">Cashless - Unpaid</span>
@endif
{{-- <td> @endif
<a href="{{ route('admin.service.edit', $service->id) }}" class="btn btn-info"> </td>
<i class="fa fa-pencil-alt"></i> <td>{{ $booking->date }}</td>
<td>
@if($booking->schedule)
{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}
@else
<span class="text-danger">Schedule Deleted</span>
@endif
</td>
<td>{{ $booking->category }} - {{ $booking->service_name }} ({{ number_format($booking->total, 0, '.', '.') }})</td>
<td>{{ $booking->name }}</td>
<td>{{ $booking->handphone }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.booking.view', $booking->id) }}" class="btn btn-sm btn-primary">
<i class="fa fa-eye"></i>
</a> </a>
<form onclick="return alert('are you sure ? ')" class="d-inline" action="{{ route('admin.service.destroy', $service->id) }}" method="POST"> <form onclick="return confirm('Are you sure you want to delete this booking?');" action="{{ route('admin.booking.destroy', $booking->id) }}" method="POST">
@csrf @csrf
@method('delete') @method('DELETE')
<button class="btn btn-danger"> <button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
<i class="fa fa-trash"></i>
</button>
</form> </form>
</td> --}} </div>
</tr> </td>
@empty </tr>
<tr> @empty
<td colspan="8" class="text-center">{{ __('Booking Data Empty') }}</td> <tr>
</tr> <td colspan="8" class="text-center">{{ __('Booking Data Empty') }}</td>
@endforelse </tr>
</tbody> @endforelse
</table> </tbody>
</table>
<div class="card-footer">
{{ $bookings->links() }}
</div> </div>
</div> </div>
{{-- <div class="card-footer">
{{ $services->links() }}
</div> --}}
</div> </div>
<!-- Content Row --> </div>
</div> </div>
@endsection @endsection

View File

@ -0,0 +1,65 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="invoice-wrapper rounded border bg-white py-5 px-3 px-md-4 px-lg-5">
<div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Booking Detail</h2>
<div class="btn-group">
<a href="{{ route('admin.booking.index') }}" class="btn btn-sm btn-warning">
Go Back</a>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Date</p>
<address>
{{ $booking->date }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Time</p>
<address>
{{ $booking->schedule ? $booking->schedule->start_time . ' - ' . $booking->schedule->end_time : 'No Schedule' }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Service</p>
<address>
{{ $booking->category }} - {{ $booking->service_name }}
</address>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Customer Name</p>
<address>
{{ $booking->name }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Contact</p>
<address>
{{ $booking->handphone }}
</address>
</div>
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Status</p>
<address>
{{ $booking->status }}
</address>
</div>
</div>
<div class="row justify-content-end">
<div class="col-lg-5 col-xl-4 col-xl-3 ml-sm-auto">
<ul class="list-unstyled mt-4">
{{-- You can add additional details here if needed --}}
</ul>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -27,22 +27,7 @@
@error('name')<span class="text-danger">{{ $message }}</span>@enderror @error('name')<span class="text-danger">{{ $message }}</span>@enderror
</div> </div>
</div> </div>
<div class="col-3">
<div class="form-group">
<label for="category_id">Parent</label>
<select name="category_id" id="category_id" class="form-control">
<option value="">---</option>
@forelse($parent_categories as $parent_category)
<option value="{{ $parent_category->id }}" {{ old('category_id') == $parent_category->id ? 'selected' : null }}>
{{ $parent_category->name }}
</option>
@empty
<option value="" disabled>No categories found</option>
@endforelse
</select>
@error('parent_id')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div> </div>
<div class="row pt-4"> <div class="row pt-4">

View File

@ -28,22 +28,7 @@
@error('name')<span class="text-danger">{{ $message }}</span>@enderror @error('name')<span class="text-danger">{{ $message }}</span>@enderror
</div> </div>
</div> </div>
<div class="col-3">
<div class="form-group">
<label for="category_id">Parent</label>
<select name="category_id" id="category_id" class="form-control">
<option value="">---</option>
@forelse($parent_categories as $parent_category)
<option value="{{ $parent_category->id }}" {{ old('category_id', $category->category_id) == $parent_category->id ? 'selected' : null }}>
{{ $parent_category->name }}
</option>
@empty
<option value="" disabled>No categories found</option>
@endforelse
</select>
@error('parent_id')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div> </div>
<div class="row pt-4"> <div class="row pt-4">

View File

@ -27,6 +27,16 @@
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<form action="{{ route('admin.categories.index') }}" method="GET" class="form-inline p-3">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search categories..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
<table class="table table-hover table-bordered"> <table class="table table-hover table-bordered">
<thead> <thead>
<tr> <tr>
@ -34,7 +44,7 @@
<th>Image</th> <th>Image</th>
<th>Name</th> <th>Name</th>
<th>Product count</th> <th>Product count</th>
<th>Parent</th>
<th class="text-center" style="width: 30px;">Action</th> <th class="text-center" style="width: 30px;">Action</th>
</tr> </tr>
</thead> </thead>
@ -55,7 +65,7 @@
</a> </a>
</td> </td>
<td>{{ $category->products_count }}</td> <td>{{ $category->products_count }}</td>
<td>{{ $category->parent->name ?? '' }}</td>
<td> <td>
<div class="btn-group btn-group-sm"> <div class="btn-group btn-group-sm">
<a href="{{ route('admin.categories.edit', $category) }}" class="btn btn-sm btn-primary"> <a href="{{ route('admin.categories.edit', $category) }}" class="btn btn-sm btn-primary">

View File

@ -18,14 +18,14 @@
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Parent</th>
<th>Created at</th> <th>Created at</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{ $category->name }}</td> <td>{{ $category->name }}</td>
<td>{{ $category->parent->name ?? '' }}</td>
<td>{{ $category->created_at }}</td> <td>{{ $category->created_at }}</td>
</tr> </tr>
</tbody> </tbody>

View File

@ -22,6 +22,14 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<form action="{{ route('admin.obtained.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." name="search" value="{{ request()->input('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Search</button>
</div>
</div>
</form>
<table class="table table-bordered" cellspacing="0" width="100%"> <table class="table table-bordered" cellspacing="0" width="100%">
<thead> <thead>
<tr> <tr>

View File

@ -16,6 +16,19 @@
{{ __('Orders') }} {{ __('Orders') }}
</h6> </h6>
</div> </div>
<div class="col-md-4 mb-3">
<form action="{{ route('admin.orders.index') }}" method="GET">
<div class="input-group">
<input type="text" name="search" class="form-control" placeholder="Search..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
</div>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover table-bordered"> <table class="table table-hover table-bordered">
<thead> <thead>
@ -44,8 +57,11 @@
</td> </td>
<td>{{ $order->customer_phone }}</td> <td>{{ $order->customer_phone }}</td>
<td> <td>
{{ $order->payment_status === 'cash' ? $order->payment_status : 'cashless(' . $order->payment_status . ')' }} {{ $order->payment_status === 'unpaid' ? $order->payment_status : '' . $order->payment_status . '' }}
</td> </td>
<td> <td>
<div class="btn-group btn-group-sm"> <div class="btn-group btn-group-sm">
<a href="{{ route('admin.orders.show', $order) }}" class="btn btn-sm btn-primary"> <a href="{{ route('admin.orders.show', $order) }}" class="btn btn-sm btn-primary">

View File

@ -7,44 +7,39 @@
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Order ID #{{ $order->code }}</h2> <h2 class="text-dark font-weight-medium">Order ID #{{ $order->code }}</h2>
<div class="btn-group"> <div class="btn-group">
<a href="{{ route('admin.orders.index') }}" class="btn btn-sm btn-warning"> <a href="{{ route('admin.orders.index') }}" class="btn btn-sm btn-warning">Go Back</a>
Go Back</a>
</div> </div>
</div> </div>
<div class="row pt-5"> <div class="row pt-5">
<div class="col-xl-4 col-lg-4"> <div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p> <p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address> <address>
{{ $order->customer_first_name }} {{ $order->customer_last_name }} Name: {{ $order->customer_first_name }} {{ $order->customer_last_name }}
<br> {{ $order->customer_address1 }} <br> {{ $order->customer_address1 }}
<br> {{ $order->customer_address2 }} <br> {{ $order->customer_address2 }}
<br> Email: {{ $order->customer_email }} <br> {{ $order->customer_email }}
<br> Phone: {{ $order->customer_phone }} <br> Phone: {{ $order->customer_phone }}
<br> Postcode: {{ $order->customer_postcode }}
</address> </address>
</div> </div>
{{-- <div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Shipment Address</p>
<address>
{{ $order->shipment->first_name }} {{ $order->shipment->last_name }}
<br> {{ $order->shipment->address1 }}
<br> {{ $order->shipment->address2 }}
<br> Email: {{ $order->shipment->email }}
<br> Phone: {{ $order->shipment->phone }}
<br> Postcode: {{ $order->shipment->postcode }}
</address>
</div> --}}
<div class="col-xl-4 col-lg-4"> <div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p> <p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address> <address>
ID: <span class="text-dark">#{{ $order->code }}</span> ID: <span class="text-dark">#{{ $order->code }}</span>
<br> DATE: <span>{{ $order->order_date }}</span> <br> DATE: <span>{{ $order->order_date }}</span>
<br> <br> NOTE: <span>{{ $order->note }}</span>
NOTE: <span>{{ $order->note }}</span>
<br> Status: {{ $order->status }} {{ $order->cancelled_at }} <br> Status: {{ $order->status }} {{ $order->cancelled_at }}
<br> Cancellation Note : {{ $order->cancellation_note}}
<br> Payment Status: {{ $order->payment_status }} <br> Payment Status: {{ $order->payment_status }}
<br> Shipped by: {{ $order->shipping_service_name }} @if ($order->payment_status === 'unpaid')
<form action="{{ route('admin.orders.markAsPaid', $order) }}" method="POST" class="d-inline-block">
@csrf
<input type="hidden" name="total_paid" id="hidden-total-paid">
<input type="hidden" name="change_amount" id="hidden-change-amount">
</form>
@else
<p>Uang Pembeli: Rp.{{ number_format(session('total_paid'), 0, '.', '.') }}</p>
<p>Kembalian: Rp.{{ number_format($order->change_amount, 0, '.', '.') }}</p>
@endif
</address> </address>
</div> </div>
</div> </div>
@ -77,46 +72,35 @@
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-lg-5 col-xl-4 col-xl-3 ml-sm-auto"> <div class="col-lg-5 col-xl-4 col-xl-3 ml-sm-auto">
<ul class="list-unstyled mt-4"> <ul class="list-unstyled mt-4">
<li class="mid pb-3 text-dark">Subtotal <li class="mid pb-3 text-dark">Total Order
<span class="d-inline-block float-right text-default">{{ $order->base_total_price }}</span> <span class="d-inline-block float-right text-default">{{ number_format($order->base_total_price, 0, '.', '.') }}</span>
</li> </li>
{{-- <li class="mid pb-3 text-dark">Tax(10%) @if ($order->payment_status === 'unpaid')
<span class="d-inline-block float-right text-default">{{ $order->tax_amount }}</span> <li class="mid pb-3 text-dark">
<form action="{{ route('admin.orders.savePayment', $order) }}" method="POST" class="d-inline-block">
@csrf
<label for="total-paid">Uang Pembeli :</label>
<input type="number" id="total-paid" name="total_paid" class="form-control" required>
<button class="btn btn-sm btn-success mt-2" type="submit">Simpan Pembayaran</button>
</form>
</li> </li>
<li class="mid pb-3 text-dark">Shipping Cost @endif
<span class="d-inline-block float-right text-default">{{ $order->shipping_cost }}</span> <li class="mid pb-3 text-dark">Kembalian
<span class="d-inline-block float-right text-default" id="change-amount">{{ number_format($order->change_amount, 0, '.', '.') }}</span>
</li> </li>
<li class="pb-3 text-dark">Total
<span class="d-inline-block float-right">{{ $order->grand_total }}</span>
</li> --}}
</ul> </ul>
{{-- @if ($order->isPaid() && $order->isConfirmed())
<a href="{{ route('admin.shipments.edit', $order->shipment->id) }}" class="btn btn-block mt-2 btn-lg btn-primary btn-pill"> Procced to Shipment</a>
@endif
@if (in_array($order->status, [\App\Models\Order::CREATED, \App\Models\Order::CONFIRMED]))
<a href="{{ route('admin.orders.cancel', $order->id) }}" class="btn btn-block mt-2 btn-lg btn-warning btn-pill"> Cancel</a>
@endif
@if ($order->isDelivered())
<form action="{{ route('admin.orders.complete', $order->id) }}" method="post" >
@csrf
<button class="btn btn-block mt-2 btn-lg btn-success btn-pill"> Mark as Completed</button>
</form>
@endif --}}
{{-- @if (!in_array($order->status, [\App\Models\Order::DELIVERED, \App\Models\Order::COMPLETED]))
<a href="" class="btn btn-block mt-2 btn-lg btn-secondary btn-pill delete" onclick="event.preventDefault();document.getElementById('delete-form-{{$order->id}}').submit();"> Remove</a>
<form action="{{ route('admin.orders.destroy', $order) }} }}" method="post" id="delete-form-{{$order->id}}" class="d-none">
@csrf
@method('delete')
</form>
@endif --}}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script>
document.getElementById('total-paid').addEventListener('input', function() {
var totalPaid = parseFloat(this.value) || 0;
var totalOrder = {{ $order->base_total_price }};
var change = totalPaid - totalOrder;
document.getElementById('change-amount').textContent = 'Rp.' + new Intl.NumberFormat('id-ID').format(change);
});
</script>
@endsection @endsection

View File

@ -100,15 +100,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="details" class="text-small text-uppercase">{{ __('details') }}</label>
<textarea name="details" rows="3" class="form-control summernote">{!! old('details') !!}</textarea>
@error('details')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<label for="images">{{ __('images') }}</label> <label for="images">{{ __('images') }}</label>

View File

@ -98,15 +98,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="details" class="text-small text-uppercase">{{ __('details') }}</label>
<textarea name="details" rows="3" class="form-control summernote">{!! old('details', $product->details) !!}</textarea>
@error('details')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<label for="images">{{ __('images') }}</label> <label for="images">{{ __('images') }}</label>

View File

@ -11,89 +11,99 @@
</div> </div>
@endif @endif
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3 d-flex"> <div class="card-header py-3 d-flex align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
{{ __('Products') }} {{ __('Data Produk') }} <!-- Judul Data Produk -->
</h6> </h6>
<div class="ml-auto"> <div class="d-flex">
@can('product_create') <form action="{{ route('admin.products.index') }}" method="GET" class="form-inline mr-2">
<a href="{{ route('admin.products.create') }}" class="btn btn-primary"> <div class="input-group">
<span class="icon text-white-50"> <input type="text" name="search" class="form-control" placeholder="Search products..." value="{{ request('search') }}">
<i class="fa fa-plus"></i> <div class="input-group-append">
</span> <button class="btn btn-primary" type="submit">
<span class="text">{{ __('New product') }}</span> <i class="fas fa-search"></i>
</a> </button>
@endcan </div>
</div> </div>
</div> </form>
<div class="table-responsive"> @can('product_create')
<table class="table table-hover table-bordered"> <a href="{{ route('admin.products.create') }}" class="btn btn-primary">
<thead> <span class="icon text-white-50">
<tr> <i class="fa fa-plus"></i>
<th>No</th> </span>
<th>Image</th> <span class="text">{{ __('New product') }}</span>
<th>Name</th> </a>
<th>Quantity</th> @endcan
<th>Price</th>
<th>Weight</th>
<th>Tags</th>
<th>Category</th>
<th>Status</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($products as $product)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if($product->firstMedia)
<img src="{{ asset('storage/images/products/' . $product->firstMedia->file_name) }}"
width="60" height="60" alt="{{ $product->name }}">
@else
<span class="badge badge-danger">no image</span>
@endif
</td>
<td><a href="{{ route('admin.products.show', $product->id) }}">{{ $product->name }}</a></td>
<td>{{ $product->quantity }}</td>
<td>Rp.{{ number_format($product->price) }}</td>
<td>{{ $product->weight }} (gram)</td>
<td>
<span class="badge badge-info">{{ $product->tags->pluck('name')->join(', ') }}</span>
</td>
<td>{{ $product->category ? $product->category->name : NULL }}</td>
<td>{{ $product->status }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.products.edit', $product) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.products.destroy', $product) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $products->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div> </div>
</div> </div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Image</th>
<th>Name</th>
<th>Quantity</th>
<th>Price</th>
<th>Weight</th>
<th>Tags</th>
<th>Category</th>
<th>Status</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($products as $product)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
@if($product->firstMedia)
<img src="{{ asset('storage/images/products/' . $product->firstMedia->file_name) }}"
width="60" height="60" alt="{{ $product->name }}">
@else
<span class="badge badge-danger">no image</span>
@endif
</td>
<td><a href="{{ route('admin.products.show', $product->id) }}">{{ $product->name }}</a></td>
<td>{{ $product->quantity }}</td>
<td>Rp.{{ number_format($product->price) }}</td>
<td>{{ $product->weight }} (gram)</td>
<td>
<span class="badge badge-info">{{ $product->tags->pluck('name')->join(', ') }}</span>
</td>
<td>{{ $product->category ? $product->category->name : NULL }}</td>
<td>{{ $product->status }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.products.edit', $product) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.products.destroy', $product) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $products->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div> </div>
@endsection @endsection

View File

@ -0,0 +1,113 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form id="printForm" action="{{ route('admin.reports.download') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="from">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="to">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="hidden" name="export" value="xlsx">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default"><i class="fas fa-download"></i> Download</button>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<!-- Summary of total revenue per service -->
<div class="mt-5">
<h4>Total Revenue per Service</h4>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($bookings as $record) {
if(isset($record->service_name)) {
if(!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Revenue Report Excel</title>
</head>
<body>
<h2>Revenue Report</h2>
<hr>
<p>Period: {{ $startDate }} - {{ $endDate }}</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Activity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($data as $record)
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>
@if(isset($record->service_name))
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }}
@elseif(isset($record->code))
{{ $record->grand_total }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Revenue Report PDF</title>
<style>
/* CSS styling for PDF */
/* Add your styling here */
</style>
</head>
<body>
<h2>Revenue Report</h2>
<hr>
<p>Period: {{ $startDate }} - {{ $endDate }}</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Activity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($data as $record)
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>
@if(isset($record->service_name))
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }}
@elseif(isset($record->code))
{{ $record->grand_total }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,131 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form action="{{ route('admin.reports.print') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<input type="hidden" name="export" value="xlsx"> <!-- Only export to Excel -->
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default"><i class="fas fa-print"></i> Print</button>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>User</th>
<th>Order Code</th>
<th>Quantity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@php
$totalQuantity = 0;
$totalPrice = 0;
@endphp
@foreach($orders as $order)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $order->created_at }}</td>
<td>{{ $order->customer_first_name }}<br/>{{ $order->customer_email }}</td>
<td>{{ $order->code }}</td>
<td>{{ $order->qty }}</td>
<td>Rp. {{ number_format($order->base_total_price, 0, '.', '.') }}</td>
</tr>
@php
$totalQuantity += $order->qty;
$totalPrice += $order->base_total_price;
@endphp
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="4">Total Quantity</th>
<th>{{ $totalQuantity }}</th>
<th>Rp. {{ number_format($totalPrice, 0, '.', '.') }}</th>
</tr>
</tfoot>
</table>
</div>
<!-- Summary of total revenue per service -->
<div class="mt-5">
<h4>Total Revenue per Service</h4>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($orders as $order) {
if(isset($order->service_name)) {
if(!isset($totalRevenuePerService[$order->service_name])) {
$totalRevenuePerService[$order->service_name] = 0;
}
$totalRevenuePerService[$order->service_name] += $order->grand_total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>Rp.{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -0,0 +1,73 @@
<!-- print.blade.php -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Revenue Report</title>
<style>
/* Define your print styles here */
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h2>Revenue Report</h2>
<table>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<h4>Total Revenue per Service</h4>
<table>
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@ -7,33 +7,38 @@
<div class="col-lg-12"> <div class="col-lg-12">
<div class="card card-default"> <div class="card card-default">
<div class="card-header card-header-border-bottom"> <div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2> <h2>Data Laporan</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('admin.reports.export') }}" method="POST" class="mb-5"> <form id="printForm" action="{{ route('admin.reports.download') }}" method="POST" class="mb-5">
@csrf @csrf
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<div class="form-group mb-2"> <div class="form-group mb-2">
<input type="text" class="form-control datepicker" readonly="" value="{{ !empty(request()->input('start')) ? request()->input('start') : '' }}" name="start" placeholder="from"> <div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2"> <div class="form-group mx-sm-3 mb-2">
<input type="text" class="form-control datepicker" readonly="" value="{{ !empty(request()->input('end')) ? request()->input('end') : '' }}" name="end" placeholder="to"> <div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div> </div>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-6 d-flex align-items-end">
<div class="form-group mx-sm-3 mb-2"> <div class="form-group mx-sm-3 mb-2">
<select name="export" class="form-control"> <input type="hidden" name="export" value="xlsx">
<option value="xlsx">excel</option> <button type="submit" class="btn btn-primary btn-default">
<option value="pdf">pdf</option> <i class="fas fa-print"></i> Cetak
</select> </button>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<button type="submit" class="btn btn-primary btn-default">Go</button>
</div> </div>
</div> </div>
</div> </div>
@ -45,34 +50,25 @@
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>User</th> <th>User</th>
<th>Activity</th> <th>Service</th>
<th>Price</th> <th class="text-right">Price</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($data as $record) @foreach($bookings as $record)
@if(isset($record->service_name))
<tr> <tr>
<td>{{ $record->created_at }}</td> <td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td> <td>{{ $record->name }}</td>
<td> <td>{{ $record->category }} - {{ $record->service_name }}</td>
@if(isset($record->service_name)) <td class="text-right">{{ number_format($record->total, 0, '.', '.') }}</td>
Booking: {{ $record->service_name }}
@elseif(isset($record->code))
Order: {{ $record->code }}
@endif
</td>
<td>
@if(isset($record->service_name))
{{ $record->total }} <!-- Menampilkan harga booking -->
@elseif(isset($record->code))
{{ $record->grand_total }} <!-- Menampilkan harga order -->
@endif
</td>
</tr> </tr>
@endif
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,53 @@
<!-- resources/views/admin/reports/total-revenue.blade.php -->
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Data Rekap</h2>
</div>
<div class="card-body">
<!-- Summary of total revenue per service -->
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Service</th>
<th>Total Revenue</th>
</tr>
</thead>
<tbody>
@php
$totalRevenuePerService = [];
foreach($bookings as $record) {
if(isset($record->service_name)) {
if(!isset($totalRevenuePerService[$record->service_name])) {
$totalRevenuePerService[$record->service_name] = 0;
}
$totalRevenuePerService[$record->service_name] += $record->total;
}
}
@endphp
@foreach($totalRevenuePerService as $service => $total)
<tr>
<td>{{ $service }}</td>
<td>{{ number_format($total, 0, '.', '.') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,88 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="content">
<div class="row">
<div class="col-lg-12">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Revenue Report</h2>
</div>
<div class="card-body">
<form id="printForm" action="{{ route('admin.reports.view') }}" method="POST" class="mb-5">
@csrf
<div class="row">
<div class="col-lg-3">
<div class="form-group mb-2">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('start') }}" name="start" placeholder="From">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<div class="input-group">
<input type="text" class="form-control datepicker" readonly value="{{ request()->input('end') }}" name="end" placeholder="To">
<div class="input-group-append">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="form-group mx-sm-3 mb-2">
<div class="input-group">
<button type="submit" class="btn btn-primary btn-default ml-2">
<i class="fas fa-print"></i> Lihat
</button>
</div>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>Service</th>
<th>Price</th>
</tr>
</thead>
<tbody>
@foreach($bookings as $record)
@if(isset($record->service_name))
<tr>
<td>{{ $record->created_at }}</td>
<td>{{ $record->name }}</td>
<td>{{ $record->category }} - {{ $record->service_name }}</td>
<td>{{ number_format($record->total, 0, '.', '.') }}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script src="{{ asset('backend/plugins/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.datepicker').datepicker({
format: 'yyyy-mm-dd'
});
</script>
@endpush

View File

@ -21,6 +21,14 @@
<!-- Content Row --> <!-- Content Row -->
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<form action="{{ route('admin.category.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" name="search" placeholder="Search by category name..." value="{{ request('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit"><i class="fas fa-search"></i></button>
</div>
</div>
</form>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered" cellspacing="0" width="100%"> <table class="table table-bordered" cellspacing="0" width="100%">
<thead> <thead>

View File

@ -22,6 +22,14 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<form action="{{ route('admin.service.index') }}" method="GET" class="mb-3">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search..." name="search" value="{{ request()->input('search') }}">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Search</button>
</div>
</div>
</form>
<table class="table table-bordered" cellspacing="0" width="100%"> <table class="table table-bordered" cellspacing="0" width="100%">
<thead> <thead>
<tr> <tr>

View File

@ -1,164 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="content">
<div class="row">
<div class="col-lg-6">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Order Shipment #{{ $shipment->order->code }}</h2>
</div>
<div class="card-body">
<form action="{{ url('admin/shipments', $shipment->id) }}" method="post">
@csrf
@method('put')
<div class="form-group row">
<div class="col-md-6">
<label for="first_name">First Name</label>
<input type="text" name="first_name" value="{{ $shipment->first_name }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="last_name">Last Name</label>
<input type="text" name="last_name" value="{{ $shipment->last_name }}" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label for="address1">Address 1</label>
<input type="text" name="address1" value="{{ $shipment->address1 }}" class="form-control" readonly>
</div>
<div class="form-group">
<label for="address2">Address 2</label>
<input type="text" name="address2" value="{{ $shipment->address2 }}" class="form-control" readonly>
</div>
<div class="form-group">
<label>Province<span class="required">*</span></label>
<select name="province_id" class="form-control" disabled>
<option value="">- Please Select -</option>
@foreach($provinces as $province => $pro)
<option {{ $shipment->province_id == $province ? 'selected' : null }} value="{{ $province }}">{{ $pro }}</option>
@endforeach
</select>
</div>
<div class="form-group row">
<div class="col-md-6">
<label>City<span class="required">*</span></label>
<select name="city_id" class="form-control" disabled>
@foreach($cities as $city => $ty)
<option {{ $shipment->city_id == $city ? 'selected' : null }} value="{{ $city }}">{{ $ty }}</option>
@endforeach
</select>
</div>
<div class="col-md-6">
<label for="postcode">Postcode</label>
<input type="text" name="postcode" value="{{ $shipment->postcode }}" class="form-control" readonly>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label for="phone">Phone</label>
<input type="text" name="phone" value="{{ $shipment->phone }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="email">Email</label>
<input type="email" name="email" value="{{ $shipment->email }}" class="form-control" readonly>
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<label for="qty">Total Qty</label>
<input type="number" name="qty" value="{{ $shipment->total_qty }}" class="form-control" readonly>
</div>
<div class="col-md-6">
<label for="total_weight">Total Weight</label>
<input type="text" name="total_weight" value="{{ $shipment->total_weight }}" class="form-control" readonly>
</div>
</div>
<div class="form-group">
<label for="track_number">Track Number</label>
<input type="text" name="track_number" value="{{ $shipment->track_number }}" class="form-control" >
</div>
<div class="form-footer pt-5 border-top">
<button type="submit" class="btn btn-primary btn-default">Save</button>
<a href="{{ url('admin/orders/'. $shipment->order->id) }}" class="btn btn-secondary btn-default">Back</a>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card card-default">
<div class="card-header card-header-border-bottom">
<h2>Detail Order</h2>
</div>
<div class="card-body">
<div class="row">
<div class="col-xl-6 col-lg-6">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address>
{{ $shipment->order->customer_company }} {{ $shipment->order->customer_last_name }}
<br> {{ $shipment->order->customer_address1 }}
<br> {{ $shipment->order->customer_address2 }}
<br> Email: {{ $shipment->order->customer_email }}
<br> Phone: {{ $shipment->order->customer_phone }}
<br> Postcode: {{ $shipment->order->customer_postcode }}
</address>
</div>
<div class="col-xl-6 col-lg-6">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address>
ID: <span class="text-dark">#{{ $shipment->order->code }}</span>
<br> {{ $shipment->order->order_date }}
<br> Status: {{ $shipment->order->status }}
<br> Payment Status: {{ $shipment->order->payment_status }}
<br> Shipped by: {{ $shipment->order->shipping_service_name }}
</address>
</div>
</div>
<table class="table mt-3 table-striped table-responsive table-responsive-large" style="width:100%">
<thead>
<tr>
<th>#</th>
<th>Item</th>
<th>Qty</th>
<th>Total</th>
</tr>
</thead>
<tbody>
@forelse ($shipment->order->orderItems as $item)
<tr>
<td>{{ $item->sku }}</td>
<td>{{ $item->name }}</td>
<td>{{ $item->qty }}</td>
<td>{{ $item->sub_total }}</td>
</tr>
@empty
<tr>
<td colspan="6">Order item not found!</td>
</tr>
@endforelse
</tbody>
</table>
<div class="row justify-content-center">
<div class="col-lg-8 col-xl-8 col-xl-8">
<ul class="list-unstyled mt-4">
<li class="mid pb-3 text-dark">Subtotal
<span class="d-inline-block float-right text-default">{{ $shipment->order->base_total_price }}</span>
</li>
<li class="mid pb-3 text-dark">Tax(10%)
<span class="d-inline-block float-right text-default">{{ $shipment->order->tax_amount }}</span>
</li>
<li class="mid pb-3 text-dark">Shipping Cost
<span class="d-inline-block float-right text-default">{{ $shipment->order->shipping_cost }}</span>
</li>
<li class="pb-3 text-dark">Total
<span class="d-inline-block float-right">{{ $shipment->order->grand_total }}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -1,68 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Shipments') }}
</h6>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Order ID</th>
<th>Name</th>
<th>Status</th>
<th>Total Qty</th>
<th>Total Weight (gram)</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($shipments as $shipment)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
{{ $shipment->order->code }}<br>
<span class="badge badge-info" style="font-size: 12px; font-weight: normal"> {{ $shipment->order->order_date }}</span>
</td>
<td>{{ $shipment->order->customer_full_name }}</td>
<td>
{{ $shipment->status }}
<br>
<span class="badge badge-info" style="font-size: 12px; font-weight: normal"> {{ $shipment->shipped_at }}</span>
</td>
<td>{{ $shipment->total_qty }}</td>
<td>{{ $shipment->total_weight }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.orders.show', $shipment->order->id) }}" class="btn btn-sm btn-primary">
<i class="fa fa-eye"></i>
</a>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="12">No products found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="12">
<div class="float-right">
{!! $shipments->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -1,98 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Create slide') }}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.slides.index') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-home"></i>
</span>
<span class="text">{{ __('Back to slides') }}</span>
</a>
</div>
</div>
<div class="card-body">
<form action="{{ route('admin.slides.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="title">title</label>
<input class="form-control" id="title" type="text" name="title" value="{{ old('title') }}">
@error('title')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="url">url</label>
<input class="form-control" id="url" type="text" name="url" value="{{ old('url') }}">
@error('url')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="body" class="text-small text-uppercase">{{ __('body') }}</label>
<textarea name="body" rows="3" class="form-control summernote">{!! old('body') !!}</textarea>
@error('body')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-12">
<label for="cover">Cover image</label>
<br>
<div class="file-loading">
<input type="file" name="cover" id="slide-img" class="file-input-overview">
<span class="form-text text-muted">Image width should be 500px x 500px</span>
</div>
@error('cover')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="form-group pt-4">
<button class="btn btn-primary" type="submit" name="submit">{{ __('Save') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script>
$(function () {
// summernote
$('.summernote').summernote({
tabSize: 2,
height: 200,
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
})
// file input
$("#slide-img").fileinput({
theme: "fas",
maxFileCount: 1,
allowedFileTypes: ['image'],
showCancel: true,
showRemove: false,
showUpload: false,
overwriteInitial: false
});
});
</script>
@endpush

View File

@ -1,107 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Edit slide')}}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.tags.index') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-home"></i>
</span>
<span class="text">{{ __('Back to slides') }}</span>
</a>
</div>
</div>
<div class="card-body">
<form action="{{ route('admin.slides.update', $slide) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('put')
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="title">title</label>
<input class="form-control" id="title" type="text" name="title" value="{{ old('title', $slide->title) }}">
@error('title')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="url">url</label>
<input class="form-control" id="url" type="text" name="url" value="{{ old('url', $slide->url) }}">
@error('url')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="body" class="text-small text-uppercase">{{ __('body') }}</label>
<textarea name="body" rows="3" class="form-control summernote">{!! old('body', $slide->body) !!}</textarea>
@error('body')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-12">
<label for="cover">Cover image</label><br>
@if($slide->cover)
<img
class="mb-2"
src="{{ Storage::url('images/slides/' . $slide->cover) }}"
alt="{{ $slide->name }}" width="100" height="100">
@else
<span class="badge badge-info">No image</span>
@endif
<br>
<div class="file-loading">
<input type="file" name="cover" id="slide-img" class="file-input-overview">
<span class="form-text text-muted">Image width should be 500px x 500px</span>
</div>
@error('cover')<span class="text-danger">{{ $message }}</span>@enderror
</div>
</div>
<div class="form-group pt-4">
<button class="btn btn-primary" type="submit" name="submit">{{ __('Save') }}</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('script-alt')
<script>
$(function () {
// summernote
$('.summernote').summernote({
tabSize: 2,
height: 200,
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['fullscreen', 'codeview', 'help']]
]
})
// file input
$("#slide-img").fileinput({
theme: "fas",
maxFileCount: 1,
allowedFileTypes: ['image'],
showCancel: true,
showRemove: false,
showUpload: false,
overwriteInitial: false
});
});
</script>
@endpush

View File

@ -1,92 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ __('Slides') }}
</h6>
<div class="ml-auto">
@can('slide_create')
<a href="{{ route('admin.slides.create') }}" class="btn btn-primary">
<span class="icon text-white-50">
<i class="fa fa-plus"></i>
</span>
<span class="text">{{ __('New slide') }}</span>
</a>
@endcan
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>No</th>
<th>Title</th>
<th>Image</th>
<th>Position</th>
<th>Set Position</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($slides as $slide)
<tr>
<td>{{ $loop->iteration }}</td>
<td>
<a href="{{ route('admin.slides.show', $slide) }}">
{{ $slide->title }}
</a>
</td>
<td>
<img width="60" src="{{ Storage::url('images/slides/'. $slide->cover) }}" alt="">
</td>
<td>{{ $slide->position }}</td>
<td>
@if ($slide->prevSlide())
<a href="{{ url('admin/slides/'. $slide->id .'/up') }}">up</a>
@else
up
@endif
|
@if ($slide->nextSlide())
<a href="{{ url('admin/slides/'. $slide->id .'/down') }}">down</a>
@else
down
@endif
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.slides.edit', $slide) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.slides.destroy', $slide) }}"
method="POST">
@csrf
@method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="6">No tags found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<td colspan="6">
<div class="float-right">
{!! $slides->appends(request()->all())->links() !!}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
@endsection

View File

@ -1,38 +0,0 @@
@extends('layouts.admin')
@section('content')
<div class="container">
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex">
<h6 class="m-0 font-weight-bold text-primary">
{{ $slide->title }}
</h6>
<div class="ml-auto">
<a href="{{ route('admin.slides.index') }}" class="btn btn-primary">
<span class="text">Back to slides</span>
</a>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Title</th>
<th>Url</th>
<th>Body</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $slide->title }}</td>
<td>{{ $slide->url }}</td>
<td>{{ $slide->body }}</td>
<td>{{ $slide->created_at }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection

View File

@ -11,11 +11,12 @@
</div> </div>
@endif @endif
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3 d-flex"> <div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
{{ __('Tags') }} {{ __('Tags') }}
</h6> </h6>
<div class="ml-auto"> <div class="d-flex">
<div class="mr-2">
@can('tag_create') @can('tag_create')
<a href="{{ route('admin.tags.create') }}" class="btn btn-primary"> <a href="{{ route('admin.tags.create') }}" class="btn btn-primary">
<span class="icon text-white-50"> <span class="icon text-white-50">
@ -25,57 +26,62 @@
</a> </a>
@endcan @endcan
</div> </div>
<form action="{{ route('admin.tags.index') }}" method="GET" class="form-inline">
<input type="text" name="search" class="form-control mr-2" placeholder="Search tags">
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div> </div>
<div class="table-responsive"> </div>
<table class="table table-bordered" cellspacing="0" width="100%"> <div class="table-responsive">
<thead> <table class="table table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>Name</th>
<th>Product count</th>
<th class="text-center" style="width: 30px;">Action</th>
</tr>
</thead>
<tbody>
@forelse($tags as $tag)
<tr> <tr>
<th>No</th> <td>{{ $loop->iteration }}</td>
<th>Name</th> <td><a href="{{ route('admin.tags.show', $tag->id) }}">
<th>Product count</th> {{ $tag->name }}
<th class="text-center" style="width: 30px;">Action</th> </a>
</tr> </td>
</thead> <td>{{ $tag->products_count }}</td>
<tbody> <td>
@forelse($tags as $tag) <div class="btn-group btn-group-sm">
<tr> <a href="{{ route('admin.tags.edit', $tag) }}" class="btn btn-sm btn-primary">
<td>{{ $loop->iteration }}</td> <i class="fa fa-edit"></i>
<td><a href="{{ route('admin.tags.show', $tag->id) }}">
{{ $tag->name }}
</a> </a>
</td> <form onclick="return confirm('are you sure !')" action="{{ route('admin.tags.destroy', $tag) }}"
<td>{{ $tag->products_count }}</td> method="POST">
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('admin.tags.edit', $tag) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit"></i>
</a>
<form onclick="return confirm('are you sure !')" action="{{ route('admin.tags.destroy', $tag) }}"
method="POST">
@csrf @csrf
@method('DELETE') @method('DELETE')
<button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button> <button class="btn btn-sm btn-danger" type="submit"><i class="fa fa-trash"></i></button>
</form> </form>
</div> </div>
</td> </td>
</tr> </tr>
@empty @empty
<tr> <tr>
<td class="text-center" colspan="6">No tags found.</td> <td class="text-center" colspan="6">No tags found.</td>
</tr> </tr>
@endforelse @endforelse
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="6"> <td colspan="6">
<div class="float-right"> <div class="float-right">
{!! $tags->appends(request()->all())->links() !!} {!! $tags->appends(request()->all())->links() !!}
</div> </div>
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div>
</div> </div>
</div>
</div> </div>
@endsection @endsection

View File

@ -5,7 +5,7 @@
<!-- Page Heading --> <!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">{{ __('create user') }}</h1> <h1 class="h3 mb-0 text-gray-800">{{ __('Create User') }}</h1>
<a href="{{ route('admin.users.index') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('Go Back') }}</a> <a href="{{ route('admin.users.index') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('Go Back') }}</a>
</div> </div>
@ -19,34 +19,38 @@
</div> </div>
@endif @endif
<!-- Content Row --> <!-- Content Row -->
<div class="card shadow"> <div class="card shadow">
<div class="card-body"> <div class="card-body">
<form action="{{ route('admin.users.store') }}" method="POST"> <form action="{{ route('admin.users.store') }}" method="POST">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="name">{{ __('Name') }}</label> <label for="name">{{ __('Name') }}</label>
<input type="text" class="form-control" id="name" placeholder="{{ __('Name') }}" name="username" value="{{ old('username') }}" /> <input type="text" class="form-control" id="name" placeholder="{{ __('Name') }}" name="username" value="{{ old('username') }}" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">{{ __('Email') }}</label> <label for="email">{{ __('Email') }}</label>
<input type="email" class="form-control" id="email" placeholder="{{ __('Email') }}" name="email" value="{{ old('email') }}" /> <input type="email" class="form-control" id="email" placeholder="{{ __('Email') }}" name="email" value="{{ old('email') }}" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">{{ __('Password') }}</label> <label for="phone">{{ __('Phone') }}</label>
<input type="text" class="form-control" id="password" placeholder="{{ __('Password') }}" name="password" value="{{ old('password') }}" required /> <input type="text" class="form-control" id="phone" placeholder="{{ __('Phone') }}" name="phone" value="{{ old('phone') }}" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="roles">{{ __('Role') }}</label> <label for="password">{{ __('Password') }}</label>
<select name="roles[]" id="roles" class="form-control select2" multiple="multiple" required> <input type="password" class="form-control" id="password" placeholder="{{ __('Password') }}" name="password" value="{{ old('password') }}" required />
</div>
</select> <div class="form-group">
</div> <label for="role">{{ __('Role') }}</label>
<button type="submit" class="btn btn-primary btn-block">{{ __('Save') }}</button> <select name="role" id="role" class="form-control" required>
</form> <option value="admin">{{ __('Admin') }}</option>
</div> <option value="user">{{ __('User') }}</option>
</select>
</div>
<button type="submit" class="btn btn-primary btn-block">{{ __('Save') }}</button>
</form>
</div> </div>
</div>
<!-- Content Row --> <!-- Content Row -->

View File

@ -22,6 +22,11 @@
<input type="email" class="form-control" id="email" name="email" value="{{ $user->email }}" required> <input type="email" class="form-control" id="email" name="email" value="{{ $user->email }}" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="phone">{{ __('Phone') }}</label>
<input type="text" class="form-control" id="phone" placeholder="{{ __('Phone') }}" name="phone" value="{{ $user->phone }}" required />
</div>
<div class="form-group">
<label for="password">Password</label> <label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password"> <input type="password" class="form-control" id="password" name="password">
</div> </div>

View File

@ -15,56 +15,68 @@
<!-- Page Heading --> <!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">{{ __('Users') }}</h1> <h1 class="h3 mb-0 text-gray-800">{{ __('Users') }}</h1>
<a href="{{ route('admin.users.create') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('create new')}} <i class="fa fa-plus"> </i></a> <a href="{{ route('admin.users.create') }}" class="btn btn-primary btn-sm shadow-sm">{{ __('create new')}} <i class="fa fa-plus"> </i></a>
</div>
<!-- Search Bar -->
<div class="mb-4">
<form action="{{ route('admin.users.index') }}" method="GET" class="form-inline">
<div class="form-group mr-2">
<input type="text" name="search" class="form-control" placeholder="{{ __('Search by name or email') }}" value="{{ request('search') }}">
</div>
<button type="submit" class="btn btn-primary">{{ __('Search') }}</button>
</form>
</div> </div>
<!-- Content Row --> <!-- Content Row -->
<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-bordered" cellspacing="0" width="100%"> <table class="table table-bordered" cellspacing="0" width="100%">
<thead> <thead>
<tr> <tr>
<th>No</th> <th>No</th>
<th>{{ __('Name') }}</th> <th>{{ __('Name') }}</th>
<th>{{ __('Email') }}</th> <th>{{ __('Email') }}</th>
<th>{{ __('Roles') }}</th> <th>{{ __('Phone') }}</th>
<th>{{ __('Action') }}</th> <th>{{ __('Roles') }}</th>
</tr> <th>{{ __('Action') }}</th>
</thead> </tr>
<tbody> </thead>
@forelse($users as $user) <tbody>
<tr> @forelse($users as $user)
<td>{{ $loop->iteration }}</td> <tr>
<td>{{ $user->username }}</td> <td>{{ $loop->iteration }}</td>
<td>{{ $user->email }}</td> <td>{{ $user->username }}</td>
<td>{{ $user->role }}</td> <td>{{ $user->email }}</td>
<td> <td>{{ $user->phone }}</td>
<a href="{{ route('admin.users.edit', $user->id) }}" class="btn btn-info"> <td>{{ $user->role }}</td>
<i class="fa fa-pencil-alt"></i> <td>
</a> <a href="{{ route('admin.users.edit', $user->id) }}" class="btn btn-info">
<form onclick="return alert('are you sure ? ')" class="d-inline" action="{{ route('admin.users.destroy', $user->id) }}" method="POST"> <i class="fa fa-pencil-alt"></i>
@csrf </a>
@method('delete') <form onclick="return confirm('Are you sure?')" class="d-inline" action="{{ route('admin.users.destroy', $user->id) }}" method="POST">
<button class="btn btn-danger"> @csrf
<i class="fa fa-trash"></i> @method('delete')
</button> <button class="btn btn-danger">
</form> <i class="fa fa-trash"></i>
</td> </button>
</tr> </form>
@empty </td>
<tr> </tr>
<td colspan="7" class="text-center">{{ __('Data Empty') }}</td> @empty
</tr> <tr>
@endforelse <td colspan="5" class="text-center">{{ __('Data Empty') }}</td>
</tbody> </tr>
</table> @endforelse
</div> </tbody>
</div> </table>
<div class="card-footer">
{{ $users->links() }}
</div> </div>
</div> </div>
<div class="card-footer">
{{ $users->links() }}
</div>
</div>
<!-- Content Row --> <!-- Content Row -->
</div> </div>

View File

@ -5,7 +5,9 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Login') }}</div> <div class="card-header text-center">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="Salon Logo" style="width: 150px;">
</div>
<div class="card-body"> <div class="card-body">
<form method="POST" action="{{ route('login') }}"> <form method="POST" action="{{ route('login') }}">
@ -39,29 +41,15 @@
</div> </div>
</div> </div>
<div class="row mb-3">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<label class="form-check-label" for="remember">
{{ __('Remember Me') }}
</label>
</div>
</div>
</div>
<div class="row mb-0"> <div class="row mb-0">
<div class="col-md-8 offset-md-4"> <div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary">
{{ __('Login') }} {{ __('Login') }}
</button> </button>
@if (Route::has('password.request')) <a class="btn btn-link" href="{{ route('register') }}">
<a class="btn btn-link" href="{{ route('password.request') }}"> Belum punya akun? <span style="text-decoration: underline;">Register</span>
{{ __('Forgot Your Password?') }} </a>
</a>
@endif
</div> </div>
</div> </div>
</form> </form>

View File

@ -5,6 +5,9 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header text-center">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="Salon Logo" style="width: 150px;">
</div>
<div class="card-header">{{ __('Register') }}</div> <div class="card-header">{{ __('Register') }}</div>
<div class="card-body"> <div class="card-body">
@ -12,10 +15,10 @@
@csrf @csrf
<div class="row mb-3"> <div class="row mb-3">
<label for="name" class="col-md-4 col-form-label text-md-end">{{ __('Username') }}</label> <label for="username" class="col-md-4 col-form-label text-md-end">{{ __('Username') }}</label>
<div class="col-md-6"> <div class="col-md-6">
<input id="name" type="text" class="form-control @error('username') is-invalid @enderror" name="username" value="{{ old('username') }}" required autocomplete="Username" autofocus> <input id="username" type="text" class="form-control @error('username') is-invalid @enderror" name="username" value="{{ old('username') }}" required autocomplete="username" autofocus>
@error('username') @error('username')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
@ -38,7 +41,19 @@
@enderror @enderror
</div> </div>
</div> </div>
<div class="row mb-3">
<label for="phone" class="col-md-4 col-form-label text-md-end">{{ __('Phone Number') }}</label>
<div class="col-md-6">
<input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror" name="phone" value="{{ old('phone') }}" required autocomplete="phone">
@error('phone')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label> <label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
@ -69,6 +84,13 @@
</div> </div>
</div> </div>
</form> </form>
<div class="row mt-3">
<div class="col-md-6 offset-md-4">
<a href="{{ route('login') }}">
{{ __('Sudah punya akun?') }} <span style="text-decoration: underline;">{{ __('Login') }}</span>
</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@
<td>{{ $booking->handphone }}</td> <td>{{ $booking->handphone }}</td>
<td>{{ $booking->total }}</td> <td>{{ $booking->total }}</td>
<td>{{ $booking->date }}</td> <td>{{ $booking->date }}</td>
<td>{{ $booking->time }}</td> <td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -44,31 +44,26 @@
</div> </div>
@endsection @endsection
@push('script') @push('script')
<script type="text/javascript"> <script type="text/javascript">
// For example trigger on button clicked, or any time you need var payButton = document.getElementById('pay-button');
var payButton = document.getElementById('pay-button'); payButton.addEventListener('click', function () {
payButton.addEventListener('click', function () { window.snap.pay('{{ $snapToken }}', {
// Trigger snap popup. @TODO: Replace TRANSACTION_TOKEN_HERE with your transaction token onSuccess: function(result){
window.snap.pay('{{ $snapToken }}', { alert("Payment success!");
onSuccess: function(result){ window.location.replace("{{ route('booking.print', ['bookingId' => $booking->id]) }}");
/* You may add your own implementation here */ },
alert("payment success!"); console.log(result); onPending: function(result){
window.location.replace("{{ route('payment.success', ['bookingId' => $booking->id, 'scheduleId' => $scheduleId]) }}"); alert("Waiting for your payment!");
}, },
onPending: function(result){ onError: function(result){
/* You may add your own implementation here */ alert("Payment failed!");
alert("wating your payment!"); console.log(result); },
}, onClose: function(){
onError: function(result){ alert('You closed the popup without finishing the payment');
/* You may add your own implementation here */ }
alert("payment failed!"); console.log(result); });
}, });
onClose: function(){ </script>
/* You may add your own implementation here */
alert('you closed the popup without finishing the payment');
}
})
});
</script>
@endpush @endpush

View File

@ -18,6 +18,16 @@
<div class="col-lg-6"> <div class="col-lg-6">
<form action="{{ route('booking.store') }}" method="POST"> <form action="{{ route('booking.store') }}" method="POST">
@csrf @csrf
<!-- Tambahkan kode untuk menampilkan pesan kesalahan -->
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="form-group"> <div class="form-group">
@ -81,5 +91,20 @@
</div> </div>
</div> </div>
</div> </div>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('form').addEventListener('submit', function (e) {
// Ambil nilai dari checkbox cash dan cashless
var cashChecked = document.getElementById('cash').checked;
var cashlessChecked = document.getElementById('cashless').checked;
// Periksa apakah keduanya dicentang
if (cashChecked && cashlessChecked) {
e.preventDefault(); // Hentikan pengiriman formulir
document.getElementById('paymentAlert').style.display = 'block'; // Tampilkan pesan peringatan
}
});
});
</script>
@endsection @endsection

View File

@ -8,12 +8,14 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3 class="text-center">Please come to the salon on the <span class="font-weight-bold">{{ $booking->date }}</span> at <span class="font-weight-bold">{{ $booking->time }}.</span></h1> <h3 class="text-center">Silahkan datang ke <span class="font-weight-bold">Aleea Salon</span> pada tanggal <span class="font-weight-bold">{{ $booking->date }}</span> pukul <span class="font-weight-bold">{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}.</span></h1>
<div class="text-center"> <div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('homepage') }}">Back</a> <div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('bookings.show', $booking->id) }}">Lihat</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection

View File

@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Bill Summary</title>
<style>
/* General styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
line-height: 1.4;
}
.container {
max-width: 300px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
background: #fff;
}
.card {
margin-bottom: 20px;
}
.card-header {
background-color: #f2f2f2;
padding: 5px 10px;
border-bottom: 1px solid #ddd;
text-align: center;
}
.card-body {
padding: 10px;
}
.card-title {
margin: 0;
font-size: 18px;
}
.details {
margin-bottom: 10px;
}
.details table {
width: 100%;
font-size: 14px;
line-height: 1.3;
}
.details th,
.details td {
padding: 2px 0;
vertical-align: top;
text-align: left;
}
.details th {
width: 40%;
padding-right: 10px;
}
.btn-print {
display: block;
width: 100%;
margin-top: 10px;
padding: 8px;
background-color: #ffc107;
color: #fff;
border: none;
border-radius: 5px;
font-size: 14px;
cursor: pointer;
}
.btn-print:hover {
background-color: #ff9800;
}
.logo-2 {
text-align: center;
margin-bottom: 20px;
}
.logo-2 img {
height: 60px;
transform: scale(2);
object-fit: cover;
}
</style>
</head>
<body onload="printBill()">
<div class="container">
<div class="logo-2 furniture-logo ptb-30">
<a href="/">
<img src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
</a>
</div>
<div class="card">
<div class="card-header">
<h3 class="card-title">Bill Summary</h3>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<h2 class="text-dark font-weight-medium">Booking ID #{{ $booking->id }}</h2>
</div>
<div class="details">
<p><strong>Customer Details:</strong></p>
<table>
<tr>
<th>Name:</th>
<td>{{ $booking->name }}</td>
</tr>
<tr>
<th>WhatsApp:</th>
<td>{{ $booking->handphone }}</td>
</tr>
</table>
</div>
<div class="details">
<p><strong>Service Details:</strong></p>
<table>
<tr>
<th>Service:</th>
<td>{{ $booking->service_name }}</td>
</tr>
<tr>
<th>Category:</th>
<td>{{ $booking->category }}</td>
</tr>
<tr>
<th>Schedule:</th>
<td>{{ $booking->date }}</td>
</tr>
<tr>
<th>Time:</th>
<td>{{ $booking->schedule->start_time }} - {{ $booking->schedule->end_time }}</td>
</tr>
<tr>
<th>Price:</th>
<td>IDR. {{ number_format($booking->total, 0, '.', '.') }}</td>
</tr>
<tr>
<th>Payment Status:</th>
<td>{{ $booking->status }}</td>
</tr>
</table>
</div>
</div>
<div class="card-footer text-center">
<button class="btn-print" onclick="printBill()">Print Bill</button>
</div>
</div>
</div>
</body>
</html>
<!-- Print Bill Script -->
<script>
function printBill() {
window.print();
window.close();
}
</script>

View File

@ -31,41 +31,39 @@
<!-- services --> <!-- services -->
<div class="services-area wrapper-padding-4 gray-bg pt-120 pb-80"> <div class="services-area wrapper-padding-4 gray-bg pt-120 pb-80">
<div class="container-fluid"> <div class="container-fluid">
<div class="section-title-furits text-center"> <div class="section-title-furits text-center">
<h2>Why Choose Us</h2> <h2>Why Choose Us</h2>
</div>
<br>
<div class="services-wrapper mt-40">
<div class="single-services mb-40">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/26.png') }}" alt="">
</div>
<div class="services-content">
<h4>Professional Services</h4>
</div>
</div> </div>
<br> <div class="single-services mb-40">
<div class="services-wrapper mt-40"> <div class="services-img">
<div class="single-services mb-40"> <img src="{{ asset('frontend/assets/img/icon-img/27.png') }}" alt="">
<div class="services-img">
<img src="{{ asset('frontend/assets/img/icon-img/26.png') }}" alt="">
</div>
<div class="services-content">
<h4>Good Service</h4>
<p>Contrary to popular belief, Lorem Ipsum is random text. </p>
</div>
</div> </div>
<div class="single-services mb-40"> <div class="services-content">
<div class="services-img"> <h4>24/7 Availability</h4>
<img src="{{ asset('frontend/assets/img/icon-img/27.png') }}" alt="">
</div>
<div class="services-content">
<h4>24/7 Support</h4>
<p>Contrary to popular belief, Lorem Ipsum is random text. </p>
</div>
</div> </div>
<div class="single-services mb-40"> </div>
<div class="services-img"> <div class="single-services mb-40">
<img src="{{ asset('frontend/assets/img/icon-img/28.png') }}" alt=""> <div class="services-img">
</div> <img src="{{ asset('frontend/assets/img/icon-img/28.png') }}" alt="">
<div class="services-content"> </div>
<h4>Secure Payments</h4> <div class="services-content">
<p>Contrary to popular belief, Lorem Ipsum is random text. </p> <h4>Secure Payments</h4>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- end services --> <!-- end services -->
@endsection @endsection

View File

@ -2,13 +2,13 @@
@section('title', 'Services') @section('title', 'Services')
@section('content') @section('content')
<div class="section-title-furits text-center"> <div class="section-title-furits text-center">
<h2>Order with <span class="font-weight-bold">Cash</span> payment <span class="text-success">Successful</span></h2> <h2>Order with <span class="font-weight-bold"></span> payment <span class="text-success">Cash</span></h2>
</div> </div>
<div class="shop-page-wrapper shop-page-padding ptb-100"> <div class="shop-page-wrapper shop-page-padding ptb-100">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3 class="text-center">Please take the product you ordered and pay with a nominal amount of <span class="font-weight-bold">IDR. {{ number_format( $order->base_total_price, 0, '.', '.') }}.</span></h1> <h3 class="text-center">Silakan ambil produk yang Anda pesan dan bayar dengan nominal <span class="font-weight-bold">IDR. {{ number_format( $order->base_total_price, 0, '.', '.') }}.</span></h1>
<div class="text-center"> <div class="text-center">
<a class="btn btn-dark mt-2" href="{{ route('homepage') }}">Back</a> <a class="btn btn-dark mt-2" href="{{ route('homepage') }}">Back</a>
</div> </div>

View File

@ -3,158 +3,129 @@
@section('title', 'Checkout Page') @section('title', 'Checkout Page')
@section('content') @section('content')
<!-- header end --> <!-- header end -->
<div class="breadcrumb-area pt-205 breadcrumb-padding pb-210" style="background-image: url({{ asset('frontend/assets/img/bg/breadcrumb.jpg') }})"> <div class="breadcrumb-area pt-205 breadcrumb-padding pb-210" style="background-image: url({{ asset('frontend/assets/img/logo/home-bg2.png') }})">
<div class="container"> <div class="container">
<div class="breadcrumb-content text-center"> <div class="breadcrumb-content text-center">
<h2>Checkout Page</h2> <h2>Checkout Page</h2>
<ul> <ul>
<li><a href="{{ url('/') }}">home</a></li> <li><a href="{{ url('/') }}">home</a></li>
<li> Checkout Page</li> <li> Checkout Page</li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<!-- checkout-area start --> <!-- checkout-area start -->
<div class="checkout-area ptb-100"> <div class="checkout-area ptb-100">
<div class="container"> <div class="container">
<form action="{{ route('checkout') }}" method="post"> <form action="{{ route('checkout') }}" method="post">
@csrf @csrf
<div class="row"> <div class="row">
<div class="col-lg-6 col-md-12 col-12"> <div class="col-lg-6 col-md-12 col-12">
<div class="checkbox-form"> <div class="checkbox-form">
<h3>Billing Details</h3> <h3>Billing Details</h3>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="checkout-form-list"> <div class="checkout-form-list">
<label>Username <span class="required">*</span></label> <label>Username <span class="required">*</span></label>
<input type="text" name="username"> <input type="text" name="username" value="{{ auth()->user()->username }}">
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="checkout-form-list"> <div class="checkout-form-list">
<label>WhatsApp<span class="required">*</span></label> <label>WhatsApp<span class="required">*</span></label>
<input type="text" name="phone" value="{{ auth()->user()->phone }}"> <input type="text" name="phone" value="{{ auth()->user()->phone }}">
</div> </div>
</div> </div>
<div class="order-notes">
<div class="checkout-form-list mrg-nn">
<label for="note">Order Notes</label>
<textarea name="note" id="note" cols="30" rows="10"></textarea>
</div>
</div>
<div class="order-notes"> </div>
<div class="checkout-form-list mrg-nn"> </div>
<label for="note">Order Notes</label> </div>
<textarea name="note" id="note" cols="30" rows="10"></textarea> <div class="col-lg-6 col-md-12 col-12">
</div> <div class="your-order">
</div> <h3>Your order</h3>
</div> <div class="your-order-table table-responsive">
</div> <table>
</div> <thead>
<div class="col-lg-6 col-md-12 col-12"> <tr>
<div class="your-order"> <th class="product-name">Product</th>
<h3>Your order</h3> <th class="product-total">Total</th>
<div class="your-order-table table-responsive"> </tr>
<table> </thead>
<thead> <tbody>
<tr> @forelse ($items as $item)
<th class="product-name">Product</th> @php
<th class="product-total">Total</th> $product = $item->associatedModel;
</tr> $image = !empty($product->firstMedia) ? asset('storage/images/products/'. $product->firstMedia->file_name) : asset('frontend/assets/img/cart/3.jpg');
</thead> @endphp
<tbody> <tr class="cart_item">
@forelse ($items as $item) <td class="product-name">
@php {{ $item->name }} <strong class="product-quantity"> × {{ $item->quantity }}</strong>
$product = $item->associatedModel; </td>
$image = !empty($product->firstMedia) ? asset('storage/images/products/'. $product->firstMedia->file_name) : asset('frontend/assets/img/cart/3.jpg') <td class="product-total">
<span class="amount">{{ number_format(\Cart::get($item->id)->getPriceSum()) }}</span>
</td>
</tr>
@empty
<tr>
<td colspan="2">The cart is empty!</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr class="order-total">
<th>Order Total</th>
<td><strong><span class="total-amount">{{ number_format(\Cart::getTotal()) }}</span></strong></td>
</tr>
</tfoot>
</table>
</div>
<div class="payment-method">
<div class="payment-accordion">
<h3>Payment</h3>
<div class="ship-different-title">
<h4>
<input id="cash" type="checkbox" name="cash" />
<label for="cash">Cash</label>
</h4>
<h4>
<input id="cashless" type="checkbox" name="cashless" />
<label for="cashless">Cashless</label>
</h4>
</div>
</div>
<div class="order-button-payment">
<input type="submit" value="Pay Now" />
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- checkout-area end -->
@endphp <script>
<tr class="cart_item"> function toggleResellerFields() {
<td class="product-name"> var resellerCheckbox = document.getElementById('reseller');
{{ $item->name }} <strong class="product-quantity"> × {{ $item->quantity }}</strong> var resellerFields = document.getElementById('reseller-fields');
</td>
<td class="product-total"> if (resellerCheckbox.checked) {
<span class="amount">{{ number_format(\Cart::get($item->id)->getPriceSum()) }}</span> resellerFields.style.display = 'block';
</td> document.getElementById('reseller_name').setAttribute('required', 'required');
</tr> document.getElementById('reseller_phone').setAttribute('required', 'required');
@empty } else {
<tr> resellerFields.style.display = 'none';
<td colspan="2">The cart is empty! </td> document.getElementById('reseller_name').removeAttribute('required');
</tr> document.getElementById('reseller_phone').removeAttribute('required');
@endforelse }
</tbody> }
<tfoot> </script>
{{-- <tr class="cart-subtotal">
<th>Subtotal</th>
<td><span class="amount">{{ number_format(\Cart::getSubTotal()) }}</span></td>
</tr>
<tr class="cart-subtotal">
<th>Tax</th>
<td><span class="amount">{{ number_format(\Cart::getSubTotal()) }}</span></td>
</tr> --}}
{{-- <tr class="cart-subtotal">
<th>Shipping Cost ({{ $totalWeight }} gram)</th>
<td><select id="shipping-cost-option" required name="shipping_service"></select></td>
</tr> --}}
<tr class="order-total">
<th>Order Total</th>
<td><strong><span class="total-amount">{{ number_format(\Cart::getTotal()) }}</span></strong>
</td>
</tr>
</tfoot>
</table>
</div>
<div class="payment-method">
<div class="payment-accordion">
<div class="panel-group" id="faq">
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a data-toggle="collapse" aria-expanded="true" data-parent="#faq" href="#payment-1">Direct Bank Transfer.</a></h5>
</div>
<div id="payment-1" class="panel-collapse collapse show">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a class="collapsed" data-toggle="collapse" aria-expanded="false" data-parent="#faq" href="#payment-2">Cheque Payment</a></h5>
</div>
<div id="payment-2" class="panel-collapse collapse">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
{{-- <div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title"><a class="collapsed" data-toggle="collapse" aria-expanded="false" data-parent="#faq" href="#payment-3">PayPal</a></h5>
</div>
<div id="payment-3" class="panel-collapse collapse">
<div class="panel-body">
<p>Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account.</p>
</div>
</div>
</div> --}}
<h3>Payment</h3>
<div class="ship-different-title">
<h4>
<input id="cash" type="checkbox" name="cash"/>
<label for="cash">Cash</label>
</h4>
<h4>
<input id="cashless" type="checkbox" name="cashless"/>
<label for="cashless">Cashless</label>
</h4>
</div>
</div>
<div class="order-button-payment" >
<input type="submit" id="test" value="Pay Now" />
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<!-- checkout-area end -->
@endsection @endsection

View File

@ -43,7 +43,7 @@
{{ $order->code }}<br> {{ $order->code }}<br>
<span style="font-size: 12px; font-weight: normal"> {{ $order->order_date }}</span> <span style="font-size: 12px; font-weight: normal"> {{ $order->order_date }}</span>
</td> </td>
<td>{{ number_format($order->grand_total) }}</td> <td>{{ number_format($order->base_total_price, 0, '.', '.') }}</td>
<td>{{ $order->status }}</td> <td>{{ $order->status }}</td>
<td>{{ $order->payment_status }}</td> <td>{{ $order->payment_status }}</td>
<td> <td>

View File

@ -33,40 +33,12 @@
<div class="col-xl-4 col-lg-4"> <div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p> <p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Billing Address</p>
<address> <address>
{{ $order->customer_first_name }} {{ $order->customer_last_name }} <br>Name: {{ $order->customer_first_name }} {{ $order->customer_last_name }}
<br> {{ $order->customer_address1 }}
<br> {{ $order->customer_address2 }}
<br> Email: {{ $order->customer_email }}
<br> Phone: {{ $order->customer_phone }} <br> Phone: {{ $order->customer_phone }}
<br> Postcode: {{ $order->customer_postcode }}
</address>
</div>
@if ($order->shipment)
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Shipment Address</p>
<address>
{{ $order->shipment->first_name }} {{ $order->shipment->last_name }}
<br> {{ $order->shipment->address1 }}
<br> {{ $order->shipment->address2 }}
<br> Email: {{ $order->shipment->email }}
<br> Phone: {{ $order->shipment->phone }}
<br> Postcode: {{ $order->shipment->postcode }}
</address>
</div>
@endif
<div class="col-xl-4 col-lg-4">
<p class="text-dark mb-2" style="font-weight: normal; font-size:16px; text-transform: uppercase;">Details</p>
<address>
ID: <span class="text-dark">#{{ $order->code }}</span>
<br> {{ $order->order_date }}
<br> Status: {{ $order->status }} {{ $order->isCancelled() ? '('. $order->cancelled_at .')' : null}}
@if ($order->isCancelled())
<br> Cancellation Note : {{ $order->cancellation_note}}
@endif
<br> Payment Status: {{ $order->payment_status }}
<br> Shipped by: {{ $order->shipping_service_name }}
</address> </address>
</div> </div>
</div> </div>
<div class="table-content table-responsive"> <div class="table-content table-responsive">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">

View File

@ -2,19 +2,18 @@
@section('title', $product->name) @section('title', $product->name)
@section('content') @section('content')
<div class="product-details ptb-100 pb-90"> <div class="product-details ptb-100 pb-90">
@if(session()->has('message'))
@if(session()->has('message')) <div class="alert alert-{{ session()->get('alert-type') }} alert-dismissible fade show" role="alert" id="alert-message">
<div class="alert alert-{{ session()->get('alert-type') }} alert-dismissible fade show" role="alert" id="alert-message"> {{ session()->get('message') }}
{{ session()->get('message') }} <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span>
<span aria-hidden="true">&times;</span> </button>
</button> </div>
</div> @endif
@endif
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-7 col-12"> <div class="col-md-6">
<div class="product-details-img-content"> <div class="product-details-img-content">
<div class="product-details-tab mr-70"> <div class="product-details-tab mr-70">
@if($product->media_count) @if($product->media_count)
@ -24,17 +23,17 @@
href="#pro-details{{ $loop->index }}" data-toggle="tab" role="tab" href="#pro-details{{ $loop->index }}" data-toggle="tab" role="tab"
aria-selected="true"> aria-selected="true">
<img src="{{ asset('storage/images/products/' . $media->file_name ) }}" <img src="{{ asset('storage/images/products/' . $media->file_name ) }}"
alt="{{ $product->name }}"> alt="{{ $product->name }}" class="img-fluid">
</a> </a>
@endforeach @endforeach
</div> </div>
@else @else
<img src="{{ asset('img/no-img.png' ) }}" alt="{{ $product->name }}"> <img src="{{ asset('img/no-img.png' ) }}" alt="{{ $product->name }}" class="img-fluid">
@endif @endif
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12 col-lg-5 col-12"> <div class="col-md-6">
<div class="product-details-content"> <div class="product-details-content">
<h3>{{ $product->name }}</h3> <h3>{{ $product->name }}</h3>
@ -43,12 +42,12 @@
</div> </div>
<p>{!! $product->description !!}</p> <p>{!! $product->description !!}</p>
<form action="{{ route('cart.store') }}" method="post"> <form action="{{ route('cart.store') }}" method="post">
@csrf @csrf
<input type="hidden" name="product_id" value="{{ $product->id }}"> <input type="hidden" name="product_id" value="{{ $product->id }}">
<div class="quickview-plus-minus"> <div class="quickview-plus-minus">
<div class="cart-plus-minus"> <div class="cart-plus-minus">
<input type="number" name="qty" min="1" value="1" class="cart-plus-minus-box" placeholder="qty"> <input type="number" name="qty" min="1" value="1" class="form-control cart-plus-minus-box" placeholder="qty">
</div> </div>
<div class="quickview-btn-cart"> <div class="quickview-btn-cart">
<button type="submit" class="submit contact-btn btn-hover">add to cart</button> <button type="submit" class="submit contact-btn btn-hover">add to cart</button>
@ -59,7 +58,7 @@
</a> </a>
</div> </div>
</div> </div>
</form> </form>
<div class="product-details-cati-tag mt-35"> <div class="product-details-cati-tag mt-35">
<ul> <ul>
<li class="categories-title">Categories :</li> <li class="categories-title">Categories :</li>
@ -80,27 +79,11 @@
</li> </li>
</ul> </ul>
</div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="product-description-review-area pb-90">
<div class="container">
<div class="product-description-review text-center">
<div class="description-review-title nav" role=tablist>
<a href="#pro-dec" data-toggle="tab" role="tab" aria-selected="true">
Description
</a>
</div>
<div class="description-review-text tab-content">
<div class="tab-pane fade show active" id="pro-dec" role="tabpanel">
<p>{!! $product->details !!}</p>
</div>
</div>
</div>
</div>
</div>
@endsection @endsection

View File

@ -6,6 +6,7 @@
</div> </div>
<div class="shop-page-wrapper shop-page-padding ptb-100"> <div class="shop-page-wrapper shop-page-padding ptb-100">
<div class="container-fluid"> <div class="container-fluid">
<div class="row justify-content-center"> <div class="row justify-content-center">
@foreach ($serviceCategories as $serviceCategory) @foreach ($serviceCategories as $serviceCategory)
<div class="col-lg-3"> <div class="col-lg-3">
@ -13,7 +14,8 @@
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-5">{{ $serviceCategory->name }}</h4> <h4 class="card-title mb-5">{{ $serviceCategory->name }}</h4>
<img src="{{ url('/frontend/assets/img/iconservice.png') }}" class="img-fluid" alt="..."> <img src="{{ url('/frontend/assets/img/iconservice.png') }}" class="img-fluid" alt="...">
<a href="{{ route('service.show', $serviceCategory->name) }}" class="btn btn-primary mt-5 d-block">Detail</a> <a href="{{ route('service.show', $serviceCategory->name) }}" class="btn btn-dark mt-5 d-block">Detail</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -23,9 +23,7 @@
<div id="app"> <div id="app">
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm"> <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container"> <div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>

View File

@ -42,7 +42,7 @@
<div class="header-bottom-wrapper"> <div class="header-bottom-wrapper">
<div class="logo-2 furniture-logo ptb-30"> <div class="logo-2 furniture-logo ptb-30">
<a href="/"> <a href="/">
<img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.png') }}" alt=""> <img height="60" style="transform:scale(2);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
</a> </a>
</div> </div>
<div class="menu-style-2 furniture-menu menu-hover"> <div class="menu-style-2 furniture-menu menu-hover">
@ -188,77 +188,72 @@
@yield('content') @yield('content')
<!-- footer -->
<footer class="footer-area"> <footer class="footer-area">
<div class="footer-top-area pt-70 pb-35 wrapper-padding-5"> <div class="footer-top-area pt-70 pb-35 wrapper-padding-5">
<div class="container-fluid"> <div class="container-fluid">
<div class="widget-wrapper"> <div class="widget-wrapper">
<div class="footer-widget mb-30"> <div class="footer-widget mb-30">
<img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.png') }}" alt=""> <img height="60" style="transform:scale(1.5);object-fit: cover;" src="{{ asset('frontend/assets/img/logo/logo.jpg') }}" alt="">
<div class="footer-about-2"> <div class="footer-about-2">
<p>There are many variations of passages of Lorem Ipsum <br>the majority have suffered alteration in some form, by <br> injected humour</p> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3952.720934169864!2d113.2532870147671!3d-7.764183794418034!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dd6862a8f23b04d%3A0x6c21b32ee7b8d746!2sJl.%20Mastrip%20No.159%2C%20Jrebeng%20Wetan%2C%20Kec.%20Kedopok%2C%20Kota%20Probolinggo%2C%20Jawa%20Timur%2067227!5e0!3m2!1sen!2sid!4v1649652136072!5m2!1sen!2sid" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
</div> </div>
</div> </div>
<div class="footer-widget mb-30"> <div class="footer-widget mb-30">
<h3 class="footer-widget-title-5">Contact Info</h3> <h3 class="footer-widget-title-5">Contact Info</h3>
<div class="footer-info-wrapper-3"> <div class="footer-info-wrapper-3">
<div class="footer-address-furniture"> <div class="footer-address-furniture">
<div class="footer-info-icon3"> <div class="footer-info-icon3">
<span>Address: </span> <span>Alamat: </span>
</div> </div>
<div class="footer-info-content3"> <div class="footer-info-content3">
<p>66 Sipu road Rampura Banasree <br>USA- 10800</p> <p>Jl. Mastrip No.159 <br>Kec. Kedopok, Kota Probolinggo</p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>Phone: </span>
</div>
<div class="footer-info-content3">
<p>+8801 (33) 515609735 <br>+8801 (66) 223352333</p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>E-mail: </span>
</div>
<div class="footer-info-content3">
<p><a href="#"> email@domain.com</a> <br><a href="#"> domain@mail.info</a></p>
</div>
</div>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5">Newsletter</h3>
<div class="footer-newsletter-2">
<p>Send us your mail or next updates</p>
<div id="mc_embed_signup" class="subscribe-form-5">
<form action="http://devitems.us11.list-manage.com/subscribe/post?u=6bbb9b6f5827bd842d9640c82&amp;id=05d85f18ef" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll" class="mc-form">
<input type="email" value="" name="EMAIL" class="email" placeholder="Enter mail address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div class="mc-news" aria-hidden="true"><input type="text" name="b_6bbb9b6f5827bd842d9640c82_05d85f18ef" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
</div> </div>
</div> </div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>WA: </span>
</div>
<div class="footer-info-content3">
<p><a href="https://wa.me/6285645979260" target="_blank">085645979260</a></p>
</div>
</div>
<div class="footer-address-furniture">
<div class="footer-info-icon3">
<span>IG: </span>
</div>
<div class="footer-info-content3">
<p><a href="https://www.instagram.com/aleea.beautysalon" target="_blank">aleea.beautysalon</a></p>
</div>
</div>
</div>
</div>
<div class="footer-widget mb-30">
<h3 class="footer-widget-title-5" style="font-size: 1.5em;">Quick Links</h3>
<div class="footer-newsletter-2">
<ul style="font-size: 1.2em;">
<li><a href="/">Home</a></li>
<li><a href="{{ route('shop.index') }}">Shop</a></li>
<li><a href="{{ route('service.index') }}">Services</a></li>
</ul>
</div> </div>
</div> </div>
</div> </div>
<div class="footer-bottom ptb-20 gray-bg-8"> </div>
<div class="container"> </div>
<div class="row"> <div class="footer-bottom ptb-20 gray-bg-8">
<div class="col-12 text-center"> <div class="container">
<div class="copyright-furniture"> <div class="row">
<p>Copyright © <a href="https://hastech.company/">HasTech</a> 2018 . All Right Reserved.</p> <div class="col-12 text-center">
</div> <div class="copyright-furniture">
</div> <p>Copyright © <a href="https://hastech.company/">Aleea Salon</a> 2024 . All Right Reserved.</p>
</div> </div>
</div> </div>
</div> </div>
</footer> </div>
</div>
</footer>

View File

@ -1,120 +0,0 @@
<div class="blog-details content" x-data="{ showForm: @entangle('showForm') }">
<div class="comments_area pb-5">
<ul class="comment__list">
@forelse($product->approvedReviews as $review)
<li>
<div class="wn__comment d-flex" style="column-gap: 1rem;">
<div class="">
@if($review->user && $review->user->user_image)
<img class="rounded-circle" src="{{ assest('storage/images/users/' . $review->user->user_image) }}" alt="" width="50">
@else
<img src="https://ui-avatars.com/api/?name={{ $review->user->name }}&background=0d8abc&color=fff" alt="{{ $review->name }}">
@endif
</div>
<div class="content d-flex" style="column-gap: 2rem;">
<div class="">
<strong>{{ $review->user->name }}</strong>
<small class="comnt__author d-block d-sm-flex">{{ $review->created_at ? $review->created_at->format('d M, Y') : '' }}</small>
<div>
@if($review->rating)
@for($i = 0; $i < 5; $i++)
<i class="{{ round($review->rating) <= $i ? 'far' : 'fas' }} fa-star"></i>
@endfor
@endif
</div>
<div>
<p style="width: 100%; font-size: 14px;">{{ $review->content }}</p>
</div>
</div>
<div class="ml-auto">
@if($currentRatingId === $review->id)
@auth
<span x-on:click="showForm = !showForm"
class="text-primary" style="cursor: pointer">
<i class="fas fa-edit"></i>
</span>
<br><br>
<span x-on:click.prevent="return confirm('Are you sure?') ? @this.delete({{ $currentRatingId }}) : false"
class="text-danger" style="cursor: pointer">
<i class="fas fa-trash"></i>
</span>
@endauth
@endif
</div>
</div>
</div>
</li>
@empty
<a class="m-2">Be the first to write your review!</a>
@endforelse
</ul>
</div>
@auth
<div class="comment_respond" x-show="showForm">
@if($canRate)
@if($showForm)
<h3 class="reply_title">{{ $currentRatingId ? 'Your Rating' : 'Leave a Reply' }}</h3>
<form wire:submit.prevent="rate()" class="review__form score">
<div class="score-wrap">
<label for="star1">
<input hidden wire:model="rating" type="radio" id="star1" name="rating" value="1" />
<span class="stars-active" data-value="1">
<i class=" @if($rating >= 1 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star2">
<input hidden wire:model="rating" type="radio" id="star2" name="rating" value="2" />
<span class="stars-active" data-value="2">
<i class=" @if($rating >= 2 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star3">
<input hidden wire:model="rating" type="radio" id="star3" name="rating" value="3" />
<span class="stars-active" data-value="3">
<i class=" @if($rating >= 3 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star4">
<input hidden wire:model="rating" type="radio" id="star4" name="rating" value="4" />
<span class="stars-active" data-value="4">
<i class=" @if($rating >= 4 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
<label for="star5">
<input hidden wire:model="rating" type="radio" id="star5" name="rating" value="5" />
<span class="stars-active" data-value="5">
<i class=" @if($rating >= 5 ) fas fa-star @else far fa-star @endif" style="cursor: pointer"></i>
</span>
</label>
</div>
<p>@error('rating')<span class="text-danger">{{ $message }}</span>@enderror</p>
<div class="input__box text-left">
<textarea class="form-control" rows="5" wire:model.lazy="content">{{ old('review') }}</textarea>
@error('content')<span class="text-danger">{{ $message }}</span>@enderror
</div>
<div class="submite__btn">
@if($currentRatingId)
@auth
<button type="submit" class="btn btn-dark rounded shadow-lg">Update</button>
<button type="button" x-on:click="showForm = false" class="btn btn-secondary rounded shadow-lg">Close</button>
@endauth
@else
<button type="submit" class="btn btn-dark rounded shadow-lg">Rate</button>
@endif
</div>
</form>
@endif
@else
<div class="alert alert-danger" role="alert">
<small>Must buy this product before write a review.</small>
</div>
@endif
</div>
@else
<a href="{{ route('login') }}" class="btn btn-dark">
Login to write a review!
</a>
@endauth
</div>

View File

@ -1,77 +1,96 @@
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"> <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand --> <!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/') }}"> <a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ url('/') }}">
<div class="sidebar-brand-text mx-3">{{ __('Homepage') }}</div> <div class="sidebar-brand-icon">
<i class="fas fa-spa"></i> <!-- Simbol Spa -->
</div>
<div class="sidebar-brand-text mx-3">Aleea Salon</div> <!-- Nama Aleea Salon -->
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ request()->is('admin/dashboard') || request()->is('admin/dashboard') ? 'active' : '' }}">
<a class="nav-link" href="{{ route('admin.dashboard.index') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>{{ __('Dashboard') }}</span>
</a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-users"></i>
<span>{{ __('User Management') }}</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/users') || request()->is('admin/users/*') ? 'active' : '' }}" href="{{ route('admin.users.index') }}"> <i class="fas fa-user mr-2"></i> {{ __('Users') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseProduct" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-cubes"></i>
<span>{{ __('Product Management') }}</span>
</a>
<div id="collapseProduct" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/tags') || request()->is('admin/tags/*') ? 'active' : '' }}" href="{{ route('admin.tags.index') }}"> <i class="fas fa-tags mr-2"></i> {{ __('Tags') }}</a>
<a class="collapse-item {{ request()->is('admin/categories') || request()->is('admin/categories/*') ? 'active' : '' }}" href="{{ route('admin.categories.index') }}"> <i class="fas fa-list mr-2"></i> {{ __('Categories') }}</a>
<a class="collapse-item {{ request()->is('admin/products') || request()->is('admin/products/*') ? 'active' : '' }}" href="{{ route('admin.products.index') }}"> <i class="fas fa-boxes mr-2"></i> {{ __('Products') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseServices" aria-expanded="true" aria-controls="collapseServices">
<i class="fas fa-tools"></i>
<span>{{ __('Services Management') }}</span>
</a>
<div id="collapseServices" class="collapse" aria-labelledby="headingServices" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/schedule') || request()->is('admin/schedule/*') ? 'active' : '' }}" href="{{ route('admin.schedule.index') }}"> <i class="fas fa-calendar-alt mr-2"></i> {{ __('Schedule') }}</a>
<a class="collapse-item {{ request()->is('admin/category') || request()->is('admin/category/*') ? 'active' : '' }}" href="{{ route('admin.category.index') }}"> <i class="fas fa-list-alt mr-2"></i> {{ __('Service Category') }}</a>
<a class="collapse-item {{ request()->is('admin/obtained') || request()->is('admin/obtained/*') ? 'active' : '' }}" href="{{ route('admin.obtained.index') }}"> <i class="fas fa-hand-holding-usd mr-2"></i> {{ __('Services Obtained') }}</a>
<a class="collapse-item {{ request()->is('admin/service') || request()->is('admin/service/*') ? 'active' : '' }}" href="{{ route('admin.service.index') }}"> <i class="fas fa-tools mr-2"></i> {{ __('Services') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseOrder" aria-expanded="true" aria-controls="collapseTwo">
<i class="fas fa-shopping-cart"></i>
<span>{{ __('Transaction') }}</span>
</a>
<div id="collapseOrder" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/orders') || request()->is('admin/orders/*') ? 'active' : '' }}" href="{{ route('admin.orders.index') }}"> <i class="fas fa-file-invoice-dollar mr-2"></i> {{ __('Orders') }}</a>
<a class="collapse-item {{ request()->is('admin/booking') || request()->is('admin/booking/*') ? 'active' : '' }}" href="{{ route('admin.booking.index') }}"> <i class="fas fa-book-open mr-2"></i> {{ __('Booking') }}</a>
</div>
</div>
</li>
<!-- resources/views/layouts/sidebar.blade.php atau yang setara -->
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseReports" aria-expanded="true" aria-controls="collapseReports">
<i class="fas fa-file-alt"></i>
<span>{{ __('Reports Management') }}</span>
</a>
<div id="collapseReports" class="collapse" aria-labelledby="headingReports" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/reports/revenue') ? 'active' : '' }}" href="{{ route('admin.reports.revenue') }}">
<i class="fas fa-chart-line mr-2"></i> {{ __('Data Laporan') }}
</a> </a>
<a class="collapse-item {{ request()->is('admin/reports/total-revenue') ? 'active' : '' }}" href="{{ route('admin.reports.total-revenue') }}">
<i class="fas fa-coins mr-2"></i> {{ __('Data Rekap') }}
</a>
</div>
</div>
</li>
<!-- Divider --> </ul>
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item {{ request()->is('admin/dashboard') || request()->is('admin/dashboard') ? 'active' : '' }}">
<a class="nav-link" href="{{ route('admin.dashboard.index') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>{{ __('Dashboard') }}</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('User Management') }}</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/users') || request()->is('admin/users/*') ? 'active' : '' }}" href="{{ route('admin.users.index') }}"> <i class="fa fa-user mr-2"></i> {{ __('Users') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseProduct" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('Product Management') }}</span>
</a>
<div id="collapseProduct" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/tags') || request()->is('admin/tags/*') ? 'active' : '' }}" href="{{ route('admin.tags.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Tags') }}</a>
<a class="collapse-item {{ request()->is('admin/categories') || request()->is('admin/categories/*') ? 'active' : '' }}" href="{{ route('admin.categories.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Categories') }}</a>
<a class="collapse-item {{ request()->is('admin/products') || request()->is('admin/products/*') ? 'active' : '' }}" href="{{ route('admin.products.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Products') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseServices" aria-expanded="true" aria-controls="collapseServices">
<span>{{ __('Services Management') }}</span>
</a>
<div id="collapseServices" class="collapse" aria-labelledby="headingServices" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/schedule') || request()->is('admin/schedule/*') ? 'active' : '' }}" href="{{ route('admin.schedule.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Schedule') }}</a>
<a class="collapse-item {{ request()->is('admin/category') || request()->is('admin/category/*') ? 'active' : '' }}" href="{{ route('admin.category.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Service Category') }}</a>
<a class="collapse-item {{ request()->is('admin/obtained') || request()->is('admin/obtained/*') ? 'active' : '' }}" href="{{ route('admin.obtained.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Services Obtained') }}</a>
<a class="collapse-item {{ request()->is('admin/service') || request()->is('admin/service/*') ? 'active' : '' }}" href="{{ route('admin.service.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Services') }}</a>
</div>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseOrder" aria-expanded="true" aria-controls="collapseTwo">
<span>{{ __('Transaction Management') }}</span>
</a>
<div id="collapseOrder" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item {{ request()->is('admin/orders') || request()->is('admin/orders/*') ? 'active' : '' }}" href="{{ route('admin.orders.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Orders') }}</a>
<a class="collapse-item {{ request()->is('admin/booking') || request()->is('admin/booking/*') ? 'active' : '' }}" href="{{ route('admin.booking.index') }}"> <i class="fa fa-briefcase mr-2"></i> {{ __('Booking') }}</a>
</div>
</div>
</li>
</ul>

Some files were not shown because too many files have changed in this diff Show More