Commit 097dd9b9 by Hussain Mohamed

Product chnages

parent 47ed3ea5
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\BodyTypeModel;
use Illuminate\Http\Request;
class BodyTypeController extends Controller
{
public function index()
{
//dd("list");
$records = BodyTypeModel::orderBy('body_type', 'ASC')->get();
return view('backend.bodyType.list', compact('records'));
}
public function BodyTypeDetails($id = '')
{
$record = '';
if ($id > 0) {
$record = BodyTypeModel::WHere('id', $id)->first();
}
return view('backend.bodyType.add_edit', compact('record'));
}
public function storeUpdateBodyType(Request $request)
{
$input = $request->all();
$id = isset($input['id']) ? $input['id'] : 0;
$dataArr = [];
foreach ($input as $key => $val) {
if ($key != '_token' && $key != 'id' )
$dataArr[$key] = $val;
}
if ($id == 0 || $id == '') {
$request->validate([
'body_type' => "required|unique:body_type,body_type",
]);
$insert = BodyTypeModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('bodyType')->with('success', 'Body Type Saved Successfully');
}else{
return redirect()->route('bodyType')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'body_type' => "required",
]);
$update = BodyTypeModel::Where('id',$id)->update($dataArr);
return redirect()->route('bodyType')->with('success', 'Body Type Updated Successfully');;
}
}
}
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\EyeModel;
use Illuminate\Http\Request;
class EyeController extends Controller
{
public function eye()
{
$records = eyeModel::orderBy('eye_color', 'ASC')->get();
return view('backend.eye.list', compact('records'));
}
public function addEye($id = '')
{
$record = '';
if ($id > 0) {
$record = EyeModel::WHere('id', $id)->first();
}
return view('backend.eye.add_edit', compact('record'));
}
public function storeUpdateEye(Request $request)
{
$input = $request->all();
$id = isset($input['id']) ? $input['id'] : 0;
$dataArr = [];
foreach ($input as $key => $val) {
if ($key != '_token' && $key != 'id' )
$dataArr[$key] = $val;
}
if ($id == 0 || $id == '') {
$request->validate([
'eye_color' => "required|unique:eye,eye_color",
]);
$insert = EyeModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('eye')->with('success', 'Eye Saved Successfully');
}else{
return redirect()->route('eye')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'eye_color' => "required",
]);
$update = EyeModel::Where('id',$id)->update($dataArr);
return redirect()->route('hair')->with('success', 'Eye Updated Successfully');;
}
}
}
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\HairModel;
use Illuminate\Http\Request;
class HairController extends Controller
{
public function hair()
{
$records = HairModel::orderBy('hair_color', 'ASC')->get();
return view('backend.hair.list', compact('records'));
}
public function addHair($id = '')
{
$record = '';
if ($id > 0) {
$record = HairModel::WHere('id', $id)->first();
}
return view('backend.hair.add_edit', compact('record'));
}
public function storeUpdateHair(Request $request)
{
$input = $request->all();
$id = isset($input['id']) ? $input['id'] : 0;
$dataArr = [];
foreach ($input as $key => $val) {
if ($key != '_token' && $key != 'id' )
$dataArr[$key] = $val;
}
if ($id == 0 || $id == '') {
$request->validate([
'hair_color' => "required|unique:hair,hair_color",
]);
$insert = HairModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('hair')->with('success', 'Hair Saved Successfully');
}else{
return redirect()->route('hair')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'hair_color' => "required",
]);
$update = HairModel::Where('id',$id)->update($dataArr);
return redirect()->route('hair')->with('success', 'Hair Updated Successfully');;
}
}
}
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\LanguageModel;
use Illuminate\Http\Request;
class LanguageController extends Controller
{
public function language()
{
$records = LanguageModel::orderBy('name', 'ASC')->get();
return view('backend.language.list', compact('records'));
}
public function addLanguage($id = '')
{
$record = '';
if ($id > 0) {
$record = LanguageModel::WHere('id', $id)->first();
}
return view('backend.language.add_edit', compact('record'));
}
public function storeUpdateLanguage(Request $request)
{
$input = $request->all();
$id = isset($input['id']) ? $input['id'] : 0;
$dataArr = [];
foreach ($input as $key => $val) {
if ($key != '_token' && $key != 'id' )
$dataArr[$key] = $val;
}
if ($id == 0 || $id == '') {
$request->validate([
'name' => "required|unique:language,name",
]);
$insert = LanguageModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('language')->with('success', 'Language Saved Successfully');
}else{
return redirect()->route('language')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'name' => "required",
]);
$update = LanguageModel::Where('id',$id)->update($dataArr);
return redirect()->route('language')->with('success', 'Language Updated Successfully');;
}
}
}
...@@ -17,7 +17,9 @@ class ProductController extends Controller ...@@ -17,7 +17,9 @@ class ProductController extends Controller
{ {
public function products() public function products()
{ {
$records = ProductModel::orderBy('id', 'ASC')->get(); // $records = ProductModel::with('category')->get();
$records = ProductModel::orderBy('id', 'ASC')->get();
// dd($records);
return view('backend.products.list', compact('records')); return view('backend.products.list', compact('records'));
} }
......
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function users()
{
$records = User::Where('auth_level',2)->get();
return view('backend.users.list',compact('records'));
}
}
<?php
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\UserVedio;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
class UserGuideController extends Controller
{
public function userVideo()
{
$records = UserVedio::orderBy('id', 'desc')->get();
return view('backend.user_guide.list', compact('records'));
}
public function info()
{
return view('backend.info');
}
public function userVideoDetails($id = '')
{
$record = '';
if ($id > 0) {
$record = UserVedio::Where('id', $id)->first();
}
return view('backend.user_guide.add_edit', compact('record'));
}
public function storeUpdateUserVideo(Request $request)
{
$input = $request->all();
$id = isset($input['id']) ? $input['id'] : 0;
$old_vedio = isset($input['old_vedio']) ? $input['old_vedio'] : 0;
if ($request->file('video') != '') {
$vedio = $request->file('video');
$imageName = 'user_guide_vedio_' . time() . '_' . str_replace(' ', '_', $vedio->getClientOriginalName());
$vedio->move(public_path('/uploads/user_vedio/'), $imageName);
$videoUrl = URL::to('/') . '/uploads/user_vedio/' . $imageName;
} else {
$videoUrl = $old_vedio;
}
$dataArr = array(
'vedio' => $videoUrl
);
if ($id == 0 || $id == '') {
$insert = UserVedio::create($dataArr);
if ($insert['id'] > 0) {
return redirect()->route('userVideo')->with('success', 'Video Saved Successfully');
} else {
return redirect()->route('userVideo')->with('error', 'Something went wrong!');
}
} else {
$update = UserVedio::Where('id', $id)->update($dataArr);
return redirect()->route('userVideo')->with('success', 'Video Updated Successfully');;
}
}
}
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\AdReport;
use App\Models\Service;
use App\Models\ServiceRequest;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class ServiceRequestController extends Controller
{
protected $FrontendController;
public function __construct(FrontendController $FrontendController)
{
$this->FrontendController = $FrontendController;
}
public function store(Request $request)
{
$validated = $request->validate([
'request_id' => 'required|string',
'service_id' => 'required|integer',
'service_request_type_id' => 'required|integer',
'number' => 'nullable|string|max:50',
]);
// Get existing record (NOT ->exists())
$existing = ServiceRequest::where('request_id', $validated['request_id'])
->where('service_id', $validated['service_id'])
->first();
$serviceModel = Service::where('id', $validated['service_id'])->first();
if (!$serviceModel) {
return response()->json(['message' => 'Service not found'], 404);
}
$userId = $serviceModel->user_id; // ← GET USER ID
if ($existing) {
// CASE 1: Same service_request_type_id → return same record
if ($existing->service_request_type_id == $validated['service_request_type_id']) {
sendRequestNotification('FindFlicker', 'Contact Changed notification from FindFlicker', "history_update", [$userId]);
return response()->json([
'status' => true,
'message' => 'Service request already exists.',
'data' => $existing
]);
}
// CASE 2: Different → UPDATE existing
$existing->update([
'service_request_type_id' => $validated['service_request_type_id'],
'number' => $validated['number'],
]);
sendRequestNotification('FindFlicker', 'Contact Changed notification from FindFlicker', "history_update", [$userId]);
return response()->json([
'status' => true,
'message' => 'Service request updated successfully.',
'data' => $existing
]);
}
// CASE 3: No record → CREATE
$data = ServiceRequest::create($validated);
sendRequestNotification('FindFlicker', 'Contact notification from FindFlicker', "history_update");
return response()->json([
'status' => true,
'message' => 'Service request created',
'data' => $data
]);
}
public function update(Request $request, $id)
{
$validated = $request->validate([
'service_id' => 'sometimes|integer',
'service_request_type_id' => 'sometimes|integer',
'number' => 'sometimes|string|max:50',
]);
$data = ServiceRequest::findOrFail($id);
$data->update($validated);
return response()->json([
'status' => true,
'message' => 'Service request updated',
'data' => $data
]);
}
public function serviceRequestStore(Request $request)
{
$request->validate([
'serviceId' => 'required|integer',
'email' => 'required|email',
'message' => 'required|string',
'proofs.*' => 'nullable|image|max:2048', // Max 2MB per image
]);
$imagePaths = [];
if ($request->hasFile('proofs')) {
foreach ($request->file('proofs') as $file) {
// Create folder if not exists
$folderPath = public_path('uploads/reports/');
if (!file_exists($folderPath)) {
mkdir($folderPath, 0777, true);
}
// Create unique file name
$filename = time() . '_' . uniqid() . '.' . $file->getClientOriginalExtension();
// Move file to /public/uploads/reports/
$file->move($folderPath, $filename);
// Save relative path to database
$imagePaths[] = $folderPath . $filename;
}
}
$report = AdReport::create([
'service_id' => $request->serviceId,
'email' => $request->email,
'message' => $request->message,
'images' => $imagePaths, // stored as JSON automatically
]);
return response()->json([
'success' => true,
'message' => 'Report submitted successfully',
'report' => $report
]);
}
// public function searchDistanceIncreaseRequest(Request $request)
// {
// $request_id = $request->requestId;
// $distance = $request->distance;
// $getServicesUserIds = $this->FrontendController->getrequestBasedServices($request_id, $distance);
// if ($getServicesUserIds) {
// sendRequestNotification('FindFlicker', 'New-request notification from FindFlicker', $getServicesUserIds);
// }
// // Return JSON response
// return response()->json([
// 'status' => true,
// 'message' => 'Distance increased search executed successfully',
// 'request_id' => $request_id,
// 'distance' => $distance,
// 'users_found' => $getServicesUserIds ?? [],
// ], 200);
// }
public function searchDistanceIncreaseRequest(Request $request)
{
try {
$request_id = $request->requestId;
$distance = $request->distance;
$getServicesUserIds = $this->FrontendController
->getrequestBasedServices($request_id, $distance);
if ($getServicesUserIds) {
sendRequestNotification(
'FindFlicker',
'New-request notification from FindFlicker',
"history_update",
$getServicesUserIds
);
}
return response()->json([
'status' => true,
'message' => 'Distance increased search executed successfully',
'request_id' => $request_id,
'distance' => $distance,
'users_found' => $getServicesUserIds ?? [],
], 200);
} catch (\Exception $e) {
// Log error
Log::error("searchDistanceIncreaseRequest error: " . $e->getMessage(), [
'request_id' => $request->requestId,
'distance' => $request->distance
]);
return response()->json([
'status' => false,
'message' => 'Something went wrong while increasing distance search.',
'error' => $e->getMessage(),
], 500);
}
}
}
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Advertisement;
use App\Models\Support;
use Illuminate\Http\Request;
class SupportController extends Controller
{
public function support_request(Request $request)
{
$request->validate([
'mobile' => 'required',
'issue' => 'required',
'photo.*' => 'nullable|image|max:2048' // each file max 2MB
]);
// ✔ FIRST: Check mobile exists in advertisement table
$mobileExists = Advertisement::where('phone', $request->mobile)->exists();
// if (!$mobileExists) {
// return back()->withErrors(['mobileExists' => 'This mobile number is not registered in advertisement.'])->withInput();
// }
$imageUrls = [];
if ($request->hasFile('photo')) {
$photos = $request->file('photo'); // array of uploaded images
// Debug: Check files (use only once)
// dd($photos);
foreach ($photos as $photo) {
// Ensure folder exists
$folderPath = public_path('uploads/support/');
if (!file_exists($folderPath)) {
mkdir($folderPath, 0777, true);
}
// Unique filename
$imageName = 'support_' . time() . '_' . uniqid() . '.' . $photo->getClientOriginalExtension();
// Move file
$photo->move($folderPath, $imageName);
// Save URL (correct format)
$imageUrls[] = $folderPath . $imageName;
}
}
// Save as comma separated (or you can store as JSON)
$commaSeparatedImages = implode(',', $imageUrls);
//dd($commaSeparatedImages);
// Insert into database
Support::create([
'mobile' => $request->mobile,
'issue' => $request->issue,
'photo' => $commaSeparatedImages, // store all paths
'created_at' => now(),
]);
return back()->with('success', 'Request sent successfully.');
}
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BrandProduct extends Model
{
use HasFactory;
protected $table = 'product_brand';
protected $guarded = ['id'];
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class CategoryProduct extends Model
{
use HasFactory;
protected $table = 'product_category';
protected $guarded = ['id'];
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class IndustryProduct extends Model
{
use HasFactory;
protected $table = 'product_industry';
protected $guarded = ['id'];
}
...@@ -10,5 +10,10 @@ class ProductModel extends Model ...@@ -10,5 +10,10 @@ class ProductModel extends Model
use HasFactory; use HasFactory;
protected $table = 'products'; protected $table = 'products';
protected $guarded = ['id']; protected $guarded = ['id'];
// public function category()
// {
// $this->belongsTo(CategoryModel::class,'category_id','id');
// }
} }
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class SizeProduct extends Model
{
use HasFactory;
protected $table = 'product_size';
protected $guarded = ['id'];
}
...@@ -176,54 +176,41 @@ ...@@ -176,54 +176,41 @@
</a> </a>
</li> </li>
<li class="pe-slide pe-has-sub <?= request()->routeIs(['slider','addSlider']) ? 'active':'' ?>">
<a href="#collapseLogisticssldier" class="pe-nav-link" data-bs-toggle="collapse" aria-expanded="<?= request()->routeIs(['slider','addSlider']) ? 'true':'false' ?>" aria-controls="collapseLogisticssldier">
<i class="bi bi-sliders pe-nav-icon"></i>
<span class="pe-nav-content">Slider Management</span>
{{-- <li class="pe-slide pe-has-sub">
<a href="#collapseLogistics" class="pe-nav-link" data-bs-toggle="collapse" aria-expanded="false" aria-controls="collapseLogistics">
<i class="bi bi-truck pe-nav-icon"></i>
<span class="pe-nav-content">Masters</span>
<i class="ri-arrow-down-s-line pe-nav-arrow"></i> <i class="ri-arrow-down-s-line pe-nav-arrow"></i>
</a> </a>
<ul class="pe-slide-menu collapse" id="collapseLogistics"> <ul class="pe-slide-menu collapse <?= request()->routeIs(['slider','addSlider']) ? 'show':'' ?>" id="collapseLogisticssldier">
<li class="slide pe-nav-content1">
<a href="javascript:void(0)">Masters</a>
</li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('country') ?>" class="pe-nav-link"> <a href="<?= route('slider') ?>" class="pe-nav-link <?= request()->routeIs(['slider','addSlider']) ? 'active':'' ?> ">
Country Slider
</a> </a>
</li> </li>
</ul>
</li>
<li class="pe-slide-item"> <li class="pe-slide pe-has-sub <?= request()->routeIs(['products','addProduct']) ? 'active':'' ?>">
<a href="<?= route('language') ?>" class="pe-nav-link"> <a href="#collapseLogisticpro" class="pe-nav-link" data-bs-toggle="collapse" aria-expanded="<?= request()->routeIs(['slider','addSlider']) ? 'true':'false' ?>" aria-controls="collapseLogisticpro">
Language <i class="bi bi-shop-window pe-nav-icon"></i>
</a> <span class="pe-nav-content">Product Management</span>
</li> <i class="ri-arrow-down-s-line pe-nav-arrow"></i>
<li class="pe-slide-item"> </a>
<a href="<?= route('hair') ?>" class="pe-nav-link"> <ul class="pe-slide-menu collapse <?= request()->routeIs(['products','addProduct']) ? 'show':'' ?>" id="collapseLogisticpro">
Hair
</a>
</li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('eye') ?>" class="pe-nav-link"> <a href="<?= route('products') ?>" class="pe-nav-link <?= request()->routeIs(['products','addProduct']) ? 'active':'' ?> ">
Eye Color Products
</a>
</li>
<li class="pe-slide-item">
<a href="<?= route('bodyType') ?>" class="pe-nav-link">
Body Type
</a>
</li>
<li class="pe-slide-item">
<a href="<?= route('orientation') ?>" class="pe-nav-link">
Orientation
</a> </a>
</li> </li>
</ul> </ul>
</li> --}} </li>
<li class="pe-slide pe-has-sub <li class="pe-slide pe-has-sub
@if(request()->routeIs([ @if(request()->routeIs([
...@@ -255,7 +242,7 @@ ...@@ -255,7 +242,7 @@
'slider', 'addSlider',
'eye', 'addEye', 'eye', 'addEye',
'type', 'addType', 'type', 'addType',
'industry', 'addIndustry', 'industry', 'addIndustry',
...@@ -270,11 +257,7 @@ ...@@ -270,11 +257,7 @@
<li class="pe-slide-item">
<a href="<?= route('slider') ?>" class="pe-nav-link @if(request()->routeIs(['slider', 'addSlider'])) active @endif">
Slider
</a>
</li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('brand') ?>" class="pe-nav-link @if(request()->routeIs(['brand', 'addBrand'])) active @endif"> <a href="<?= route('brand') ?>" class="pe-nav-link @if(request()->routeIs(['brand', 'addBrand'])) active @endif">
...@@ -284,33 +267,31 @@ ...@@ -284,33 +267,31 @@
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('type') ?>" class="pe-nav-link @if(request()->routeIs(['type', 'addType'])) active @endif"> <a href="<?= route('type') ?>" class="pe-nav-link @if(request()->routeIs(['type', 'addType'])) active @endif">
Type Product Type
</a> </a>
</li> </li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('industry') ?>" class="pe-nav-link @if(request()->routeIs(['industry', 'addIndustry'])) active @endif"> <a href="<?= route('size') ?>" class="pe-nav-link @if(request()->routeIs(['size', 'addSize'])) active @endif">
Industry Product Size
</a> </a>
</li> </li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('size') ?>" class="pe-nav-link @if(request()->routeIs(['size', 'addSize'])) active @endif"> <a href="<?= route('industry') ?>" class="pe-nav-link @if(request()->routeIs(['industry', 'addIndustry'])) active @endif">
Size Industry
</a> </a>
</li> </li>
<li class="pe-slide-item"> <li class="pe-slide-item">
<a href="<?= route('category') ?>" class="pe-nav-link @if(request()->routeIs(['category', 'addCategory'])) active @endif"> <a href="<?= route('category') ?>" class="pe-nav-link @if(request()->routeIs(['category', 'addCategory'])) active @endif">
Category Category
</a> </a>
</li> </li>
<li class="pe-slide-item">
<a href="<?= route('products') ?>" class="pe-nav-link @if(request()->routeIs(['products', 'addProduct'])) active @endif">
Products
</a>
</li>
</ul> </ul>
</li> </li>
......
@extends('backend.app_template')
@section('title','Body Type Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$body_type = isset($record->body_type) ? $record->body_type:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Body Type</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateBodyType') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> Body Type</h5>
<div class="float-end">
<a href="<?= route('bodyType') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="body_type" class="form-label">Body Type <span class="text-danger"> *</span></label>
<input type="text" value="<?= $body_type ?>" class="form-control" id="body_type" name="body_type" placeholder="Enter Body Type">
@error('body_type') <span class="text-danger">{{$message}}</span> @enderror
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
body_type: { required: true },
},
messages: {
body_type: { required: "Please enter Body Type" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Body Type List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Body Type</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('BodyTypeDetails') ?>" class="btn btn-primary">Add Body Type</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Body Type</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->body_type ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','BodyTypeModel')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('BodyTypeDetails', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','BodyTypeModel')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Eye Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$eye_color = isset($record->eye_color) ? $record->eye_color:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Eye</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateEye') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> Eye</h5>
<div class="float-end">
<a href="<?= route('eye') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="eye_color" class="form-label">Eye Color<span class="text-danger"> *</span></label>
<input type="text" value="<?= $eye_color ?>" class="form-control" id="eye_color" name="eye_color" placeholder="Enter Eye Color">
@error('eye_color') <span class="text-danger">{{$message}}</span> @enderror
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
eye_color: { required: true },
},
messages: {
eye_color: { required: "Please enter eye color" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Eye List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Eye</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('addEye') ?>" class="btn btn-primary">Add Eye</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Eye Color</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->eye_color ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','EyeModel')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('addEye', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','EyeModel')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Hair Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$hair_color = isset($record->hair_color) ? $record->hair_color:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Hair</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateHair') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> Hair</h5>
<div class="float-end">
<a href="<?= route('hair') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="hair_color" class="form-label">Hair Color<span class="text-danger"> *</span></label>
<input type="text" value="<?= $hair_color ?>" class="form-control" id="hair_color" name="hair_color" placeholder="Enter Hair Color">
@error('hair_color') <span class="text-danger">{{$message}}</span> @enderror
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
hair_color: { required: true },
},
messages: {
hair_color: { required: "Please enter hair color" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Hair List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Hair</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('addHair') ?>" class="btn btn-primary">Add Hair</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Hair Color</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->hair_color ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','HairModel')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('addHair', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','HairModel')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Language Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$name = isset($record->name) ? $record->name:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Language</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateLanguage') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> Language</h5>
<div class="float-end">
<a href="<?= route('language') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="name" class="form-label">Language<span class="text-danger"> *</span></label>
<input type="text" value="<?= $name ?>" class="form-control" id="name" name="name" placeholder="Enter Language">
@error('name') <span class="text-danger">{{$message}}</span> @enderror
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
name: { required: true },
},
messages: {
name: { required: "Please enter langauge" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Language List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Language</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('addLanguage') ?>" class="btn btn-primary">Add Language</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Language</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->name ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','LanguageModel')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('addLanguage', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','LanguageModel')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Orientation Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$orientation_name = isset($record->orientation_name) ? $record->orientation_name:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Orientation</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateOrientation') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> Orientation</h5>
<div class="float-end">
<a href="<?= route('orientation') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="orientation_name" class="form-label">Orientation Name <span class="text-danger"> *</span></label>
<input type="text" value="<?= $orientation_name ?>" class="form-control" id="orientation_name" name="orientation_name" placeholder="Enter Orientation Name">
@error('orientation_name') <span class="text-danger">{{$message}}</span> @enderror
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
orientation_name: { required: true },
},
messages: {
orientation_name: { required: "Please enter Orientation Name" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
\ No newline at end of file
@extends('backend.app_template')
@section('title','Orientation List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Orientation</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('orientationDetails') ?>" class="btn btn-primary">Add Orientation</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Orientation</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->orientation_name ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','OrientationModel')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('orientationDetails', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','OrientationModel')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<div class="col-xl-4"> <div class="col-xl-4">
<label for="type_id" class="form-label">Type<span class="text-danger"> *</span></label> <label for="type_id" class="form-label">Product Type<span class="text-danger"> *</span></label>
<select class="form-control select2" id="type_id" name="type_id"> <select class="form-control select2" id="type_id" name="type_id">
<option value="">--select--</option> <option value="">--select--</option>
<?php <?php
...@@ -97,6 +97,34 @@ ...@@ -97,6 +97,34 @@
@error('type_id') <span class="text-danger">{{$message}}</span> @enderror @error('type_id') <span class="text-danger">{{$message}}</span> @enderror
</div> </div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Size Type<span class="text-danger"> *</span></label>
<select class="form-control select2" id="size_type" name="size_type">
<option value="">--select--</option>
<option value="1">Size</option>
<option value="2">Range</option>
<option value="3">Capacity</option>
</select>
</div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Product Size<span class="text-danger"> *</span></label>
<select class="form-control select2" id="size" multiple name="size[]">
<option value="">--select--</option>
<?php
if (isset($sizeData)) {
foreach ($sizeData as $val) { ?>
<option value="<?php echo $val->id ?>"><?php echo ucwords($val->size) ?></option>
<?php }
} ?>
</select>
</div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Product Catalogue</label>
<input type="file" name="broucher" id="broucher" class="form-control">
</div>
<div class="col-xl-12"> <div class="col-xl-12">
<label for="type_id" class="form-label">Product Description</label> <label for="type_id" class="form-label">Product Description</label>
<textarea class="form-control" id="product_description" name="product_description"></textarea> <textarea class="form-control" id="product_description" name="product_description"></textarea>
...@@ -105,9 +133,9 @@ ...@@ -105,9 +133,9 @@
<table style="width:100%" class="table"> <table style="width:100%" class="table">
<tr> <tr>
<th>Image</th> <th>Image</th>
<th>Broucher</th> <!-- <th>Catalogue</th>
<th>Product Type</th> <th>Product Type</th>
<th>Product Size</th> <th>Product Size</th> -->
<th>Action</th> <th>Action</th>
</tr> </tr>
<tbody id="invoiceBody"> <tbody id="invoiceBody">
...@@ -115,27 +143,28 @@ ...@@ -115,27 +143,28 @@
<td style="width:20%"> <td style="width:20%">
<input data-row="0" data-name="product_image" id="product_image0" type="file" name="product_image[]" id="product_image" class="form-control"> <input data-row="0" data-name="product_image" id="product_image0" type="file" name="product_image[]" id="product_image" class="form-control">
</td> </td>
<td style="width:20%"> <!-- <td style="width:20%">
<input data-row="0" data-name="broucher" id="broucher0" type="file" name="broucher[]" id="broucher" class="form-control"> <input data-row="0" data-name="broucher" id="broucher0" type="file" name="broucher[]" id="broucher" class="form-control">
</td> </td>
<td style="width:20%"> <td style="width:20%">
<select class="form-control select2" data-row="0" data-name="size_type" id="size_type0" name="size_type[]"> <select class="form-control select2" data-row="0" data-name="size_type" id="size_type0" name="size_type[]">
<option value="">--select--</option> <option value="">--select--</option>
<option value="1">Size</option> <option value="1">Size</option>
<option value="2">Range</option> <option value="2">Range</option>
<option value="3">Capacity</option> <option value="3">Capacity</option>
</select> </select>
</td> </td>
<td style="width:20%"> <td style="width:20%">
<select class="form-control select2" data-row="0" data-name="size" id="size0" name="size[]"> <select class="form-control select2" data-row="0" data-name="size" id="size0" name="size[]">
<option value="">--select--</option> <option value="">--select--</option>
<?php <?php
if (isset($sizeData)) { if (isset($sizeData)) {
foreach ($sizeData as $val) { ?> foreach ($sizeData as $val) { ?>
<option value="<?php echo $val->id ?>"><?php echo ucwords($val->size) ?></option> <option value="<?php echo $val->id ?>"><?php echo ucwords($val->size) ?></option>
<?php } } ?> <?php }
} ?>
</select> </select>
</td> </td> -->
<td style="width:10%"> <td style="width:10%">
<button type="button" class="btn btn-sm btn-success" onclick="addRow('invoiceBody');"><i class="bi bi-plus"></i></button> <button type="button" class="btn btn-sm btn-success" onclick="addRow('invoiceBody');"><i class="bi bi-plus"></i></button>
<button type="button" data-row="0" id="delete" onclick="deleteItem(this)" class="btn btn-sm btn-danger"><i class="bi bi-trash"></i></button> <button type="button" data-row="0" id="delete" onclick="deleteItem(this)" class="btn btn-sm btn-danger"><i class="bi bi-trash"></i></button>
...@@ -167,35 +196,35 @@ ...@@ -167,35 +196,35 @@
CKEDITOR.replace('product_description'); CKEDITOR.replace('product_description');
function addRow(content_id, label_checkbox = '') { function addRow(content_id, label_checkbox = '') {
var row = $("#" + content_id + " tr:last"); var row = $("#" + content_id + " tr:last");
row.find("select").each(function(index) { row.find("select").each(function(index) {
$(this).select2('destroy'); $(this).select2('destroy');
}); });
row.clone().find("input, textarea, select, button, checkbox, radio, label").each(function(j, obj) { row.clone().find("input, textarea, select, button, checkbox, radio, label").each(function(j, obj) {
i = $(this).data('row') + 1; i = $(this).data('row') + 1;
id = $(this).data('name') + i; id = $(this).data('name') + i;
$(this).val('').attr({ $(this).val('').attr({
'id': id, 'id': id,
'data-row': i 'data-row': i
}); });
}).end().appendTo("#" + content_id); }).end().appendTo("#" + content_id);
row.find("select").each(function(index) { row.find("select").each(function(index) {
$("select").select2(); $("select").select2();
}); });
} }
function deleteItem(e) { function deleteItem(e) {
var id = e.dataset.row; var id = e.dataset.row;
if (id != 0) { if (id != 0) {
if (confirm("are you sure you want delete?") === true) { if (confirm("are you sure you want delete?") === true) {
$('#product_image' + id).parent().parent().remove(); $('#product_image' + id).parent().parent().remove();
} }
} }
} }
$(function() { $(function() {
$("#countryForm").validate({ $("#countryForm").validate({
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<div class="col-xl-4"> <div class="col-xl-4">
<label for="type_id" class="form-label">Type<span class="text-danger"> *</span></label> <label for="type_id" class="form-label">Product Type<span class="text-danger"> *</span></label>
<select class="form-control select2" id="type_id" name="type_id"> <select class="form-control select2" id="type_id" name="type_id">
<option value="">--select--</option> <option value="">--select--</option>
<?php <?php
...@@ -106,6 +106,34 @@ ...@@ -106,6 +106,34 @@
@error('type_id') <span class="text-danger">{{$message}}</span> @enderror @error('type_id') <span class="text-danger">{{$message}}</span> @enderror
</div> </div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Size Type<span class="text-danger"> *</span></label>
<select class="form-control select2" id="size_type" name="size_type">
<option value="">--select--</option>
<option value="1">Size</option>
<option value="2">Range</option>
<option value="3">Capacity</option>
</select>
</div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Product Size<span class="text-danger"> *</span></label>
<select class="form-control select2" id="size" multiple name="size[]">
<option value="">--select--</option>
<?php
if (isset($sizeData)) {
foreach ($sizeData as $val) { ?>
<option value="<?php echo $val->id ?>"><?php echo ucwords($val->size) ?></option>
<?php }
} ?>
</select>
</div>
<div class="col-xl-4">
<label for="type_id" class="form-label">Product Catalogue<span class="text-danger"> *</span></label>
<input type="file" name="broucher" id="broucher" class="form-control">
</div>
<div class="col-xl-12"> <div class="col-xl-12">
<label for="type_id" class="form-label">Product Description</label> <label for="type_id" class="form-label">Product Description</label>
<textarea class="form-control" id="product_description" name="product_description"><?= $product_description ?></textarea> <textarea class="form-control" id="product_description" name="product_description"><?= $product_description ?></textarea>
...@@ -114,9 +142,9 @@ ...@@ -114,9 +142,9 @@
<table style="width:100%" class="table"> <table style="width:100%" class="table">
<tr> <tr>
<th>Image</th> <th>Image</th>
<th>Broucher</th> <!--<th>Catalogue</th>
<th>Product Type</th> <th>Product Type</th>
<th>Product Size</th> <th>Product Size</th> -->
<th>Action</th> <th>Action</th>
</tr> </tr>
<tbody id="invoiceBody"> <tbody id="invoiceBody">
...@@ -127,10 +155,10 @@ ...@@ -127,10 +155,10 @@
<td style="width:20%"> <td style="width:20%">
<input data-row="<?= $key ?>" data-name="product_image" id="product_image<?= $key ?>" type="file" name="product_image[]" id="product_image" class="form-control"> <input data-row="<?= $key ?>" data-name="product_image" id="product_image<?= $key ?>" type="file" name="product_image[]" id="product_image" class="form-control">
</td> </td>
<td style="width:20%"> <!--<td style="width:20%">
<input data-row="<?= $key ?>" data-name="broucher" id="broucher<?= $key ?>" type="file" name="broucher[]" id="broucher" class="form-control"> <input data-row="<?= $key ?>" data-name="broucher" id="broucher<?= $key ?>" type="file" name="broucher[]" id="broucher" class="form-control">
</td> </td>
<td style="width:20%"> <td style="width:20%">
<select class="form-control select2" data-row="<?= $key ?>" data-name="size_type" id="size_type<?= $key ?>" name="size_type[]"> <select class="form-control select2" data-row="<?= $key ?>" data-name="size_type" id="size_type<?= $key ?>" name="size_type[]">
<option value="">--select--</option> <option value="">--select--</option>
<option <?= ($row->product_type == 1) ? 'selected':'' ?> value="1">Size</option> <option <?= ($row->product_type == 1) ? 'selected':'' ?> value="1">Size</option>
...@@ -148,7 +176,7 @@ ...@@ -148,7 +176,7 @@
<?php } <?php }
}?> }?>
</select> </select>
</td> </td> -->
<td style="width:10%"> <td style="width:10%">
<button type="button" class="btn btn-sm btn-success" onclick="addRow('invoiceBody');"><i class="bi bi-plus"></i></button> <button type="button" class="btn btn-sm btn-success" onclick="addRow('invoiceBody');"><i class="bi bi-plus"></i></button>
<button type="button" data-row="<?= $key ?>" id="delete" onclick="deleteItem(this)" class="btn btn-sm btn-danger"><i class="bi bi-trash"></i></button> <button type="button" data-row="<?= $key ?>" id="delete" onclick="deleteItem(this)" class="btn btn-sm btn-danger"><i class="bi bi-trash"></i></button>
......
@extends('backend.app_template')
@section('title','Country Store or Update')
@section('content')
<?php
$id = isset($record->id) ? $record->id:'';
$video = isset($record->vedio) ? $record->vedio:'';
$type = ($id == '') ? 'Create':'Update';
?>
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">User Guide Video</a></li>
<li class="breadcrumb-item active" aria-current="page"><?= $type ?></li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-xxl-12">
<form method="POST" id="countryForm" action="<?= route('storeUpdateUserVideo') ?>" enctype="multipart/form-data">
@csrf
<div>
<div class="card">
<span></span>
<!-- Logistics Details Section -->
<div class="card-header">
<h5 class="mb-0"><?= $type ?> User Guide Video</h5>
<div class="float-end">
<a href="<?= route('userVideo') ?>" class="btn btn-primary" >Back</a>
</div>
</div>
<input type="hidden" name="id" value="<?= $id ?>" />
<input type="hidden" name="old_vedio" value="<?= $video ?>" />
<div class="card-body">
<div class="row g-4">
<div class="col-xl-4">
<label for="video" class="form-label">User Guide Video</label>
<input type="file" accept="video/mp4" class="form-control" name="video" >
</div>
<div class="col-xl-4">
<?php if ($video != '') { ?>
<video width="200" height="100" controls>
<source src="<?= $video ?>" type="video/mp4">
</video>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end gap-3 my-5">
<a href="" class="btn btn-light-light text-muted">Cancel</a>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
<!-- Submit Section -->
</div>
</main>
<script>
$(function() {
$("#countryForm").validate({
rules: {
name: { required: true },
phone_code: { required: true },
currency_name: { required: true },
currency_code: { required: true },
},
messages: {
name: { required: "Please enter country name" },
phone_code: { required: "Please enter country code" },
currency_name: { required: "Please enter currency name" },
currency_code: { required: "Please enter currency code" },
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
}
});
});
</script>
@endsection
@extends('backend.app_template')
@section('title','Country List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">User Guide Vedio</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="d-flex justify-content-end mb-4">
<a href="<?php echo route('userVideoDetails') ?>" class="btn btn-primary">Add User Guide Video</a>
</div>
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>video </th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td>
<?php if ($row->vedio != '') { ?>
<video width="200" height="100" controls>
<source src="<?= $row->vedio ?>" type="video/mp4">
</video>
<?php } ?>
</td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','UserVedio')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('userVideoDetails', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','UserVedio')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
<?php $i++;
}
} ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
@extends('backend.app_template')
@section('title','Users List')
@section('content')
<main class="app-wrapper">
<div class="container-fluid">
<div class="d-flex align-items-center mt-2 mb-2">
<div class="flex-shrink-0">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-end mb-0">
<li class="breadcrumb-item"><a href="javascript:void(0)">Users</a></li>
<li class="breadcrumb-item active" aria-current="page">List</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<table id="datatables" class="table table-nowrap table-hover table-bordered w-100 mt-5">
<thead>
<tr>
<th>S.No</th>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Status</th>
<!-- <th>Action</th> -->
</tr>
</thead>
<tbody>
<?php if (isset($records)) {
$i = 1;
foreach ($records as $key => $row) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $row->name ?></td>
<td><?php echo $row->email ?></td>
<td><?php echo $row->mobile ?></td>
<td><a data-placement="top" title="Status" data-original-title="Status" href="javascript:void(0)" onclick="changeStatus('<?php echo $row->id ?>','<?php echo ($row->status == 1) ? 0 : 1 ?>','User')" class="badge bg-pill bg-<?php echo ($row->status == 1) ? 'success' : 'danger' ?>"><?php echo ($row->status == 1) ? 'Active' : 'In-Active' ?></a></td>
<!-- <td>
<a data-toggle="tooltip" data-placement="top" title="Edit" href="<?php echo route('addPage', [$row->id]) ?>" class="btn btn-sm btn-warning"><i class="bi bi-pencil-fill"></i></a>
<a data-toggle="tooltip" data-placement="top" title="Delete" data-original-title="Delete" href="javascript:void(0)" onclick="commonDelete('<?php echo $row->id ?>','User')" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></a>
</td> -->
</tr>
<?php $i++;
} } ?>
</tbody>
</table>
</div>
<!-- Submit Section -->
</div>
</main>
@endsection
\ No newline at end of file
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