FIX_ISSUE

This commit is contained in:
VENKATESHWARAN 2026-02-13 13:03:33 +05:30
parent a5248d52b3
commit e2a93aeb2e
3 changed files with 21 additions and 21 deletions

View File

@ -178,13 +178,10 @@ class UserController extends AdminController
]
],
];
if (!$this->validate($rules)) {
return $this->response->setStatusCode(400)->setJSON([
'status' => false,
'message' => 'Input validation failed',
'code' => 400,
'errors' => $this->validator->getErrors()
]);
if (!$this->validate($rules)) {
return redirect()->to(base_url('/user/list'))
->withInput()
->with('errors', $this->validator->getErrors());
}
$userData['created_by'] = get_session_userid();
@ -363,12 +360,9 @@ class UserController extends AdminController
],
];
if (!$this->validate($rules)) {
return $this->response->setStatusCode(400)->setJSON([
'status' => false,
'message' => 'Input validation failed',
'code' => 400,
'errors' => $this->validator->getErrors()
]);
return redirect()->to(base_url('/user/list'))
->withInput()
->with('errors', $this->validator->getErrors());
}
$data = $this->request->getPost();
@ -845,7 +839,7 @@ class UserController extends AdminController
],
'errors' => [
'required' => 'Retention Rate is required',
'regex_match' => 'Retention Rate must be between 0 and 100 with up to 2 decimal places'
'regex_match' => 'Retention Rate must be between 0 to 100 with up to 2 decimal places'
]
],
// ======================

View File

@ -884,12 +884,18 @@ table.dataTable tbody td {
</table>
</div>
</div>
<?php if (session()->getFlashdata('errors')): ?>
<script>
$(document).ready(function() {
<?php foreach (session()->getFlashdata('errors') as $error): ?>
toastr.error("<?= addslashes($error) ?>", "Validation Error");
<?php endforeach; ?>
});
</script>
<?php endif; ?>
<?php if (session()->getFlashdata('error')) : ?>
<?php foreach (session()->getFlashdata('error') as $error) : ?>
<script>
toastr.error("<?= esc($error) ?>", "Validation Error");
</script>
<?php endforeach; ?>
<script>
var errorModal = new bootstrap.Modal(

View File

@ -741,12 +741,12 @@
</div>
<div class="form-group col-md-3">
<label for="bp_cgst">D.O.C</label>
<label for="bp_cgst">D.O.C <span class="text-danger">*</span></label>
<input id="policy_start_date" type="text" class="form-control" name="policy_start_date" placeholder="DD/MM/YYYY" >
</div>
<div class="form-group col-md-3">
<label for="bp_igst">D.O.E</label>
<label for="bp_igst">D.O.E <span class="text-danger">*</span></label>
<input id="policy_end_date" type="text" class="form-control" name="policy_end_date" placeholder="DD/MM/YYYY" >
</div>
<!--