diff --git a/public/assets/css/style.css b/public/assets/css/style.css index b1a4449..acdf462 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -1097,6 +1097,8 @@ kt-app-layout=dark-sidebar] .app-sidebar .menu .menu-item .menu-link .menu-icon display: flex; } + + /* table.dataTable tbody td { text-align: center; } */ diff --git a/resources/views/Frontend/Pages/handpicked-investment.blade.php b/resources/views/Frontend/Pages/handpicked-investment.blade.php index 80cbf95..0a3fa61 100644 --- a/resources/views/Frontend/Pages/handpicked-investment.blade.php +++ b/resources/views/Frontend/Pages/handpicked-investment.blade.php @@ -146,7 +146,7 @@ function fetch_data(page, query, categories, assetType, geographicFocus) { $.ajax({ type: 'get', - url: "/primary-investment/fetch_data?page=" + + url: "http://localhost/my-freeu/primary-investment/fetch_data?page=" + page + "&query=" + query + "&categories=" + categories + "&assetType=" + assetType + diff --git a/resources/views/Frontend/Pages/index.blade.php b/resources/views/Frontend/Pages/index.blade.php index e4018f0..fc82849 100644 --- a/resources/views/Frontend/Pages/index.blade.php +++ b/resources/views/Frontend/Pages/index.blade.php @@ -1,6 +1,21 @@ @extends('Frontend.layouts.master') - + @section('content')
@@ -381,8 +396,7 @@ @endif - {{--

{{ $pick->product_name }}

--}} -

{{ Str::limit($pick->product_name, 50) }}

+

{{ $pick->product_name }}-{{ $pick->categories_id }}

Category: {{ $pick->category_name }}

@@ -502,12 +516,13 @@
Opportunities
+

Investment Strategy

- - - + + +
@@ -1176,7 +1191,7 @@ submitHandler: function(form) { var formData = new FormData(form); $.ajax({ - url: "http://localhost/jericho_28_march/check-risk-disclosure", + url: "/check-risk-disclosure", type: 'post', data: formData, dataType: 'json', @@ -1196,15 +1211,32 @@ } }); + // $(function() { + // $(`.india-financial-assets,.global-financial-assets, .india-real-estate, .global-real-estate `) + // .addClass('d-none'); + // $(`.india-financial-assets-managed-funds-growth`).removeClass('d-none'); + // $('#asset_type_input').val('financial-assets') + // $('#geographic_focus_input').val('india') + // $('#investment_type_input').val('managed-funds') + // $('#investment_strategy_input').val('growth') + // }) + $(function() { - $(`.india-financial-assets,.global-financial-assets, .india-real-estate, .global-real-estate `) - .addClass('d-none'); - $(`.india-financial-assets-managed-funds-growth`).removeClass('d-none'); - $('#asset_type_input').val('financial-assets') - $('#geographic_focus_input').val('india') + // Set initial values + $('#asset_type_input').val('financial-assets'); + $('#geographic_focus_input').val('india'); $('#investment_type_input').val('managed-funds') - $('#investment_strategy_input').val('growth') - }) + + // Hide all elements initially + $('.india-financial-assets, .global-financial-assets, .india-real-estate, .global-real-estate') + .addClass('d-none'); + + // Show only relevant elements + $('.india-financial-assets').removeClass('d-none'); + $('#financial-assets').addClass('active'); + $('#india').addClass('active'); + + }); $('.parent-filter').click(function() { let id = this.id; @@ -1235,8 +1267,14 @@ } if (id == 'growth' || id == 'income' || id == 'hybrid') { + var button = $(this); + // Check if the button is active or inactive + var isActive = button.hasClass('active'); + // Toggle active/inactive state + toggleActive(button); + $('#investment_strategy_input').val(id) - investmentStrategyFilter(id) + investmentStrategyFilter(id, !isActive) } }) @@ -1473,111 +1511,176 @@ }; } - function investmentStrategyFilter(type) { + function investmentStrategyFilter(type, isActive) { if (type == null) { return; } - $(`#growth , #income, #hybrid`).removeClass('active'); - $(`#${type}`).addClass('active'); - let assetType = $('#asset_type_input').val(); - let geography = $('#geographic_focus_input').val(); - let investmentType = $('#investment_type_input').val(); - if (type == 'growth') { - // $('.india-real-estate, .global-real-estate').addClass('d-none'); - hideRealAssets(); - $('.india-hybrid, .global-hybrid, .india-income, .global-income').addClass('d-none') - $('.india-growth, .global-growth').removeClass('d-none') - if (geography) { - $('.india-growth, .global-growth').addClass('d-none') - $(`.${geography}-growth`).removeClass('d-none') - } - if (assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); - } - if (investmentType) { - $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') - .addClass('d-none'); - $(`.${investmentType}-growth`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').addClass('d-none'); - $(`.${geography}-financial-assets`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets' && investmentType) { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); - $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) - .addClass('d-none'); - $(`.${geography}-financial-assets-${investmentType}-growth`).removeClass('d-none'); - } - } - if (type == 'income') { - // $('.india-real-estate, .global-real-estate').addClass('d-none'); - hideRealAssets(); - $('.india-growth, .global-growth, .india-hybrid, .global-hybrid').addClass('d-none') - $('.india-income, .global-income').removeClass('d-none'); - if (geography) { - $('.india-income, .global-income').addClass('d-none'); - $(`.${geography}-income`).removeClass('d-none') - } - if (assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); - } - // if(investmentType){ - // $('.india-managed-funds, .india-direct-investment-opportunities, .global-managed-funds, .global-direct-investment-opportunities').addClass('d-none'); - // $(`.india-${investmentType}, .global-${investmentType}`).removeClass('d-none'); - // } - if (investmentType) { - $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') - .addClass('d-none'); - $(`.${investmentType}-income`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').addClass('d-none'); - $(`.${geography}-financial-assets`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets' && investmentType) { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); - $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) - .addClass('d-none'); - $(`.${geography}-financial-assets-${investmentType}-income`).removeClass('d-none'); - } - } + // Check if the buttons in asset-type-btns and geographic-btns are active + var isAssetActive = $('.asset-type-btns button.active').length > 0; + var isGeographicActive = $('.geographic-btns button.active').length > 0; + var activeAssetId = $('.asset-type-btns button.active').attr('id'); + var activeGeographicId = $('.geographic-btns button.active').attr('id'); - if (type == 'hybrid') { - // $('.india-real-estate, .global-real-estate').addClass('d-none'); - hideRealAssets(); - $('.india-growth, .global-growth, .india-income, .global-income').addClass('d-none') - $('.india-hybrid, .global-hybrid').removeClass('d-none'); - if (geography) { - $('.india-hybrid, .global-hybrid').addClass('d-none'); - $(`.${geography}-hybrid`).removeClass('d-none') + + // alert(isActive); + if (isActive) { + $(`#growth , #income, #hybrid`).removeClass('active'); + $(`#${type}`).addClass('active'); + let assetType = $('#asset_type_input').val(); + let geography = $('#geographic_focus_input').val(); + let investmentType = $('#investment_type_input').val(); + if (type == 'growth') { + // $('.india-real-estate, .global-real-estate').addClass('d-none'); + hideRealAssets(); + $('.india-hybrid, .global-hybrid, .india-income, .global-income').addClass('d-none') + $('.india-growth, .global-growth').removeClass('d-none') + if (geography) { + $('.india-growth, .global-growth').addClass('d-none') + $(`.${geography}-growth`).removeClass('d-none') + } + if (assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + } + if (investmentType) { + $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') + .addClass('d-none'); + $(`.${investmentType}-growth`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').addClass('d-none'); + $(`.${geography}-financial-assets`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets' && investmentType) { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) + .addClass('d-none'); + $(`.${geography}-financial-assets-${investmentType}-growth`).removeClass('d-none'); + } } - if (assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + + if (type == 'income') { + // $('.india-real-estate, .global-real-estate').addClass('d-none'); + hideRealAssets(); + $('.india-growth, .global-growth, .india-hybrid, .global-hybrid').addClass('d-none') + $('.india-income, .global-income').removeClass('d-none'); + if (geography) { + $('.india-income, .global-income').addClass('d-none'); + $(`.${geography}-income`).removeClass('d-none') + } + if (assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + } + // if(investmentType){ + // $('.india-managed-funds, .india-direct-investment-opportunities, .global-managed-funds, .global-direct-investment-opportunities').addClass('d-none'); + // $(`.india-${investmentType}, .global-${investmentType}`).removeClass('d-none'); + // } + if (investmentType) { + $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') + .addClass('d-none'); + $(`.${investmentType}-income`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').addClass('d-none'); + $(`.${geography}-financial-assets`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets' && investmentType) { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) + .addClass('d-none'); + $(`.${geography}-financial-assets-${investmentType}-income`).removeClass('d-none'); + } + } - // if(investmentType){ - // $('.india-managed-funds, .india-direct-investment-opportunities, .global-managed-funds, .global-direct-investment-opportunities').addClass('d-none'); - // $(`.india-${investmentType}, .global-${investmentType}`).removeClass('d-none'); - // } - if (investmentType) { - $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') - .addClass('d-none'); - $(`.${investmentType}-hybrid`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets') { - $('.india-financial-assets, .global-financial-assets').addClass('d-none'); - $(`.${geography}-financial-assets`).removeClass('d-none'); - } - if (geography && assetType == 'financial-assets' && investmentType) { - $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); - $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) - .addClass('d-none'); - $(`.${geography}-financial-assets-${investmentType}-hybrid`).removeClass('d-none'); + + if (type == 'hybrid') { + // $('.india-real-estate, .global-real-estate').addClass('d-none'); + hideRealAssets(); + $('.india-growth, .global-growth, .india-income, .global-income').addClass('d-none') + $('.india-hybrid, .global-hybrid').removeClass('d-none'); + if (geography) { + $('.india-hybrid, .global-hybrid').addClass('d-none'); + $(`.${geography}-hybrid`).removeClass('d-none') + } + if (assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + } + // if(investmentType){ + // $('.india-managed-funds, .india-direct-investment-opportunities, .global-managed-funds, .global-direct-investment-opportunities').addClass('d-none'); + // $(`.india-${investmentType}, .global-${investmentType}`).removeClass('d-none'); + // } + if (investmentType) { + $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') + .addClass('d-none'); + $(`.${investmentType}-hybrid`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').addClass('d-none'); + $(`.${geography}-financial-assets`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets' && investmentType) { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) + .addClass('d-none'); + $(`.${geography}-financial-assets-${investmentType}-hybrid`).removeClass('d-none'); + } } + } else { + + $('#asset_type_input').val(activeAssetId); + $('#geographic_focus_input').val(activeGeographicId); + $('#investment_type_input').val('managed-funds') + + // Hide all elements initially + $('.india-financial-assets, .global-financial-assets, .india-real-estate, .global-real-estate') + .addClass('d-none'); + + // Show only relevant elements + $('.india-financial-assets').removeClass('d-none'); + $('#financial-assets').addClass('active'); + $('#india').addClass('active'); + } } + function toggleActive(button) { + button.toggleClass('active').toggleClass('inactive'); + } + + if (type == 'hybrid') { + // $('.india-real-estate, .global-real-estate').addClass('d-none'); + hideRealAssets(); + $('.india-growth, .global-growth, .india-income, .global-income').addClass('d-none') + $('.india-hybrid, .global-hybrid').removeClass('d-none'); + if (geography) { + $('.india-hybrid, .global-hybrid').addClass('d-none'); + $(`.${geography}-hybrid`).removeClass('d-none') + } + if (assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + } + // if(investmentType){ + // $('.india-managed-funds, .india-direct-investment-opportunities, .global-managed-funds, .global-direct-investment-opportunities').addClass('d-none'); + // $(`.india-${investmentType}, .global-${investmentType}`).removeClass('d-none'); + // } + if (investmentType) { + $('.managed-funds-growth, .direct-investment-opportunities-growth, .direct-investment-opportunities-hybrid, .managed-funds-income, .managed-funds-hybrid, .direct-investment-opportunities-income') + .addClass('d-none'); + $(`.${investmentType}-hybrid`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets') { + $('.india-financial-assets, .global-financial-assets').addClass('d-none'); + $(`.${geography}-financial-assets`).removeClass('d-none'); + } + if (geography && assetType == 'financial-assets' && investmentType) { + $('.india-financial-assets, .global-financial-assets').removeClass('d-none'); + $(`.india-financial-assets-managed-funds, .global-financial-assets-managed-funds, .india-financial-assets-direct-investment-opportunities, .global-financial-assets-direct-investment-opportunities`) + .addClass('d-none'); + $(`.${geography}-financial-assets-${investmentType}-hybrid`).removeClass('d-none'); + } + } + + function hideRealAssets() { $('.india-real-estate, .global-real-estate').addClass('d-none'); }