Files
freeu-project/resources/views/Admin/Pages/manage_users/manage_user.blade.php
2024-03-28 15:47:38 +05:30

683 lines
37 KiB
PHP

@extends('Admin.layouts.master')
@section('content')
<!--begin::Wrapper-->
<!--<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">-->
<!--begin::Main-->
<!--<div class="app-main flex-column flex-row-fluid" id="kt_app_main">-->
<!--begin::Content wrapper-->
<div class="d-flex flex-column flex-column-fluid">
<!--begin::Toolbar-->
<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
<!--begin::Toolbar container-->
<div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
<!--begin::Page title-->
<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
<!--begin::Title-->
<h1
class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">
Manage Users</h1>
<!--end::Title-->
</div>
<!--end::Page title-->
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
<!--begin::Filter menu-->
<div class="m-0">
<!--begin::Menu toggle-->
<a href="#"
class="btn btn-sm btn-flex bg-body btn-color-gray-700 btn-active-color-primary fw-bold"
data-kt-menu-trigger="click" data-kt-menu-placement="bottom-end">
<!--begin::Svg Icon | path: icons/duotune/general/gen031.svg-->
<span class="svg-icon svg-icon-6 svg-icon-muted me-1">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M19.0759 3H4.72777C3.95892 3 3.47768 3.83148 3.86067 4.49814L8.56967 12.6949C9.17923 13.7559 9.5 14.9582 9.5 16.1819V19.5072C9.5 20.2189 10.2223 20.7028 10.8805 20.432L13.8805 19.1977C14.2553 19.0435 14.5 18.6783 14.5 18.273V13.8372C14.5 12.8089 14.8171 11.8056 15.408 10.964L19.8943 4.57465C20.3596 3.912 19.8856 3 19.0759 3Z"
fill="currentColor" />
</svg>
</span>
<!--end::Svg Icon-->Filter
</a>
<!--end::Menu toggle-->
<!--begin::Menu 1-->
<!--begin::Menu 1-->
<div class="menu menu-sub menu-sub-dropdown w-250px w-md-300px"
data-kt-menu="true" id="kt_menu_62cfa3a253c5c">
<!--begin::Header-->
<div class="px-7 py-5">
<div class="fs-5 text-dark fw-bold">Filter Options</div>
</div>
<!--end::Header-->
<!--begin::Menu separator-->
<div class="separator border-gray-200"></div>
<!--end::Menu separator-->
<!--begin::Form-->
<div class="px-7 py-5">
<!--begin::Input group-->
<div class="mb-10">
<!--begin::Label-->
<label class="form-label fw-semibold">Status:</label>
<!--end::Label-->
<!--begin::Input-->
<div>
<select class="form-select form-select-solid"
data-kt-select2="true" data-placeholder="Select option"
data-dropdown-parent="#kt_menu_62cfa3a253c5c"
data-allow-clear="true">
<option></option>
<option value="1">Active</option>
<option value="2">In-active</option>
</select>
</div>
<!--end::Input-->
</div>
<!--end::Input group-->
<!--begin::Actions-->
<div class="d-flex justify-content-end">
<button type="reset"
class="btn btn-sm btn-light btn-active-light-primary me-2"
data-kt-menu-dismiss="true">Reset</button>
<button type="submit" class="btn btn-sm btn-primary"
data-kt-menu-dismiss="true">Apply</button>
</div>
<!--end::Actions-->
</div>
<!--end::Form-->
</div>
<!--end::Menu 1-->
<!--end::Menu 1-->
</div>
<!--end::Filter menu-->
<!--begin::Secondary button-->
<!--end::Secondary button-->
<!--begin::Primary button-->
<a href="{{ url('/export-user') }}" class="btn btn-sm fw-bold btn-primary">Export
</a>
<!--end::Primary button-->
</div>
<!--end::Actions-->
</div>
<!--end::Toolbar container-->
</div>
<!--end::Toolbar-->
<!--begin::Content-->
<div id="kt_app_content" class="app-content flex-column-fluid">
<!--begin::Content container-->
<div id="kt_app_content_container" class="app-container container-xxl">
<!--begin::Tables Widget 13-->
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body card-padding">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<table
class="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3" id="example">
<!--begin::Table head-->
<thead>
<tr class="fw-bold ">
<th class="w-50px">
<div class="form-check form-check-sm form-check-custom form-check-solid">
<input class="form-check-input" type="checkbox" value="1" data-kt-check="true" data-kt-check-target=".widget-13-check">
</div>
</th>
<th class="min-w-75px">ClientId</th>
<th class="min-w-150px">Full Name</th>
<th class="min-w-120px">Registration Date</th>
<th class="min-w-120px">Contact Number</th>
<th class="min-w-120px">Email Id</th>
<th class="min-w-150px">Location</th>
<th class="min-w-125px text-center">Actions</th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
@foreach($Users as $key=>$user)
<tr>
<td>
<div class="form-check form-check-sm form-check-custom form-check-solid">
<input class="form-check-input widget-13-check"
type="checkbox" />
</div>
</td>
<td class="text-dark fs-6">{{$key+1}}
</td>
<td>
<a href="javascript:void(0)"
class="text-dark text-hover-primary d-block mb-1 fs-6 viewUserDetails" id="show-user"
data-id="{{ $user->id }}"
data-name="{{ $user->full_name}}"
data-email="{{ $user->email}}"
data-mobile="{{ $user->mob_number}}"
data-toggle="modal" data-target="#userDetailsModal" href="{{url('manage_users_view/'.$user->id)}}">
{{$user->full_name}}</a>
<!--<a -->
<!-- class="text-dark text-hover-primary d-block mb-1 fs-6 viewUserDetails" id="show-user" -->
<!-- href="{{url('manage_users_view/'.$user->id)}}"> -->
<!-- {{$user->full_name}}-->
<!--</a>-->
</td>
<td class="text-dark mb-1 fs-6">
{{date("d-m-Y", strtotime($user->created_at)) }}
</td>
<td class="text-dark d-block mb-1 fs-6">{{$user->mob_number}}
</td>
<td class="text-dark fs-6">
{{$user->email}}</td>
<td class="text-dark fs-6">Malad,
Mumbai</td>
<td class="text-center">
<a href="#" data-toggle="modal" data-target="#notify_popup"
class="btn btn-icon btn-bg-light btn-active-color-primary btn-sm me-1">
<!--begin::Svg Icon | path: icons/duotune/general/gen019.svg-->
<span class="svg-icon svg-icon-3">
<img src="{{asset('public/assets/media/logos/noti-icons.png')}}">
</span>
<!--end::Svg Icon-->
</a>
<!--<a href="" id="deletebtn" data-toggle="modal" data-target="#delete_opt" type="button" class="btn btn-icon btn-bg-light btn-active-color-primary btn-sm">-->
<a href="javascript:void(0)" class= "deletebtn" type="button" data-target="#delete_opt" class="btn btn-icon btn-bg-light btn-active-color-primary btn-sm" data-id="{{$user->id}}">
<!--begin::Svg Icon | path: icons/duotune/general/gen027.svg-->
<span class="svg-icon svg-icon-3">
<svg width="24" height="24" viewBox="0 0 24 24"
fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M5 9C5 8.44772 5.44772 8 6 8H18C18.5523 8 19 8.44772 19 9V18C19 19.6569 17.6569 21 16 21H8C6.34315 21 5 19.6569 5 18V9Z"
fill="currentColor" />
<path opacity="0.5"
d="M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V5C19 5.55228 18.5523 6 18 6H6C5.44772 6 5 5.55228 5 5V5Z"
fill="currentColor" />
<path opacity="0.5"
d="M9 4C9 3.44772 9.44772 3 10 3H14C14.5523 3 15 3.44772 15 4V4H9V4Z"
fill="currentColor" />
</svg>
</span>
<!--end::Svg Icon-->
</a>
</td>
</tr>
@endforeach
</tbody>
<!--end::Table body-->
</table>
<!--end::Table-->
</div>
<!--end::Table container-->
</div>
<!--begin::Body-->
</div>
<!--end::Tables Widget 13-->
</div>
<!--end::Content container-->
</div>
<!--end::Content-->
</div>
<!--end::Content wrapper-->
<!--</div>-->
<!--end:::Main-->
<!--</div>-->
<!--end::Wrapper-->
<!--begin::Scrolltop-->
<div id="kt_scrolltop" class="scrolltop" data-kt-scrolltop="true">
<!--begin::Svg Icon | path: icons/duotune/arrows/arr066.svg-->
<span class="svg-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)"
fill="currentColor" />
<path
d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z"
fill="currentColor" />
</svg>
</span>
<!--end::Svg Icon-->
</div>
<!--end::Scrolltop-->
<!--begin::Modals-->
<!--begin::Delete Modals-->
<div class="modal fade" data-toggle="modal" data-target="#delete_opt" id="userDeleteModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content Delete_pop">
<form action="">
@csrf
<div class="modal-body">
<svg style="color: red;margin-bottom: 20px;" xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"> <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" fill="red"></path> <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" fill="red"></path> </svg>
<h2>Are you sure want to delete?</h2>
<!--<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor</p>-->
<div class="modal-footer logout_footer">
<button id="close_modal" class="log-close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">Cancel</span>
</button>
<!--<a href=""><button type="button" class="btn btn-primary">Delete</button></a>-->
<input type="hidden" name="user_id" id="user_id">
<!-- <a href=""><input target="_blank" type="Delete" value="Delete" class="btn btn-primary"></a>-->
<button id='delete_user' class="btn btn-primary">Delete</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!--end:: DeleteModals-->
<div class="modal fade" id="notify_popup" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<form>
<div class="mu-notify">
<div class="mu-name">
<p><span>Name :</span> Aditya Gupta</p>
</div>
<div class="mu-subject">
<p><span>Subject :</span> <input type="text" placeholder="Enter Subject" value=" Lorem ipsum dolar (Optional)"></p>
</div>
<div class="musub-content">
<input type="text" placeholder="Enter heading" value="Please Click on Links and invest in Stocks and Mutual Fund.">
<textarea>Mutual Fund
https://www.zerodha.com/mutual-funds/nav/canara-robeco-blue-chip-equity-fund-direct-plan/MCA212
Stock
https://www.zerodha.com/india/stockpricequote/banks-private-sector/icicibank/ICI02
</textarea>
</div>
</div>
</form>
<div class="modal-footer">
<button class="log-close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">Cancel</span>
</button>
<a href=""><button type="button" class="btn btn-primary">Send</button></a>
</div>
</div>
</div>
</div>
</div>
<!-- Button trigger modal -->
<!--begin::manage_users details Modals-->
<div class="modal fade userDetailsModalpop" id="userDetailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content ">
<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
<!--begin::Title-->
<h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">
User Profile</h1>
<!--end::Title-->
</div>
<div class="advi-tab">
<ul id="myTabs" class="nav nav-pills nav-justified" role="tablist" data-tabs="tabs">
<li><a href="#PersonalInformation" data-toggle="tab" class="active">Personal Information</a></li>
<li><a href="#FamilyDetails" data-toggle="tab">Family Details</a></li>
<li><a href="#AddIncomeExpensesDetails" data-toggle="tab">Add Income & Expenses Details</a></li>
<li><a href="#DocumentDetails" data-toggle="tab">Document Details</a></li>
<li><a href="#SecurityQuestions" data-toggle="tab">Security Questions</a></li>
<button href="javascript:void(0)" data-toggle="modal" data-target="#editUserDetails" type="button" data-id="" id="userId" class="btn btn-primary btn-sm editUserDetails">Edit Details</button>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active show" id="PersonalInformation">
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body py-3">
<div class="table-responsive">
<!--begin::Table-->
<table class="table table-row-bordered table-row-gray-100 align-middle gs-0 gy-3">
<!--begin::Table head-->
<tbody >
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Full Name :</td>
<td class="text-dark fw-bold fs-6">
<!--<input type="text" id="user-name" name=""/>-->
<span id="user-name"></span>
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Address :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Email ID :</td>
<td class="text-dark fw-bold fs-6">
<span id="user-email"></span>
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
PAN Number :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Mobile number :</td>
<td class="text-dark fw-bold fs-6">
<span id="user-mobile"></span>
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Age :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Occupation :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Gender :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Residential Status :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Retirement Age :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
<tr>
<td class="text-dark fw-bold fs-6 w-200px">
Life expectancy :</td>
<td class="text-dark fw-bold fs-6">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="FamilyDetails">
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body py-3">
FamilyDetails
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="AddIncomeExpensesDetails">
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body py-3">
AddIncomeExpensesDetails
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="DocumentDetails">
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body py-3">
DocumentDetails
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="SecurityQuestions">
<div class="card mb-5 mb-xl-8">
<!--begin::Body-->
<div class="card-body py-3">
SecurityQuestions
</div>
</div>
</div>
</div>
</div>
</div>
<!--end:: manage_users details Modals end-->
<!--begin::Edit manage_users details Modals-->
<div class="modal fade" data-target="#editUserDetails" id="editUserDetails" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered inner-mode" role="document">
<div class="modal-content addpln-content resource-popup w-500px m-auto">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Edit Personal Information</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form>
@csrf
<div class="add_subAdm">
<div class="subAdm_right res-brd">
<div class="subAdm_label">
<label>Full Name</label>
</div>
<div class="subAdm_input">
<input id="userName" name="fullName" type="text" value="">
</div>
</div>
<div class="subAdm_left res-brd">
<div class="subAdm_label">
<label>Email Id</label>
</div>
<div class="subAdm_input">
<input id="userEmail" name="emailId" type="text" value="">
</div>
</div>
<div class="subAdm_left res-brd">
<div class="subAdm_label">
<label>Mobile Number</label>
</div>
<div class="subAdm_input">
<input id="userMobile" name="mobileNo" type="text" value="">
</div>
</div>
</div>
<input type="hidden" id="userId" name="userId">
<div class="modal-footer">
<button type="submit" id="updateDatails" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!--end::Edit manage_users details Modals-->
@section('scripts')
<script>
//Filter start
$(document).ready(function () {
$('.applyFilter').click(function (e) {
alert('apply');
e.preventDefault();
var activeUser = $("#activeUser").val();
console.log(activeUser);
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url: '{{url("/get_users")}}',
type: "post",
dataType: "json",
data: {activeUser: activeUser, },
success: function (data) {
// var users = data.
console.log(data);
// console.log(data.activeUser);
},
error: function (error) {
console.log(error);
}
});
});
});
//Filter end
//For delete user
//For Manage user
$('.deletebtn').click(function (e) {
// $('#userDeleteModal').show();
e.preventDefault();
$('#userDeleteModal').modal('show');
var userID = $(this).attr("data-id");
$('#user_id').val(userID);
// alert(userID);
});
$('#close_modal').click(function () {
$('#userDeleteModal').modal('hide');
});
$('#delete_user').on('click', function (e) {
e.preventDefault();
var userID = $('#user_id').val();
console.log(userID);
$.ajax({
url: '{{url("/delete_manage_users")}}',
type: "post",
data: {
userID: userID,
_token: $("input[name=_token]").val()
},
success: function (response) {
toastr.info('User deleted successfully!')
$('#delete_opt').modal('hide');
setTimeout(function () {
window.location.reload();
}, 3000);
window.location.reload();
}
});
});
//Delete User end
// For view id wise user details
$(document).ready(function () {
/* When click show user */
$('.viewUserDetails').on('click', function () {
// alert('show');
// e.preventDefault();
var userID = $(this).data("id");
var userName = $(this).data("name");
var userEmail = $(this).data("email");
var usermobile = $(this).data("mobile");
// var userURL = $(this).data('url');
$("#user-name").html(userName);
$("#user-email").html(userEmail);
$("#user-mobile").html(usermobile);
$('#userId').attr( 'value',userID);
$('#userName').attr( 'value',userName);
$('#userEmail').attr( 'value',userEmail);
$('#userMobile').attr( 'value',usermobile);
// $.get(userID, function (data) {
// $('#userDetailsModal').modal('show');
// $('#user-id').text(data.id);
// $('#user-name').text(data.name);
// $('#user-email').text(data.email);
// })
});
});
// For view id wise user details end
// For edit user
//
$('#updateDatails').on('click', function (e) {
e.preventDefault();
var userID = $('#userId').val();
var data = {
'userID': userID,
'name' : $('#userName').val(),
'email' : $('#userEmail').val(),
'mobile' : $('#userMobile').val(),
};
// console.log(data);
$.ajax({
url:'{{url("/edit_manage_users")}}',
type:"POST",
data:{userdata: data,
_token: $("input[name=_token]").val()
},
dataType:"json",
success: function(response){
toastr.info('User Updated successfully!')
$('#editUserDetails').modal('hide');
setTimeout(function () {
window.location.reload();
}, 3000);
window.location.reload();
}
});
// alert(userID);
// var userId = $('#userId').attr( 'dataid',userID)
// alert(userId);
// $('#userDeleteModal').show();
// e.preventDefault();
// $('#editUserDetails').modal('show');
// var userID = $(this).attr("data-id");
// $('#edit_user_id').val(userID);
// alert('kfdkfdfdkkfdkfd');
});
// For edit user information end
</script>
@endsection
@endsection