You need to sign in or sign up before continuing.
Commit 49f8a646 by Hussain Mohamed

changes

parent abc8de64
......@@ -3,9 +3,56 @@
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\ProductBrandModel;
use Illuminate\Http\Request;
class BrandController extends Controller
{
//
public function brand()
{
$records = ProductBrandModel::orderBy('id', 'ASC')->get();
return view('backend.brand.list', compact('records'));
}
public function addBrand($id = '')
{
$record = '';
if ($id > 0) {
$record = ProductBrandModel::WHere('id', $id)->first();
}
return view('backend.brand.add_edit', compact('record'));
}
public function storeUpdateBrand(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([
'brand' => "required|unique:brand,brand",
]);
$insert = ProductBrandModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('brand')->with('success', 'Brand Saved Successfully');
}else{
return redirect()->route('brand')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'brand' => "required",
]);
$update = ProductBrandModel::Where('id',$id)->update($dataArr);
return redirect()->route('brand')->with('success', 'Brand Updated Successfully');;
}
}
}
......@@ -3,9 +3,57 @@
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\ProductIndustryModel;
use Illuminate\Http\Request;
class IndustryController extends Controller
{
//
public function industry()
{
$records = ProductIndustryModel::orderBy('id', 'ASC')->get();
return view('backend.industry.list', compact('records'));
}
public function addIndustry($id = '')
{
$record = '';
if ($id > 0) {
$record = ProductIndustryModel::WHere('id', $id)->first();
}
return view('backend.industry.add_edit', compact('record'));
}
public function storeUpdateIndustry(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([
'industry' => "required|unique:industry,industry",
]);
$insert = ProductIndustryModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('industry')->with('success', 'Industry Saved Successfully');
}else{
return redirect()->route('industry')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'industry' => "required",
]);
$update = ProductIndustryModel::Where('id',$id)->update($dataArr);
return redirect()->route('industry')->with('success', 'Industry Updated Successfully');;
}
}
}
......@@ -3,9 +3,57 @@
namespace App\Http\Controllers\Backend;
use App\Http\Controllers\Controller;
use App\Models\ProductTypeModel;
use Illuminate\Http\Request;
class TypeController extends Controller
{
//
public function type()
{
$records = ProductTypeModel::orderBy('id', 'ASC')->get();
return view('backend.type.list', compact('records'));
}
public function addType($id = '')
{
$record = '';
if ($id > 0) {
$record = ProductTypeModel::WHere('id', $id)->first();
}
return view('backend.type.add_edit', compact('record'));
}
public function storeUpdateType(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([
'type' => "required|unique:type,type",
]);
$insert = ProductTypeModel::create($dataArr);
if($insert['id'] > 0)
{
return redirect()->route('type')->with('success', 'Type Saved Successfully');
}else{
return redirect()->route('type')->with('error', 'Something went wrong!');
}
} else {
$request->validate([
'type' => "required",
]);
$update = ProductTypeModel::Where('id',$id)->update($dataArr);
return redirect()->route('type')->with('success', 'Type Updated Successfully');;
}
}
}
@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','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','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
......@@ -2,11 +2,13 @@
use App\Http\Controllers\Backend\AuthController;
use App\Http\Controllers\Backend\BodyTypeController;
use App\Http\Controllers\Backend\BrandController;
use App\Http\Controllers\Backend\CommonController;
use App\Http\Controllers\Backend\CountryController;
use App\Http\Controllers\Backend\DashboardController;
use App\Http\Controllers\Backend\EyeController;
use App\Http\Controllers\Backend\HairController;
use App\Http\Controllers\Backend\IndustryController;
use App\Http\Controllers\Backend\LanguageController;
use App\Http\Controllers\Backend\MetaController;
use App\Http\Controllers\Backend\OrientationController;
......@@ -15,6 +17,7 @@
use App\Http\Controllers\Backend\UserController;
use App\Http\Controllers\Backend\SettingsController;
use App\Http\Controllers\Backend\SliderController;
use App\Http\Controllers\Backend\TypeController;
use App\Http\Controllers\Backend\UserGuideController;
use Illuminate\Support\Facades\Route;
......@@ -32,10 +35,24 @@
Route::get('addCountry/{id?}', [CountryController::class, 'addCountry'])->name('addCountry');
Route::post('storeUpdateCountry', [CountryController::class, 'storeUpdateCountry'])->name('storeUpdateCountry');
Route::get('slider', [SliderController::class, 'slider'])->name('slider');
Route::get('slider', [SliderController::class, 'slider'])->name('slider');
Route::get('addSlider/{id?}', [SliderController::class, 'addSlider'])->name('addSlider');
Route::post('storeUpdateSlider', [SliderController::class, 'storeUpdateSlider'])->name('storeUpdateSlider');
Route::get('brand', [BrandController::class, 'brand'])->name('brand');
Route::get('addBrand/{id?}', [BrandController::class, 'addBrand'])->name('addBrand');
Route::post('storeUpdateBrand', [BrandController::class, 'storeUpdateBrand'])->name('storeUpdateBrand');
Route::get('type', [TypeController::class, 'type'])->name('type');
Route::get('addType/{id?}', [TypeController::class, 'addType'])->name('addType');
Route::post('storeUpdateType', [TypeController::class, 'storeUpdateType'])->name('storeUpdateType');
Route::get('industry', [IndustryController::class, 'industry'])->name('industry');
Route::get('addIndustry/{id?}', [IndustryController::class, 'addIndustry'])->name('addIndustry');
Route::post('storeUpdateIndustry', [IndustryController::class, 'storeUpdateIndustry'])->name('storeUpdateIndustry');
Route::get('language', [LanguageController::class, 'language'])->name('language');
Route::get('addLanguage/{id?}', [LanguageController::class, 'addLanguage'])->name('addLanguage');
......
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