diff --git a/app/Controllers/AppContentManagementController.php b/app/Controllers/AppContentManagementController.php index a3db36ec..15a95f49 100755 --- a/app/Controllers/AppContentManagementController.php +++ b/app/Controllers/AppContentManagementController.php @@ -73,11 +73,11 @@ class AppContentManagementController extends AdminController ] ], 'client_id' => [ - 'rules' => 'required|integer|is_natural_no_zero', + 'rules' => 'required|integer|is_natural', 'errors' => [ - 'required' => 'Client is required', - 'integer' => 'Invalid client selected', - 'is_natural_no_zero' => 'Invalid client selected' + 'required' => 'Client is required', + 'integer' => 'Invalid client selected', + 'is_natural' => 'Invalid client selected', ] ], 'advertise_image' => [ @@ -85,15 +85,13 @@ class AppContentManagementController extends AdminController . 'is_image[advertise_image]' . '|mime_in[advertise_image,image/jpg,image/jpeg,image/png]' . '|max_size[advertise_image,200]' - . '|min_dims[advertise_image,1640,664]' . '|max_dims[advertise_image,1640,664]', 'errors' => [ 'uploaded' => 'Image is required', 'is_image' => 'File must be an image', 'mime_in' => 'Only JPG, JPEG, PNG allowed', 'max_size' => 'Image size must not exceed 200 KB', - 'min_dims' => 'Image dimensions must be exactly 1640x664 pixels', - 'max_dims' => 'Image dimensions must be exactly 1640x664 pixels', + 'max_dims' => 'Image dimensions must not exceed 1640x664 pixels', ] ], ]; @@ -110,9 +108,11 @@ class AppContentManagementController extends AdminController $file = $this->request->getFile('advertise_image'); $client_id = (int)($sanitized_post_data['client_id'] ?? 0); - $clientExists = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first(); - if (!$clientExists) { - return $this->respond(['status' => false, 'message' => 'Invalid client selected.'], 400); + if ($client_id !== 0) { + $clientExists = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first(); + if (!$clientExists) { + return $this->respond(['status' => false, 'message' => 'Invalid client selected.'], 400); + } } if (!$file || !$file->isValid()) { @@ -123,6 +123,11 @@ class AppContentManagementController extends AdminController return $this->respond(['status' => false, 'message' => 'Only JPG, JPEG, PNG files are allowed.'], 400); } + $dimInfo = @getimagesize($file->getTempName()); + if ($dimInfo === false || (int) $dimInfo[0] !== 1640 || (int) $dimInfo[1] !== 664) { + return $this->respond(['status' => false, 'message' => 'Image dimensions must be exactly 1640x664 pixels.'], 400); + } + $fileName = sanitize_upload_filename($file->getClientName()); $existing = $this->addImgModel->where('name', $fileName)->where('client_id', $client_id)->where('is_active', 1)->first(); if($existing){ return $this->respond(['status' => false, 'message' => 'This file has already been uploaded in active state.'], 400); } diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 3c1d1940..df632ae8 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -497,6 +497,7 @@ class EmployeeController extends AdminController batch_files.is_active, batch_files.amount, batch_files.status, + batch_files.icici_status_flag, batch_files.client_branch_id, insurers.short_name as insurer_short_name, tpa.short_name as tpa_short_name, diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 8849f24f..d93e987e 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -61,6 +61,11 @@ for ($i = 0; $i < $batch_col_count; $i++) { cursor: pointer; } +/* Allow line breaks in tooltip titles using \n */ +.tooltip-inner { + white-space: pre-line; +} + /* Column widths from max data length (see PHP above). Avoid table-layout:fixed + identical max-width on TH — it fights DataTables col sizing and skews TH vs TD. Do not max-width THEAD cells (sort icons use position:absolute; narrow max clips them). */ @@ -289,15 +294,32 @@ for ($i = 0; $i < $batch_col_count; $i++) {