FEAT_HR_HISTORY AND_OTHERS : RV
This commit is contained in:
parent
0eaabe28cf
commit
b9519c994a
@ -8,6 +8,8 @@ use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
use App\Controllers\ClientController;
|
||||
|
||||
|
||||
use App\Models\UserModel;
|
||||
use App\Models\RoleModel;
|
||||
@ -295,65 +297,265 @@ class UserController extends AdminController
|
||||
// }
|
||||
|
||||
|
||||
// public function getUserActivityHistory()
|
||||
// {
|
||||
// try {
|
||||
// $client_id = $this->request->getVar('client_id');
|
||||
// $user_id = $this->request->getVar('user_id');
|
||||
// $pre_hr_id = $this->request->getVar('pre_hr_id');
|
||||
// $user_type = $this->request->getVar('user_type');
|
||||
|
||||
// $clientController = new ClientController;
|
||||
|
||||
// if (empty($client_id)) {
|
||||
// return $this->respond(['status' => false,'message' => 'Client Id is required'], 400);
|
||||
// }
|
||||
|
||||
// if (empty($user_type)) {
|
||||
// return $this->respond(['status' => false,'message' => 'User type is required'], 400);
|
||||
// }
|
||||
|
||||
// $field_for_where_condition = 'user_id';
|
||||
|
||||
// if (empty($user_id) || $user_id == 0) {
|
||||
// if (empty($pre_hr_id)) {
|
||||
// return $this->respond(['status' => false,'message' => 'user_id or pre_hr_id must be provided'], 400);
|
||||
// }
|
||||
|
||||
// $field_for_where_condition = 'pre_hr_id';
|
||||
// $user_id = $pre_hr_id;
|
||||
// }
|
||||
|
||||
// // Get login/auth history
|
||||
// if ($field_for_where_condition == 'user_id') {
|
||||
// $auth_data = $this->authHistoryModel
|
||||
// ->where('is_active', 1)
|
||||
// ->where('user_id', $user_id)
|
||||
// ->where('user_type', $user_type)
|
||||
// ->orderBy('created_at', 'desc')
|
||||
// ->findAll();
|
||||
// // print_r(db_connect()->getLastQuery()); die;
|
||||
// } else {
|
||||
// $preDB = \Config\Database::connect('preDB');
|
||||
// $auth_data = $preDB->table('auth_history')
|
||||
// ->where('is_active', 1)
|
||||
// ->where('user_id', $user_id)
|
||||
// ->where('user_type', $user_type)
|
||||
// ->orderBy('created_at', 'desc')
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
// }
|
||||
|
||||
// // Get activity history
|
||||
// $activity_data = $this->userActivityHistoryModel
|
||||
// ->where($field_for_where_condition, $user_id)
|
||||
// ->where('user_type', $user_type)
|
||||
// ->findAll();
|
||||
|
||||
// $merged_data = $this->getMergedUserHistory($auth_data, $activity_data);
|
||||
|
||||
// return $this->respond([
|
||||
// 'status' => true,
|
||||
// 'message' => 'User history fetched successfully',
|
||||
// 'auth_history' => $auth_data,
|
||||
// 'activity_log' => $activity_data,
|
||||
// 'merged_data' => $merged_data,
|
||||
// ]);
|
||||
|
||||
// } catch (\Exception $e) {
|
||||
// $this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine() . '----' . $e->getTraceAsString()));
|
||||
// return $this->respond([
|
||||
// 'status' => false,
|
||||
// 'message' => 'Error: ' . $e->getMessage()
|
||||
// ], 500);
|
||||
// }
|
||||
// }
|
||||
|
||||
public function getUserActivityHistory()
|
||||
{
|
||||
try {
|
||||
$user_id = $this->request->getVar('user_id');
|
||||
$pre_hr_id = $this->request->getVar('pre_hr_id');
|
||||
$user_type = $this->request->getVar('user_type');
|
||||
$this->myLogger->logme("error", "User activity history fetch initiated.");
|
||||
|
||||
if (empty($user_type)) {
|
||||
return $this->respond(['status' => false,'message' => 'User type is required'], 400);
|
||||
$client_id = $this->request->getVar('client_id');
|
||||
$startDate = $this->request->getVar('startDate');
|
||||
$endDate = $this->request->getVar('endDate');
|
||||
$user_type = 'hr';
|
||||
$clientController = new ClientController;
|
||||
|
||||
// Convert to DB format with full time range
|
||||
$startDateTime = null;
|
||||
$endDateTime = null;
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$startDateTime = \DateTime::createFromFormat('d-m-Y', $startDate)->format('Y-m-d 00:00:00');
|
||||
$endDateTime = \DateTime::createFromFormat('d-m-Y', $endDate)->format('Y-m-d 23:59:59');
|
||||
}
|
||||
|
||||
$field_for_where_condition = 'user_id';
|
||||
|
||||
if (empty($user_id) || $user_id == 0) {
|
||||
if (empty($pre_hr_id)) {
|
||||
return $this->respond(['status' => false,'message' => 'user_id or pre_hr_id must be provided'], 400);
|
||||
$this->myLogger->logme("error", "Received client_id: " . $client_id);
|
||||
|
||||
if (empty($client_id)) {
|
||||
$this->myLogger->logme("warning", "Client ID is missing.");
|
||||
return $this->respond(['status' => false, 'message' => 'Client Id is required'], 400);
|
||||
}
|
||||
|
||||
$hr_access_data = $clientController->getHrAccessData($client_id)['hr_access_data'] ?? [];
|
||||
$this->myLogger->logme("error", "Fetched HR access data: " . json_encode($hr_access_data));
|
||||
|
||||
if (empty($hr_access_data)) {
|
||||
$this->myLogger->logme("error", "No HR access data found for client_id: $client_id");
|
||||
$html = view('hr_activity_history');
|
||||
return $this->respond(['status' => true, 'data' => $html, 'list_of_activity_data' => []], 200);
|
||||
}
|
||||
|
||||
$activityMap = [
|
||||
'export_empdata' => 'Exporting post employee data',
|
||||
'export_cddata' => 'Exporting cd data',
|
||||
'export_cdsummary' => 'Exporting cd summary data',
|
||||
'export_preempdata' => 'Exporting pre employee data',
|
||||
'import_enrollempdata' => 'Import enrolment file',
|
||||
];
|
||||
|
||||
$list_of_activity_data = [];
|
||||
|
||||
foreach ($hr_access_data as $key => $value) {
|
||||
$this->myLogger->logme("error", "Processing HR user: " . json_encode($value));
|
||||
|
||||
$auth_data = [];
|
||||
$activity_data = [];
|
||||
|
||||
$hr_name = $value['hr_name'] ?? '';
|
||||
$hr_mail = $value['hr_mail'] ?? '';
|
||||
|
||||
if (!empty($value['pre_hr_id']) && !empty($value['post_hr_id'])) {
|
||||
$this->myLogger->logme("error", "Both pre_hr_id and post_hr_id found. Using post DB for user_id: {$value['post_hr_id']}");
|
||||
|
||||
// Fetch Auth History
|
||||
$auth_query = $this->authHistoryModel
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at")
|
||||
->where('is_active', 1)
|
||||
->where('user_id', $value['post_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$auth_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$auth_data = $auth_query->orderBy('created_at', 'desc')->findAll();
|
||||
|
||||
|
||||
// Fetch User Activity
|
||||
$activity_query = $this->userActivityHistoryModel
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at, activity")
|
||||
->where('user_id', $value['post_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$activity_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$activity_data = $activity_query->findAll();
|
||||
|
||||
|
||||
} elseif (!empty($value['post_hr_id'])) {
|
||||
$this->myLogger->logme("error", "Only post_hr_id found. user_id: {$value['post_hr_id']}");
|
||||
|
||||
$auth_query = $this->authHistoryModel
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at")
|
||||
->where('is_active', 1)
|
||||
->where('user_id', $value['post_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$auth_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$auth_data = $auth_query->orderBy('created_at', 'desc')->findAll();
|
||||
|
||||
$activity_query = $this->userActivityHistoryModel
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at, activity")
|
||||
->where('user_id', $value['post_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$activity_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$activity_data = $activity_query->findAll();
|
||||
|
||||
} elseif (!empty($value['pre_hr_id'])) {
|
||||
$this->myLogger->logme("error", "Only pre_hr_id found. user_id: {$value['pre_hr_id']}");
|
||||
|
||||
$preDB = \Config\Database::connect('preDB');
|
||||
|
||||
$auth_query = $preDB->table('auth_history')
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at")
|
||||
->where('is_active', 1)
|
||||
->where('user_id', $value['pre_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$auth_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$auth_data = $auth_query->orderBy('created_at', 'desc')->get()->getResultArray();
|
||||
|
||||
$activity_query = $this->userActivityHistoryModel
|
||||
->select("DATE_FORMAT(created_at, '%d-%m-%Y %r') AS created_at, activity")
|
||||
->where('pre_hr_id', $value['pre_hr_id'])
|
||||
->where('user_type', $user_type);
|
||||
|
||||
if (!empty($startDate)) {
|
||||
$activity_query->where('created_at >=', $startDateTime)
|
||||
->where('created_at <=', $endDateTime);
|
||||
}
|
||||
|
||||
$activity_data = $activity_query->findAll();
|
||||
}
|
||||
|
||||
$field_for_where_condition = 'pre_hr_id';
|
||||
$user_id = $pre_hr_id;
|
||||
foreach ($auth_data as &$entry) {
|
||||
$entry['user_name'] = $hr_name;
|
||||
$entry['user_mail'] = $hr_mail;
|
||||
$entry['activity'] = "Login";
|
||||
}
|
||||
|
||||
foreach ($activity_data as &$entry) {
|
||||
$entry['user_name'] = $hr_name;
|
||||
$entry['user_mail'] = $hr_mail;
|
||||
|
||||
if (!empty($entry['activity']) && isset($activityMap[$entry['activity']])) {
|
||||
$entry['activity'] = $activityMap[$entry['activity']];
|
||||
}
|
||||
}
|
||||
|
||||
$merged_data = array_merge($auth_data, $activity_data);
|
||||
$list_of_activity_data = array_merge($list_of_activity_data, $merged_data);
|
||||
|
||||
$this->myLogger->logme("error", "Merged data count after processing: " . count($list_of_activity_data));
|
||||
}
|
||||
|
||||
// Get login/auth history
|
||||
if ($field_for_where_condition == 'pre_hr_id') {
|
||||
$auth_data = $this->authHistoryModel
|
||||
->where('is_active', 1)
|
||||
->where('user_id', $user_id)
|
||||
->where('user_type', $user_type)
|
||||
->orderBy('created_at', 'desc')
|
||||
->findAll();
|
||||
} else {
|
||||
$preDB = \Config\Database::connect('preDB');
|
||||
$auth_data = $preDB->table('auth_history')
|
||||
->where('is_active', 1)
|
||||
->where('user_id', $user_id)
|
||||
->where('user_type', $user_type)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get()
|
||||
->getResultArray();
|
||||
}
|
||||
usort($list_of_activity_data, function ($a, $b) {
|
||||
return strtotime($b['created_at']) <=> strtotime($a['created_at']);
|
||||
});
|
||||
|
||||
// Get activity history
|
||||
$activity_data = $this->userActivityHistoryModel
|
||||
->where($field_for_where_condition, $user_id)
|
||||
->where('user_type', $user_type)
|
||||
->findAll();
|
||||
$this->myLogger->logme("error", "Final sorted list_of_activity_data count: " . count($list_of_activity_data));
|
||||
|
||||
$merged_data = $this->getMergedUserHistory($auth_data, $activity_data);
|
||||
$html = view('hr_activity_history', ['data' => $list_of_activity_data]);
|
||||
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'message' => 'User history fetched successfully',
|
||||
'auth_history' => $auth_data,
|
||||
'activity_log' => $activity_data,
|
||||
'merged_data' => $merged_data,
|
||||
'data' => $html,
|
||||
'list_of_activity_data' => $list_of_activity_data,
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine() . '----' . $e->getTraceAsString()));
|
||||
$this->myLogger->logme("error", $e->getMessage() . ' --- ' . $e->getLine() . ' ---- ' . $e->getTraceAsString());
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'message' => 'Error: ' . $e->getMessage()
|
||||
@ -361,27 +563,4 @@ class UserController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getMergedUserHistory($auth_data, $activity_data)
|
||||
{
|
||||
// Tag each entry with its source
|
||||
foreach ($auth_data as &$entry) {
|
||||
$entry['source'] = 'auth';
|
||||
}
|
||||
|
||||
foreach ($activity_data as &$entry) {
|
||||
$entry['source'] = 'activity';
|
||||
}
|
||||
|
||||
// Merge both arrays
|
||||
$merged = array_merge($auth_data, $activity_data);
|
||||
|
||||
// Sort by 'created_at' descending
|
||||
usort($merged, function ($a, $b) {
|
||||
return strtotime($b['created_at']) <=> strtotime($a['created_at']);
|
||||
});
|
||||
|
||||
return $merged;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -252,7 +252,7 @@ if (!function_exists('check_si')) {
|
||||
|
||||
if (!$is_si_found && $slab_value['si'] == $received_si) //match si amount
|
||||
{
|
||||
echo 'found - ' . $slab_value['si']. ' - ' . $received_si;
|
||||
// echo 'found - ' . $slab_value['si']. ' - ' . $received_si;
|
||||
$is_si_found = true;
|
||||
}
|
||||
|
||||
|
||||
@ -34,224 +34,224 @@ body {
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-size: 14px;
|
||||
}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 12px;
|
||||
}
|
||||
.container-fluid {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(77, 77, 77, 0.3);
|
||||
margin-bottom: 12px;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.user-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(77, 77, 77, 0.3);
|
||||
margin-bottom: 12px;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.user-card:hover {
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.user-card:hover {
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
background: #d6d6d6;
|
||||
color: white;
|
||||
padding: 12px 18px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
.card-header {
|
||||
background: #d6d6d6;
|
||||
color: white;
|
||||
padding: 12px 18px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.card-header:hover {
|
||||
background: #b4bec5;
|
||||
}
|
||||
.card-header:hover {
|
||||
background: #b4bec5;
|
||||
}
|
||||
|
||||
|
||||
.user-info h5 {
|
||||
margin-bottom: 2px;
|
||||
font-size: 1.1em;
|
||||
color: #121212;
|
||||
}
|
||||
.user-info h5 {
|
||||
margin-bottom: 2px;
|
||||
font-size: 1.1em;
|
||||
color: #121212;
|
||||
}
|
||||
|
||||
.user-email {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
color:rgb(56, 55, 55);
|
||||
}
|
||||
.user-email {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
color:rgb(56, 55, 55);
|
||||
}
|
||||
|
||||
.accordion-icon {
|
||||
font-size: 1.2em;
|
||||
transition: transform 0.3s ease;
|
||||
color: #121212;
|
||||
}
|
||||
.accordion-icon {
|
||||
font-size: 1.2em;
|
||||
transition: transform 0.3s ease;
|
||||
color: #121212;
|
||||
}
|
||||
|
||||
.accordion-icon.active {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.accordion-icon.active {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.card-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.4s ease;
|
||||
background: white;
|
||||
}
|
||||
.card-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.4s ease;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.card-content.active {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.card-content.active {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.content-inner {
|
||||
padding: 18px;
|
||||
}
|
||||
.content-inner {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.section {
|
||||
background: #d6dce1;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e9ecef;
|
||||
margin-bottom: 12px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.section {
|
||||
background: #d6dce1;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e9ecef;
|
||||
margin-bottom: 12px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.section:hover {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
.section:hover {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: #121212;
|
||||
font-size: 0.95em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.section-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: #121212;
|
||||
font-size: 0.95em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-checkbox {
|
||||
margin-right: 8px;
|
||||
transform: scale(1.1);
|
||||
cursor: pointer;
|
||||
}
|
||||
.main-checkbox {
|
||||
margin-right: 8px;
|
||||
transform: scale(1.1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.checkbox-group {
|
||||
margin-left: 24px;
|
||||
transition: all 0.3s ease;
|
||||
max-height: 225px;
|
||||
overflow-y: auto;
|
||||
padding-right: 8px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.checkbox-group {
|
||||
margin-left: 24px;
|
||||
transition: all 0.3s ease;
|
||||
max-height: 225px;
|
||||
overflow-y: auto;
|
||||
padding-right: 8px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.checkbox-group::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.checkbox-group::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-thumb {
|
||||
background: #667eea;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.checkbox-group::-webkit-scrollbar-thumb {
|
||||
background: #667eea;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-thumb:hover {
|
||||
background: #5a6fd8;
|
||||
}
|
||||
.checkbox-group::-webkit-scrollbar-thumb:hover {
|
||||
background: #5a6fd8;
|
||||
}
|
||||
|
||||
.checkbox-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
transition: background 0.2s ease;
|
||||
/* margin-bottom: 3px; */
|
||||
margin-bottom: -7px;
|
||||
}
|
||||
.checkbox-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
transition: background 0.2s ease;
|
||||
/* margin-bottom: 3px; */
|
||||
margin-bottom: -7px;
|
||||
}
|
||||
|
||||
.checkbox-item:hover {
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
.checkbox-item:hover {
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.checkbox-item input[type="checkbox"] {
|
||||
transform: scale(1.05);
|
||||
cursor: pointer;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.checkbox-item input[type="checkbox"] {
|
||||
transform: scale(1.05);
|
||||
cursor: pointer;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.checkbox-item label {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
margin: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.checkbox-item label {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
margin: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.policy-number {
|
||||
font-family: monospace;
|
||||
font-size: 0.8em;
|
||||
color: #6c757d;
|
||||
}
|
||||
.policy-number {
|
||||
font-family: monospace;
|
||||
font-size: 0.8em;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.submit-container {
|
||||
background: white;
|
||||
padding: 18px;
|
||||
border-radius: 8px;
|
||||
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
.submit-container {
|
||||
background: white;
|
||||
padding: 18px;
|
||||
border-radius: 8px;
|
||||
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* .btn-submit {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: none;
|
||||
padding: 10px 30px;
|
||||
font-weight: 600;
|
||||
border-radius: 25px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
/* .btn-submit {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: none;
|
||||
padding: 10px 30px;
|
||||
font-weight: 600;
|
||||
border-radius: 25px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
|
||||
} */
|
||||
.btn-submit:hover {
|
||||
background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
|
||||
} */
|
||||
|
||||
.output-container {
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
margin-top: 20px;
|
||||
display: none;
|
||||
}
|
||||
.output-container {
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
margin-top: 20px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.output-table {
|
||||
font-family: monospace;
|
||||
font-size: 0.85em;
|
||||
white-space: pre-wrap;
|
||||
background: white;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
</style>
|
||||
.output-table {
|
||||
font-family: monospace;
|
||||
font-size: 0.85em;
|
||||
white-space: pre-wrap;
|
||||
background: white;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@ -314,6 +314,12 @@ body {
|
||||
<span class="d-none d-sm-inline-block">HR Access Controll</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#hr-activity-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_activity_tab" onclick="appendHrActivityHistoryHtml(this)">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">HR Activity History</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#api-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="api_tab">
|
||||
<span class="mdi mdi-api"></span>
|
||||
@ -340,6 +346,17 @@ body {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="hr-activity-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" id="hr_activity_history_append_area" style="position: relative;bottom: 50px;">
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("client_api.php"); ?>
|
||||
<?php // include('client_others_tab.php'); ?>
|
||||
<?php include('notification.php'); ?>
|
||||
@ -358,6 +375,7 @@ body {
|
||||
<script>
|
||||
|
||||
let hrAccessControlHtmlAppended = false;
|
||||
let hrActivityHistoryHtmlAppended = false;
|
||||
|
||||
function client_kyc_docs() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
@ -416,7 +434,6 @@ body {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function client_notification() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
@ -432,14 +449,11 @@ body {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.getElementById("kyc_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_kyc_docs();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("RM_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_relationship_manager();
|
||||
@ -460,6 +474,7 @@ body {
|
||||
client_notification();
|
||||
});
|
||||
|
||||
//HR Access Controll
|
||||
function appendHrAccessControllHtml(input){
|
||||
console.log(input.id);
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
@ -490,6 +505,45 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
//HR Activity History
|
||||
function appendHrActivityHistoryHtml(input, submit = false){
|
||||
console.log(input.id);
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
let startDate = $('#startDate').val();
|
||||
let endDate = $('#endDate').val();
|
||||
console.log('client_id ', client_id);
|
||||
console.log('startDate ', startDate);
|
||||
console.log('endDate ', endDate);
|
||||
|
||||
if(submit){
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
}
|
||||
|
||||
let url = '<?= base_url('user/getUserActivityHistory') ?>';
|
||||
let requestData = {client_id : client_id, startDate : startDate, endDate : endDate};
|
||||
|
||||
if(hrActivityHistoryHtmlAppended == false){
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
$('#hr_activity_history_append_area').empty();
|
||||
$('#hr_activity_history_append_area').append(response.data)
|
||||
hrActivityHistoryHtmlAppended = true;
|
||||
} else {
|
||||
console.log(response.message, 'WARNING');
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
}
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
});
|
||||
}else{
|
||||
console.log('Already HTML appended');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@ -554,12 +608,13 @@ body {
|
||||
console.log(event.target.dataset.id);//return;
|
||||
let ids = event.target.dataset.id.split('-');
|
||||
console.log('ids', ids)
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
// let url = '<?= base_url('user/getUserActivityHistory?user_id=') ?>' + event.target.dataset.id.split('-')[0] + '&pre_hr_id=' + event.target.dataset.id.split('-')[1];
|
||||
let url = '<?= base_url('user/getUserActivityHistory') ?>';
|
||||
console.log(url);
|
||||
let user_type = "hr";
|
||||
|
||||
let requestData = {user_id : ids[0], pre_hr_id : ids[1], user_type : user_type};
|
||||
let requestData = {user_id : ids[1], pre_hr_id : ids[0], user_type : user_type, client_id : client_id};
|
||||
console.log('requestData', requestData);
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
@ -581,79 +636,6 @@ body {
|
||||
});
|
||||
}
|
||||
|
||||
// function submitForm(event) {
|
||||
// event.preventDefault();
|
||||
|
||||
// const formData = new FormData(document.getElementById('insuranceForm'));
|
||||
// const users = [];
|
||||
|
||||
// // Process User 1
|
||||
// const user1 = {
|
||||
// pk: formData.get('user1_pk'),
|
||||
// pre_hr_id: formData.get('user1_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user1_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user1_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user1_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user1_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user1_cd'),
|
||||
// allowed_claims: getCheckedValues('user1_claims')
|
||||
// };
|
||||
|
||||
// // Process User 2
|
||||
// const user2 = {
|
||||
// pk: formData.get('user2_pk'),
|
||||
// pre_hr_id: formData.get('user2_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user2_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user2_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user2_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user2_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user2_cd'),
|
||||
// allowed_claims: getCheckedValues('user2_claims')
|
||||
// };
|
||||
|
||||
// users.push(user1, user2);
|
||||
|
||||
// // Generate JSON format
|
||||
// const jsonOutput = users.map(user => {
|
||||
// const modules = user.allowed_modules.length > 0 ? `[${user.allowed_modules.join(',')}]` : '[]';
|
||||
// const prePolicies = user.allowed_pre_policies.length > 0 ? `[${user.allowed_pre_policies.join(',')}]` : '[]';
|
||||
// const activePolicies = user.allowed_active_policies.length > 0 ? `[${user.allowed_active_policies.join(',')}]` : '[]';
|
||||
// const cdPolicies = user.allowed_cd.length > 0 ? `[${user.allowed_cd.join(',')}]` : '[]';
|
||||
// const claims = user.allowed_claims.length > 0 ? `[${user.allowed_claims.join(',')}]` : '[]';
|
||||
|
||||
// return {
|
||||
// pk: parseInt(user.pk) || 0,
|
||||
// pre_hr_id: user.pre_hr_id || "",
|
||||
// post_hr_id: user.post_hr_id || "",
|
||||
// allowed_modules: modules,
|
||||
// allowed_pre_policies: prePolicies,
|
||||
// allowed_active_policies: activePolicies,
|
||||
// allowed_cd: cdPolicies,
|
||||
// allowed_claims: claims
|
||||
// };
|
||||
// });
|
||||
|
||||
// const output = JSON.stringify(jsonOutput, null, 1);
|
||||
|
||||
// // Display the output (you can modify this part based on your needs)
|
||||
// console.log(output);
|
||||
|
||||
// // Optional: Display in a textarea or pre element
|
||||
// const outputElement = document.getElementById('output');
|
||||
// if (outputElement) {
|
||||
// outputElement.textContent = output;
|
||||
// }
|
||||
|
||||
// // Optional: Copy to clipboard
|
||||
// if (navigator.clipboard) {
|
||||
// navigator.clipboard.writeText(output).then(() => {
|
||||
// console.log('Output copied to clipboard');
|
||||
// }).catch(err => {
|
||||
// console.error('Failed to copy to clipboard:', err);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
function submitForm(event) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -742,22 +724,6 @@ body {
|
||||
return Array.from(checkboxes).map(cb => cb.value);
|
||||
}
|
||||
|
||||
// $(document).on('change', '.select-all', function () {
|
||||
// let type = $(this).data('type');
|
||||
// let user = $(this).data('user');
|
||||
// let group = $(this).data('group');
|
||||
|
||||
// let selector = '.policy-checkbox[data-user="' + user + '"][data-group="' + group + '"]';
|
||||
|
||||
// if (type === 'active') {
|
||||
// selector += '.active';
|
||||
// } else if (type === 'inactive') {
|
||||
// selector += '.inactive';
|
||||
// }
|
||||
|
||||
// $(selector).prop('checked', this.checked);
|
||||
// });
|
||||
|
||||
$(document).on('change', '.select-all', function () {
|
||||
let $this = $(this);
|
||||
let type = $this.data('type');
|
||||
@ -802,6 +768,103 @@ body {
|
||||
console.log('--- END ---');
|
||||
});
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// function submitForm(event) {
|
||||
// event.preventDefault();
|
||||
|
||||
// const formData = new FormData(document.getElementById('insuranceForm'));
|
||||
// const users = [];
|
||||
|
||||
// // Process User 1
|
||||
// const user1 = {
|
||||
// pk: formData.get('user1_pk'),
|
||||
// pre_hr_id: formData.get('user1_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user1_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user1_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user1_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user1_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user1_cd'),
|
||||
// allowed_claims: getCheckedValues('user1_claims')
|
||||
// };
|
||||
|
||||
// // Process User 2
|
||||
// const user2 = {
|
||||
// pk: formData.get('user2_pk'),
|
||||
// pre_hr_id: formData.get('user2_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user2_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user2_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user2_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user2_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user2_cd'),
|
||||
// allowed_claims: getCheckedValues('user2_claims')
|
||||
// };
|
||||
|
||||
// users.push(user1, user2);
|
||||
|
||||
// // Generate JSON format
|
||||
// const jsonOutput = users.map(user => {
|
||||
// const modules = user.allowed_modules.length > 0 ? `[${user.allowed_modules.join(',')}]` : '[]';
|
||||
// const prePolicies = user.allowed_pre_policies.length > 0 ? `[${user.allowed_pre_policies.join(',')}]` : '[]';
|
||||
// const activePolicies = user.allowed_active_policies.length > 0 ? `[${user.allowed_active_policies.join(',')}]` : '[]';
|
||||
// const cdPolicies = user.allowed_cd.length > 0 ? `[${user.allowed_cd.join(',')}]` : '[]';
|
||||
// const claims = user.allowed_claims.length > 0 ? `[${user.allowed_claims.join(',')}]` : '[]';
|
||||
|
||||
// return {
|
||||
// pk: parseInt(user.pk) || 0,
|
||||
// pre_hr_id: user.pre_hr_id || "",
|
||||
// post_hr_id: user.post_hr_id || "",
|
||||
// allowed_modules: modules,
|
||||
// allowed_pre_policies: prePolicies,
|
||||
// allowed_active_policies: activePolicies,
|
||||
// allowed_cd: cdPolicies,
|
||||
// allowed_claims: claims
|
||||
// };
|
||||
// });
|
||||
|
||||
// const output = JSON.stringify(jsonOutput, null, 1);
|
||||
|
||||
// // Display the output (you can modify this part based on your needs)
|
||||
// console.log(output);
|
||||
|
||||
// // Optional: Display in a textarea or pre element
|
||||
// const outputElement = document.getElementById('output');
|
||||
// if (outputElement) {
|
||||
// outputElement.textContent = output;
|
||||
// }
|
||||
|
||||
// // Optional: Copy to clipboard
|
||||
// if (navigator.clipboard) {
|
||||
// navigator.clipboard.writeText(output).then(() => {
|
||||
// console.log('Output copied to clipboard');
|
||||
// }).catch(err => {
|
||||
// console.error('Failed to copy to clipboard:', err);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// $(document).on('change', '.select-all', function () {
|
||||
// let type = $(this).data('type');
|
||||
// let user = $(this).data('user');
|
||||
// let group = $(this).data('group');
|
||||
|
||||
// let selector = '.policy-checkbox[data-user="' + user + '"][data-group="' + group + '"]';
|
||||
|
||||
// if (type === 'active') {
|
||||
// selector += '.active';
|
||||
// } else if (type === 'inactive') {
|
||||
// selector += '.inactive';
|
||||
// }
|
||||
|
||||
// $(selector).prop('checked', this.checked);
|
||||
// });
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// $(document).on('change', '.post-select-all', function () {
|
||||
|
||||
// let $this = $(this);
|
||||
|
||||
120
app/Views/hr_activity_history.php
Normal file
120
app/Views/hr_activity_history.php
Normal file
@ -0,0 +1,120 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
/* .col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
} */
|
||||
|
||||
/* .dataTables_filter {
|
||||
position: absolute;
|
||||
margin-left: -25px;
|
||||
} */
|
||||
|
||||
/* .right-align-input {
|
||||
text-align: right;
|
||||
} */
|
||||
</style>
|
||||
|
||||
<div class="row" style="position: relative;left: 250px;top: 55px;">
|
||||
<div class="form-group col-md-3" id="date_div">
|
||||
<!-- <label>ActivityDate<span class="text-danger"></span></label> -->
|
||||
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
<input type="hidden" id="startDate">
|
||||
<input type="hidden" id="endDate">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<button type="button" class="btn btn-primary" onclick="appendHrActivityHistoryHtml(this, true)"> submit </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
<th>HR Name</th>
|
||||
<th>HR Mail</th>
|
||||
<th>Activity</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (isset($data) && !empty($data)) { ?>
|
||||
<?php foreach ($data as $index => $row) { ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['user_name']; ?></td>
|
||||
<td><?php echo $row['user_mail']; ?></td>
|
||||
<td><?php echo $row['activity']; ?></td>
|
||||
<td><?php echo $row['created_at']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-2'>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-3'i><'col-sm-2'l><'col-sm-7'p>>",
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
ordering: false
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
|
||||
// Daterangepicker setup
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
const start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
const end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user