Commit 3e3455e5 by Dhanaraj

new changes

parent ed86bc4b
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AdminAuthController extends Controller
{
public function showLoginForm()
{
return view('admin.auth.login');
}
public function login(Request $request)
{
$credentials = $request->validate([
'email' => ['required', 'string'],
'password' => ['required', 'string'],
]);
if (Auth::attempt($credentials, $request->boolean('remember'))) {
$request->session()->regenerate();
return redirect()->intended(url('/admin/dashboard'))->with('success', 'Logged in successfully!');
}
return back()->withErrors([
'email' => 'The provided credentials do not match our records.',
])->onlyInput('email');
}
public function logout(Request $request)
{
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect(url('/admin/login'))->with('success', 'Logged out securely.');
}
}
......@@ -7,10 +7,10 @@ use Illuminate\Http\Request;
use App\Models\Country;
use App\Models\State;
use App\Models\City;
use App\Models\Unit;
use App\Models\UnitSize;
use App\Models\Size;
use App\Models\Category;
use App\Models\Product;
use App\Models\ProductVariant;
class AdminMasterDataController extends Controller
{
......@@ -19,20 +19,97 @@ class AdminMasterDataController extends Controller
'country', 'countries' => Country::class,
'state', 'states' => State::class,
'city', 'cities' => City::class,
'unit', 'units' => Unit::class,
'unitsizes' => UnitSize::class,
'size', 'sizes' => Size::class,
'productprices', 'product_variants', 'product_variant' => ProductVariant::class,
'category', 'categories' => Category::class,
'gallery', 'galleries' => \App\Models\Gallery::class,
'product', 'products' => Product::class,
default => null,
};
}
private function saveProductImages(Request $request, $product)
{
$imageUrl = null;
if ($request->hasFile('primary_image_file')) {
$file = $request->file('primary_image_file');
$filename = time() . '_' . uniqid() . '.' . $file->getClientOriginalExtension();
$file->move(public_path('uploads/products'), $filename);
$imageUrl = '/uploads/products/' . $filename;
}
elseif ($request->filled('primary_image_url')) {
$imageUrl = $request->input('primary_image_url');
}
if ($imageUrl) {
$primaryImage = \App\Models\ProductImage::where('product_id', $product->id)
->where('is_primary', true)
->first();
if ($primaryImage) {
$primaryImage->update([
'image_url' => $imageUrl
]);
} else {
\App\Models\ProductImage::create([
'product_id' => $product->id,
'image_url' => $imageUrl,
'is_primary' => true
]);
}
}
}
public function store(Request $request, $type)
{
$modelClass = $this->getModelClass($type);
if (!$modelClass) return back()->with('error', 'Invalid type');
if ($type === 'products' || $type === 'product') {
$productData = $request->only([
'category_id', 'name', 'slug', 'description', 'is_bestseller', 'status'
]);
$productData['price'] = 0.00;
$productData['stock_quantity'] = 0;
$product = Product::create($productData);
$this->saveProductImages($request, $product);
return redirect('/admin/products')->with('success', 'Product created successfully!');
}
if ($type === 'gallery' || $type === 'galleries') {
$data = $request->only(['filename', 'status']);
$url = null;
if ($request->hasFile('image_file')) {
$file = $request->file('image_file');
$filename = time() . '_' . uniqid() . '.' . $file->getClientOriginalExtension();
$file->move(public_path('uploads/gallery'), $filename);
$url = '/uploads/gallery/' . $filename;
} elseif ($request->filled('url')) {
$url = $request->input('url');
}
if (!$url) {
return back()->with('error', 'Please upload an image file or provide an Image URL.');
}
$data['url'] = $url;
\App\Models\Gallery::create($data);
return redirect('/admin/gallery')->with('success', 'Gallery entry created successfully!');
}
if ($type === 'productprices' || $type === 'product_variants' || $type === 'product_variant') {
$exists = ProductVariant::where('product_id', $request->product_id)
->where('size_id', $request->size_id)
->exists();
if ($exists) {
return back()->with('error', 'This size variant already exists for the selected product.');
}
}
$data = $request->except('_token');
$modelClass::create($data);
......@@ -45,6 +122,35 @@ class AdminMasterDataController extends Controller
if (!$modelClass) return back()->with('error', 'Invalid type');
$record = $modelClass::findOrFail($id);
if ($type === 'products' || $type === 'product') {
$productData = $request->only([
'category_id', 'name', 'slug', 'description', 'is_bestseller', 'status'
]);
$record->update($productData);
$this->saveProductImages($request, $record);
return redirect('/admin/products')->with('success', 'Product updated successfully!');
}
if ($type === 'gallery' || $type === 'galleries') {
$data = $request->only(['filename', 'status']);
$url = $record->url;
if ($request->hasFile('image_file')) {
$file = $request->file('image_file');
$filename = time() . '_' . uniqid() . '.' . $file->getClientOriginalExtension();
$file->move(public_path('uploads/gallery'), $filename);
$url = '/uploads/gallery/' . $filename;
} elseif ($request->filled('url')) {
$url = $request->input('url');
}
$data['url'] = $url;
$record->update($data);
return redirect('/admin/gallery')->with('success', 'Gallery entry updated successfully!');
}
$data = $request->except(['_token', '_method']);
$record->update($data);
......
......@@ -41,16 +41,6 @@ class AdminViewController extends Controller
return view('admin.city', compact('cities'));
}
public function units() {
$units = Unit::all();
return view('admin.unit', compact('units'));
}
public function unitsizes() {
$unitsizes = UnitSize::all();
return view('admin.unitsizes', compact('unitsizes'));
}
public function sizes() {
$sizes = Size::all();
return view('admin.sizes', compact('sizes'));
......@@ -66,9 +56,22 @@ class AdminViewController extends Controller
return view('admin.products', compact('products'));
}
public function productsCreate() {
$categories = Category::all();
return view('admin.products_create', compact('categories'));
}
public function productsEdit($id) {
$product = Product::findOrFail($id);
$categories = Category::all();
return view('admin.products_edit', compact('product', 'categories'));
}
public function productprices() {
$productprices = ProductVariant::with('product')->get();
return view('admin.productprices', compact('productprices'));
$productprices = ProductVariant::with(['product', 'size'])->get();
$products = Product::orderBy('name')->get();
$sizes = Size::orderBy('name')->get();
return view('admin.productprices', compact('productprices', 'products', 'sizes'));
}
public function orders() {
......@@ -91,6 +94,15 @@ class AdminViewController extends Controller
return view('admin.gallery', compact('gallery'));
}
public function galleryCreate() {
return view('admin.gallery_create');
}
public function galleryEdit($id) {
$gallery = Gallery::findOrFail($id);
return view('admin.gallery_edit', compact('gallery'));
}
public function pincodes() {
$pincodes = Pincode::all();
return view('admin.pincodes', compact('pincodes'));
......
......@@ -26,7 +26,7 @@ class CatalogController extends Controller
*/
public function products(Request $request): JsonResponse
{
$query = Product::with(['primaryImage', 'category', 'variants']);
$query = Product::with(['primaryImage', 'category', 'variants.size']);
// Filter by category slug
if ($request->has('category') && $request->input('category') !== 'all') {
......@@ -72,7 +72,7 @@ class CatalogController extends Controller
*/
public function productDetails(string $slug): JsonResponse
{
$product = Product::with(['images', 'variants', 'category'])->where('slug', $slug)->first();
$product = Product::with(['images', 'variants.size', 'category'])->where('slug', $slug)->first();
if (!$product) {
return response()->json([
......@@ -82,7 +82,7 @@ class CatalogController extends Controller
}
// Fetch related products from same category (excluding current)
$relatedProducts = Product::with('primaryImage')
$relatedProducts = Product::with(['primaryImage', 'variants.size'])
->where('category_id', $product->category_id)
->where('id', '!=', $product->id)
->limit(4)
......
......@@ -56,7 +56,7 @@ class CheckoutController extends Controller
$price = $variant->price;
}
if ($variant->stock_quantity < $item['quantity']) {
throw new \Exception("Inadequate stock for product variant: {$product->name} ({$variant->size})");
throw new \Exception("Inadequate stock for product variant: {$product->name} ({$variant->size->name})");
}
// Deduct variant stock
$variant->decrement('stock_quantity', $item['quantity']);
......
......@@ -19,10 +19,11 @@ class FrontendController extends Controller
public function productDetail($slug)
{
$product = Product::with(['category'])->where('slug', $slug)->firstOrFail();
$product = Product::with(['category', 'variants.size'])->where('slug', $slug)->firstOrFail();
// Fetch related products (same category)
$relatedProducts = Product::where('category_id', $product->category_id)
$relatedProducts = Product::with(['primaryImage', 'variants.size'])
->where('category_id', $product->category_id)
->where('id', '!=', $product->id)
->take(4)
->get();
......
......@@ -20,6 +20,7 @@ class Product extends Model
'strike_price',
'stock_quantity',
'is_bestseller',
'status',
];
protected $casts = [
......
......@@ -12,7 +12,7 @@ class ProductVariant extends Model
protected $fillable = [
'product_id',
'size',
'size_id',
'price',
'stock_quantity',
];
......@@ -28,4 +28,12 @@ class ProductVariant extends Model
{
return $this->belongsTo(Product::class);
}
/**
* Get the size configuration for the variant.
*/
public function size(): BelongsTo
{
return $this->belongsTo(Size::class, 'size_id');
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Unit extends Model
{
protected $guarded = [];
//
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class UnitSize extends Model
{
protected $guarded = [];
//
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
// Insert default admin user
DB::table('users')->insert([
'name' => 'Admin',
'email' => 'admin', // use admin as email/username
'password' => Hash::make('admin123'),
'created_at' => now(),
'updated_at' => now(),
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};
......@@ -11,11 +11,8 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('units', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('code')->unique();
$table->timestamps();
Schema::table('products', function (Blueprint $table) {
$table->string('status')->default('Active')->after('is_bestseller');
});
}
......@@ -24,6 +21,8 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('units');
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('status');
});
}
};
......@@ -11,11 +11,9 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('unit_sizes', function (Blueprint $table) {
$table->id();
$table->string('identifier');
$table->string('unit');
$table->timestamps();
Schema::table('product_variants', function (Blueprint $table) {
$table->dropColumn('size');
$table->foreignId('size_id')->after('product_id')->constrained('sizes')->onDelete('cascade');
});
}
......@@ -24,6 +22,10 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('unit_sizes');
Schema::table('product_variants', function (Blueprint $table) {
$table->dropForeign(['size_id']);
$table->dropColumn('size_id');
$table->string('size');
});
}
};
<?php
namespace Database\Seeders;
use App\Models\Gallery;
use Illuminate\Database\Seeder;
class GallerySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// Truncate existing gallery entries to avoid duplicates
Gallery::truncate();
$items = [
['filename' => 'Decorative Shell Wall Frame', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Shell Clock Frame', 'url' => 'https://images.unsplash.com/photo-1595855759920-86582396756a?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Starfish Lights Decor', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Shell Jewelry Box Open', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Shell Gift Hamper Box', 'url' => 'https://images.unsplash.com/photo-1542838132-92c53300491e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Beach Mugs and Frames', 'url' => 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Wind Chime', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Shell Candle Holder', 'url' => 'https://images.unsplash.com/photo-1520038410233-7141be7e6f97?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Jewelry Box Closed', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Iridescent Conch Table Lamp', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Oyster Shell Ring Dish', 'url' => 'https://images.unsplash.com/photo-1535632066927-ab7c9ab60908?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Polished Nautilus Display', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Ocean Theme Bottle Art', 'url' => 'https://images.unsplash.com/photo-1526947425960-945c6e72858f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Mussel Shell Wind Chime', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Scallop Shell Jewelry Holder', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Sea Glass Window Pendant', 'url' => 'https://images.unsplash.com/photo-154474655-9aed1e956bc2?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Cowrie Shell Tribal Necklace', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Abalone Shell Inlay Bangle', 'url' => 'https://images.unsplash.com/photo-1535632066927-ab7c9ab60908?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Polished Pearl Conch', 'url' => 'https://images.unsplash.com/photo-1544735716-392fe2489ffa?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Miniature Shell Message Bottle', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Bonsai Tree', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Hand-painted Oyster Coasters', 'url' => 'https://images.unsplash.com/photo-1595855759920-86582396756a?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Starfish Wall Tapestry', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Candle Pillar', 'url' => 'https://images.unsplash.com/photo-1603006905003-be475563bc59?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Clam Shell Centerpiece Bowl', 'url' => 'https://images.unsplash.com/photo-154474655-9aed1e956bc2?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Marine Theme Pen Stand', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Gift Box Ornament', 'url' => 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Ocean Theme Hanging Mirror', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Polished Scallop Shell Garland', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Pearlized Abalone Pendant', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Beach Sand & Shell Coaster', 'url' => 'https://images.unsplash.com/photo-1595855759920-86582396756a?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Windchime Large', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Ocean Resin Coaster', 'url' => 'https://images.unsplash.com/photo-154474655-9aed1e956bc2?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Sea Urchin Accent Light', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Clam Shell Dish Set', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Keychain Set', 'url' => 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Ocean Wave Acrylic Painting', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Golden Trim Oyster Dishes', 'url' => 'https://images.unsplash.com/photo-1535632066927-ab7c9ab60908?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Rustic Beach Wood Signboard', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Starfish Pattern Photo Frame', 'url' => 'https://images.unsplash.com/photo-1595855759920-86582396756a?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Handcrafted Shell Bookmark', 'url' => 'https://images.unsplash.com/photo-154474655-9aed1e956bc2?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Sea Glass Wrapped Bracelet', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Tropical Conch Wall Decor', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Embedded Coffin Box', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Starfish Table Runner', 'url' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Hanging Driftwood Chime', 'url' => 'https://images.unsplash.com/photo-154474655-9aed1e956bc2?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Iridescent Conch Nightlight', 'url' => 'https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Seashell Mosaic Mirror', 'url' => 'https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Ocean Reef Trinket Pot', 'url' => 'https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=600&auto=format&fit=crop&q=80'],
['filename' => 'Abalone Shell Inlay Coaster', 'url' => 'https://images.unsplash.com/photo-1535632066927-ab7c9ab60908?w=600&auto=format&fit=crop&q=80']
];
foreach ($items as $item) {
Gallery::create([
'filename' => $item['filename'],
'url' => $item['url'],
'status' => 'Active'
]);
}
}
}
......@@ -15,6 +15,13 @@ class ProductSeeder extends Seeder
*/
public function run(): void
{
// Ensure standard sizes exist
$sizesMap = [
'Small' => \App\Models\Size::firstOrCreate(['code' => 'S'], ['name' => 'Small', 'status' => 'Active']),
'Medium' => \App\Models\Size::firstOrCreate(['code' => 'M'], ['name' => 'Medium', 'status' => 'Active']),
'Large' => \App\Models\Size::firstOrCreate(['code' => 'L'], ['name' => 'Large', 'status' => 'Active']),
];
// 1. Ensure Categories exist
$cats = [
'Seashell Hand Crafts' => 'seashell-hand-crafts',
......@@ -618,19 +625,19 @@ class ProductSeeder extends Seeder
// 4. Create Product Size and Price Variants dynamically
// Small variant (default base price)
\App\Models\ProductVariant::updateOrCreate(
['product_id' => $product->id, 'size' => 'Small'],
['product_id' => $product->id, 'size_id' => $sizesMap['Small']->id],
['price' => $data['price'], 'stock_quantity' => 25]
);
// Medium variant (+25% price)
\App\Models\ProductVariant::updateOrCreate(
['product_id' => $product->id, 'size' => 'Medium'],
['product_id' => $product->id, 'size_id' => $sizesMap['Medium']->id],
['price' => $data['price'] * 1.25, 'stock_quantity' => 20]
);
// Large variant (+50% price)
\App\Models\ProductVariant::updateOrCreate(
['product_id' => $product->id, 'size' => 'Large'],
['product_id' => $product->id, 'size_id' => $sizesMap['Large']->id],
['price' => $data['price'] * 1.50, 'stock_quantity' => 12]
);
}
......
......@@ -42,27 +42,37 @@ function saveCart() {
$(document).ready(function() {
updateCartHeader();
// Size Selection toggles
// Size Selection toggles and price updates
$(document).on('click', '.size-btn', function() {
$(this).siblings().removeClass('active');
$(this).addClass('active');
const newPrice = $(this).attr('data-price');
if (newPrice) {
const card = $(this).closest('.product-card-body, .product-card, .card-body, .product-detail-info');
card.find('.display-price, .product-price').text('₹' + parseInt(newPrice).toLocaleString());
card.find('.btn-add-to-cart-dynamic').attr('data-price', newPrice);
}
});
// Add to cart buttons (for bestsellers & product detail page)
$(document).on('click', '.btn-add-to-cart-dynamic', function() {
let card = $(this).closest('.product-card-body, .product-detail-info');
let card = $(this).closest('.product-card-body, .product-card, .card-body, .product-detail-info');
let id = $(this).data('id') || 'p1';
let name = $(this).data('name') || card.find('.product-title, h1').text().trim();
let price = parseInt($(this).data('price')) || 450;
let img = $(this).data('img') || '';
let size = card.find('.size-btn.active').text() || 'Small';
let sizeBtn = card.find('.size-btn.active');
let size = sizeBtn.text().trim() || 'Small';
let variantId = sizeBtn.attr('data-variant-id') || null;
let quantity = parseInt($('#detail-qty').val()) || 1;
let existing = cart.find(item => item.id === id && item.size === size);
if (existing) {
existing.quantity += quantity;
} else {
cart.push({ id, name, price, img, size, quantity });
cart.push({ id, name, price, img, size, variantId, quantity });
}
saveCart();
......@@ -195,6 +205,53 @@ $(document).ready(function() {
let subtotal = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0);
$('#summary-subtotal').text('₹' + subtotal);
$('#summary-total').text('₹' + subtotal);
// --- Dynamic State & City Dropdowns ---
$.ajax({
url: '/api/states',
method: 'GET',
success: function(res) {
if (res.success && res.data) {
res.data.forEach(function(state) {
$('#checkout_state').append(
$('<option>').val(state.name).text(state.name)
);
});
}
}
});
// When state changes, load cities
$('#checkout_state').on('change', function() {
let stateName = $(this).val();
let citySelect = $('#checkout_city');
citySelect.html('<option value="">Loading...</option>').prop('disabled', true);
if (!stateName) {
citySelect.html('<option value="">Select City</option>').prop('disabled', true);
return;
}
$.ajax({
url: '/api/cities',
method: 'GET',
data: { state: stateName },
success: function(res) {
citySelect.html('<option value="">Select City</option>');
if (res.success && res.data) {
res.data.forEach(function(city) {
citySelect.append(
$('<option>').val(city.name).text(city.name)
);
});
}
citySelect.prop('disabled', false);
},
error: function() {
citySelect.html('<option value="">Select City</option>').prop('disabled', true);
}
});
});
}
// Payment Selection
......@@ -205,13 +262,13 @@ $(document).ready(function() {
// Gallery Lightbox Modal
let galleryImages = [];
$('.gallery-grid .gallery-item img').each(function() {
$('.gallery-masonry .gallery-masonry-item img').each(function() {
galleryImages.push($(this).attr('src'));
});
let currentImgIdx = 0;
$('.gallery-grid .gallery-item').click(function() {
$('.gallery-masonry .gallery-masonry-item').click(function() {
let imgUrl = $(this).find('img').attr('src');
currentImgIdx = galleryImages.indexOf(imgUrl);
$('#lightbox-img').attr('src', imgUrl);
......@@ -262,7 +319,7 @@ $(document).ready(function() {
let items = cart.map(item => {
return {
product_id: item.id,
variant_id: null, // simple override if custom variants needed
variant_id: item.variantId || null,
quantity: item.quantity
};
});
......@@ -280,8 +337,8 @@ $(document).ready(function() {
email: $('input[name="email"]').val(),
phone: $('input[name="phone"]').val(),
shipping_address: $('input[name="shipping_address"]').val(),
city: $('input[name="city"]').val(),
state: $('input[name="state"]').val(),
city: $('#checkout_city').val(),
state: $('#checkout_state').val(),
pincode: $('input[name="pincode"]').val(),
payment_method: paymentMethod,
coupon_code: appliedCoupon ? 'OCEAN10' : null,
......
......@@ -21,27 +21,37 @@ function saveCart() {
$(document).ready(function() {
updateCartHeader();
// Size Selection toggles
// Size Selection toggles and price updates
$(document).on('click', '.size-btn', function() {
$(this).siblings().removeClass('active');
$(this).addClass('active');
const newPrice = $(this).attr('data-price');
if (newPrice) {
const card = $(this).closest('.product-card-body, .product-card, .card-body, .product-detail-info');
card.find('.display-price, .product-price').text('₹' + parseInt(newPrice).toLocaleString());
card.find('.btn-add-to-cart-dynamic').attr('data-price', newPrice);
}
});
// Add to cart buttons (for bestsellers & product detail page)
$(document).on('click', '.btn-add-to-cart-dynamic', function() {
let card = $(this).closest('.product-card-body, .product-detail-info');
let card = $(this).closest('.product-card-body, .product-card, .card-body, .product-detail-info');
let id = $(this).data('id') || 'p1';
let name = $(this).data('name') || card.find('.product-title, h1').text().trim();
let price = parseInt($(this).data('price')) || 450;
let img = $(this).data('img') || '';
let size = card.find('.size-btn.active').text() || 'Small';
let sizeBtn = card.find('.size-btn.active');
let size = sizeBtn.text().trim() || 'Small';
let variantId = sizeBtn.attr('data-variant-id') || null;
let quantity = parseInt($('#detail-qty').val()) || 1;
let existing = cart.find(item => item.id === id && item.size === size);
if (existing) {
existing.quantity += quantity;
} else {
cart.push({ id, name, price, img, size, quantity });
cart.push({ id, name, price, img, size, variantId, quantity });
}
saveCart();
......@@ -160,13 +170,13 @@ $(document).ready(function() {
// Gallery Lightbox Modal
let galleryImages = [];
$('.gallery-grid .gallery-item img').each(function() {
$('.gallery-masonry .gallery-masonry-item img').each(function() {
galleryImages.push($(this).attr('src'));
});
let currentImgIdx = 0;
$('.gallery-grid .gallery-item').click(function() {
$('.gallery-masonry .gallery-masonry-item').click(function() {
let imgUrl = $(this).find('img').attr('src');
currentImgIdx = galleryImages.indexOf(imgUrl);
$('#lightbox-img').attr('src', imgUrl);
......
......@@ -619,47 +619,104 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1.4;
}
/* Gallery Masonry Layout */
.gallery-grid:not(.row) {
column-count: 4;
column-gap: 1.2rem;
/* Gallery Page – Edge-to-Edge Masonry Collage */
.gallery-page-wrapper {
padding: 0;
margin: 0;
width: 100%;
}
@media (max-width: 992px) {
.gallery-grid:not(.row) {
column-count: 3;
}
.gallery-page-header {
padding: 2.5rem 1rem 1.5rem;
background: #fafbfc;
}
@media (max-width: 768px) {
.gallery-grid:not(.row) {
column-count: 2;
}
.gallery-page-title {
font-size: 2rem;
font-weight: 800;
color: #3a3a3a;
font-family: 'Plus Jakarta Sans', sans-serif;
margin-bottom: 0.3rem;
}
@media (max-width: 480px) {
.gallery-grid:not(.row) {
column-count: 1;
}
.gallery-page-subtitle {
color: #888;
font-size: 0.95rem;
margin-bottom: 0;
}
.gallery-item {
.gallery-masonry {
column-count: 5;
column-gap: 6px;
padding: 6px;
background: #f0f0f0;
}
.gallery-masonry-item {
break-inside: avoid;
margin-bottom: 1.2rem;
border-radius: 12px;
margin-bottom: 6px;
border-radius: 10px;
overflow: hidden;
position: relative;
cursor: pointer;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
transition: all 0.3s ease;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
transform: scale(1.02);
box-shadow: 0 10px 20px rgba(0,0,0,0.12);
.gallery-masonry-item:hover {
transform: scale(1.015);
box-shadow: 0 8px 24px rgba(0,0,0,0.18);
z-index: 2;
}
.gallery-item img {
.gallery-masonry-item img {
width: 100%;
height: auto;
display: block;
transition: transform 0.4s ease;
}
.gallery-masonry-item:hover img {
transform: scale(1.05);
}
.gallery-masonry-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 14px 12px 10px;
background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
}
.gallery-masonry-item:hover .gallery-masonry-overlay {
opacity: 1;
}
.gallery-masonry-label {
color: #fff;
font-size: 0.82rem;
font-weight: 600;
font-family: 'Plus Jakarta Sans', sans-serif;
text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
/* Gallery responsive breakpoints */
@media (max-width: 1200px) {
.gallery-masonry { column-count: 4; }
}
@media (max-width: 992px) {
.gallery-masonry { column-count: 3; }
}
@media (max-width: 768px) {
.gallery-masonry { column-count: 2; column-gap: 4px; padding: 4px; }
.gallery-masonry-item { margin-bottom: 4px; border-radius: 6px; }
}
@media (max-width: 480px) {
.gallery-masonry { column-count: 2; column-gap: 3px; padding: 3px; }
.gallery-masonry-item { margin-bottom: 3px; border-radius: 4px; }
}
/* Lightbox Modal */
......@@ -1014,9 +1071,6 @@ footer a:hover {
margin-bottom: 3rem;
max-width: 480px;
}
.gallery-grid:not(.row) {
column-count: 2;
}
}
@media (max-width: 768px) {
......@@ -1044,9 +1098,6 @@ footer a:hover {
padding-top: 50px;
padding-bottom: 50px;
}
.gallery-grid:not(.row) {
column-count: 1;
}
.feature-badge {
flex-direction: column;
text-align: center;
......
# Placeholder for products upload directory
......@@ -498,8 +498,6 @@
<li><a href="#country" data-tab="country"><i class="fa-solid fa-globe"></i>Countries</a></li>
<li><a href="#state" data-tab="state"><i class="fa-solid fa-map"></i>States</a></li>
<li><a href="#city" data-tab="city"><i class="fa-solid fa-city"></i>Cities</a></li>
<li><a href="#unit" data-tab="unit"><i class="fa-solid fa-scale-balanced"></i>Units</a></li>
<li><a href="#unitsizes" data-tab="unitsizes"><i class="fa-solid fa-ruler-combined"></i>Unit Sizes</a></li>
<li><a href="#category" data-tab="category"><i class="fa-solid fa-list"></i>Categories</a></li>
</ul>
</div>
......@@ -565,16 +563,6 @@
@include('admin.city')
</div>
<!-- Tab Pane: Unit -->
<div id="tab-unit" class="tab-pane-content d-none">
@include('admin.unit')
</div>
<!-- Tab Pane: Unit Sizes -->
<div id="tab-unitsizes" class="tab-pane-content d-none">
@include('admin.unitsizes')
</div>
<!-- Tab Pane: Category -->
<div id="tab-category" class="tab-pane-content d-none">
@include('admin.category')
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Announcements</li>
</ol>
</nav>
@endsection
@section('page_title', 'Announcements')
@section('page_description', 'Manage store announcements.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login - VSI Mart</title>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- FontAwesome 6 Icons -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Plus Jakarta Sans', sans-serif;
background-color: #03489F;
color: #1e293b;
margin: 0;
overflow-x: hidden;
}
.shells-ai-loader-container {
width: 140px;
height: 140px;
margin-bottom: 25px;
position: relative;
animation: shells-float 3.5s ease-in-out infinite;
}
.shells-ai-svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.8s ease-in-out;
}
.shells-ai-svg.shell-scallop {
animation: cycle-shell-1 8s infinite ease-in-out;
}
.shells-ai-svg.shell-conch {
animation: cycle-shell-2 8s infinite ease-in-out;
}
.shells-ai-svg.shell-cowrie {
animation: cycle-shell-3 8s infinite ease-in-out;
}
.shells-ai-svg.shell-snail {
animation: cycle-shell-4 8s infinite ease-in-out;
}
@keyframes shells-float {
0%, 100% { transform: translateY(0) scale(1); }
50% { transform: translateY(-18px) scale(1.05); }
}
@keyframes cycle-shell-1 {
0%, 20% { opacity: 1; filter: drop-shadow(0 0 18px rgba(227, 82, 107, 0.85)); }
25%, 95% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes cycle-shell-2 {
0%, 20% { opacity: 0; }
25%, 45% { opacity: 1; filter: drop-shadow(0 0 20px rgba(255, 91, 0, 0.95)); }
50%, 100% { opacity: 0; }
}
@keyframes cycle-shell-3 {
0%, 45% { opacity: 0; }
50%, 70% { opacity: 1; filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.9)); }
75%, 100% { opacity: 0; }
}
@keyframes cycle-shell-4 {
0%, 70% { opacity: 0; }
75%, 95% { opacity: 1; filter: drop-shadow(0 0 20px rgba(76, 163, 117, 0.9)); }
100% { opacity: 0; }
}
/* Glassmorphism Login Container */
.login-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: linear-gradient(135deg, #03489F 0%, #2172E2 100%);
display: flex;
align-items: center;
justify-content: center;
z-index: 1500;
}
.login-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 24px;
padding: 40px;
width: 100%;
max-width: 440px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
color: white;
text-align: center;
}
</style>
</head>
<body>
<div class="login-overlay">
<div class="login-card">
<div class="shells-ai-loader-container mx-auto">
<svg viewBox="0 0 100 100" class="shells-ai-svg shell-scallop">
<defs>
<linearGradient id="scallopGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#FF8A8A" />
<stop offset="50%" stop-color="#E3526B" />
<stop offset="100%" stop-color="#9C1E3E" />
</linearGradient>
</defs>
<path d="M50,12 C44,30 32,45 22,62 C16,72 19,82 30,84 C38,85 45,74 50,67 C55,74 62,85 70,84 C81,82 84,72 78,62 C68,45 56,30 50,12 Z" fill="url(#scallopGrad)"/>
<path d="M50,12 L50,67 M50,12 C47,30 43,48 40,65 M50,12 C53,30 57,48 60,65 M50,12 C40,30 30,48 26,67 M50,12 C60,30 70,48 74,67 M50,12 C35,30 22,48 18,70 M50,12 C65,30 78,48 82,70" stroke="rgba(255,255,255,0.45)" stroke-width="2" fill="none"/>
</svg>
<svg viewBox="0 0 100 100" class="shells-ai-svg shell-conch">
<defs>
<linearGradient id="conchGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#FFEED4" />
<stop offset="60%" stop-color="#FFBD8A" />
<stop offset="100%" stop-color="#FF5B00" />
</linearGradient>
</defs>
<path d="M45,15 C48,22 55,25 60,20 C65,15 58,10 50,8 C40,6 35,12 40,18 Z" fill="#FFEED4"/>
<path d="M40,18 C30,30 20,48 22,65 C24,80 40,82 50,75 C62,65 72,40 68,28 C64,18 52,15 40,18 Z" fill="url(#conchGrad)"/>
<path d="M48,32 C42,42 35,55 38,72 C40,80 50,82 54,75 C58,68 62,55 58,40 C55,32 50,30 48,32 Z" fill="#FF5B00" opacity="0.9"/>
<path d="M38,20 C32,32 26,45 28,60 M46,20 C42,32 38,48 40,65" stroke="rgba(255,255,255,0.3)" stroke-width="2.2" fill="none"/>
</svg>
<svg viewBox="0 0 100 100" class="shells-ai-svg shell-cowrie">
<defs>
<linearGradient id="cowrieGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#FFFFFF" />
<stop offset="70%" stop-color="#F2EFE9" />
<stop offset="100%" stop-color="#D9D0C1" />
</linearGradient>
</defs>
<path d="M50,15 C32,15 25,32 25,50 C25,68 32,85 50,85 C68,85 75,68 75,50 C75,32 68,15 50,15 Z" fill="url(#cowrieGrad)" stroke="#C4B9A3" stroke-width="1"/>
<path d="M50,22 C48,35 48,65 50,78" stroke="#877C68" stroke-width="4" stroke-linecap="round" fill="none"/>
<path d="M43,30 L48,30 M43,38 L48,38 M43,46 L48,46 M43,54 L48,54 M43,62 L48,62 M43,70 L48,70 M57,30 L52,30 M57,38 L52,38 M57,46 L52,46 M57,54 L52,54 M57,62 L52,62 M57,70 L52,70" stroke="#877C68" stroke-width="1.8"/>
</svg>
<svg viewBox="0 0 100 100" class="shells-ai-svg shell-snail">
<defs>
<linearGradient id="snailGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#9CDEB5" />
<stop offset="50%" stop-color="#4CA375" />
<stop offset="100%" stop-color="#216E45" />
</linearGradient>
</defs>
<path d="M50,18 C30,18 20,32 20,50 C20,68 35,82 50,82 C65,82 80,68 80,50 C80,35 70,22 55,20 C42,18 32,28 32,42 C32,54 42,62 52,60 C60,58 65,50 62,42 C60,35 52,32 48,38" fill="url(#snailGrad)"/>
<path d="M50,18 C30,18 20,32 20,50 C20,68 35,82 50,82 C65,82 80,68 80,50" stroke="#104A2B" stroke-width="2.5" fill="none"/>
<path d="M55,20 C42,18 32,28 32,42 C32,54 42,62 52,60" stroke="#104A2B" stroke-width="1.8" fill="none"/>
<path d="M22,40 L30,42 M22,60 L31,56 M35,76 L40,68 M55,80 L52,71 M72,70 L65,63 M78,50 L68,48 M70,32 L62,35 M55,20 L52,30" stroke="rgba(255,255,255,0.4)" stroke-width="2"/>
</svg>
</div>
<h3 class="fw-bold mb-2">VSI Mart Admin</h3>
<p class="text-white-50 mb-4">Please log in to manage your inventory and store operations.</p>
@if (session('success'))
<div class="alert alert-success py-2">{{ session('success') }}</div>
@endif
<form method="POST" action="{{ url('/admin/login') }}">
@csrf
<div class="mb-3 text-start">
<label class="form-label small fw-semibold text-white-50">Username</label>
<input type="text" name="email" class="form-control bg-transparent text-white border-white-50 rounded-pill px-3" value="{{ old('email', 'admin') }}" required autofocus>
@error('email')
<span class="text-warning small mt-1 d-block">{{ $message }}</span>
@enderror
</div>
<div class="mb-4 text-start">
<label class="form-label small fw-semibold text-white-50">Password</label>
<input type="password" name="password" class="form-control bg-transparent text-white border-white-50 rounded-pill px-3" value="admin123" required>
@error('password')
<span class="text-warning small mt-1 d-block">{{ $message }}</span>
@enderror
</div>
<div class="mb-3 text-start form-check ms-2">
<input type="checkbox" class="form-check-input border-white-50" name="remember" id="remember">
<label class="form-check-label text-white-50 small" for="remember">Remember me</label>
</div>
<button type="submit" class="btn btn-warning w-100 rounded-pill py-2.5 fw-bold text-dark mb-2">Login</button>
</form>
</div>
</div>
</body>
</html>
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Master Data</li>
<li class="breadcrumb-item active" aria-current="page">Categories</li>
</ol>
</nav>
@endsection
@section('page_title', 'Categories')
@section('page_description', 'Manage master data for Categories')
@section('content')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
......
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Master Data</li>
<li class="breadcrumb-item active" aria-current="page">Cities</li>
</ol>
</nav>
@endsection
@section('page_title', 'Cities')
@section('page_description', 'Manage master data for Cities')
@section('content')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
......
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Master Data</li>
<li class="breadcrumb-item active" aria-current="page">Countries</li>
</ol>
</nav>
@endsection
@section('page_title', 'Countries')
@section('page_description', 'Manage master data for Countries')
@section('content')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Coupons</li>
</ol>
</nav>
@endsection
@section('page_title', 'Coupons')
@section('page_description', 'Create and manage promotional discount coupons.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Gallery</li>
</ol>
</nav>
@endsection
@section('page_title', 'Gallery')
@section('page_description', 'Manage master data for Gallery Images')
@section('page_description', 'Manage product images and promotional media.')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New Image</button>
<a href="{{ url('/admin/gallery/create') }}" class="btn btn-primary rounded-pill px-4">+ Add New Image</a>
@endsection
@push('scripts')
<!-- CRUD Modal -->
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog">
<form method="POST" action="" id="crudForm">
@csrf
<input type="hidden" name="_method" id="crudMethod" value="POST">
<div class="modal-content">
<div class="modal-header border-0 pb-0">
<h5 class="modal-title fw-bold" id="crudModalLabel">Create Gallery Entry</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body pt-4">
<div class="mb-3">
<label class="form-label">Filename (Title)</label>
<input type="text" class="form-control" name="filename" id="crud_filename" required>
</div>
<div class="mb-3">
<label class="form-label">Image URL</label>
<input type="url" class="form-control" name="url" id="crud_url" required placeholder="https://example.com/image.jpg">
</div>
<div class="mb-3">
<label class="form-label">Status</label>
<select class="form-select" name="status" id="crud_status">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
</select>
</div>
</div>
<div class="modal-footer border-0 pt-0">
<button type="button" class="btn btn-light rounded-pill px-4" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary rounded-pill px-4" id="crudSubmitBtn">Save Changes</button>
</div>
</div>
</form>
</div>
</div>
<script>
const entityData = @json($gallery);
function openCreateModal() {
document.getElementById('crudModalLabel').innerText = 'Create Gallery Entry';
document.getElementById('crudMethod').value = 'POST';
document.getElementById('crudForm').action = '/admin/master/gallery';
document.getElementById('crudSubmitBtn').innerText = 'Create';
document.getElementById('crud_filename').value = '';
document.getElementById('crud_url').value = '';
document.getElementById('crud_status').value = 'Active';
}
function openEditModal(type, id) {
const item = entityData.find(x => x.id === id);
if (!item) return;
document.getElementById('crudModalLabel').innerText = 'Edit Gallery Entry';
document.getElementById('crudMethod').value = 'PUT';
document.getElementById('crudForm').action = '/admin/master/gallery/' + id;
document.getElementById('crudSubmitBtn').innerText = 'Update';
document.getElementById('crud_filename').value = item.filename || '';
document.getElementById('crud_url').value = item.url || '';
document.getElementById('crud_status').value = item.status || 'Active';
const modal = new bootstrap.Modal(document.getElementById('crudModal'));
modal.show();
}
</script>
@endpush
<div class="panel-card">
@section('content')
<div class="panel-card shadow-sm border-0 p-4">
<div class="row row-cols-2 row-cols-md-4 g-4" id="gallery-grid-box">
@foreach($gallery as $item)
<div class="col">
......@@ -94,7 +33,7 @@
<div class="card-body p-2 d-flex justify-content-between align-items-center">
<span class="small text-muted text-truncate" style="max-width:110px;">{{ $item->filename }}</span>
<div class="d-flex gap-1">
<button class="btn btn-link text-primary p-0 me-1" onclick="openEditModal('gallery', {{ $item->id }})"><i class="fa-solid fa-pen"></i></button>
<a href="{{ url('/admin/gallery/' . $item->id . '/edit') }}" class="btn btn-link text-primary p-0 me-1"><i class="fa-solid fa-pen"></i></a>
<button class="btn btn-link text-danger p-0" onclick="deleteRecord('gallery', {{ $item->id }})"><i class="fa-solid fa-trash"></i></button>
</div>
</div>
......@@ -106,5 +45,4 @@
@endif
</div>
</div>
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item"><a href="{{ url('/admin/gallery') }}">Gallery</a></li>
<li class="breadcrumb-item active" aria-current="page">Add Image</li>
</ol>
</nav>
@endsection
@section('page_title', 'Add Gallery Image')
@section('content')
<form method="POST" action="{{ url('/admin/master/gallery') }}" enctype="multipart/form-data">
@csrf
<div class="row g-4">
<!-- Main Form Column (Left) -->
<div class="col-lg-8">
<div class="panel-card shadow-sm border-0 h-100 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-file-invoice me-2 text-primary"></i>Image Details</h5>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Filename (Title)</label>
<input type="text" class="form-control rounded-3" name="filename" id="crud_filename" placeholder="Enter image title/filename..." required>
</div>
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Status</label>
<select class="form-select rounded-3" name="status" id="crud_status">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
</select>
</div>
</div>
</div>
<!-- Sidebar Column (Right) -->
<div class="col-lg-4">
<div class="d-flex flex-column gap-4">
<!-- Image Upload Card -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-image me-2 text-success"></i>Media Upload</h5>
<!-- File Upload Container -->
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Upload Image File</label>
<div class="upload-dropzone text-center p-3 border border-dashed rounded-3 bg-light position-relative" style="border-color: #cbd5e1 !important; cursor: pointer; transition: all 0.2s ease;">
<i class="fa-solid fa-cloud-arrow-up text-muted mb-2 fs-2 d-block"></i>
<span class="small text-muted d-block mb-1">Choose file to upload</span>
<span class="x-small text-muted d-block opacity-75">(JPG, PNG, WEBP)</span>
<input type="file" name="image_file" id="image_file" class="position-absolute top-0 start-0 opacity-0 w-100 h-100" style="cursor: pointer;" onchange="previewUploadImage(this)">
</div>
<div id="file_preview_container" class="mt-3 d-none text-center">
<img id="file_preview" src="" alt="Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
<span class="small d-block text-success mt-1 fw-semibold"><i class="fa-solid fa-circle-check me-1"></i>File selected</span>
</div>
</div>
<div class="text-center my-3 text-muted small fw-bold">--- OR ---</div>
<!-- Remote URL input -->
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Stock Image URL</label>
<input type="url" class="form-control rounded-3" name="url" id="crud_url" placeholder="https://example.com/image.jpg" oninput="previewUrlImage(this.value)">
<div id="url_preview_container" class="mt-3 d-none text-center">
<img id="url_preview" src="" alt="URL Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Action buttons footer -->
<div class="panel-card shadow-sm border-0 mt-4 p-3 d-flex justify-content-end align-items-center bg-white rounded-3">
<a href="{{ url('/admin/gallery') }}" class="btn btn-light rounded-pill px-4 me-2 fw-semibold">Cancel</a>
<button type="submit" class="btn btn-primary rounded-pill px-4 py-2 fw-semibold shadow-sm"><i class="fa-solid fa-floppy-disk me-2"></i>Create Entry</button>
</div>
</form>
@push('scripts')
<script>
function previewUploadImage(input) {
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('file_preview').src = e.target.result;
document.getElementById('file_preview_container').classList.remove('d-none');
document.getElementById('url_preview_container').classList.add('d-none');
document.getElementById('crud_url').value = '';
}
reader.readAsDataURL(input.files[0]);
}
}
function previewUrlImage(url) {
if (url && url.startsWith('http')) {
document.getElementById('url_preview').src = url;
document.getElementById('url_preview_container').classList.remove('d-none');
document.getElementById('file_preview_container').classList.add('d-none');
document.getElementById('image_file').value = '';
} else {
document.getElementById('url_preview_container').classList.add('d-none');
}
}
const zone = document.querySelector('.upload-dropzone');
if (zone) {
zone.addEventListener('dragover', () => zone.style.backgroundColor = '#e2e8f0');
zone.addEventListener('dragleave', () => zone.style.backgroundColor = '#f8fafc');
zone.addEventListener('drop', () => zone.style.backgroundColor = '#f8fafc');
}
</script>
@endpush
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item"><a href="{{ url('/admin/gallery') }}">Gallery</a></li>
<li class="breadcrumb-item active" aria-current="page">Edit Image</li>
</ol>
</nav>
@endsection
@section('page_title', 'Edit Gallery Image')
@section('content')
<form method="POST" action="{{ url('/admin/master/gallery/' . $gallery->id) }}" enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="row g-4">
<!-- Main Form Column (Left) -->
<div class="col-lg-8">
<div class="panel-card shadow-sm border-0 h-100 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-file-invoice me-2 text-primary"></i>Image Details</h5>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Filename (Title)</label>
<input type="text" class="form-control rounded-3" name="filename" id="crud_filename" value="{{ $gallery->filename }}" placeholder="Enter image title/filename..." required>
</div>
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Status</label>
<select class="form-select rounded-3" name="status" id="crud_status">
<option value="Active" {{ $gallery->status === 'Active' ? 'selected' : '' }}>Active</option>
<option value="Inactive" {{ $gallery->status === 'Inactive' ? 'selected' : '' }}>Inactive</option>
</select>
</div>
</div>
</div>
<!-- Sidebar Column (Right) -->
<div class="col-lg-4">
<div class="d-flex flex-column gap-4">
<!-- Image Upload Card -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-image me-2 text-success"></i>Media Upload</h5>
<!-- File Upload Container -->
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Upload New Image File</label>
<div class="upload-dropzone text-center p-3 border border-dashed rounded-3 bg-light position-relative" style="border-color: #cbd5e1 !important; cursor: pointer; transition: all 0.2s ease;">
<i class="fa-solid fa-cloud-arrow-up text-muted mb-2 fs-2 d-block"></i>
<span class="small text-muted d-block mb-1">Choose file to upload</span>
<span class="x-small text-muted d-block opacity-75">(JPG, PNG, WEBP)</span>
<input type="file" name="image_file" id="image_file" class="position-absolute top-0 start-0 opacity-0 w-100 h-100" style="cursor: pointer;" onchange="previewUploadImage(this)">
</div>
<!-- Show current file path preview or fallback -->
<div id="file_preview_container" class="mt-3 text-center {{ $gallery->url && !str_starts_with($gallery->url, 'http') ? '' : 'd-none' }}">
<img id="file_preview" src="{{ $gallery->url && !str_starts_with($gallery->url, 'http') ? $gallery->url : '' }}" alt="Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
<span class="small d-block text-success mt-1 fw-semibold"><i class="fa-solid fa-circle-check me-1"></i>Current Uploaded File</span>
</div>
</div>
<div class="text-center my-3 text-muted small fw-bold">--- OR ---</div>
<!-- Remote URL input -->
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Stock Image URL</label>
<input type="url" class="form-control rounded-3" name="url" id="crud_url" value="{{ $gallery->url && str_starts_with($gallery->url, 'http') ? $gallery->url : '' }}" placeholder="https://example.com/image.jpg" oninput="previewUrlImage(this.value)">
<div id="url_preview_container" class="mt-3 text-center {{ $gallery->url && str_starts_with($gallery->url, 'http') ? '' : 'd-none' }}">
<img id="url_preview" src="{{ $gallery->url && str_starts_with($gallery->url, 'http') ? $gallery->url : '' }}" alt="URL Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Action buttons footer -->
<div class="panel-card shadow-sm border-0 mt-4 p-3 d-flex justify-content-end align-items-center bg-white rounded-3">
<a href="{{ url('/admin/gallery') }}" class="btn btn-light rounded-pill px-4 me-2 fw-semibold">Cancel</a>
<button type="submit" class="btn btn-primary rounded-pill px-4 py-2 fw-semibold shadow-sm"><i class="fa-solid fa-floppy-disk me-2"></i>Update Entry</button>
</div>
</form>
@push('scripts')
<script>
function previewUploadImage(input) {
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('file_preview').src = e.target.result;
document.getElementById('file_preview_container').classList.remove('d-none');
document.getElementById('url_preview_container').classList.add('d-none');
document.getElementById('crud_url').value = '';
}
reader.readAsDataURL(input.files[0]);
}
}
function previewUrlImage(url) {
if (url && url.startsWith('http')) {
document.getElementById('url_preview').src = url;
document.getElementById('url_preview_container').classList.remove('d-none');
document.getElementById('file_preview_container').classList.add('d-none');
document.getElementById('image_file').value = '';
} else {
document.getElementById('url_preview_container').classList.add('d-none');
}
}
const zone = document.querySelector('.upload-dropzone');
if (zone) {
zone.addEventListener('dragover', () => zone.style.backgroundColor = '#e2e8f0');
zone.addEventListener('dragleave', () => zone.style.backgroundColor = '#f8fafc');
zone.addEventListener('drop', () => zone.style.backgroundColor = '#f8fafc');
}
</script>
@endpush
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Orders</li>
</ol>
</nav>
@endsection
@section('page_title', 'Orders')
@section('page_description', 'Manage customer orders.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Order Status Change</li>
</ol>
</nav>
@endsection
@section('page_title', 'Order Status')
@section('page_description', 'Update order statuses and track shipments.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item active" aria-current="page">Dashboard Overview</li>
</ol>
</nav>
@endsection
@section('page_title', 'Dashboard Overview')
@section('page_description', 'Manage and oversee your store operations.')
@section('content')
<div class="row g-4 mb-5">
<div class="col-md-4">
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Pincodes</li>
</ol>
</nav>
@endsection
@section('page_title', 'Pincodes')
@section('page_description', 'Manage serviceable pin codes and delivery timelines.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Products</li>
</ol>
</nav>
@endsection
@section('page_title', 'Products')
@section('page_action')
<a href="{{ url('/admin/products/create') }}" class="btn btn-primary rounded-pill px-4">+ Add Product</a>
@endsection
@section('content')
<div class="panel-card">
<div class="table-responsive">
<table class="table mb-0">
<table class="table mb-0" style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Product Name</th>
<th>Category</th>
<th>Price</th>
<th>Stock</th>
<th>Action</th>
<th style="width: 40%;">Product Name</th>
<th style="width: 35%;">Category</th>
<th style="width: 13%;">Status</th>
<th style="width: 12%; text-align: center;">Action</th>
</tr>
</thead>
<tbody id="products-tbody">
@foreach($products as $item)
<tr>
<td>{{ $item->name }}</td>
<td>{{ $item->category }}</td>
<td>{{ $item->price }}</td>
<td>{{ $item->stock }}</td>
<td class="text-wrap fw-semibold">{{ $item->name }}</td>
<td>{{ $item->category ? $item->category->name : 'Uncategorized' }}</td>
<td>
<button class="btn-action" onclick="openEditModal('products', {{ $item->id }})"><i class="fa-solid fa-pen"></i></button>
@if(($item->status ?? 'Active') === 'Active')
<span class="badge bg-success rounded-pill px-3">Active</span>
@else
<span class="badge bg-secondary rounded-pill px-3">Inactive</span>
@endif
</td>
<td style="text-align: center;">
<a href="{{ url('/admin/products/' . $item->id . '/edit') }}" class="btn-action"><i class="fa-solid fa-pen"></i></a>
<button class="btn-action" onclick="deleteRecord('products', {{ $item->id }})"><i class="fa-solid fa-trash"></i></button>
</td>
</tr>
@endforeach
@if(count($products) === 0)
<tr>
<td colspan="10" class="text-center text-muted py-4">No records found.</td>
<td colspan="4" class="text-center text-muted py-4">No records found.</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item"><a href="{{ url('/admin/products') }}">Products</a></li>
<li class="breadcrumb-item active" aria-current="page">Add Product</li>
</ol>
</nav>
@endsection
@section('page_title', 'Create New Product')
@section('content')
<form method="POST" action="{{ url('/admin/master/products') }}" enctype="multipart/form-data">
@csrf
<div class="row g-4">
<!-- Main Form Column (Left) -->
<div class="col-lg-8">
<div class="panel-card shadow-sm border-0 h-100 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-file-invoice me-2 text-primary"></i>Product Details</h5>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Product Name</label>
<input type="text" class="form-control form-control-lg rounded-3 fs-6" name="name" id="crud_name" placeholder="Enter product name..." required oninput="generateSlug()">
</div>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Slug</label>
<input type="text" class="form-control rounded-3" name="slug" id="crud_slug" placeholder="product-url-slug" required>
</div>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Description</label>
<textarea class="form-control rounded-3" name="description" id="crud_description" rows="6" placeholder="Describe this beautiful seashell product..."></textarea>
</div>
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Category</label>
<select class="form-select rounded-3" name="category_id" id="crud_category_id" required>
<option value="">Select Category</option>
@foreach($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<!-- Sidebar Column (Right) -->
<div class="col-lg-4">
<div class="d-flex flex-column gap-4">
<!-- Image Upload Card -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-image me-2 text-success"></i>Product Image</h5>
<!-- File Upload Container -->
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Upload Image File</label>
<div class="upload-dropzone text-center p-3 border border-dashed rounded-3 bg-light position-relative" style="border-color: #cbd5e1 !important; cursor: pointer; transition: all 0.2s ease;">
<i class="fa-solid fa-cloud-arrow-up text-muted mb-2 fs-2 d-block"></i>
<span class="small text-muted d-block mb-1">Choose file to upload</span>
<span class="x-small text-muted d-block opacity-75">(JPG, PNG, WEBP)</span>
<input type="file" name="primary_image_file" id="primary_image_file" class="position-absolute top-0 start-0 opacity-0 w-100 h-100" style="cursor: pointer;" onchange="previewUploadImage(this)">
</div>
<div id="file_preview_container" class="mt-3 d-none text-center">
<img id="file_preview" src="" alt="Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
<span class="small d-block text-success mt-1 fw-semibold"><i class="fa-solid fa-circle-check me-1"></i>File selected</span>
</div>
</div>
<div class="text-center my-3 text-muted small fw-bold">--- OR ---</div>
<!-- Remote URL input -->
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Stock Image URL</label>
<input type="url" class="form-control rounded-3" name="primary_image_url" id="crud_image_url" placeholder="https://example.com/image.jpg" oninput="previewUrlImage(this.value)">
<div id="url_preview_container" class="mt-3 d-none text-center">
<img id="url_preview" src="" alt="URL Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
</div>
</div>
</div>
<!-- Visibility & Tags -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-sliders me-2 text-info"></i>Status & Badges</h5>
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Is Bestseller?</label>
<select class="form-select rounded-3" name="is_bestseller" id="crud_is_bestseller">
<option value="0">No</option>
<option value="1">Yes</option>
</select>
</div>
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Status</label>
<select class="form-select rounded-3" name="status" id="crud_status">
<option value="Active">Active</option>
<option value="Inactive">Inactive</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- Action buttons footer -->
<div class="panel-card shadow-sm border-0 mt-4 p-3 d-flex justify-content-end align-items-center bg-white rounded-3">
<a href="{{ url('/admin/products') }}" class="btn btn-light rounded-pill px-4 me-2 fw-semibold">Cancel</a>
<button type="submit" class="btn btn-primary rounded-pill px-4 py-2 fw-semibold shadow-sm"><i class="fa-solid fa-floppy-disk me-2"></i>Create Product</button>
</div>
</form>
@push('scripts')
<script>
function generateSlug() {
const name = document.getElementById('crud_name').value;
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '');
document.getElementById('crud_slug').value = slug;
}
function previewUploadImage(input) {
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('file_preview').src = e.target.result;
document.getElementById('file_preview_container').classList.remove('d-none');
document.getElementById('url_preview_container').classList.add('d-none');
}
reader.readAsDataURL(input.files[0]);
}
}
function previewUrlImage(url) {
if (url && url.startsWith('http')) {
document.getElementById('url_preview').src = url;
document.getElementById('url_preview_container').classList.remove('d-none');
document.getElementById('file_preview_container').classList.add('d-none');
document.getElementById('primary_image_file').value = '';
} else {
document.getElementById('url_preview_container').classList.add('d-none');
}
}
const zone = document.querySelector('.upload-dropzone');
if (zone) {
zone.addEventListener('dragover', () => zone.style.backgroundColor = '#e2e8f0');
zone.addEventListener('dragleave', () => zone.style.backgroundColor = '#f8fafc');
zone.addEventListener('drop', () => zone.style.backgroundColor = '#f8fafc');
}
</script>
@endpush
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item"><a href="{{ url('/admin/products') }}">Products</a></li>
<li class="breadcrumb-item active" aria-current="page">Edit Product</li>
</ol>
</nav>
@endsection
@section('page_title', 'Edit Product')
@section('content')
<form method="POST" action="{{ url('/admin/master/products/' . $product->id) }}" enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="row g-4">
<!-- Main Form Column (Left) -->
<div class="col-lg-8">
<div class="panel-card shadow-sm border-0 h-100 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-file-invoice me-2 text-primary"></i>Product Details</h5>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Product Name</label>
<input type="text" class="form-control form-control-lg rounded-3 fs-6" name="name" id="crud_name" required value="{{ $product->name }}" oninput="generateSlug()">
</div>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Slug</label>
<input type="text" class="form-control rounded-3" name="slug" id="crud_slug" required value="{{ $product->slug }}">
</div>
<div class="mb-4">
<label class="form-label small fw-semibold text-muted">Description</label>
<textarea class="form-control rounded-3" name="description" id="crud_description" rows="6">{{ $product->description }}</textarea>
</div>
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Category</label>
<select class="form-select rounded-3" name="category_id" id="crud_category_id" required>
<option value="">Select Category</option>
@foreach($categories as $category)
<option value="{{ $category->id }}" {{ $product->category_id == $category->id ? 'selected' : '' }}>{{ $category->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<!-- Sidebar Column (Right) -->
<div class="col-lg-4">
<div class="d-flex flex-column gap-4">
<!-- Image Upload Card -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-image me-2 text-success"></i>Product Image</h5>
<!-- Display Current Image if exists -->
@if($product->primaryImage && $product->primaryImage->image_url)
<div class="mb-4 text-center" id="current_image_container" style="transition: opacity 0.2s ease;">
<label class="form-label small fw-semibold text-muted d-block text-start">Current Primary Image</label>
<img src="{{ $product->primaryImage->image_url }}" alt="Product Image" class="img-thumbnail" style="max-height: 140px; border-radius: 8px;">
</div>
@endif
<!-- File Upload Container -->
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Upload New Image File</label>
<div class="upload-dropzone text-center p-3 border border-dashed rounded-3 bg-light position-relative" style="border-color: #cbd5e1 !important; cursor: pointer; transition: all 0.2s ease;">
<i class="fa-solid fa-cloud-arrow-up text-muted mb-2 fs-2 d-block"></i>
<span class="small text-muted d-block mb-1">Choose new file...</span>
<input type="file" name="primary_image_file" id="primary_image_file" class="position-absolute top-0 start-0 opacity-0 w-100 h-100" style="cursor: pointer;" onchange="previewUploadImage(this)">
</div>
<div id="file_preview_container" class="mt-3 d-none text-center">
<img id="file_preview" src="" alt="Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
<span class="small d-block text-success mt-1 fw-semibold"><i class="fa-solid fa-circle-check me-1"></i>New file selected</span>
</div>
</div>
<div class="text-center my-3 text-muted small fw-bold">--- OR ---</div>
<!-- Remote URL input -->
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Update Stock Image URL</label>
<input type="url" class="form-control rounded-3" name="primary_image_url" id="crud_image_url" placeholder="https://example.com/image.jpg" value="{{ $product->primaryImage && !str_starts_with($product->primaryImage->image_url, '/uploads/') ? $product->primaryImage->image_url : '' }}" oninput="previewUrlImage(this.value)">
<div id="url_preview_container" class="mt-3 d-none text-center">
<img id="url_preview" src="" alt="URL Preview" class="img-thumbnail" style="max-height: 120px; border-radius: 8px;">
</div>
</div>
</div>
<!-- Visibility & Tags -->
<div class="panel-card shadow-sm border-0 p-4">
<h5 class="fw-bold mb-4 text-dark"><i class="fa-solid fa-sliders me-2 text-info"></i>Status & Badges</h5>
<div class="mb-3">
<label class="form-label small fw-semibold text-muted">Is Bestseller?</label>
<select class="form-select rounded-3" name="is_bestseller" id="crud_is_bestseller">
<option value="0" {{ !$product->is_bestseller ? 'selected' : '' }}>No</option>
<option value="1" {{ $product->is_bestseller ? 'selected' : '' }}>Yes</option>
</select>
</div>
<div class="mb-0">
<label class="form-label small fw-semibold text-muted">Status</label>
<select class="form-select rounded-3" name="status" id="crud_status">
<option value="Active" {{ ($product->status ?? 'Active') == 'Active' ? 'selected' : '' }}>Active</option>
<option value="Inactive" {{ ($product->status ?? 'Active') == 'Inactive' ? 'selected' : '' }}>Inactive</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- Action buttons footer -->
<div class="panel-card shadow-sm border-0 mt-4 p-3 d-flex justify-content-end align-items-center bg-white rounded-3">
<a href="{{ url('/admin/products') }}" class="btn btn-light rounded-pill px-4 me-2 fw-semibold">Cancel</a>
<button type="submit" class="btn btn-primary rounded-pill px-4 py-2 fw-semibold shadow-sm"><i class="fa-solid fa-floppy-disk me-2"></i>Save Changes</button>
</div>
</form>
@push('scripts')
<script>
function generateSlug() {
const name = document.getElementById('crud_name').value;
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '');
document.getElementById('crud_slug').value = slug;
}
function previewUploadImage(input) {
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('file_preview').src = e.target.result;
document.getElementById('file_preview_container').classList.remove('d-none');
document.getElementById('url_preview_container').classList.add('d-none');
if(document.getElementById('current_image_container')) {
document.getElementById('current_image_container').style.opacity = '0.3';
}
}
reader.readAsDataURL(input.files[0]);
}
}
function previewUrlImage(url) {
if (url && url.startsWith('http')) {
document.getElementById('url_preview').src = url;
document.getElementById('url_preview_container').classList.remove('d-none');
document.getElementById('file_preview_container').classList.add('d-none');
document.getElementById('primary_image_file').value = '';
if(document.getElementById('current_image_container')) {
document.getElementById('current_image_container').style.opacity = '0.3';
}
} else {
document.getElementById('url_preview_container').classList.add('d-none');
}
}
const zone = document.querySelector('.upload-dropzone');
if (zone) {
zone.addEventListener('dragover', () => zone.style.backgroundColor = '#e2e8f0');
zone.addEventListener('dragleave', () => zone.style.backgroundColor = '#f8fafc');
zone.addEventListener('drop', () => zone.style.backgroundColor = '#f8fafc');
}
</script>
@endpush
@endsection
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Master Data</li>
<li class="breadcrumb-item active" aria-current="page">Sizes</li>
</ol>
</nav>
@endsection
@section('page_title', 'Sizes')
@section('page_description', 'Manage master data for Sizes')
@section('content')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
......
@extends('layouts.admin')
@section('content')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Master Data</li>
<li class="breadcrumb-item active" aria-current="page">States</li>
</ol>
</nav>
@endsection
@section('page_title', 'States')
@section('page_description', 'Manage master data for States')
@section('content')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
......
@extends('layouts.admin')
@section('content')
@section('page_title', 'Measuring Units')
@section('page_description', 'Manage master data for Measuring Units')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
@endsection
@push('scripts')
<!-- CRUD Modal -->
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog">
<form method="POST" action="" id="crudForm">
@csrf
<input type="hidden" name="_method" id="crudMethod" value="POST">
<div class="modal-content">
<div class="modal-header border-0 pb-0">
<h5 class="modal-title fw-bold" id="crudModalLabel">Create Measuring Units</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body pt-4">
<div class="mb-3">
<label class="form-label">Unit Name</label>
<input type="text" class="form-control" name="name" id="crud_name" required>
</div>
<div class="mb-3">
<label class="form-label">Unit Code</label>
<input type="text" class="form-control" name="code" id="crud_code" required>
</div>
</div>
<div class="modal-footer border-0 pt-0">
<button type="button" class="btn btn-light rounded-pill px-4" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary rounded-pill px-4" id="crudSubmitBtn">Save Changes</button>
</div>
</div>
</form>
</div>
</div>
<script>
const entityData = @json($units);
function openCreateModal() {
document.getElementById('crudModalLabel').innerText = 'Create Measuring Units';
document.getElementById('crudMethod').value = 'POST';
document.getElementById('crudForm').action = '/admin/master/units';
document.getElementById('crudSubmitBtn').innerText = 'Create';
document.getElementById('crud_name').value = '';
document.getElementById('crud_code').value = '';
}
function openEditModal(type, id) {
// Find the record
const item = entityData.find(x => x.id === id);
if (!item) return;
document.getElementById('crudModalLabel').innerText = 'Edit Measuring Units';
document.getElementById('crudMethod').value = 'PUT';
document.getElementById('crudForm').action = '/admin/master/units/' + id;
document.getElementById('crudSubmitBtn').innerText = 'Update';
document.getElementById('crud_name').value = item.name || '';
document.getElementById('crud_code').value = item.code || '';
const modal = new bootstrap.Modal(document.getElementById('crudModal'));
modal.show();
}
</script>
@endpush
<div class="panel-card">
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th>Unit Name</th>
<th>Code</th>
<th>Action</th>
</tr>
</thead>
<tbody id="unit-tbody">
@foreach($units as $item)
<tr>
<td>{{ $item->name }}</td>
<td>{{ $item->code }}</td>
<td>
<button class="btn-action" onclick="openEditModal('unit', {{ $item->id }})"><i class="fa-solid fa-pen"></i></button>
<button class="btn-action" onclick="deleteRecord('unit', {{ $item->id }})"><i class="fa-solid fa-trash"></i></button>
</td>
</tr>
@endforeach
@if(count($units) === 0)
<tr>
<td colspan="10" class="text-center text-muted py-4">No records found.</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@extends('layouts.admin')
@section('content')
@section('page_title', 'Unit Sizes')
@section('page_description', 'Manage master data for Unit Sizes')
@section('page_action')
<button class="btn btn-primary rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#crudModal" onclick="openCreateModal()">+ Add New</button>
@endsection
@push('scripts')
<!-- CRUD Modal -->
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog">
<form method="POST" action="" id="crudForm">
@csrf
<input type="hidden" name="_method" id="crudMethod" value="POST">
<div class="modal-content">
<div class="modal-header border-0 pb-0">
<h5 class="modal-title fw-bold" id="crudModalLabel">Create Unit Sizes</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body pt-4">
<div class="mb-3">
<label class="form-label">Size Identifier</label>
<input type="text" class="form-control" name="identifier" id="crud_identifier" required>
</div>
<div class="mb-3">
<label class="form-label">Measuring Unit</label>
<input type="text" class="form-control" name="unit" id="crud_unit" required>
</div>
</div>
<div class="modal-footer border-0 pt-0">
<button type="button" class="btn btn-light rounded-pill px-4" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary rounded-pill px-4" id="crudSubmitBtn">Save Changes</button>
</div>
</div>
</form>
</div>
</div>
<script>
const entityData = @json($unitsizes);
function openCreateModal() {
document.getElementById('crudModalLabel').innerText = 'Create Unit Sizes';
document.getElementById('crudMethod').value = 'POST';
document.getElementById('crudForm').action = '/admin/master/unitsizes';
document.getElementById('crudSubmitBtn').innerText = 'Create';
document.getElementById('crud_identifier').value = '';
document.getElementById('crud_unit').value = '';
}
function openEditModal(type, id) {
// Find the record
const item = entityData.find(x => x.id === id);
if (!item) return;
document.getElementById('crudModalLabel').innerText = 'Edit Unit Sizes';
document.getElementById('crudMethod').value = 'PUT';
document.getElementById('crudForm').action = '/admin/master/unitsizes/' + id;
document.getElementById('crudSubmitBtn').innerText = 'Update';
document.getElementById('crud_identifier').value = item.identifier || '';
document.getElementById('crud_unit').value = item.unit || '';
const modal = new bootstrap.Modal(document.getElementById('crudModal'));
modal.show();
}
</script>
@endpush
<div class="panel-card">
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th>Size Identifier</th>
<th>Measuring Unit</th>
<th>Action</th>
</tr>
</thead>
<tbody id="unitsizes-tbody">
@foreach($unitsizes as $item)
<tr>
<td>{{ $item->identifier }}</td>
<td>{{ $item->unit }}</td>
<td>
<button class="btn-action" onclick="openEditModal('unitsizes', {{ $item->id }})"><i class="fa-solid fa-pen"></i></button>
<button class="btn-action" onclick="deleteRecord('unitsizes', {{ $item->id }})"><i class="fa-solid fa-trash"></i></button>
</td>
</tr>
@endforeach
@if(count($unitsizes) === 0)
<tr>
<td colspan="10" class="text-center text-muted py-4">No records found.</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@extends('layouts.admin')
@section('breadcrumbs')
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{ url('/admin/dashboard') }}">Admin</a></li>
<li class="breadcrumb-item">Manage Portal</li>
<li class="breadcrumb-item active" aria-current="page">Wishlist</li>
</ol>
</nav>
@endsection
@section('page_title', 'Wishlist')
@section('page_description', 'View items saved by customers in their wishlists.')
@section('content')
<div class="panel-card">
<div class="table-responsive">
......
......@@ -113,16 +113,20 @@
<input type="text" name="shipping_address" class="form-control checkout-form-control w-100" placeholder="Street address, Flat/Door number" required>
</div>
<div class="col-md-4">
<label class="form-label checkout-form-label">City *</label>
<input type="text" name="city" class="form-control checkout-form-control w-100" placeholder="City" value="Chennai" required>
<label class="form-label checkout-form-label">State *</label>
<select name="state" id="checkout_state" class="form-select checkout-form-control w-100" required>
<option value="">Select State</option>
</select>
</div>
<div class="col-md-4">
<label class="form-label checkout-form-label">State *</label>
<input type="text" name="state" class="form-control checkout-form-control w-100" placeholder="State" value="Tamil Nadu" required>
<label class="form-label checkout-form-label">City *</label>
<select name="city" id="checkout_city" class="form-select checkout-form-control w-100" required disabled>
<option value="">Select City</option>
</select>
</div>
<div class="col-md-4">
<label class="form-label checkout-form-label">PIN Code *</label>
<input type="text" name="pincode" class="form-control checkout-form-control w-100" placeholder="600001" value="600001" required>
<input type="text" name="pincode" class="form-control checkout-form-control w-100" placeholder="600001" required>
</div>
</div>
</div>
......
......@@ -72,98 +72,30 @@
</header>
<!-- Gallery Section -->
<main class="container py-5">
<div class="text-center mb-5">
<h2 class="h1 fw-bold" style="color: #717171;">Our Shell Art Gallery</h2>
<p class="text-muted">Explore beautiful seashell creations and ocean-inspired fancy items designed with creativity and love.</p>
<main class="gallery-page-wrapper">
<div class="text-center gallery-page-header">
<h2 class="gallery-page-title">Our Shell Art Gallery</h2>
<p class="gallery-page-subtitle">Explore beautiful seashell creations and ocean-inspired fancy items designed with creativity and love.</p>
</div>
<!-- Collage/Grid of 18 items matching screenshot gallery layout -->
<div class="row g-4 mb-5 gallery-grid">
<!-- Row 1: 9 items -->
<!-- Column 1 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=500&auto=format&fit=crop&q=80" alt="Decorative Shell Wall Frame" class="img-fluid rounded-3">
@if(count($gallery) > 0)
<div class="gallery-masonry">
@foreach($gallery as $item)
<div class="gallery-masonry-item" style="cursor: pointer;">
<img src="{{ $item->url }}" alt="{{ $item->filename }}" loading="lazy">
<div class="gallery-masonry-overlay">
<span class="gallery-masonry-label">{{ $item->filename }}</span>
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1595855759920-86582396756a?w=500&auto=format&fit=crop&q=80" alt="Shell Clock Frame" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 2 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&auto=format&fit=crop&q=80" alt="Starfish Lights Decor" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=500&auto=format&fit=crop&q=80" alt="Shell Jewelry Box Open" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1542838132-92c53300491e?w=500&auto=format&fit=crop&q=80" alt="Shell Gift Hamper Box" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 3 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=500&auto=format&fit=crop&q=80" alt="Beach Mugs and Frames" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&auto=format&fit=crop&q=80" alt="Seashell Wind Chime" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 4 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1520038410233-7141be7e6f97?w=500&auto=format&fit=crop&q=80" alt="Shell Candle Holder" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=500&auto=format&fit=crop&q=80" alt="Seashell Jewelry Box Closed" class="img-fluid rounded-3">
</div>
</div>
</div>
<div class="row g-4 gallery-grid">
<!-- Row 2: 9 items duplicated -->
<!-- Column 1 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=500&auto=format&fit=crop&q=80" alt="Decorative Shell Wall Frame" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1595855759920-86582396756a?w=500&auto=format&fit=crop&q=80" alt="Shell Clock Frame" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 2 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&auto=format&fit=crop&q=80" alt="Starfish Lights Decor" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1599643478518-a784e5dc4c8f?w=500&auto=format&fit=crop&q=80" alt="Shell Jewelry Box Open" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1542838132-92c53300491e?w=500&auto=format&fit=crop&q=80" alt="Shell Gift Hamper Box" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 3 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=500&auto=format&fit=crop&q=80" alt="Beach Mugs and Frames" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=500&auto=format&fit=crop&q=80" alt="Seashell Wind Chime" class="img-fluid rounded-3">
</div>
</div>
<!-- Column 4 -->
<div class="col-lg-3 col-md-6 d-flex flex-column gap-4">
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1520038410233-7141be7e6f97?w=500&auto=format&fit=crop&q=80" alt="Shell Candle Holder" class="img-fluid rounded-3">
</div>
<div class="gallery-item">
<img src="https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=500&auto=format&fit=crop&q=80" alt="Seashell Jewelry Box Closed" class="img-fluid rounded-3">
</div>
@endforeach
</div>
@else
<div class="text-center text-muted py-5">
<i class="bi bi-image fs-1 text-muted"></i>
<h4 class="mt-3">No images found</h4>
<p class="text-muted">Stay tuned for handcrafted ocean treasures!</p>
</div>
@endif
</main>
<!-- Lightbox Modal Popup (Page 7) -->
......
......@@ -578,7 +578,8 @@
let sizeButtons = '';
if (p.variants && p.variants.length > 0) {
p.variants.forEach((v, idx) => {
sizeButtons += `<button class="size-btn ${idx === 0 ? 'active' : ''}" data-price="${Math.round(v.price)}" data-size="${v.size}">${v.size}</button> `;
let sizeName = (v.size && v.size.name) ? v.size.name : (v.size || '');
sizeButtons += `<button class="size-btn ${idx === 0 ? 'active' : ''}" data-price="${Math.round(v.price)}" data-size="${sizeName}" data-variant-id="${v.id}">${sizeName}</button> `;
});
} else {
sizeButtons = `
......@@ -594,10 +595,14 @@
<div class="position-relative">
<span class="badge-bestseller">Best Seller</span>
<button class="btn-wishlist"><i class="fa-regular fa-heart"></i></button>
<a href="/product-detail/${p.slug}">
<img src="${imgUrl}" class="card-img-top object-fit-cover" alt="${p.name}" height="220">
</a>
</div>
<div class="card-body d-flex flex-column p-3">
<h5 class="product-title fw-bold mb-1" style="font-size: 0.95rem; color: #000000;">${p.name}</h5>
<h5 class="product-title fw-bold mb-1" style="font-size: 0.95rem; color: #000000; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
<a href="/product-detail/${p.slug}" class="text-decoration-none text-dark">${p.name}</a>
</h5>
<div class="d-flex align-items-center mb-2">
<span class="product-price fw-bold text-dark fs-5 display-price">₹${Math.round(p.price)}</span>
${strikePart}
......
......@@ -316,7 +316,8 @@
let sizeButtons = '';
if (p.variants && p.variants.length > 0) {
p.variants.forEach((v, idx) => {
sizeButtons += `<button class="size-btn ${idx === 0 ? 'active' : ''}" data-price="${Math.round(v.price)}" data-size="${v.size}">${v.size}</button> `;
let sizeName = (v.size && v.size.name) ? v.size.name : (v.size || '');
sizeButtons += `<button class="size-btn ${idx === 0 ? 'active' : ''}" data-price="${Math.round(v.price)}" data-size="${sizeName}" data-variant-id="${v.id}">${sizeName}</button> `;
});
} else {
sizeButtons = `
......@@ -332,10 +333,14 @@
<div class="position-relative">
${p.is_bestseller ? '<span class="badge-bestseller">Best Seller</span>' : ''}
<button class="btn-wishlist"><i class="fa-regular fa-heart"></i></button>
<a href="/product-detail/${p.slug}">
<img src="${imgUrl}" class="card-img-top object-fit-cover" alt="${p.name}" height="220">
</a>
</div>
<div class="card-body d-flex flex-column p-3 product-card-body">
<h5 class="product-title fw-bold mb-1" style="font-size: 0.95rem; color: #000000; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">${p.name}</h5>
<h5 class="product-title fw-bold mb-1" style="font-size: 0.95rem; color: #000000; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
<a href="/product-detail/${p.slug}" class="text-decoration-none text-dark">${p.name}</a>
</h5>
<div class="d-flex align-items-center mb-2">
<span class="product-price fw-bold text-dark fs-5 display-price">₹${Math.round(p.price)}</span>
${strikePart}
......
......@@ -33,6 +33,25 @@ Route::get('/customer/orders', [\App\Http\Controllers\CustomerAuthController::cl
// Serviceability Pincode Endpoints
Route::post('/check-pincode', [PincodeController::class, 'checkServiceability']);
// States and Cities Endpoints
Route::get('/states', function () {
return response()->json([
'success' => true,
'data' => \App\Models\State::where('status', 'Active')->orderBy('name')->get()
]);
});
Route::get('/cities', function (\Illuminate\Http\Request $request) {
$state = $request->query('state');
$query = \App\Models\City::where('status', 'Active');
if ($state) {
$query->where('state', $state);
}
return response()->json([
'success' => true,
'data' => $query->orderBy('name')->get()
]);
});
// Checkout / Place Order
Route::post('/place-order', [CheckoutController::class, 'store']);
......
......@@ -2,6 +2,7 @@
use App\Http\Controllers\Backend\AdminViewController;
use App\Http\Controllers\Backend\AdminMasterDataController;
use App\Http\Controllers\Backend\AdminAuthController;
use Illuminate\Support\Facades\Route;
/*
......@@ -12,13 +13,17 @@ use Illuminate\Support\Facades\Route;
Route::prefix('admin')->group(function () {
// Auth Routes
Route::get('/login', [AdminAuthController::class, 'showLoginForm'])->name('login');
Route::post('/login', [AdminAuthController::class, 'login']);
Route::get('/logout', [AdminAuthController::class, 'logout'])->name('logout');
Route::middleware('auth')->group(function () {
Route::get('/', [AdminViewController::class, 'dashboard']);
Route::get('/dashboard', [AdminViewController::class, 'dashboard']);
Route::get('/countries', [AdminViewController::class, 'countries']);
Route::get('/states', [AdminViewController::class, 'states']);
Route::get('/cities', [AdminViewController::class, 'cities']);
Route::get('/units', [AdminViewController::class, 'units']);
Route::get('/unitsizes', [AdminViewController::class, 'unitsizes']);
Route::get('/sizes', [AdminViewController::class, 'sizes']);
Route::get('/categories', [AdminViewController::class, 'categories']);
......@@ -28,13 +33,17 @@ Route::prefix('admin')->group(function () {
Route::delete('/master/{type}/{id}', [AdminMasterDataController::class, 'destroy']);
Route::get('/products', [AdminViewController::class, 'products']);
Route::get('/products/create', [AdminViewController::class, 'productsCreate']);
Route::get('/products/{id}/edit', [AdminViewController::class, 'productsEdit']);
Route::get('/productprices', [AdminViewController::class, 'productprices']);
Route::get('/orders', [AdminViewController::class, 'orders']);
Route::get('/orderstatuschange', [AdminViewController::class, 'orderstatuschange']);
Route::get('/announcements', [AdminViewController::class, 'announcements']);
Route::get('/gallery', [AdminViewController::class, 'gallery']);
Route::get('/gallery/create', [AdminViewController::class, 'galleryCreate']);
Route::get('/gallery/{id}/edit', [AdminViewController::class, 'galleryEdit']);
Route::get('/pincodes', [AdminViewController::class, 'pincodes']);
Route::get('/coupons', [AdminViewController::class, 'coupons']);
Route::get('/wishlist', [AdminViewController::class, 'wishlist']);
});
});
......@@ -33,7 +33,8 @@ Route::get('/checkout', function () {
});
Route::get('/gallery', function () {
return view('gallery');
$gallery = \App\Models\Gallery::where('status', 'Active')->get();
return view('gallery', compact('gallery'));
});
Route::get('/catalog', [FrontendController::class, 'ourCollection']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment