diff --git a/app/Config/Routes.php b/app/Config/Routes.php index c92e8115..2ec88ef2 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -41,6 +41,7 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'editUser', 'User::editUser'); $routes->post('user/Deleteuserdepartment', 'User::Deleteuserdepartment'); $routes->get('user/deleteUser', 'User::deleteUser'); $routes->get('user/reActivateUser', 'User::reActivateUser'); +$routes->get('isEmailExists', 'User::isEmailExists'); // Supplier Routes $routes->match(["GET","POST"],'supplierlisting', 'Supplier::index'); // list supplier diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index e29aba2e..469b535f 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -970,7 +970,7 @@ class Monthlypay extends BaseController $this->global['pageTitle'] = 'Employee Leave Application Form'; $data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm(); $data['employee_info'] = $this->monthlypay_model->getheringemployeeinformation(); - $data['status_info'] = ["Draft","Approved"]; + $data['status_info'] = ["Draft","Approved","Cancel"]; $this->loadviews('employeeLeaveApplicationForm', $this->global, $data, NULL); } diff --git a/app/Controllers/User.php b/app/Controllers/User.php index 66466711..2f55a36d 100755 --- a/app/Controllers/User.php +++ b/app/Controllers/User.php @@ -1020,15 +1020,11 @@ class User extends BaseController // Validation passed $EmpID = $this->request->getPost('EmpList'); - $roleId = !empty($this->request->getPost('role')) ? $this->request->getPost('role') : '2' ; + $roleId = $this->request->getPost('role'); $password = (string)$this->request->getPost('password'); $Createddt = date('Y-m-d H:i:s'); $email = $this->request->getPost('MailID'); - $SelectedDepartment = (string)$this->request->getPost('txtSelectedDepartment'); - $comma_separated = explode(':', $SelectedDepartment); - if (count($comma_separated) == 1 && in_array('DEP27', $comma_separated)) { - $roleId = '6'; - } + $userInfo = [ 'email' => $email, 'EmpID' => $EmpID, @@ -1040,16 +1036,7 @@ class User extends BaseController $result = $this->user_model->addNewUser($userInfo); - if ($SelectedDepartment != '') { - foreach ($comma_separated as $DeptCode) { - $userdept = [ - 'EmpID' => $EmpID, - 'Departmentcode' => $DeptCode - ]; - $access = $this->user_model->addAccess($userdept); - } - } - + if ($result > 0) { // return redirect()->to('userListing')->with('success', 'New user created successfully!'); $this->session->setFlashdata('success', 'New user created successfully!'); @@ -1072,6 +1059,27 @@ class User extends BaseController }; } + function isEmailExists(){ + + + $MailID = $this->request->getPost('MailID'); + $empID = $this->request->getPost('EmpID'); + + + if (!$MailID) { + return $this->response->setJSON(['success' => false, 'message' => 'Mail ID not provided']); + } + + $isEmailExists = $this->user_model->isEmailExists($MailID,$empID); + + if ($isEmailExists) { + return $this->response->setJSON(['success' => true, 'message' => 'Email Already Exsiting']); + } else { + return $this->response->setJSON(['success' => false, 'message' => '']); + } + + } + function Deleteuserdepartment() { diff --git a/app/Models/User_model.php b/app/Models/User_model.php index ebafde7c..b0656cdf 100755 --- a/app/Models/User_model.php +++ b/app/Models/User_model.php @@ -340,4 +340,20 @@ GROUP BY financial_year "; return $query->getResult(); } + + + public function isEmailExists($email, $excludeEmpID = null) + { + $builder = $this->db->table('tbl_users'); + $builder->select('email'); + $builder->where('email', $email); + + if (!empty($excludeEmpID)) { + $builder->where('EmpID !=', $excludeEmpID); + } + + $query = $builder->get(); + return $query->getNumRows() > 0; + } + } \ No newline at end of file diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index df60b841..7471ca43 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1256,7 +1256,7 @@ if (!empty($getlogpodtl)) { > IS THIS OPEN ORDER FORMAT - + @@ -1395,7 +1395,7 @@ if (!empty($getlogpodtl)) { if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?> - +     @@ -1659,7 +1659,7 @@ if (!empty($getlogpodtl)) {      - + @@ -1701,21 +1701,21 @@ if (!empty($getlogpodtl)) {
-   Reset -   Save as Draft -   Submit -   Approve +   Reset +   Save as Draft +   Submit +   Approve -   Reset -   Submit -   Approve +   Reset +   Submit +   Approve -   OK -   Submit +   OK +   Submit -   Reset -   Submit -   Approve +   Reset +   Submit +   Approve   OK @@ -1968,7 +1968,7 @@ if (!empty($getlogpodtl)) {
@@ -2262,7 +2262,7 @@ if (!empty($getlogpodtl)) { diff --git a/app/Views/POlist.php b/app/Views/POlist.php index 7f5f87b3..c6be2a09 100755 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -193,13 +193,13 @@ ?> - get('roleText') == 'System Administrator'){ ?> -     - + diff --git a/app/Views/accountsDashboard.php b/app/Views/accountsDashboard.php index ea3bdd4a..afde5728 100644 --- a/app/Views/accountsDashboard.php +++ b/app/Views/accountsDashboard.php @@ -436,7 +436,7 @@ Tax (%) Taxable Amt Total Amt - Remarks + Remarks * @@ -812,8 +812,8 @@ '' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '' + '' + Number(item.Rate).toFixed(2) + '' + '' + tax_percentage + '' + - '' + amount + '' + - '' + grand_total_amount + '' + + '' + Number(amount).toFixed(2) + '' + + '' + Number(grand_total_amount).toFixed(2) + ''; ' ' + ' ' + '' + @@ -852,8 +852,8 @@ '' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '' + '' + Number(item.Rate).toFixed(2) + '' + '' + tax_percentage + '' + - '' + amount + '' + - '' + grand_total_amount + '' + + '' + Number(amount).toFixed(2) + '' + + '' + Number(grand_total_amount).toFixed(2) + ''; ' ' + ' ' + '' + @@ -887,8 +887,8 @@ '' + item.QuantityAsPerInvoice + '' + '' + Number(item.Rate).toFixed(2) + '' + '' + tax_percentage + '' + - '' + amount + '' + - '' + grand_total_amount + '' + + '' + Number(amount).toFixed(2) + '' + + '' + Number(grand_total_amount).toFixed(2) + ''; '' + item.Remarks + '' + ' ' + '' + diff --git a/app/Views/addUser.php b/app/Views/addUser.php index d23d6733..e2c3a463 100755 --- a/app/Views/addUser.php +++ b/app/Views/addUser.php @@ -18,8 +18,8 @@
-
-
+ +
@@ -63,7 +63,7 @@
- +
-
+
@@ -181,58 +181,67 @@ $("#ContactNo").val(''); } }); + + $('#MailID').change(function() { + var mailID = $(this).val(); + var empID = ''// $('#EmpList').val(); + if (mailID) { + $('#loader').show(); + $.ajax({ + url: "isEmailExists", + type: 'POST', + data: { EmpID:empID,MailID:mailID }, + success: function(data) { + if (data.success) { + $('#loader').hide(); + alert(data.message); + $("#MailID").val(''); + } else { + $('#loader').hide(); + } + }, + error: function() { + $('#loader').hide(); + alert('An Error Occur in this email address'); + $("#MailID").val(''); + } + }); + }else{ + alert("Invalid email address"); + } + }); }); - $('#addPop').click(function() { - if ($('#distriList option:selected').val() != null) { - if ($('#distriList option:selected').val() == 0) {} else { - var tempSelect = $('#distriList option:selected').val(); - var tempText = $('#distriList option:selected').text(); - var o = new Option(tempText, tempSelect); - var hidval = tempSelect; - var Selectedval = '' - if (orgVal != '') { - Selectedval = orgVal + ':' + hidval; - } else { - Selectedval = hidval - } - $(o).html(tempText); - $("#selectDistriList").append(o); - $('#distriList option:selected').remove(); - $("#distriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected"); - $("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected"); - tempSelect = ''; - tempText = ''; - Selectedval = ''; - } - } else { - alert("Before add please select any position."); - } - }); > \ No newline at end of file diff --git a/app/Views/editOldasset.php b/app/Views/editOldasset.php index 35c903af..76d7c852 100755 --- a/app/Views/editOldasset.php +++ b/app/Views/editOldasset.php @@ -272,7 +272,7 @@ if (!empty($assetList)) {
Cancel - +
diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index e142d4b3..48b5e391 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -364,7 +364,7 @@ if ($total <= $reorder) { - +
diff --git a/app/Views/editRevenueAmendPO.php b/app/Views/editRevenueAmendPO.php index 91c73689..d230eafd 100755 --- a/app/Views/editRevenueAmendPO.php +++ b/app/Views/editRevenueAmendPO.php @@ -1681,7 +1681,7 @@ if (!empty($INRSYMBOL)) { Previous Upload -      - +
@@ -1735,9 +1735,9 @@ if (!empty($INRSYMBOL)) {
-   Reset -   Save as Draft -   Approve +   Reset +   Save as Draft +   Approve
@@ -2165,7 +2165,7 @@ if (!empty($INRSYMBOL)) { diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index 8888791f..aedc3008 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -2359,7 +2359,7 @@ if (!empty($getlogpodtl)) { + class="btn btn-success auditor-restricted-btn" id="abcd">Select Line Item @@ -2575,7 +2575,7 @@ if (!empty($getlogpodtl)) { data-userid="" data-toggle="modal" href="#EDITREVENUE"> - @@ -2947,7 +2947,7 @@ if (!empty($getlogpodtl)) { Previous Upload -      - + @@ -3002,21 +3002,21 @@ if (!empty($getlogpodtl)) {
-   Reset -   Save as Draft -   Submit -   Approve +   Reset +   Save as Draft +   Submit +   Approve -   Reset -   Submit -   Approve +   Reset +   Submit +   Approve   OK -   Submit +   Submit -   Reset -   Submit -   Approve +   Reset +   Submit +   Approve   OK @@ -3381,7 +3381,7 @@ if (!empty($getlogpodtl)) { @@ -3749,7 +3749,7 @@ if (!empty($getlogpodtl)) { @@ -4579,7 +4579,7 @@ if (!empty($getlogpodtl)) { - + diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index 2c7c4e5e..b3f41f9a 100755 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -1404,7 +1404,7 @@ foreach ($PaymentTerms as $TER) { Previous Upload -      - +
@@ -1451,9 +1451,9 @@ foreach ($PaymentTerms as $TER) {
-   Reset -   Save as Draft -   Approve +   Reset +   Save as Draft +   Approve
@@ -1783,7 +1783,7 @@ foreach ($PaymentTerms as $TER) { diff --git a/app/Views/editSupplier.php b/app/Views/editSupplier.php index 1b8366f8..5e90c047 100755 --- a/app/Views/editSupplier.php +++ b/app/Views/editSupplier.php @@ -498,7 +498,7 @@ if (!empty($supplier)) { - + diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 27bf6f70..1013c078 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -99,7 +99,7 @@ if (!empty($master)) {
   + class="btn btn-success auditor-restricted-btn">   Configuration Value
@@ -211,6 +211,7 @@ if (!empty($master)) {       configlisting?page=" class="btn btn-secondary" > Cancel - + @@ -361,7 +362,7 @@ if (!empty($master)) { data-dismiss="modal">Cancel diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 4f881dbe..a2e23b74 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -836,7 +836,7 @@ if (!empty($getlogpodtl)) {
- Add Line Item + Add Line Item
@@ -1037,7 +1037,7 @@ if (!empty($getlogpodtl)) { if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED) { ?>     - + @@ -1336,7 +1336,7 @@ if (!empty($getlogpodtl)) { Previous Upload -      - +
@@ -1389,17 +1389,17 @@ if (!empty($getlogpodtl)) {
-   Reset -   Save as Draft -   Submit -   Approve +   Reset +   Save as Draft +   Submit +   Approve -   Reset -   Submit -   Approve +   Reset +   Submit +   Approve OK -   Submit +   Submit OK @@ -2568,7 +2568,7 @@ if (!empty($getlogpodtl)) {
diff --git a/app/Views/editrequisitionform.php b/app/Views/editrequisitionform.php index 627eb3f9..64dcc3d3 100755 --- a/app/Views/editrequisitionform.php +++ b/app/Views/editrequisitionform.php @@ -208,7 +208,7 @@ td {
@@ -251,7 +251,7 @@ td { StatusName; ?> -     +     CategoryName; ?> @@ -296,14 +296,14 @@ td {
-    -    -    -    +    +    +    +    -    -    -    +    +    +   
@@ -487,7 +487,7 @@ td { + class="btn btn-info waves-effect waves-light auditor-restricted-btn EditClick">Edit diff --git a/app/Views/employeeLeaveApplicationForm.php b/app/Views/employeeLeaveApplicationForm.php index 65974ac5..b7bcc8d6 100755 --- a/app/Views/employeeLeaveApplicationForm.php +++ b/app/Views/employeeLeaveApplicationForm.php @@ -82,7 +82,7 @@ From Date To Date Number Of Days - Status + Status Action @@ -105,7 +105,7 @@ - + -
+
@@ -241,6 +242,7 @@
+
@@ -256,8 +258,10 @@
@@ -349,10 +353,10 @@ alert('Please Enter the Reason'); return; } - if ($('#status_val').val() === '') { - alert('Please Select Status'); - return; - } + // if ($('#status_val').val() === '') { + // alert('Please Select Status'); + // return; + // } // validateDateRange(function(isValid) { // if (!isValid) { // alert("The selected date range overlaps with an existing approved leave."); @@ -366,7 +370,7 @@ end_date:$('#end_date').val(), no_of_days:$('#no_of_days').val(), reason:$('#reason').val(), - status:$('#status_val').val(), + status:$('#status_val').val() ? $('#status_val').val() : 'Draft', }; $('#loader').show(); diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index 9dcc2b9c..bdf32fc3 100755 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -101,7 +101,7 @@
Export Excel - Add New Employee + Add New Employee
diff --git a/app/Views/includes/new_footer.php b/app/Views/includes/new_footer.php index 0d2c6d92..25454a4a 100755 --- a/app/Views/includes/new_footer.php +++ b/app/Views/includes/new_footer.php @@ -155,6 +155,39 @@ + + -