new commit

This commit is contained in:
meghamalore
2024-04-25 10:51:37 +05:30
parent 0b5fc1a6cd
commit 435126502c
9 changed files with 281 additions and 247 deletions

View File

@@ -197,7 +197,8 @@ class DashboardController extends Controller
$totalProductCount = Product::count();
$leads = Lead::with('leadSource')->where('lead_owner', auth()->user()->id)->get();
$tasks = LeadTasksMeeting::where('owner', auth()->user()->id)->tasks()->get();
$meetings = LeadTasksMeeting::where('host', auth()->user()->id)->meetings()->get();
$meetings = LeadTasksMeeting::where('host', (string)auth()->user()->id)->meetings()->get();
// dd($meetings);
$users = User::admins()->get();
return view('Admin.personal-dashboard', compact('companyCount', 'a', 'leads', 'tasks', 'meetings','users','userCount','investingUserCount','totalProductCount'));
}

View File

@@ -44,7 +44,8 @@ class StoreMeetingRequest extends FormRequest
public function validated(){
return array_merge(parent::validated(), [
'status' => $this->status ? '1' : '0',
'created_by' => auth()->user()->id
'created_by' => auth()->user()->id,
'Type' => 'Meeting',
]);
}
}

View File

@@ -46,22 +46,22 @@ class ImportMontlyUpdateAlternativeInvestmentFund implements ToCollection, With
foreach ($rows as $row) {
MonthlyUpdateAlternativeInvestmentFund::create([
'custom_id' => $row['custom_id'],
'commitment_amount' => $row['commitment_amount'],
'contribution_amount' => $row['contribution_amount'],
'contribution_called_amount' => $row['contribution_called_amount'],
'contribution_uncalled_amount' => $row['contribution_uncalled_amount'],
'date_of_initial_contribution' => $row['date_of_initial_contribution'],
'face_value_nav_per_unit' => $row['face_valuenav_per_unit'],
'principal_capital_repaid' => $row['principal_capital_repaid'],
'gross_income' => $row['gross_income'],
'total_fees_paid' => $row['total_fees_paid_set_up_management_operating'],
'net_income' => $row['net_income'],
'no_of_units_alloted' => $row['no_of_units_alloted'],
'no_of_units_redeemed' => $row['no_of_units_redeemed'],
'current_valuation' => $row['current_valuation'],
'current_nav' => $row['current_nav'],
'no_of_units_held' => $row['no_of_units_held'],
'custom_id' => $row['custom_id'] ?? null,
'commitment_amount' => $row['commitment_amount'] ?? 0,
'contribution_amount' => $row['contribution_amount'] ?? 0,
'contribution_called_amount' => $row['contribution_called_amount'] ?? 0,
'contribution_uncalled_amount' => $row['contribution_uncalled_amount'] ?? 0,
'date_of_initial_contribution' => $row['date_of_initial_contribution'] ?? 0,
'face_value_nav_per_unit' => $row['face_valuenav_per_unit'] ?? 0,
'principal_capital_repaid' => $row['principal_capital_repaid'] ?? 0,
'gross_income' => $row['gross_income'] ?? 0,
'total_fees_paid' => $row['total_fees_paid_set_up_management_operating'] ?? 0,
'net_income' => $row['net_income'] ?? 0,
'no_of_units_alloted' => $row['no_of_units_alloted'] ?? 0,
'no_of_units_redeemed' => $row['no_of_units_redeemed'] ?? 0,
'current_valuation' => $row['current_valuation'] ?? 0,
'current_nav' => $row['current_nav'] ?? 0,
'no_of_units_held' => $row['no_of_units_held'] ?? 0,
]);
}
}

View File

@@ -50,17 +50,17 @@ class ImportMontlyUpdateIndianFinancialAssets implements ToCollection, WithHeadi
foreach ($rows as $row) {
MonthlyUpdateIndianFinancialAssets::create([
'custom_id' => $row['custom_id'],
'investment_date' => $row['investment_date'],
'amount_invested' => $row['amount_invested'],
'total_gross_repaid_amount' => $row['total_gross_repaid_amount'],
'tenure_in_days' => $row['tenure_days'],
'principal_payment_frequency' => $row['principal_payment_frequency'],
'interest_payment_frequency' => $row['interest_payment_frequency'],
'next_repayment_due_date' => $row['next_repayment_due_date'],
'maturity_date' => $row['maturity_date'],
'next_repayment_amount' => $row['next_repayment_amount'],
'expected_irr' => $row['expected_irr'],
'custom_id' => $row['custom_id'] ?? null,
'investment_date' => $row['investment_date'] ?? null,
'amount_invested' => $row['amount_invested'] ?? null,
'total_gross_repaid_amount' => $row['total_gross_repaid_amount'] ?? null,
'tenure_in_days' => $row['tenure_days'] ?? null,
'principal_payment_frequency' => $row['principal_payment_frequency'] ?? null,
'interest_payment_frequency' => $row['interest_payment_frequency'] ?? null,
'next_repayment_due_date' => $row['next_repayment_due_date'] ?? null,
'maturity_date' => $row['maturity_date'] ?? null,
'next_repayment_amount' => $row['next_repayment_amount'] ?? null,
'expected_irr' => $row['expected_irr'] ?? null,
]);
}
}

View File

@@ -45,7 +45,7 @@ function imagePath($path = null)
$finalPath = "https://staging.jerichoalternatives.in/";
}
if (env('APP_ENV') == 'local') {
$finalPath = "http://localhost/jericho_28_march/";
$finalPath = "http://localhost/freeu/my-freeu/";
}
return $finalPath . $path;
}

View File

@@ -1,37 +1,49 @@
@extends('Admin.layouts.master')
@section('style')
<style>
.active {
color: blue !important
}
</style>
<style>
.active {
color: blue !important
}
</style>
@endsection
@section('title','Manage Chats')
@section('title', 'Manage Chats')
@section('content')
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
<div class="d-flex flex-column flex-column-fluid">
<div id="kt_app_content_container" class="app-container container-xxl">
<div class="row max-w-100">
<div class="col-md-3 p-0 users_list" style="height:45rem;overflow:auto">
<div class="card">
<div class="card-header pt-5" id="kt_chat_contacts_header">
<form class="w-100 position-relative" autocomplete="off">
<span class="svg-icon svg-icon-2 svg-icon-lg-1 svg-icon-gray-500 position-absolute top-50 ms-5 translate-middle-y" style="margin-top:-5px;">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2" rx="1" transform="rotate(45 17.0365 15.1223)" fill="currentColor" />
<path d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z" fill="currentColor" />
</svg>
</span>
<input type="text" class="form-control form-control-solid px-15" name="search" value="" oninput="searchData(this.value)" id="search" placeholder="Search" />
</form>
</div>
<div class="card-body pt-5" id="kt_chat_contacts_body">
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto user_Detail" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_header, #kt_toolbar, #kt_footer, #kt_chat_contacts_header" data-kt-scroll-wrappers="#kt_content, #kt_chat_contacts_body" data-kt-scroll-offset="5px">
{{--@foreach($users as $user)
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
<div class="d-flex flex-column flex-column-fluid">
<div id="kt_app_content_container" class="app-container container-xxl">
<div class="row max-w-100">
<div class="col-md-3 p-0 users_list" style="height:45rem;overflow:auto">
<div class="card">
<div class="card-header pt-5" id="kt_chat_contacts_header">
<form class="w-100 position-relative" autocomplete="off">
<span
class="svg-icon svg-icon-2 svg-icon-lg-1 svg-icon-gray-500 position-absolute top-50 ms-5 translate-middle-y"
style="margin-top:-5px;">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2"
rx="1" transform="rotate(45 17.0365 15.1223)" fill="currentColor" />
<path
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
fill="currentColor" />
</svg>
</span>
<input type="text" class="form-control form-control-solid px-15" name="search"
value="" oninput="searchData(this.value)" id="search"
placeholder="Search" />
</form>
</div>
<div class="card-body pt-5" id="kt_chat_contacts_body">
<div class="scroll-y me-n5 pe-5 h-200px h-lg-auto user_Detail" data-kt-scroll="true"
data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto"
data-kt-scroll-dependencies="#kt_header, #kt_toolbar, #kt_footer, #kt_chat_contacts_header"
data-kt-scroll-wrappers="#kt_content, #kt_chat_contacts_body"
data-kt-scroll-offset="5px">
{{-- @foreach ($users as $user)
<div class="d-flex flex-stack py-4">
<div class="d-flex align-items-center">
<div class="symbol symbol-45px symbol-circle">
@if($user->profile_image)
@if ($user->profile_image)
<?php
$img = 'public/uploads/profile/img/' . $user->getAttributes()['profile_image'];
?>
@@ -39,7 +51,7 @@
@php($img ='https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png')
@endif
<img alt="Pic" src="{{$img}}" />
@if($user->total_count)
@if ($user->total_count)
<span class="symbol-badge badge badge-sm badge-circle badge-white badge-outline bg-danger start-100">{{$user->total_count}}</span>
@endif
</div>
@@ -49,193 +61,196 @@
</div>
</div>
</div>
@endforeach--}}
@endforeach --}}
</div>
</div>
</div>
</div>
<div class="col-md-6 p-0 chat_screen">
<div class="card w-100 rounded-0 border-0" id="kt_drawer_chat_messenger"
style="height:45rem;overflow:auto">
<div class="chat-msgs">
</div>
<div class="card-footer d-flex align-items-center me-2 p-0 d-none"
id="kt_drawer_chat_messenger_footer">
<textarea class="form-control form-control-flush resize-none" rows="1" data-kt-element="input" name="message"
id="message" placeholder="Type a message"></textarea>
<input type="hidden" name="user_id" id="user_id">
<div class="btn" data-kt-element="send"><i class="fa-solid fa-paper-plane" title="send"
onclick="sendMsg()"></i></div>
</div>
</div>
</div>
<div class="col-md-3 p-0 active_user_details show-user">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 p-0 chat_screen">
<div class="card w-100 rounded-0 border-0" id="kt_drawer_chat_messenger" style="height:45rem;overflow:auto">
<div class="chat-msgs">
</div>
<div class="card-footer d-flex align-items-center me-2 p-0 d-none" id="kt_drawer_chat_messenger_footer">
<textarea class="form-control form-control-flush resize-none" rows="1" data-kt-element="input" name="message" id="message" placeholder="Type a message"></textarea>
<input type="hidden" name="user_id" id="user_id">
<div class="btn" data-kt-element="send"><i class="fa-solid fa-paper-plane" title="send" onclick="sendMsg()"></i></div>
</div>
</div>
</div>
<div class="col-md-3 p-0 active_user_details show-user">
</div>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
<script>
$(function() {
userList();
})
setInterval(function() {
if ($('#user_id').val()) {
// $(`#user_${$('#user_id').val()}`).addClass('active');
getUser($('#user_id').val());
// $('.spanName').each(function() {
// $(this).removeClass('active');
// })
}
}, 4000);
setInterval(function() {
userList();
}, 5000)
function searchData(search) {
$.ajax({
url: "{{route('search-user-data')}}",
type: "GET",
data: {
search: search
},
success: function(result) {
if (result) {
$('.user_Detail').html('').append(result);
} else {
$('.user_Detail').html('').append("No data found");
}
}
});
}
// sending message on click on enter
$('#message').keyup(function(event) {
if (event.keyCode === 13) {
sendMsg();
}
});
function sendMsg() {
let msg = $('#message').val();
let user_id = $('#user_id').val();
// alert(user_id);
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
cache: false,
url: "{{route('send-admin-msg')}}",
type: "POST",
data: {
message: msg,
user_id: user_id
},
dataType: "json",
success: function(result) {
if (result.status == 200) {
getUser($('#user_id').val());
$('#message').val('')
}
if (result.status == 400) {
toastr.warning(result.message);
}
},
});
}
function getUser(id) {
$('.spanName').each(function() {
$(this).removeClass('active');
<script>
$(function() {
userList();
})
$(`#user_${id}`).addClass('active');
$('#user_id').val(id);
setInterval(function() {
if ($('#user_id').val()) {
// $(`#user_${$('#user_id').val()}`).addClass('active');
getUser($('#user_id').val());
// $('.spanName').each(function() {
// $(this).removeClass('active');
// })
}
}, 4000);
setInterval(function() {
userList();
}, 5000)
$.ajax({
url: "{{route('get-user-for-chat')}}",
type: "GET",
data: {
id: id,
},
success: function(result) {
$('.show-user').html('');
$('.chat-msgs').html('');
$('.show-user').append(result.user);
$('.chat-msgs').append(result.chat);
$('#kt_drawer_chat_messenger_footer').removeClass('d-none');
if (result.status == 400) {
toastr.warning(result.message);
function searchData(search) {
// alert(search)
$.ajax({
url: "{{ route('search-user-data') }}",
type: "GET",
data: {
search: search
},
success: function(result) {
if (result) {
$('.user_Detail').html('').append(result);
} else {
$('.user_Detail').html('').append("No data found");
}
}
},
});
}
function userList() {
let search = $('#search').val();
if (search) {
return;
});
}
$.ajax({
url: "{{route('get-user-list')}}",
type: "GET",
// dataType : 'json',
success: function(result) {
if (result) {
$('.user_Detail').html('').append(result);
}
},
});
}
</script>
@endsection
// sending message on click on enter
$('#message').keyup(function(event) {
if (event.keyCode === 13) {
sendMsg();
}
});
function sendMsg() {
let msg = $('#message').val();
let user_id = $('#user_id').val();
// alert(user_id);
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
cache: false,
url: "{{ route('send-admin-msg') }}",
type: "POST",
data: {
message: msg,
user_id: user_id
},
dataType: "json",
success: function(result) {
if (result.status == 200) {
getUser($('#user_id').val());
$('#message').val('')
}
if (result.status == 400) {
toastr.warning(result.message);
}
},
});
}
function getUser(id) {
$('.spanName').each(function() {
$(this).removeClass('active');
})
$(`#user_${id}`).addClass('active');
$('#user_id').val(id);
$.ajax({
url: "{{ route('get-user-for-chat') }}",
type: "GET",
data: {
id: id,
},
success: function(result) {
$('.show-user').html('');
$('.chat-msgs').html('');
$('.show-user').append(result.user);
$('.chat-msgs').append(result.chat);
$('#kt_drawer_chat_messenger_footer').removeClass('d-none');
if (result.status == 400) {
toastr.warning(result.message);
}
},
});
}
function userList() {
let search = $('#search').val();
if (search) {
return;
}
$.ajax({
url: "{{ route('get-user-list') }}",
type: "GET",
// dataType : 'json',
success: function(result) {
if (result) {
$('.user_Detail').html('').append(result);
}
},
});
}
</script>
@endsection

View File

@@ -24,10 +24,10 @@
<div class="card p-10">
<div class="fv-row mb-7">
<label class="required fs-6 fw-semibold mb-2">User</label>
<select class="form-select form-select-solid user_name" data-control="select2" name="user_name" data-hide-search="true" data-placeholder="Select A Page">
<select class="form-select form-select-solid user_name" data-control="select2" name="user_name" data-hide-search="true" data-placeholder="Select A User">
<option value="">Select User</option>
@foreach( $users as $userdata)
<option value="{{$userdata->id}}">{{$userdata->name}}</option>
@endforeach
</select>
</div>
@@ -37,7 +37,8 @@
<div class="card p-10">
<div class="fv-row mb-7">
<label class="required fs-6 fw-semibold mb-2">Partner</label>
<select class="form-select form-select-solid partner_name" data-control="select2" name="partner_name" data-hide-search="true" data-placeholder="Select A Page">
<select class="form-select form-select-solid partner_name" data-control="select2" name="partner_name" data-hide-search="true" data-placeholder="Select A Partner">
<option value="">Select Partner</option>
@foreach($company as $companydata)
<option value="{{$companydata->id}}">{{$companydata->company_name}}</option>
@endforeach
@@ -171,8 +172,8 @@
},
messages: {
user_name: "Please enter your name",
partner_name: "Please enter your designation/company name",
user_name: "Please select user",
partner_name: "Please select partner",
login: "This field is required",
password: "This field is required",

View File

@@ -204,7 +204,7 @@
<span>Date of Initial Contribution</span>
</label>
<!--begin::Input-->
<input type="text" class="form-control form-control-solid" name="date_of_initial_contribution" />
<input type="date" class="form-control form-control-solid" name="date_of_initial_contribution" />
</div>
<div class="form-box mb-5">
<label class="fs-6 fw-semibold form-label mt-3">
@@ -1143,7 +1143,7 @@
$.validator.addMethod(
"panCorrect",
function(value) {
return /[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(
return /^[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(
value
);
},
@@ -1797,6 +1797,10 @@
},
})
$.validator.addMethod("validDate", function(value, element) {
// Regular expression for date validation (YYYY-MM-DD format)
return /^(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value);
}, "Please enter a valid date (YYYY-MM-DD)");
$('#AlternativeInvestmentFund').validate({
ignore: [],
@@ -1852,7 +1856,7 @@
},
date_of_initial_contribution: {
required: true,
digits: true,
validDate: true
},
principal_capital_repaid: {
required: true,
@@ -1923,8 +1927,7 @@
digits: 'Please enter digits',
},
date_of_initial_contribution: {
required: 'Please select date of initial contribution',
digits: 'Please enter digits',
required: 'Please select date of initial contribution'
},
principal_capital_repaid: {
required: 'Please enter principal capital repaid',

View File

@@ -80,7 +80,7 @@
<div class="col-md-6 fv-row">
<label class=" fs-6 fw-semibold mb-2">Email</label>
<!--pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"-->
<input type="email" class="form-control form-control-solid" placeholder="Enter Email" name="email" pattern="@(gmail|yahoo)\.com$" />
<input type="email" class="form-control form-control-solid" placeholder="Enter Email" name="email" id="email"/>
</div>
<div class="col-md-6 fv-row">
<label class=" fs-6 fw-semibold mb-2">Phone</label>
@@ -238,13 +238,22 @@
$(this).valid();
}
});
$.validator.addMethod("customEmail", function(value, element) {
// Regular expression for email validation
return /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/.test(value);
}, "Please enter a valid email address");
$("#add-lead-form").validate({
ignore: [],
debug: false,
rules: {
lead_owner: 'required',
users_id : 'required',
products_id : 'required'
products_id : 'required',
email: {
required: true,
customEmail: true,
},
},
messages: {
lead_owner: {
@@ -256,6 +265,10 @@
products_id: {
required: "Please select product",
},
email: {
required: "Please enter email",
email: 'Please enter a valid email address',
},
},
submitHandler: function(form) {
var formData = new FormData(form);