Commit 4e8240e8 by Hussain Mohamed

changes

parent 623698fa
......@@ -9,6 +9,8 @@
use App\Models\Country;
use App\Models\Currency;
use App\Models\DistanceRequest;
use App\Models\EnquiryCatalogModel;
use App\Models\EnquiryModel;
use App\Models\IndustryProduct;
use App\Models\WebRequestModel;
use App\Models\LanguageModel;
......@@ -27,9 +29,11 @@
use App\Models\SizeModel;
use App\Models\SizeProduct;
use App\Models\SliderModel;
use Exception;
use Google\Service\AdExchangeBuyer\Product;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Str;
class FrontendController extends Controller
......@@ -94,6 +98,117 @@ public function getProduct($name = '')
}
public function submitEnquiry(Request $request)
{
$input = $request->all();
$name = isset($input['name']) ? $input['name']:'';
$email = isset($input['email']) ? $input['email']:'';
$phone = isset($input['phone']) ? $input['phone']:'';
$brand = isset($input['brand']) ? $input['brand']:'';
$size = isset($input['size']) ? $input['size']:'';
$industry = isset($input['industry']) ? $input['industry']:'';
if($brand != '')
{
$bname = ProductBrandModel::Where('id',$brand)->value('brand');
}
if($size != '')
{
$sname = SizeModel::Where('id',$size)->value('size');
}
if($industry != '')
{
$iname = ProductIndustryModel::Where('id',$industry)->value('industry');
}
$data = [
'name' => $name,
'email' => $email,
'phone' => $phone,
'brand' => $bname ?? '',
'size' => $sname ?? '',
'industry' => $iname ?? '',
'ip' => $request->ip()
];
try{
Mail::send('email.enquiry', ['data' => $data], function ($message) use ($data) {
$message->from('enquiry@palaniappaelectronics.in', 'Palaniappa Electronics');
$message->to('hussain@alphasoftz.in')
->subject('New Enquiry from Website');
// ->replyTo($data['email']);
});
EnquiryModel::create($data);
return response()->json(['status' => 1]);
}catch(Exception $e)
{
return response()->json(['status' => 0]);
}
}
public function download($token)
{
$id = EnquiryCatalogModel::Where('hash',$token)->value('id');
if($id != '')
{
$path = public_path('assets/catalog/catalog.pdf');
return response()->download($path);
}else{
return redirect()->back()->with('error', 'Token mismatching');;
}
}
public function downloadCatalog(Request $request)
{
$input = $request->all();
$phone = isset($input['phone']) ? $input['phone']:'';
$token = hash('sha256', Str::random(20));
$data = [
'mobile' => $phone,
'ip' => $request->ip(),
'hash' => $token
];
$insert = EnquiryCatalogModel::create($data);
$html = '<a href="'.route('download',['token'=>$token]).'">Click here to Download</a>';
if($insert['id'] > 0)
{
return response()->json(['status' => 1,'link' => $html]);
}
}
public function sendSms()
{
$payload = [
"sender" => "Myshop",
"recipient" => "9894764234",
"content" => "Your Id is KCT00012",
"type" => "marketing",
"unicodeEnabled" => true
];
$ch = curl_init("https://api.brevo.com/v3/transactionalSMS/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"accept: application/json",
"content-type: application/json",
"api-key: " . env('BREVO_API_KEY')
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
public function getAjaxProducts(Request $request)
{
$offset = $request->get('offset', 0);
......@@ -101,7 +216,8 @@ public function getAjaxProducts(Request $request)
$categoryId = $request->get('category');
$brandId = $request->get('brand');
$industryId = $request->get('industry');
$category_slug = $request->get('category_slug');
DB::enableQueryLog();
$products = ProductModel::query()->from('products as p')
->leftJoin('product_attributes as pi', 'pi.product_id', '=', 'p.id')
......@@ -111,6 +227,17 @@ public function getAjaxProducts(Request $request)
$products->where('p.category_id', $categoryId);
}
if($category_slug != '')
{
$cate = str_replace("-"," ",$category_slug);
$cateId = CategoryModel::Where('category_name',$cate)->value('id');
if($cateId != '')
{
$products->where('p.category_id', $cateId);
}
}
// Brand filter (pivot)
if ($brandId) {
......
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EnquiryCatalogModel extends Model
{
use HasFactory;
protected $table = 'enquiry_catalog';
protected $guarded = ['id'];
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EnquiryModel extends Model
{
use HasFactory;
protected $table = 'enquiry';
protected $guarded = ['id'];
}
......@@ -5271,6 +5271,8 @@ section,
.footer-social > a{
padding: 10px;
color: #fff;
font-size: 17px;
}
.form-control{
......@@ -5350,6 +5352,11 @@ section,
overflow-y: auto;
}
#type .accordion-body {
max-height: 250px;
overflow-y: auto;
}
.mb-10{
margin-bottom: 10rem;
}
......
/*! jQuery Validation Plugin - v1.21.0 - 7/17/2024
* https://jqueryvalidation.org/
* Copyright (c) 2024 Jörn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,customElements:[],onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)});var f=[":text","[type='password']","[type='file']","select","textarea","[type='number']","[type='search']","[type='tel']","[type='url']","[type='email']","[type='datetime']","[type='date']","[type='month']","[type='week']","[type='time']","[type='datetime-local']","[type='range']","[type='color']","[type='radio']","[type='checkbox']","[contenteditable]","[type='button']"],g=["select","option","[type='radio']","[type='checkbox']"];a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",f.concat(this.settings.customElements).join(", "),b).on("click.validate",g.concat(this.settings.customElements).join(", "),b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={},d=["input","select","textarea","[contenteditable]"];return a(this.currentForm).find(d.concat(this.settings.customElements).join(", ")).not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);this.abortRequest(b),"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),this.settings&&this.settings.escapeHtml?h.text(c||""):h.html(c||"")):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass),this.settings&&this.settings.escapeHtml?h.text(c||""):h.html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return void 0===a?"":a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},elementAjaxPort:function(a){return"validate"+a.name},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()&&0===this.pendingRequest?(a(this.currentForm).trigger("submit"),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},abortRequest:function(b){var c;this.pending[b.name]&&(c=this.elementAjaxPort(b),a.ajaxAbort(c),this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass))},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a["date"===b?"dateISO":c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(a,d){b[a]="function"==typeof d&&"normalizer"!==a?d(c):d}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var a;b[this]&&(Array.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(a=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(a[0]),Number(a[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c},maxlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d<=c},rangelength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c[0]&&d<=c[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),null!==i.valid&&i.old===h?i.valid:(i.old=h,i.valid=null,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:this.elementAjaxPort(c),dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(b,c,e){var f=b.port;"abort"===b.mode&&(a.ajaxAbort(f),d[f]=e)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(a.ajaxAbort(f),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a.ajaxAbort=function(a){d[a]&&(d[a].abort(),delete d[a])},a});
\ No newline at end of file
</main>
<footer id="footer" class="footer dark-background">
<div class="container footer-top">
<div class="row gy-4">
<div class="col-lg-3 col-6 footer-links">
......@@ -13,8 +12,6 @@
</ul>
</div>
<div class="col-lg-3 col-6 footer-links">
<h4>HELP</h4>
<ul>
......@@ -27,7 +24,7 @@
<h4>REG. OFFICE</h4>
<p>No. 14/30, 2nd Main Road,</p>
<p>New Colony, Chromepet,</p>
<p>Chennai 600 044</p>
<p>Chennai - 600 044</p>
</div>
<div class="col-lg-3 col-md-12 footer-contact text-center text-md-start">
......@@ -36,12 +33,11 @@
<p>185/2, Abdul karam Street, Nagalkeni,</p>
<p>Chromepet, Chennai-600 044</p>
</div>
</div>
</div>
<hr>
<div class="container ">
Designed and developed by <b>Alpha</b>
Designed and developed by <b>Palaniappa Electornics</b>
<div class="text-right float-end footer-social">
<a href="#" class="facebook"><i class="bi bi-facebook"></i></a>
<a href="#" class="instagram"><i class="bi bi-instagram"></i></a>
......@@ -49,7 +45,6 @@
<a href="#" class="twitter"><i class="bi bi-youtube"></i></a>
</div>
</div>
</footer>
<!-- Scroll Top -->
......@@ -68,6 +63,7 @@
<!-- Main JS File -->
<script src="<?= asset('assets') ?>/js/main.js"></script>
<script src="<?= asset('assets') ?>/js/jquery.validate.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
new Swiper('.hero-slider', {
......@@ -90,6 +86,11 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
$(document).ready(function () {
const lightbox = GLightbox({
selector: '.glightbox',
});
});
</script>
</body>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>New Enquiry</title>
</head>
<body style="margin:0;padding:0;background:#f5f5f5;font-family:Arial,Helvetica,sans-serif;">
<table width="100%" cellpadding="0" cellspacing="0" style="background:#f5f5f5;padding:20px;">
<tr>
<td align="center">
<table width="600" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:6px;overflow:hidden;">
<tr> <td align="center" style="padding:15px;background:#ffffff;"> <img src="<?= asset('assets/img/') ?>/logo.png" alt="Company Logo" width="160" style="display:block;"> </td> </tr>
<!-- Header -->
<tr>
<td style="background:#024959;color:#ffffff;padding:15px 20px;">
<h2 style="margin:0;font-size:18px;">New Product Enquiry</h2>
</td>
</tr>
<!-- Content -->
<tr>
<td style="padding:20px;">
<p style="margin:0 0 15px;">
You have received a new enquiry. Details are below:
</p>
<table width="100%" cellpadding="8" cellspacing="0" style="border-collapse:collapse;">
<tr>
<td style="border:1px solid #ddd;"><strong>Name</strong></td>
<td style="border:1px solid #ddd;">{{ $data['name'] }}</td>
</tr>
<tr>
<td style="border:1px solid #ddd;"><strong>Email</strong></td>
<td style="border:1px solid #ddd;">{{ $data['email'] }}</td>
</tr>
<tr>
<td style="border:1px solid #ddd;"><strong>Phone</strong></td>
<td style="border:1px solid #ddd;">{{ $data['phone'] }}</td>
</tr>
<?php if($data['brand'] != ''){ ?>
<tr>
<td style="border:1px solid #ddd;"><strong>Brand</strong></td>
<td style="border:1px solid #ddd;">{{ $data['brand'] }}</td>
</tr>
<?php }
if($data['size'] != ''){
?>
<tr>
<td style="border:1px solid #ddd;"><strong>Size</strong></td>
<td style="border:1px solid #ddd;">{{ $data['size'] }}</td>
</tr>
<?php }
if($data['industry'] != ''){
?>
<tr>
<td style="border:1px solid #ddd;"><strong>Industry</strong></td>
<td style="border:1px solid #ddd;">{{ $data['industry'] }}</td>
</tr>
<?php } ?>
</table>
<p style="margin-top:20px;font-size:13px;color:#555;">
This enquiry was submitted from the website enquiry form.
</p>
</td>
</tr>
<!-- Footer -->
<tr>
<td style="background:#f1f1f1;padding:10px 20px;font-size:12px;color:#555;text-align:center;">
© {{ date('Y') }} Palaniappa Electronics
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
......@@ -15,7 +15,7 @@
<div class="hero-content">
<h1><?php echo $row->slider_caption ?></h1>
<h4><?php echo $row->slider_type ?></h4>
<a href="#">View All</a>
<a href="<?= route('product',['prodcat'=>$row->url_slug]) ?>">View All</a>
</div>
</div>
</div>
......@@ -46,7 +46,7 @@
Our advanced visual display solutions are changing the landscape
of how we see and interact with the world around us.
</p>
<a href="#" class="btn view-all-btn">View All</a>
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>" class="btn view-all-btn">View All</a>
</div>
</div>
......@@ -56,35 +56,35 @@
<div class="col-md-6">
<div class="display-card large">
<img src="<?php echo asset('assets') ?>/img/signage-tv.png" class="img-fluid" alt="">
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>"><img src="<?php echo asset('assets') ?>/img/signage-tv.png" class="img-fluid" alt=""></a>
<div class="display-title">Signage Display</div>
</div>
</div>
<div class="col-md-6">
<div class="display-card large">
<img src="<?php echo asset('assets') ?>/img/portable-projectors.png" class="img-fluid" alt="">
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>"><img src="<?php echo asset('assets') ?>/img/portable-projectors.png" class="img-fluid" alt=""></a>
<div class="display-title">Projectors</div>
</div>
</div>
<div class="col-md-4">
<div class="display-card small">
<img src="<?php echo asset('assets') ?>/img/led-wall.png" class="img-fluid" alt="">
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>"><img src="<?php echo asset('assets') ?>/img/led-wall.png" class="img-fluid" alt=""></a>
<div class="display-title">LED Wall</div>
</div>
</div>
<div class="col-md-4">
<div class="display-card small">
<img src="<?php echo asset('assets') ?>/img/interactive-display.png" class="img-fluid" alt="">
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>"><img src="<?php echo asset('assets') ?>/img/interactive-display.png" class="img-fluid" alt=""></a>
<div class="display-title">Interactive Displays</div>
</div>
</div>
<div class="col-md-4">
<div class="display-card small">
<img src="<?php echo asset('assets') ?>/img/digital-writing-pad.png" class="img-fluid" alt="">
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>"><img src="<?php echo asset('assets') ?>/img/digital-writing-pad.png" class="img-fluid" alt=""></a>
<div class="display-title">Digital Writing Pad</div>
</div>
</div>
......@@ -142,7 +142,7 @@
<div class="col-md-6">
<h3>Monitors</h3>
<p>Perfect monitor for all Applications</p>
<a href="#" class="sand-btn">See All <i class="bi bi-arrow-right"></i></a>
<a href="<?= route('product',['prodcat'=>'visual-display']) ?>" class="sand-btn">See All <i class="bi bi-arrow-right"></i></a>
</div>
<div class="col-md-6 text-end">
<img src="<?php echo asset('assets') ?>/img/monitor-3.png" class="img-fluid" alt="Monitors">
......@@ -158,7 +158,7 @@
<div class="col-md-6">
<h3>Aircon</h3>
<p>Beat the heat, Stay cool!</p>
<a href="#" class="teal-btn">See All <i class="bi bi-arrow-right"></i></a>
<a href="<?= route('product',['prodcat'=>'aircon-solutions']) ?>" class="teal-btn">See All <i class="bi bi-arrow-right"></i></a>
</div>
<div class="col-md-6 text-end">
<img src="<?php echo asset('assets') ?>/img/aircon.png" class="img-fluid" alt="Aircon">
......@@ -174,7 +174,7 @@
<div class="col-md-6">
<h3>Small Appliances</h3>
<p>Small Appliances for Offices</p>
<a href="#" class="teal-btn">See All <i class="bi bi-arrow-right"></i></a>
<a href="<?= route('product',['prodcat'=>'in-room-appliances']) ?>" class="teal-btn">See All <i class="bi bi-arrow-right"></i></a>
</div>
<div class="col-md-6 text-end">
<img src="<?php echo asset('assets') ?>/img/small-appliances.png" class="img-fluid" alt="Appliances">
......@@ -190,7 +190,7 @@
<div class="col-md-6">
<h3>Accessories</h3>
<p>Accessories for your every need!</p>
<a href="#" class="sand-btn">See All <i class="bi bi-arrow-right"></i></a>
<a href="<?= route('product',['prodcat'=>'housekeeping-amenities']) ?>" class="sand-btn">See All <i class="bi bi-arrow-right"></i></a>
</div>
<div class="col-md-6 text-end">
<img src="<?php echo asset('assets') ?>/img/accessories.png" class="img-fluid" alt="Accessories">
......
......@@ -7,30 +7,31 @@
<div class="row g-4">
<div class="col-lg-7">
<?php
$image = isset($productItems[0]->product_image) ? $productItems[0]->product_image : '';
?>
<div class="service-image-block">
<img src="<?= $image ?>" alt="Construction Services" class="img-fluid">
<a href="<?php echo $image ?>" data-zoomable="true" class="glightbox"><img src="<?php echo $image ?>" alt="Construction Services" class="img-fluid"></a>
</div>
</div>
<div class="col-lg-5">
<nav class="breadcrumbs d-flex">
<ol>
<li><a href="<?= route('/') ?>">Home</a></li>
<li><a href="#"><?= $record->category->category_name ?></a></li>
<li><a href="<?= route('products', [$record->product_slug]) ?>"><?= ucwords($record->product_name) ?></a></li>
<li><a href="<?php echo route('/') ?>">Home</a></li>
<li><a href="#"><?php echo $record->category->category_name ?></a></li>
<li><a href="<?php echo route('products', [$record->product_slug]) ?>"><?php echo ucwords($record->product_name) ?></a></li>
</ol>
</nav>
<div class="container py-4">
<div class="row g-4">
<h3 class="htitle "><?= ucwords($record->product_name) ?></h3>
<h3 class="htitle "><?php echo ucwords($record->product_name) ?></h3>
<p>{!! $record->product_description !!}</p>
<div class="d-flex">
<a href="javascript:void(0)" onclick="showForm('enquiryForm','catalogForm')"><span class="enquiry">Enquiry Now</span></a>&nbsp;
<a href="javascript:void(0)" onclick="showForm('enquiryForm','catalogForm')"><span class="enquiry">Enquiry Now</span></a>&nbsp;
<a href="javascript:void(0)" onclick="showForm('catalogForm','enquiryForm')"><span class="enquiry">Download Catalogue</span></a>
</div>
<form action="" method="post" class="enquiryForm">
<form action="#" method="post" class="enquiryForm">
@csrf
<label>Fields marked with an * are required</label>
<div class="form-floating mb-3">
<input type="text" class="form-control form-bord" id="nameInput" name="name" placeholder="Name" required="">
......@@ -43,30 +44,36 @@
</div>
<div class="form-floating mb-3">
<input type="text" class="form-control form-bord" id="emailInput" name="phone" placeholder="Phone" required="">
<input type="text" class="form-control form-bord" id="phone" name="phone" placeholder="Phone" required="">
<label for="messageInput">Phone *</label>
</div>
<input name="brand" type="hidden" id="filter-brand" name="filter-brand" />
<input name="size" type="hidden" id="filter-size" name="filter-size" />
<input name="industry" type="hidden" id="filter-industry" name="filter-industry" />
<div class="d-grid mt-5">
<button type="submit" class="btnsubmit">Submit</button>
</div>
</form>
<form action="" method="post" class="catalogForm">
<form action="" method="post" class="catalogForm">
@csrf
<label>Fields marked with an * are required</label>
<div class="form-floating mb-3">
<input type="text" class="form-control form-bord" id="emailInput" name="phone" placeholder="Phone" required="">
<input type="text" class="form-control form-bord" id="emailInput" name="phone" placeholder="Phone" required="">
<label for="messageInput">Phone *</label>
</div>
<div class="d-grid mt-5">
<button type="submit" class="btnsubmit">Submit</button>
</div>
</form>
<div id="link">
</div>
<div class="mb-1">
<h6 class=" text-muted">Brand</h6>
<?php foreach($brands as $val){ ?>
<a href="javascript:void(0)" ><span data-toggle="tooltip" title="<?= $val->brand ?>" data-placement="top" class="tag-box-brand"><?= $val->brand ?></span></a>
<?php foreach ($brands as $val) { ?>
<a onclick="filterBrand('<?= $val->id ?>')" href="javascript:void(0)"><span data-toggle="tooltip" title="<?php echo $val->brand ?>" data-placement="top" class="tag-box-brand"><?php echo $val->brand ?></span></a>
<?php } ?>
<input name="brand" type="hidden" id="filter-brand" />
</div>
<hr>
......@@ -74,22 +81,22 @@
<div class="mb-1">
<h6 class=" text-muted">Size/Range/Capacity</h6>
<div class="d-flex flex-wrap gap-2">
<?php foreach($size as $val){ ?>
<a href="javascript:void(0)" ><span data-toggle="tooltip" title="<?= $val->size ?>" data-placement="top" class="tag-box-size"><?= $val->size ?></span></a>
<?php foreach ($size as $val) { ?>
<a onclick="filterSize('<?= $val->id ?>')" href="javascript:void(0)"><span data-toggle="tooltip" title="<?php echo $val->size ?>" data-placement="top" class="tag-box-size"><?php echo $val->size ?></span></a>
<?php } ?>
</div>
</div>
<hr>
<div class="mb-1">
<h6 class=" text-muted">Industry</h6>
<div class="d-flex flex-wrap gap-2">
<?php foreach($industrys as $val){ ?>
<a href="javascript:void(0)" ><span data-toggle="tooltip" title="<?= $val->industry ?>" data-placement="top" class="tag-box-indus"><?= ucwords($val->industry) ?></span></a>
<?php foreach ($industrys as $val) { ?>
<a onclick="filterIndustry('<?= $val->id ?>')" href="javascript:void(0)"><span data-toggle="tooltip" title="<?php echo $val->industry ?>" data-placement="top" class="tag-box-indus"><?php echo ucwords($val->industry) ?></span></a>
<?php } ?>
</div>
</div>
......@@ -102,12 +109,146 @@
<script>
$('.catalogForm , .enquiryForm').hide();
function showForm(showid,hideid)
{
$('.'+showid).show();
$('.'+hideid).hide();
function showForm(showid, hideid) {
$('.' + showid).show();
$('.' + hideid).hide();
}
$(function() {
$(".enquiryForm").validate({
rules: {
name: {
required: true,
minlength: 3
},
email: {
required: true,
email: true
},
phone: {
required: true,
digits: true,
maxlength: 10,
minlength: 10
},
},
messages: {
name: {
required: "please enter name",
minlength: "name must be at least 3 characters"
},
email: {
required: "email is required",
email: "please enter a valid email address"
},
phone: {
required: "phone number is required",
digits: "only numbers are allowed",
minlength: "phone number must be 10 digits",
maxlength: "phone number must be 10 digits"
},
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
},
submitHandler: function(form) {
$.ajax({
url: '<?= route('submit-enquiry') ?>',
type: "POST",
data: $(form).serialize(),
dataType: "json",
beforeSend: function() {
$(form).find("button[type=submit]").prop("disabled", true);
$(form).find("button[type=submit]").text("Loading...");
},
success: function(response) {
alert("Enquiry Submiited.");
$('.enquiryForm')[0].reset();
$('.enquiryForm').hide();
},
error: function() {
alert("Server error. Please try again.");
},
complete: function() {
$(form).find("button[type=submit]").prop("disabled", false);
$(form).find("button[type=submit]").text("Submit");
}
});
return false;
}
});
$(".catalogForm").validate({
rules: {
phone: {
required: true,
digits: true,
maxlength: 10,
minlength: 10
},
},
messages: {
phone: {
required: "phone number is required",
digits: "only numbers are allowed",
minlength: "phone number must be 10 digits",
maxlength: "phone number must be 10 digits"
},
},
errorElement: "span",
errorPlacement: function(error, element) {
error.addClass("text-danger");
error.insertAfter(element);
},
submitHandler: function(form) {
$.ajax({
url: '<?= route('download-catalog') ?>',
type: "POST",
data: $(form).serialize(),
dataType: "json",
beforeSend: function() {
$(form).find("button[type=submit]").prop("disabled", true);
$(form).find("button[type=submit]").text("Loading...");
},
success: function(response) {
// var row = JSON.parse(response);
if(response.status == 1)
{
$('#link').html(response.link);
$('.catalogForm').hide();
$('.catalogForm')[0].reset();
}
},
error: function() {
alert("Server error. Please try again.");
},
complete: function() {
$(form).find("button[type=submit]").prop("disabled", false);
$(form).find("button[type=submit]").text("Submit");
}
});
return false;
}
});
});
function filterIndustry(id)
{
$('#filter-industry').val(id);
}
function filterSize(id)
{
$('#filter-size').val(id);
}
function filterBrand(id)
{
$('#filter-brand').val(id);
}
</script>
@endsection
\ No newline at end of file
......@@ -27,6 +27,7 @@
} ?>
</div>
<input name="category" type="hidden" id="filter-category" />
<input name="category_slug" type="hidden" id="category_slug" value="<?= request('prodcat') ?>" />
</div>
</div>
......@@ -120,6 +121,8 @@ function loadProducts(reset = false) {
var industry = $('#filter-industry').val();
var category = $('#filter-category').val();
var brand = $('#filter-brand').val();
var category_slug = $('#category_slug').val();
$.ajax({
url: '<?php echo route('getProducts') ?>',
type: 'GET',
......@@ -129,6 +132,7 @@ function loadProducts(reset = false) {
industry: industry,
category: category,
brand: brand,
category_slug:category_slug
},
success: function(data) {
......
......@@ -28,9 +28,12 @@
Route::get('about-us', [FrontendController::class, 'about'])->name('about-us');
Route::get('career', [FrontendController::class, 'career'])->name('career');
Route::get('product', [FrontendController::class, 'products'])->name('product');
Route::get('sendSms', [FrontendController::class, 'sendSms'])->name('sendSms');
Route::get('products/{name?}', [FrontendController::class, 'getProduct'])->name('products');
Route::get('download/{token?}', [FrontendController::class, 'download'])->name('download');
Route::match(['get','post'],'getProducts', [FrontendController::class, 'getAjaxProducts'])->name('getProducts');
Route::post('submit-enquiry', [FrontendController::class, 'submitEnquiry'])->name('submit-enquiry');
Route::post('download-catalog', [FrontendController::class, 'downloadCatalog'])->name('download-catalog');
Route::get('/request-waiting/{token}', [FrontendController::class, 'requestWaiting'])
->name('request.waiting');
......
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