Merge pull request #29 from Ritikeshyadav/adarshFreeu

Adarsh freeu
This commit is contained in:
kadarshdeveloper
2024-04-05 20:14:03 +05:30
committed by GitHub
3 changed files with 215 additions and 110 deletions

View File

@@ -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;
} */

View File

@@ -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 +

View File

@@ -1,6 +1,21 @@
@extends('Frontend.layouts.master')
<style>
.investment-strategy .investmentstrategy {
background: #e8c69f;
border: navajowhite;
padding: 7px 20px;
border-radius: 5px;
color: #000;
font-size: 18px;
line-height: 1.2;
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
font-family: "Cambria";
}
</style>
@section('content')
<div class="{{ auth()->guard('users')->user() == false ? '' : 'd-none' }}">
<div class="main-banner">
@@ -381,8 +396,7 @@
@endif
<img src="{{ asset(getCategoryIcons($pick->categories_id)) }}">
{{-- <p>{{ $pick->product_name }}</p> --}}
<p>{{ Str::limit($pick->product_name, 50) }}</p>
<p>{{ $pick->product_name }}-{{ $pick->categories_id }}</p>
</div>
<div class="middle-sec p-0">
<p class="cate">Category: {{ $pick->category_name }}</p>
@@ -502,12 +516,13 @@
<br> Opportunities</button>
</div>
</div>
<div class="investment-strategy">
<p class="sub-heading">Investment Strategy</p>
<div class="d-flex gap-3 btn-group investment-strategy-btns">
<button class="active inactive parent-filter" id="growth">Growth</button>
<button class="inactive parent-filter" id="income">Annuity</button>
<button class="inactive parent-filter" id="hybrid">Hybrid</button>
<button class="inactive parent-filter investmentstrategy" id="growth">Growth</button>
<button class="inactive parent-filter investmentstrategy" id="income">Annuity</button>
<button class="inactive parent-filter investmentstrategy" id="hybrid">Hybrid</button>
</div>
</div>
</div>
@@ -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');
}