407 lines
26 KiB
PHP
407 lines
26 KiB
PHP
@extends('Admin.layouts.master')
|
|
|
|
@section('content')
|
|
<!--begin::Main-->
|
|
<div class="app-main flex-column flex-row-fluid mb-10" id="kt_app_main">
|
|
<!--begin::Content wrapper-->
|
|
<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 index_table mt-10">
|
|
<div class="top_header d-flex justify-content-between">
|
|
<p class='fs-2 fw-bold'>Admin Users</p>
|
|
<div class="table_right_options d-flex">
|
|
<a>
|
|
<button type="button" class="btn btn-light-primary me-3" data-bs-toggle="modal" data-bs-target="#kt_modal_add_user">
|
|
<!--begin::Svg Icon | path: icons/duotune/arrows/arr075.svg-->
|
|
<span class="svg-icon svg-icon-2">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.5" x="11.364" y="20.364" width="16" height="2" rx="1" transform="rotate(-90 11.364 20.364)" fill="currentColor"></rect>
|
|
<rect x="4.36396" y="11.364" width="16" height="2" rx="1" fill="currentColor"></rect>
|
|
</svg>
|
|
</span>
|
|
<!--end::Svg Icon-->Add New User
|
|
</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="dataTable_area my-5 mb-0">
|
|
<!--begin::Card-->
|
|
<div class="card">
|
|
<div class="card-header border-0 pt-0 h-0">
|
|
<!--begin::Card toolbar-->
|
|
<div class="card-toolbar">
|
|
<!--begin::Toolbar-->
|
|
<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
|
|
<!--begin::Group actions-->
|
|
<div class="d-flex justify-content-end align-items-center d-none" data-kt-user-table-toolbar="selected">
|
|
<button type="button" class="btn btn-danger" data-kt-user-table-select="delete_selected">Delete Selected</button>
|
|
</div>
|
|
</div>
|
|
<!--end::Group actions-->
|
|
</div>
|
|
<!--end::Card toolbar-->
|
|
</div>
|
|
<!--begin::Card body-->
|
|
<div class="card-body py-4">
|
|
<!--begin::Table-->
|
|
<div class="table-responsive">
|
|
<table class="table align-middle table-row-dashed fs-6 gy-5 user-table" id="user-table">
|
|
<!--begin::Table head-->
|
|
<thead>
|
|
<!--begin::Table row-->
|
|
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
|
|
<th class="min-w-25px w-100px align-top">Sr. No.</th>
|
|
<th class="min-w-125px w-125px align-top">User</th>
|
|
<th class="min-w-125px w-125px align-top">Mobile No.</th>
|
|
<th class="min-w-125px w-150px align-top">Email</th>
|
|
{{--<th class="min-w-125px w-150px align-top">Address</th>--}}
|
|
{{--<th class="min-w-50px w-75px align-top">Role</th>--}}
|
|
{{--<th class="min-w-50px w-100px align-top">Last Login</th>--}}
|
|
<th class="min-w-50px w-100px align-top ">Joined Date</th>
|
|
<th class="text-center min-w-100px align-top w-150px">Actions</th>
|
|
</tr>
|
|
<!--end::Table row-->
|
|
</thead>
|
|
<!--end::Table head-->
|
|
<!--begin::Table body-->
|
|
<tbody class="text-gray-600 fw-semibold">
|
|
<!--begin::Table row-->
|
|
@php($no=1)
|
|
@foreach($user as $data)
|
|
<tr>
|
|
<td>{{$no}}</td>
|
|
<td class="name d-flex align-items-center">
|
|
<p class='full_name mb-0'>{{$data->name}}</p>
|
|
</td>
|
|
<td>{{$data->contact_number}}</td>
|
|
<td>{{$data->email}}</td>
|
|
{{--<td>{{$data->address}}</td>--}}
|
|
<td>{{(!is_null($data->created_at))?$data->created_at->diffForHumans() : ''}}</td>
|
|
<td class="text-end d-flex align-items-center justify-content-around">
|
|
<a onclick="getUser({{$data->id}})" class="action_icon" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="Edit Investor Profile">
|
|
<i class="fa-solid fa-pen-to-square"></i>
|
|
</a>
|
|
|
|
<a onclick="deleteUser({{$data->id}})" class="action_icon" data-bs-toggle="tooltip" data-bs-custom-class="tooltip-inverse" data-bs-placement="top" title="Delete" onClick="sweetAlert();">
|
|
<i class="fa-solid fa-trash"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@php($no++)
|
|
@endforeach
|
|
<!--end::Table row-->
|
|
</tbody>
|
|
<!--end::Table body-->
|
|
</table>
|
|
</div>
|
|
<!--end::Table-->
|
|
</div>
|
|
<!--end::Card body-->
|
|
</div>
|
|
<!--end::Card-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- add-new-user-start -->
|
|
<div class="modal fade" id="kt_modal_add_user" tabindex="-1" aria-hidden="true">
|
|
<!--begin::Modal dialog-->
|
|
<div class="modal-dialog modal-dialog-centered mw-650px">
|
|
<!--begin::Modal content-->
|
|
<div class="modal-content">
|
|
<!--begin::Modal header-->
|
|
<div class="modal-header" id="kt_modal_add_user_header">
|
|
<!--begin::Modal title-->
|
|
<h2 class="fw-bold">Add User</h2>
|
|
<!--end::Modal title-->
|
|
<!--begin::Close-->
|
|
<div class="btn btn-icon btn-sm btn-active-icon-primary" data-kt-users-modal-action="close">
|
|
<!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg-->
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor" />
|
|
<rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor" />
|
|
</svg>
|
|
</span>
|
|
<!--end::Svg Icon-->
|
|
</div>
|
|
<!--end::Close-->
|
|
</div>
|
|
<!--end::Modal header-->
|
|
<!--begin::Modal body-->
|
|
<div class="modal-body scroll-y mx-5 mx-xl-15 my-7">
|
|
<!--begin::Form-->
|
|
<form id="kt_modal_add_user_form" class="form" action="#">
|
|
@csrf
|
|
<!--begin::Scroll-->
|
|
<div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_add_user_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_add_user_header" data-kt-scroll-wrappers="#kt_modal_add_user_scroll" data-kt-scroll-offset="300px">
|
|
<!--begin::Input group-->
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Full Name</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="name" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Full Name" required />
|
|
<!--end::Input-->
|
|
</div>
|
|
<!--end::Input group-->
|
|
<!--begin::Input group-->
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Email</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="email" name="email" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Email" required />
|
|
<!--end::Input-->
|
|
</div>
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Mobile No.</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="tel" name="contact_number" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Mobile No." required />
|
|
<!--end::Input-->
|
|
</div>
|
|
{{--<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Pan No.</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="pan_no" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Pan No." required />
|
|
<!--end::Input-->
|
|
</div>
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Address</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="address" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Address" required />
|
|
<!--end::Input-->
|
|
</div>--}}
|
|
<!--end::Input group-->
|
|
<!--begin::Input group-->
|
|
{{--<div class="mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-5">Role</label>
|
|
<!--end::Label-->
|
|
<!--begin::Roles-->
|
|
<!--begin::Input row-->
|
|
<div class="d-flex fv-row">
|
|
<!--begin::Radio-->
|
|
<div class="form-check form-check-custom form-check-solid">
|
|
<!--begin::Input-->
|
|
<input class="form-check-input me-3" name="user_role" type="radio" value="0" id="kt_modal_update_role_option_0" />
|
|
<!--end::Input-->
|
|
<!--begin::Label-->
|
|
<label class="form-check-label" for="kt_modal_update_role_option_0">
|
|
<div class="fw-bold text-gray-800">Administrator</div>
|
|
</label>
|
|
<!--end::Label-->
|
|
</div>
|
|
<!--end::Radio-->
|
|
</div>
|
|
<!--end::Input row-->
|
|
<div class='separator separator-dashed my-5'></div>
|
|
<!--begin::Input row-->
|
|
<div class="d-flex fv-row">
|
|
<!--begin::Radio-->
|
|
<div class="form-check form-check-custom form-check-solid">
|
|
<!--begin::Input-->
|
|
<input class="form-check-input me-3" name="user_role" type="radio" value="1" id="kt_modal_update_role_option_1" />
|
|
<!--end::Input-->
|
|
<!--begin::Label-->
|
|
<label class="form-check-label" for="kt_modal_update_role_option_1">
|
|
<div class="fw-bold text-gray-800">Developer</div>
|
|
</label>
|
|
<!--end::Label-->
|
|
</div>
|
|
<!--end::Radio-->
|
|
</div>
|
|
<!--end::Roles-->
|
|
</div>--}}
|
|
<!--end::Input group-->
|
|
</div>
|
|
<!--end::Scroll-->
|
|
<!--begin::Actions-->
|
|
<div class="text-center pt-15">
|
|
<button type="reset" class="btn btn-light me-3" data-kt-users-modal-action="cancel">Discard</button>
|
|
<button type="submit" class="btn btn-primary" data-kt-users-modal-action="submit">
|
|
<span class="indicator-label">Submit</span>
|
|
<span class="indicator-progress">Please wait...
|
|
<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
|
|
</button>
|
|
</div>
|
|
<!--end::Actions-->
|
|
</form>
|
|
<!--end::Form-->
|
|
</div>
|
|
<!--end::Modal body-->
|
|
</div>
|
|
<!--end::Modal content-->
|
|
</div>
|
|
<!--end::Modal dialog-->
|
|
</div>
|
|
<!-- add-new-user-end -->
|
|
|
|
<!-- edit new-user-start -->
|
|
<div class="modal fade" id="kt_modal_edit_user" tabindex="-1" aria-hidden="true">
|
|
<!--begin::Modal dialog-->
|
|
<div class="modal-dialog modal-dialog-centered mw-650px">
|
|
<!--begin::Modal content-->
|
|
<div class="modal-content">
|
|
<!--begin::Modal header-->
|
|
<div class="modal-header" id="kt_modal_add_user_header">
|
|
<!--begin::Modal title-->
|
|
<h2 class="fw-bold">Edit User</h2>
|
|
<!--end::Modal title-->
|
|
<!--begin::Close-->
|
|
<div class="btn btn-icon btn-sm btn-active-icon-primary" data-bs-dismiss="modal" aria-label="Close">
|
|
<!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg-->
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor" />
|
|
<rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor" />
|
|
</svg>
|
|
</span>
|
|
<!--end::Svg Icon-->
|
|
</div>
|
|
<!--end::Close-->
|
|
</div>
|
|
<!--end::Modal header-->
|
|
<!--begin::Modal body-->
|
|
<div class="modal-body scroll-y mx-5 mx-xl-15 my-7">
|
|
<!--begin::Form-->
|
|
<form id="kt_modal_edit_user_form" class="form" method="POST">
|
|
@method('PATCH')
|
|
<input type="hidden" name="id" id="edit_id">
|
|
<!--begin::Scroll-->
|
|
<div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_add_user_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_add_user_header" data-kt-scroll-wrappers="#kt_modal_add_user_scroll" data-kt-scroll-offset="300px">
|
|
<!--begin::Input group-->
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Full Name</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="name" id="edit_name" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Full name" />
|
|
<!--end::Input-->
|
|
</div>
|
|
<!--end::Input group-->
|
|
<!--begin::Input group-->
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Email</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="email" name="email" id="edit_email" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Email" />
|
|
<!--end::Input-->
|
|
</div>
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Mobile No.</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="number" name="contact_number" id="edit_contact_no" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Mobile Number" />
|
|
<!--end::Input-->
|
|
</div>
|
|
{{--<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Pan No.</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="pan_no" id="edit_pan_no" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Pan No." />
|
|
<!--end::Input-->
|
|
</div>
|
|
<div class="fv-row mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-2">Address</label>
|
|
<!--end::Label-->
|
|
<!--begin::Input-->
|
|
<input type="text" name="address" id="edit_address" class="form-control form-control-solid mb-3 mb-lg-0" placeholder="Please Enter Address" />
|
|
<!--end::Input-->
|
|
</div>--}}
|
|
<!--end::Input group-->
|
|
<!--begin::Input group-->
|
|
{{--<div class="mb-7">
|
|
<!--begin::Label-->
|
|
<label class="required fw-semibold fs-6 mb-5">Role</label>
|
|
<!--end::Label-->
|
|
<!--begin::Roles-->
|
|
<!--begin::Input row-->
|
|
<div class="d-flex fv-row">
|
|
<!--begin::Radio-->
|
|
<div class="form-check form-check-custom form-check-solid">
|
|
<!--begin::Input-->
|
|
<input class="form-check-input me-3" name="user_role" type="radio" value="0" id="kt_modal_update_role_option_0" checked='checked' />
|
|
<!--end::Input-->
|
|
<!--begin::Label-->
|
|
<label class="form-check-label" for="kt_modal_update_role_option_0">
|
|
<div class="fw-bold text-gray-800">Administrator</div>
|
|
</label>
|
|
<!--end::Label-->
|
|
</div>
|
|
<!--end::Radio-->
|
|
</div>
|
|
<!--end::Input row-->
|
|
<div class='separator separator-dashed my-5'></div>
|
|
<!--begin::Input row-->
|
|
<div class="d-flex fv-row">
|
|
<!--begin::Radio-->
|
|
<div class="form-check form-check-custom form-check-solid">
|
|
<!--begin::Input-->
|
|
<input class="form-check-input me-3" name="user_role" type="radio" value="1" id="kt_modal_update_role_option_1" />
|
|
<!--end::Input-->
|
|
<!--begin::Label-->
|
|
<label class="form-check-label" for="kt_modal_update_role_option_1">
|
|
<div class="fw-bold text-gray-800">Developer</div>
|
|
</label>
|
|
<!--end::Label-->
|
|
</div>
|
|
<!--end::Radio-->
|
|
</div>
|
|
<!--end::Roles-->
|
|
</div>--}}
|
|
<!--end::Input group-->
|
|
</div>
|
|
<!--end::Scroll-->
|
|
<!--begin::Actions-->
|
|
<div class="text-center pt-15">
|
|
<button type="reset" class="btn btn-light me-3" data-bs-dismiss="modal" aria-label="Close">Discard</button>
|
|
<button type="submit" class="btn btn-primary" id="updated_successfully">
|
|
<span class="indicator-label">Submit</span>
|
|
<span class="indicator-progress">Please wait...
|
|
<span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
|
|
</button>
|
|
</div>
|
|
<!--end::Actions-->
|
|
</form>
|
|
<!--end::Form-->
|
|
</div>
|
|
<!--end::Modal body-->
|
|
</div>
|
|
<!--end::Modal content-->
|
|
</div>
|
|
<!--end::Modal dialog-->
|
|
</div>
|
|
<!-- edit-new-user-end -->
|
|
</div>
|
|
<!--end::Content wrapper-->
|
|
</div>
|
|
<!--end:::Main-->
|
|
@endsection
|
|
@section('scripts')
|
|
<!-- <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> -->
|
|
|
|
<script src="{{asset('/public/assets/js/admin/user-management.js')}}"></script>
|
|
<script>
|
|
// swal({
|
|
// // title: "Good job!",
|
|
// text: "Form has been successfully submitted!",
|
|
// icon: "success",
|
|
// button: "Ok,got it!",
|
|
// }).then((value) => {
|
|
// // swal(`The returned value is: ${value}`);
|
|
// location.reload();
|
|
// });;
|
|
</script>
|
|
@endsection |