Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
aadhavan valli 2024-03-29 17:29:31 +05:30
commit c85fc0c9d8
10 changed files with 215 additions and 158 deletions

View File

@ -1,5 +1,5 @@
--- ---
deployment: deployment:
tasks: tasks:
- export DEPLOYPATH=/home/example/public_html/ - export DEPLOYPATH=home3/venbaehn/public_html/nhance/devauto/
- /bin/cp . $DEPLOYPATH - /bin/cp -r home3/venbaehn/repositories/nhance_dev/* $DEPLOYPATH

View File

@ -41,8 +41,12 @@ class LoginController extends BaseController
$user = $UserModel->getUserByEmail($value->email); $user = $UserModel->getUserByEmail($value->email);
if($user){ if($user){
if($user->is_active !== '0'){ if($user->is_active !== '0'){
$session_data = [
$session_data = ['isLoggedIn' => True ,'userid' => $user->id, 'userData' => $user]; 'isLoggedIn' => True ,
'userid' => $user->id,
'userData' => $user,
'userProfile' => $value->picture,
];
set_session_data($session_data); set_session_data($session_data);
log_message('error', 'Set The UserId : `'. $user->id .'` in Session'); log_message('error', 'Set The UserId : `'. $user->id .'` in Session');
log_message('error', 'User Login Sucessfully'); log_message('error', 'User Login Sucessfully');

View File

@ -28,6 +28,15 @@ if (!function_exists('get_session_userdata')) {
} }
} }
if (!function_exists('get_userProfile')) {
function get_userProfile()
{
// $ci =& get_instance();
$session = \Config\Services::session();
return $session->get('userProfile');
}
}
if (!function_exists('get_session_user')) { if (!function_exists('get_session_user')) {
function get_session_user() function get_session_user()
{ {

View File

@ -375,6 +375,7 @@ input:checked + .slider:before {
var fileExtension = file.name.split('.').pop().toLowerCase(); var fileExtension = file.name.split('.').pop().toLowerCase();
if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) { if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
fileInput.value = ""; // Clear the file input fileInput.value = ""; // Clear the file input
document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image
} else { } else {
@ -408,6 +409,7 @@ input:checked + .slider:before {
if (fileSize > 200) { if (fileSize > 200) {
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.'); toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"); $("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
input.value = "";
} }
// Check image dimensions // Check image dimensions

View File

@ -1,3 +1,14 @@
<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
</style>
<div class="row" id="client_list"> <div class="row" id="client_list">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">

View File

@ -1,15 +1,31 @@
<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
</style>
<br> <div class="row">
<div class="row"> <div class="col-xl-6">
<div class="col-12"> <div id="accordion" class="mb-3">
<div class="card"> <div class="card mb-1">
<h5 class="m-1">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</h5>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
<div class="row"> <div class="row">
<div class="col-md-6 col-xl-3"> <div class="col-md-6 col-xl-3">
<div class="form-group mb-3"> <div class="form-group mb-3">
<label>Client</label> <br/> <label>Client</label> <br />
<select class="form-control" id="clients"> <select class="form-control" id="clients">
<option value="0">Select</option> <option value="0">Select</option>
</select> </select>
@ -17,7 +33,7 @@
</div> </div>
<div class="col-md-6 col-xl-3"> <div class="col-md-6 col-xl-3">
<div class="form-group mb-3"> <div class="form-group mb-3">
<label>Policy</label> <br/> <label>Policy</label> <br />
<select class="form-control" id="policies"> <select class="form-control" id="policies">
<option value="0">Select</option> <option value="0">Select</option>
</select> </select>
@ -26,7 +42,9 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-12" style="text-align: right;"> <div class="col-12" style="text-align: right;">
<a href="<?= base_url("employee/list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a> <a href="<?= base_url("employee/list"); ?>"
class="btn btn-primary waves-effect waves-light" id="get-emp-list"
onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
</div> </div>
<!-- </div> --> <!-- </div> -->
@ -35,19 +53,10 @@
</div> </div>
</div> </div>
</div> </div>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"></h4>
<div class="page-title-right">
</div>
</div>
</div>
</div> </div>
<!-- end page title -->
<div class="row" id="client_list"> <div class="row" id="client_list">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
@ -58,12 +67,13 @@
</div> </div>
</div> </div>
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" id="tickets-table"> <table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">SNO</th>
<th class="font-weight-medium">Employee code</th> <!-- <th class="font-weight-medium">Employee code</th> -->
<th class="font-weight-medium">Name</th> <th class="font-weight-medium">Name/code</th>
<th class="font-weight-medium">Policy name</th> <th class="font-weight-medium">Policy name</th>
<th class="font-weight-medium">Insurar name</th> <th class="font-weight-medium">Insurar name</th>
<th class="font-weight-medium">TPA ID</th> <th class="font-weight-medium">TPA ID</th>
@ -82,8 +92,8 @@
<tr> <tr>
<td><b><?php echo ($key + 1)?></b></td> <td><b><?php echo ($key + 1)?></b></td>
<td><?php echo $employee['emp_code']?></td> <!-- <td><?php echo $employee['emp_code']?></td> -->
<td><?php echo $employee['name']?></td> <td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td>
<td><?php echo $employee['policy_name']?></td> <td><?php echo $employee['policy_name']?></td>
<td><?php echo $employee['insurer_short_name']?></td> <td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td> <td><?php echo $employee['tpa_id']?></td>
@ -92,12 +102,20 @@
<td><?php echo $employee['premium']?></td> <td><?php echo $employee['premium']?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);"
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit Ticket</a> <a class="dropdown-item" href="#"><i
<a class="dropdown-item" href="#"><i class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a> class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a> Ticket</a>
<a class="dropdown-item" href="#"><i class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as Unread</a> <a class="dropdown-item" href="#"><i
class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a>
<a class="dropdown-item" href="#"><i
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a>
<a class="dropdown-item" href="#"><i
class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as
Unread</a>
</div> </div>
</div> </div>
</td> </td>
@ -114,24 +132,23 @@
<div id="loader" class="loader" style="display:none;">SPINNER</div> <div id="loader" class="loader" style="display:none;">SPINNER</div>
<script> <script>
// Declare a global variable to store API response data
var clientPolicies = [];
// Declare a global variable to store API response data $(document).ready(function() {
var clientPolicies = []; console.log("document loaded");
$( document ).ready(function() {
console.log( "document loaded" );
//fetchClientPolicies(); //fetchClientPolicies();
}); });
$( window ).on( "load", function() { $(window).on("load", function() {
console.log( "window loaded" ); console.log("window loaded");
fetchClientPolicies(); fetchClientPolicies();
}); });
function fetchClientPolicies() { function fetchClientPolicies() {
$('#loader').show(); $('#loader').show();
var apiURL = '<?php echo base_url();?>' + 'util/clients-with-policies'; var apiURL = '<?php echo base_url();?>' + 'util/clients-with-policies';
console.log('fetchClientPolicies'); console.log('fetchClientPolicies');
@ -152,15 +169,12 @@
clientPolicies = (response.data); clientPolicies = (response.data);
// console.log(clientPolicies); // console.log(clientPolicies);
appendClients(clientPolicies); appendClients(clientPolicies);
} catch (error) } catch (error) {
{
console.error('Error parsing API response data:', error); console.error('Error parsing API response data:', error);
} }
} else if(response.code === 404 && response.dataStatus === false){ } else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response); console.error('no data found', response);
} } else {
else
{
console.error('Something went wrong!'); console.error('Something went wrong!');
} }
}, },
@ -170,21 +184,24 @@
}); });
$('#loader').hide(); $('#loader').hide();
} }
function appendClients(data) { function appendClients(data) {
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#clients').append($('<option>', { $('#clients').append($('<option>', {
value: item.id, value: item.id,
text: item.client_name text: item.client_name
})); }));
}); });
} }
function appendPolicies(data) { function appendPolicies(data) {
$('#policies').empty(); $('#policies').empty();
$('#policies').append($('<option>', { value: '0',text: 'Select'})); $('#policies').append($('<option>', {
value: '0',
text: 'Select'
}));
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#policies').append($('<option>', { $('#policies').append($('<option>', {
@ -192,7 +209,7 @@
text: item.name text: item.name
})); }));
}); });
} }
$('#clients').on('change', function() { $('#clients').on('change', function() {
var selectedClient = $(this).val(); var selectedClient = $(this).val();
@ -205,7 +222,7 @@ $('#clients').on('change', function() {
}); });
console.log(foundPolicies.policies); console.log(foundPolicies.policies);
appendPolicies(foundPolicies.policies); appendPolicies(foundPolicies.policies);
}); });
// Function to convert object to query parameters // Function to convert object to query parameters
function objectToQueryString(obj) { function objectToQueryString(obj) {
@ -217,8 +234,8 @@ function fetchEmpolyeeList(event) {
var client_id = $('#clients').val(); var client_id = $('#clients').val();
var policy_id = $('#policies').val(); var policy_id = $('#policies').val();
console.log(client_id+'-'+policy_id); console.log(client_id + '-' + policy_id);
if (client_id == '0' || policy_id == '0' ) { if (client_id == '0' || policy_id == '0') {
alert('Please select values in both dropdowns.'); alert('Please select values in both dropdowns.');
return; return;
} }
@ -229,7 +246,7 @@ function fetchEmpolyeeList(event) {
}; };
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
const apiURL = $('#get-emp-list').attr('href')+"?" + queryString; const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
console.log(apiURL); console.log(apiURL);
window.location.href = apiURL; window.location.href = apiURL;
@ -251,5 +268,9 @@ function fetchEmpolyeeList(event) {
// }); // });
} }
document.getElementById('toggleIcon').addEventListener('click', function() {
var icon = document.getElementById('icon');
icon.classList.toggle('mdi-chevron-down');
icon.classList.toggle('mdi-chevron-up');
});
</script> </script>

View File

@ -1,4 +1,14 @@
<style>
.table th, .table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
</style>
<div class="row" id="client_add" style="position: relative; bottom: 25px;"> <div class="row" id="client_add" style="position: relative; bottom: 25px;">
<div class="col-12"> <div class="col-12">

View File

@ -375,7 +375,7 @@
<a href="javascript:void(0);" class="dropdown-item notify-item"> <a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-secondary"> <div class="notify-icon bg-secondary">
<i class="mdi mdi-heart"></i> <i class="mdi mdi-heart"></i>
</div> </div>composer create-project laravel/laravel:^11.0 example-app
<p class="notify-details">Carlos Crouch liked <p class="notify-details">Carlos Crouch liked
<b>Admin</b> <b>Admin</b>
<small class="text-muted">13 days ago</small> <small class="text-muted">13 days ago</small>
@ -393,7 +393,7 @@
<li class="dropdown notification-list topbar-dropdown"> <li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false"> <a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-1.jpg" alt="user-image" class="rounded-circle"> <img src="<?php echo (get_userProfile() != null && !empty(get_userProfile())) ? get_userProfile() : base_url() . 'public/assets/images/avatar_2x.png'; ?>" alt="user-image" class="rounded-circle">
<span class="pro-user-name ml-1" style="font-size: 16px;" > <span class="pro-user-name ml-1" style="font-size: 16px;" >
<?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?> <?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?>
<!-- <i class="mdi mdi-chevron-down"></i> --> <!-- <i class="mdi mdi-chevron-down"></i> -->
@ -502,7 +502,7 @@
<!-- LOGO --> <!-- LOGO -->
<div class="logo-box"> <div class="logo-box">
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center"> <a href="<?= base_url('/dashboard/view')?>" class="logo logo-dark text-center">
<span class="logo-sm"> <span class="logo-sm">
<img src="<?= base_url()."public"; ?>/assets/images/logo-sm-dark.png" alt="" height="24"> <img src="<?= base_url()."public"; ?>/assets/images/logo-sm-dark.png" alt="" height="24">
<!-- <span class="logo-lg-text-light">nHance</span> --> <!-- <span class="logo-lg-text-light">nHance</span> -->
@ -513,7 +513,7 @@
</span> </span>
</a> </a>
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center"> <a href="<?= base_url('/dashboard/view')?>" class="logo logo-light text-center">
<span class="logo-sm"> <span class="logo-sm">
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24"> <img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
</span> </span>

View File

@ -13,11 +13,12 @@
.radiobuttondiv{ .radiobuttondiv{
margin-left: 32px; margin-left: 32px;
} }
.{
/* .{
width:62% !important; width:62% !important;
margin-left: 30px; margin-left: 30px;
margin-top: 3px margin-top: 3px
} } */
/* .form-group.col-md-6 */ /* .form-group.col-md-6 */
.form-group-client-policy-master{ .form-group-client-policy-master{
display:-webkit-box; display:-webkit-box;
@ -48,14 +49,14 @@
.jodit-status-bar{ .jodit-status-bar{
display:none; display:none;
} }
.jodit-container{ /* .jodit-container{
/* width: 821px !important; */ width: 821px !important;
/* margin-top: 3px; */ margin-top: 3px;
/* margin-bottom: 3px; */ margin-bottom: 3px;
/* margin-left: 30px; */ margin-left: 30px;
/* height: 0px !important; */ height: 0px !important;
/* min-height: 100px !important; */ min-height: 100px !important;
} } */
.input-group { .input-group {
width: 64.5% !important; width: 64.5% !important;
} }
@ -643,7 +644,7 @@ var grid_html = '';
var gmc_policy_type_id = $(this).attr('id'); var gmc_policy_type_id = $(this).attr('id');
if(gmc_policy_type_id >= '2'){ if(gmc_policy_type_id >= 2){
$('#policyGMCTerms').css('display', ''); $('#policyGMCTerms').css('display', '');
$('#police-tab').css('display', 'none'); $('#police-tab').css('display', 'none');

View File

@ -104,8 +104,7 @@
<th class="font-weight-medium">Sub Type</th> <th class="font-weight-medium">Sub Type</th>
<th class="font-weight-medium">Credit</th> <th class="font-weight-medium">Credit</th>
<th class="font-weight-medium">Debit</th> <th class="font-weight-medium">Debit</th>
<th class="font-weight-medium">Balance</th>
<th class="font-weight-medium">Balnce</th>
</tr> </tr>
</thead> </thead>