muliple branch access changes

This commit is contained in:
resicovenba 2017-11-22 20:38:34 +05:30
parent abc1995004
commit 3c8c415288
10 changed files with 222 additions and 135 deletions

View File

@ -235,8 +235,8 @@ class Employee_Controller extends REST_Controller {
$req['MobileNumber'] = $data['MobileNumber'];
$req['AlternateNumber'] = $data['AlternateNumber'];
$req['Gender'] = $data['Gender'];
$req['DOB'] = date('d-m-Y', strtotime($data['DOB']) );
// $req['DOB'] = $data['dateofbirth'];
// $req['DOB'] = date('d-m-Y', strtotime($data['DOB']) );
$req['DOB'] = $data['DOB'];
$req['PresentAddress'] = $data['PresentAddress'];
$req['PermanentAddress'] = $data['PermanentAddress'];
$req['AadharNumber'] = $data['AadharNumber'];
@ -292,13 +292,15 @@ class Employee_Controller extends REST_Controller {
// update employee branch
public function updateEmpBranchDetail_post() {
$empFor = $this->post('empFor');
$reqBanch['BranchCode'] = $this->post('updateBranch');
$req['ListCode'] = $this->post('updateRole');
$req['UpdatedBy'] = $this->post('updateBy');
$date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date;
$updateBranch = $this->employee_model->upate_employee_branch( $empFor, $reqBanch, $req );// Check if the employee exist
$updateBranch = $this->employee_model->upate_employee_branch( $empFor, $reqBanch, $req, $req['UpdatedBy'], $req['UpdatedOn'] );// Check if the employee exist
if ($updateBranch)
{
$updateBranch['status'] = REST_Controller::HTTP_OK;

View File

@ -337,33 +337,19 @@ class Employee_model extends CI_Model
$this->db->where('StaffID', $updateFor);
$this->db->update(STAFF, $empArr);
if ($this->db->affected_rows() == '1') {
$result['updateEmpStatus'] = true;
$result['message'] = "Successfully employee details Udated";
// $branchArr['BranchCode'] = $empArr['BranchCode'];
// $branchArr['IsActive'] = $empArr['IsActive'];
// $branchArr['CreatedBy'] = $createdBy;
// $this->db->where('StaffID',$updateFor);
// $this->db->insert(STAFF_BRANCH, $branchArr);
// if($this->db->affected_rows() == '1'){
// $loginArr['StaffID'] = $empArr['StaffID'];
// $loginArr['ListCode'] = $empArr['ListCode'];
// $loginArr['MobileNumber'] = $empArr['MobileNumber'];
// $loginArr['EmailId'] = $empArr['EmailID'];
// $loginArr['IsActive'] = $empArr['IsActive'];
// $loginArr['CreatedBy'] = $createdBy;
// $loginArr['Password'] = ENCR_PASSWORD;
// $this->db->insert(LOGIN, $loginArr);
// if($this->db->affected_rows() == '1'){
// $result['addEmpStatus'] = true;
// $result['message'] = "Successfully employee details added";
// } else {
// $result['addEmpStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
// } else {
// $result['addEmpStatus'] = false;
// $result['message'] = "Something went wrong.please try again";
// }
$mobile = $empArr['MobileNumber'];
$email = $empArr['EmailID'];
$active = $empArr['IsActive'];
$updatedBy = $empArr['UpdatedBy'];
$updatedOn = $empArr['UpdatedOn'];
$sql = "UPDATE ".LOGIN." SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'";
if($this->db->query($sql) == '1'){
$result['addEmpStatus'] = true;
$result['message'] = "Successfully employee details Updated";
} else {
$result['addEmpStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
} else {
$result['updateEmpStatus'] = false;
$result['message'] = "Something went wrong.please try again";
@ -396,10 +382,20 @@ class Employee_model extends CI_Model
}
return $result;
}
public function get_branch_code($name) {
$this->db->select('BranchCode');
$this->db->from(BRANCH);
$this->db->where('BranchName', $name);
$roleDetails = $this->db->get()->first_row();
return $roleDetails->BranchCode;
}
// update employee branch details
public function upate_employee_branch($empFor, $reqBanch, $req)
{
public function upate_employee_branch($empFor, $reqBanch, $req, $createby, $createon)
{
// print_r( count($reqBanch['BranchCode']));exit();
if( count($reqBanch['BranchCode']) > 1) {
$this->db->where('StaffID', $empFor);
$this->db->update(STAFF, $req);
// update role to staff table
@ -409,15 +405,57 @@ class Employee_model extends CI_Model
// echo $this->db->affected_rows();exit();
// update role to login table
if ($this->db->affected_rows() == '1') {
// $this->db->where('StaffID', "'$empFor'");
// $this->db->update(STAFF, $reqBanch);
$branchCode = $reqBanch['BranchCode'];
$branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]);
$sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'";
// update branch to staff table
if ($this->db->query($sql) == '1') {
// $this->db->where('StaffID', $empFor);
// $this->db->update(STAFF_BRANCH, $reqBanch);
$sql1 = "UPDATE ".STAFF_BRANCH." SET BranchCode='$branchCode' WHERE StaffID='$empFor'";
if ($this->db->query($sql) == '1') {
$this->db->where('StaffID', $empFor);
$this->db->delete(STAFF_BRANCH);
foreach($reqBanch['BranchCode'] as $something) {
$branchCode = $this->get_branch_code($something);
$sql1 = "INSERT INTO ".STAFF_BRANCH." (StaffID, BranchCode, IsActive, CreatedBy, CreatedOn)
VALUES ('$empFor', '$branchCode', '1','$createby', '$createon')";
// update branch to staff_branch table
if ($this->db->query($sql1) == '1') {
$result['updateEmpbranchStatus'] = true;
$result['message'] = "Successfully employee branch details Updated";
} else {
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
}
} else {
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
} else {
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
} else {
$result['updateEmpbranchStatus'] = false;
$result['message'] = "Something went wrong.please try again";
}
return $result;
} else {
$this->db->where('StaffID', $empFor);
$this->db->update(STAFF, $req);
// update role to staff table
if ($this->db->affected_rows() == '1') {
$this->db->where('StaffID', $empFor);
$this->db->update(LOGIN, $req);
// echo $this->db->affected_rows();exit();
// update role to login table
if ($this->db->affected_rows() == '1') {
$branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]);
$sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'";
// update branch to staff table
if ($this->db->query($sql) == '1') {
$this->db->where('StaffID', $empFor);
$this->db->delete(STAFF_BRANCH);
$sql1 = "INSERT INTO ".STAFF_BRANCH." (StaffID, BranchCode, IsActive, CreatedBy, CreatedOn)
VALUES ('$empFor', '$branchCode', '1','$createby', '$createon')";
// update branch to staff_branch table
if ($this->db->query($sql1) == '1') {
$result['updateEmpbranchStatus'] = true;
@ -439,6 +477,8 @@ class Employee_model extends CI_Model
$result['message'] = "Something went wrong.please try again";
}
return $result;
}
}
public function selfGetEmpId($sID)

View File

@ -84,7 +84,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com
url: '/employee',
templateUrl: "assets/views/employeeDetails.html",
title: 'Employee',
resolve: loadSequence('spin', 'ui.mask', 'ladda', 'angular-ladda', 'employeeCtrl', 'ngTable'),
resolve: loadSequence('ui.select','spin', 'ui.mask', 'ladda', 'angular-ladda', 'employeeCtrl', 'ngTable'),
ncyBreadcrumb: {
label: 'Employee'
}

View File

@ -38,7 +38,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
$scope.employeeDetails = '';
$scope.loader = false;
$scope.emptyData;
// 2017-11-23T00:00:00+0530
// sorting function for table params
$scope.sort = function (keyname) {
$scope.sortKey = keyname; //set the sortKey to the param passed
@ -150,7 +150,15 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
if (response.data.empBranchDetails) {
// $scope.editBranchId = id;
$scope.branchEditLoading = false;
$scope.empBranchDetails = response.data.branch_details[0];
$scope.empBranchs = response.data.branch_details;
$scope.branchArr = [];
angular.forEach($scope.empBranchs, function (item, index) {
// alert(item.BranchName);
$scope.branchArr.push(item.BranchName);
});
$scope.empBranchDetails = {
arr: $scope.branchArr,
}
$scope.empRoleDetail = response.data.role_details[0];
} else {
}
@ -193,6 +201,11 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
if (response.data.MeasterBranchDetailStatus == true) {
$scope.branchDetails = response.data.branch_details;
$scope.branchDetailsName = [];
angular.forEach($scope.branchDetails, function (item, index) {
// alert(item.BranchName);
$scope.branchDetailsName.push(item.BranchName);
});
} else {
}
@ -268,6 +281,9 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
// add empolyee
$scope.employeeForm = {
submit: function (form, myModel) {
// var formate = "yyyy-MM-dd'T'HH:mm:ssZ";
// var date = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
// alert(date);
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
@ -284,9 +300,12 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
// alert($scope.myModel.dateofbirth);
var formate = "yyyy-MM-dd";
// var date = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
$scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), 'dd-MM-yyyy');
$scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), 'dd-MM-yyyy');
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
$scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), formate);
// alert($scope.myModel.dateofbirth)
var req = {
method: 'POST',
@ -403,13 +422,15 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
$scope.dob= new Date(p.DOB).toDateString();
$scope.doj=new Date(p.DOJ).toDateString();
// alert(p.DOB);
var formate = "dd-MM-yyyy";
// var dob= new Date(p.DOB).toDateString();
// $scope.doj=new Date(p.DOJ).toDateString();
// alert(p.DOB);
// alert(dob.toLocaleDateString());
p.IsActive = p.IsActive === true ? 1 : 0;
p.DOB = $filter('date')(new Date($scope.dob), 'dd-MM-yyyy');
p.DOJ = $filter('date')(new Date($scope.doj), 'dd-MM-yyyy');
p.DOB = $filter('date')(new Date(p.DOB), formate);
p.DOJ = $filter('date')(new Date(p.DOJ), formate);
var req = {
method: 'POST',
url: apiPoint.url + 'updateEmpExistDetail/',
@ -435,53 +456,56 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
}
$scope.updateEmpBranchDetails = function (form, empRole, empBranchs, p) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
if (firstError === null && !form[field].$valid) {
firstError = form[field].$name;
}
if (form[field].$pristine) {
form[field].$dirty = true;
// alert(empBranchs.arr.length);
if (empBranchs.arr.length >= 1) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
if (firstError === null && !form[field].$valid) {
firstError = form[field].$name;
}
if (form[field].$pristine) {
form[field].$dirty = true;
}
}
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
// alert(JSON.stringify(p));
// alert(JSON.stringify(empRole));
// alert(JSON.stringify(empBranchs));
$scope.sendBranchData = {
'empFor': p.StaffID,
'updateRole': empRole.ListCode,
'updateBranch': empBranchs.arr,
'updateBy': localDetails.localUserID
}
// p.IsActive = p.IsActive === true ? 1 : 0;
var req = {
method: 'POST',
url: apiPoint.url + 'updateEmpBranchDetail/',
headers: {
'Content-Type': 'application/json'
},
data: $scope.sendBranchData
};
$http(req).then(function (response) {
if (response.data.updateEmpbranchStatus = true) {
swal("Success!", response.data.message, "success");
$scope.getEmployeeList();
$scope.editBranchId = -1;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}
});
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
} else {
// alert(JSON.stringify(p));
// alert(JSON.stringify(empRole));
// alert(JSON.stringify(empBranchs));
$scope.sendBranchData = {
'empFor': p.StaffID,
'updateRole': empRole.ListCode,
'updateBranch': empBranchs.BranchCode,
'updateBy': localDetails.localUserID
}
// p.IsActive = p.IsActive === true ? 1 : 0;
var req = {
method: 'POST',
url: apiPoint.url + 'updateEmpBranchDetail/',
headers: {
'Content-Type': 'application/json'
},
data: $scope.sendBranchData
};
$http(req).then(function (response) {
if (response.data.updateEmpbranchStatus = true) {
swal("Success!", response.data.message, "success");
$scope.getEmployeeList();
$scope.editBranchId = -1;
} else {
// $scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}
});
swal("Warning!", "should select atleast branch!!", "warning");
}
}
}]);

View File

@ -356,7 +356,7 @@
Branch Details
</legend>
<div class="row">
<div class="col-md-4 form-group" ng-class="{'has-error':Form.homeBranch.$dirty && Form.homeBranch.$invalid, 'has-success':Form.homeBranch.$valid}">
<!--<div class="col-md-4 form-group" ng-class="{'has-error':Form.homeBranch.$dirty && Form.homeBranch.$invalid, 'has-success':Form.homeBranch.$valid}">
<label for="form-field-select-2">
Home Branch <span class="symbol required"></span>
</label>
@ -366,6 +366,23 @@
<option ng-repeat="item in branchDetails" value="{{item.BranchCode}}" ng-selected="empBranchDetails.BranchCode == item.BranchCode">{{item.BranchName}}</option>
</select>
<span class="error text-small block" ng-if="Form.homeBranch.$dirty && Form.homeBranch.$error.required">Home Branch is Required</span>
</div>-->
<div>
<div class=" col-md-4 form-group">
<label>
Select Branch
<!--<div>{{ branchDetailsName | json}}</div>
<div>{{ empBranchDetails | json}}</div>-->
</label>
<ui-select multiple ng-model="empBranchDetails.arr" theme="bootstrap" ng-disabled="disabled" close-on-select="false">
<ui-select-match placeholder="Select Branch">
{{$item}}
</ui-select-match>
<ui-select-choices repeat="name in branchDetailsName | filter:$select.search">
{{name}}
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.role.$dirty && Form.role.$invalid, 'has-success':Form.role.$valid}">

View File

@ -158,7 +158,7 @@
Employee ID <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Employee Id" tabindex="5" class="form-control" name="employeeId" ng-model="p.StaffID"
<input type="text" placeholder="Enter Employee Id" tabindex="1" class="form-control" name="employeeId" ng-model="p.StaffID"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" ng-blur='checkEmpIdExist()' readonly required/>
<span class="error text-small block" ng-if="Form.employeeId.$dirty && Form.employeeId.$error.required">Employee Id required</span>
<span class="error text-small block" ng-if="Form.employeeId.$dirty && Form.employeeId.$error.pattern">Invalid Employee Id </span>
@ -170,7 +170,7 @@
First Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter First Name" tabindex="5" class="form-control" name="firstname" ng-model="p.Firstname"
<input type="text" placeholder="Enter First Name" tabindex="2" class="form-control" name="firstname" ng-model="p.Firstname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.required">First Name required</span>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.pattern">Invalid First Name </span>
@ -181,7 +181,7 @@
Last Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Last Name" tabindex="5" class="form-control" name="lastname" ng-model="p.Lastname"
<input type="text" placeholder="Enter Last Name" tabindex="3" class="form-control" name="lastname" ng-model="p.Lastname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.lastname.$dirty && Form.lastname.$error.required">Last Name required</span>
<span class="error text-small block" ng-if="Form.lastname.$dirty && Form.lastname.$error.pattern">Invalid Last Name </span>
@ -193,7 +193,7 @@
Father Name
</label>
<input type="text" placeholder="Enter Father Name" tabindex="5" class="form-control" name="fathername" ng-model="p.Fathername"
<input type="text" placeholder="Enter Father Name" tabindex="4" class="form-control" name="fathername" ng-model="p.Fathername"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.fathername.$dirty && Form.fathername.$error.pattern">Invalid Father Name </span>
</div>
@ -211,7 +211,7 @@
<label>
Email ID <span class="symbol required"></span>
</label>
<input type="email" tabindex="27" placeholder="Enter Email ID" class="form-control" name="emailId" ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
<input type="email" tabindex="6" placeholder="Enter Email ID" class="form-control" name="emailId" ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
ng-model="p.EmailID" ng-blur='updateCheckEmailExist(p)' required>
<span class="error text-small block" ng-if="Form.emailId.$dirty && Form.primaryEmail.$invalid" ng-hide="Form.emailId.$error.email">Email is required.</span>
<span class="error text-small block" ng-if="Form.emailId.$error.email">Please, enter a valid email address.</span>
@ -224,7 +224,7 @@
Mobile Number <span
class="symbol required"></span>
</label>
<input type="text" name="primaryPhone" tabindex="29" placeholder="Enter Mobile Number" class="form-control" ng-model="p.MobileNumber"
<input type="text" name="primaryPhone" tabindex="7" placeholder="Enter Mobile Number" class="form-control" ng-model="p.MobileNumber"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" ng-blur='updateCheckMobileExist(p)' required/>
<span class="error text-small block" ng-if="Form.primaryPhone.$dirty && Form.primaryPhone.$invalid" ng-hide="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Mobile Number is required.</span>
<span class="error text-small block" ng-if="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Enter a Valid Phone Number</span>
@ -233,7 +233,7 @@
<label class="control-label">
Alternate Mobile Number
</label>
<input type="text" name="secondaryPhone" tabindex="30" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="p.AlternateNumber"
<input type="text" name="secondaryPhone" tabindex="8" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="p.AlternateNumber"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" />
<span class="error text-small block" ng-if="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Enter a Valid Phone Number</span>
</div>
@ -246,7 +246,7 @@
Date Of Birth <span
class="symbol required"></span>
</label>
<input type="text" tabindex="6" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="p.DOB"
<input type="text" tabindex="9" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="p.DOB"
is-open="startOpen" ng-init="startOpen = false" name="dateofbirth" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />
@ -281,7 +281,7 @@
Qualification
</label>
<input type="text" placeholder="Enter Qualification" tabindex="5" class="form-control" name="qualificaion" ng-model="p.Qualification"
<input type="text" placeholder="Enter Qualification" tabindex="11" class="form-control" name="qualificaion" ng-model="p.Qualification"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.qualificaion.$dirty && Form.qualificaion.$error.pattern">Enter a Valid Qualification</span>
</div>
@ -292,7 +292,7 @@
</label>
<!--<input type="text" class="form-control" name="masked" placeholder="99/99/9999" ui-mask="99/99/9999" ng-model="x">-->
<input type="text" name="aadharNumber" tabindex="29" placeholder="0000-0000-0000" ui-mask="9999-9999-9999" class="form-control"
<input type="text" name="aadharNumber" tabindex="12" placeholder="____-____-____" ui-mask="9999-9999-9999" class="form-control"
ng-model="p.AadharNumber" ng-minlength="10" ng-maxlength="15" ng-pattern="/^[0-9]*$/"
required>
<span class="error text-small block" ng-if="Form.aadharNumber.$dirty && Form.aadharNumber.$invalid" ng-hide="Form.aadharNumber.$error.maxlength || Form.aadharNumber.$error.minlength || Form.aadharNumber.$error.pattern">Aadhar Number is required.</span>
@ -307,7 +307,7 @@
<label>
Other ID
</label>
<input type="text" name="otherId" tabindex="29" placeholder="Other Id" class="form-control" ng-model="p.OtherID"
<input type="text" name="otherId" tabindex="13" placeholder="Other Id" class="form-control" ng-model="p.OtherID"
ng-minlength="1" ng-maxlength="20" ng-pattern="/^[a-zA-Z0-9 ._-]+$/">
<span class="error text-small block" ng-if="Form.otherId.$dirty && Form.otherId.$invalid" ng-hide="Form.otherId.$error.maxlength || Form.otherId.$error.minlength || Form.otherId.$error.pattern">Aadhar Number is required.</span>
<span class="error text-small block" ng-if="Form.otherId.$error.maxlength || Form.otherId.$error.minlength || Form.otherId.$error.pattern">Enter a Valid Details</span>
@ -316,7 +316,7 @@
<label>
Other ID Details
</label>
<input type="text" name="otherIdDetails" tabindex="29" placeholder="Other Id Details" class="form-control" ng-model="p.OtherIDDetails"
<input type="text" name="otherIdDetails" tabindex="14" placeholder="Other Id Details" class="form-control" ng-model="p.OtherIDDetails"
ng-minlength="1" ng-maxlength="20" ng-pattern="/^[a-zA-Z0-9 ._-]+$/">
<span class="error text-small block" ng-if="Form.otherIdDetails.$dirty && Form.otherIdDetails.$invalid" ng-hide="Form.otherIdDetails.$error.maxlength || Form.otherIdDetails.$error.minlength || Form.otherIdDetails.$error.pattern">Aadhar Number is required.</span>
<span class="error text-small block" ng-if="Form.otherIdDetails.$error.maxlength || Form.otherIdDetails.$error.minlength || Form.otherIdDetails.$error.pattern">Enter a Valid Details</span>
@ -327,14 +327,14 @@
<label>
Permenent Address
</label>
<textarea placeholder="Enter Permenent Address" tabindex="31" class="form-control textdsc" name="address1" ng-model="p.PermanentAddress"></textarea>
<textarea placeholder="Enter Permenent Address" tabindex="15" class="form-control textdsc" name="address1" ng-model="p.PermanentAddress"></textarea>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permenent Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address2.$dirty && Form.address2.$invalid}">
<label>
Current Address
</label>
<textarea placeholder="Enter Current Address" tabindex="31" class="form-control textdsc" name="address2" ng-model="p.PresentAddress"></textarea>
<textarea placeholder="Enter Current Address" tabindex="16" class="form-control textdsc" name="address2" ng-model="p.PresentAddress"></textarea>
<span class="error text-small block" ng-if="Form.address2.$dirty && Form.address2.$invalid">Current Address is required</span>
</div>
</div>
@ -345,7 +345,7 @@
Date Of Joining <span class="symbol required"></span>
</label>
<input type="text" tabindex="6" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="p.DOJ"
<input type="text" tabindex="17" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="p.DOJ"
is-open="startOpen" ng-init="startOpen = false" name="dateofjoining" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />
@ -390,10 +390,10 @@
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="button" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateEmpDetails(Form, p)">
<button type="button" ladda="ldloading1.zoom_in" tabindex="19" class="btn btn-wide btn-success" data-style="zoom-in" ng-click="updateEmpDetails(Form, p)">
Save
</button>
<button type="reset" class="btn btn-warning btn-wide" tabindex="9" ng-click="cancel()">
<button type="reset" class="btn btn-warning btn-wide" tabindex="20" ng-click="cancel()">
Cancel
</button>
</div>

View File

@ -160,7 +160,7 @@
Employee ID <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Employee Id" tabindex="5" class="form-control" name="employeeId" ng-model="myModel.employeeId"
<input type="text" placeholder="Enter Employee Id" tabindex="1" class="form-control" name="employeeId" ng-model="myModel.employeeId"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" ng-blur='checkEmpIdExist()' required/>
<span class="error text-small block" ng-if="Form.employeeId.$dirty && Form.employeeId.$error.required">Employee Id required</span>
<span class="error text-small block" ng-if="Form.employeeId.$dirty && Form.employeeId.$error.pattern">Invalid Employee Id </span>
@ -172,7 +172,7 @@
First Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter First Name" tabindex="5" class="form-control" name="firstname" ng-model="myModel.firstname"
<input type="text" placeholder="Enter First Name" tabindex="2" class="form-control" name="firstname" ng-model="myModel.firstname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.required">First Name required</span>
<span class="error text-small block" ng-if="Form.firstname.$dirty && Form.firstname.$error.pattern">Invalid First Name </span>
@ -183,7 +183,7 @@
Last Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Last Name" tabindex="5" class="form-control" name="lastname" ng-model="myModel.lastname"
<input type="text" placeholder="Enter Last Name" tabindex="3" class="form-control" name="lastname" ng-model="myModel.lastname"
ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
<span class="error text-small block" ng-if="Form.lastname.$dirty && Form.lastname.$error.required">Last Name required</span>
<span class="error text-small block" ng-if="Form.lastname.$dirty && Form.lastname.$error.pattern">Invalid Last Name </span>
@ -207,7 +207,7 @@
Father Name
</label>
<input type="text" placeholder="Enter Father Name" tabindex="5" class="form-control" name="fathername" ng-model="myModel.fathername"
<input type="text" placeholder="Enter Father Name" tabindex="4" class="form-control" name="fathername" ng-model="myModel.fathername"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.fathername.$dirty && Form.fathername.$error.pattern">Invalid Father Name </span>
</div>
@ -225,7 +225,7 @@
<label>
Email ID <span class="symbol required"></span>
</label>
<input type="email" tabindex="27" placeholder="Enter Email ID" class="form-control" name="emailId" ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
<input type="email" tabindex="6" placeholder="Enter Email ID" class="form-control" name="emailId" ng-pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i"
ng-model="myModel.emailId" ng-blur='checkEmailExist()' required>
<span class="error text-small block" ng-if="Form.emailId.$dirty && Form.primaryEmail.$invalid" ng-hide="Form.emailId.$error.email">Email is required.</span>
<span class="error text-small block" ng-if="Form.emailId.$error.email">Please, enter a valid email address.</span>
@ -238,7 +238,7 @@
Mobile Number <span
class="symbol required"></span>
</label>
<input type="text" name="primaryPhone" tabindex="29" placeholder="Enter Mobile Number" class="form-control" ng-model="myModel.primaryPhone"
<input type="text" name="primaryPhone" tabindex="7" placeholder="Enter Mobile Number" class="form-control" ng-model="myModel.primaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" ng-blur='checkMobileExist()'
required/>
<span class="error text-small block" ng-if="Form.primaryPhone.$dirty && Form.primaryPhone.$invalid" ng-hide="Form.primaryPhone.$error.maxlength || Form.primaryPhone.$error.minlength || Form.primaryPhone.$error.pattern">Mobile Number is required.</span>
@ -248,19 +248,22 @@
<label class="control-label">
Alternate Mobile Number
</label>
<input type="text" name="secondaryPhone" tabindex="30" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="myModel.secondaryPhone"
<input type="text" name="secondaryPhone" tabindex="8" placeholder="Enter Alternate Mobile Number" class="form-control" ng-model="myModel.secondaryPhone"
ng-minlength="10" ng-maxlength="12" ng-pattern="/^[0-9]*$/" />
<span class="error text-small block" ng-if="Form.secondaryPhone.$error.maxlength || Form.secondaryPhone.$error.minlength || Form.secondaryPhone.$error.pattern">Enter a Valid Phone Number</span>
</div>
<div data-ng-controller="DatepickerDemoCtrl">
<pre>Selected date is: <em>{{myModel.dateofbirth}}</em></pre>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.dateofbirth.$dirty && Form.dateofbirth.$invalid, 'has-success':Form.dateofbirth.$valid}">
<label>
Date Of Birth <span
class="symbol required"></span>
</label>
<input type="text" tabindex="6" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofbirth"
is-open="startOpen" ng-init="startOpen = false" name="dateofbirth" datepicker-options="dateOptions"
<input type="text" tabindex="9" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofbirth"
is-open="startOpen" ng-init="startOpen = true" name="dateofbirth" datepicker-options="dateOptions"
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />
@ -276,7 +279,7 @@
Gender
</label>
<div class="clip-radio radio-primary">
<input type="radio" id="female" name="gender" value="female" ng-model="myModel.gender" required>
<input type="radio" tabindex="10" id="female" name="gender" value="female" ng-model="myModel.gender" required>
<label for="female">
Female
</label>
@ -293,7 +296,7 @@
Qualification
</label>
<input type="text" placeholder="Enter Qualification" tabindex="5" class="form-control" name="qualificaion" ng-model="myModel.qualificaion"
<input type="text" placeholder="Enter Qualification" tabindex="11" class="form-control" name="qualificaion" ng-model="myModel.qualificaion"
ng-pattern="/^[a-zA-Z.\s]*$/" />
<span class="error text-small block" ng-if="Form.qualificaion.$dirty && Form.qualificaion.$error.pattern">Enter a Valid Qualification</span>
</div>
@ -304,7 +307,7 @@
</label>
<!--<input type="text" class="form-control" name="masked" placeholder="99/99/9999" ui-mask="99/99/9999" ng-model="x">-->
<input type="text" name="aadharNumber" tabindex="29" placeholder="0000-0000-0000" ui-mask="9999-9999-9999" class="form-control"
<input type="text" name="aadharNumber" tabindex="12" placeholder="____-____-____" ui-mask="9999-9999-9999" class="form-control"
ng-model="myModel.aadharNumber" ng-minlength="10" ng-maxlength="15" ng-pattern="/^[0-9]*$/"
required>
<span class="error text-small block" ng-if="Form.aadharNumber.$dirty && Form.aadharNumber.$invalid" ng-hide="Form.aadharNumber.$error.maxlength || Form.aadharNumber.$error.minlength || Form.aadharNumber.$error.pattern">Aadhar Number is required.</span>
@ -319,7 +322,7 @@
<label>
Other ID
</label>
<input type="text" name="otherId" tabindex="29" placeholder="Other Id" class="form-control" ng-model="myModel.otherId" ng-minlength="1"
<input type="text" name="otherId" tabindex="13" placeholder="Other Id" class="form-control" ng-model="myModel.otherId" ng-minlength="1"
ng-maxlength="20" ng-pattern="/^[a-zA-Z0-9 ._-]+$/">
<span class="error text-small block" ng-if="Form.otherId.$dirty && Form.otherId.$invalid" ng-hide="Form.otherId.$error.maxlength || Form.otherId.$error.minlength || Form.otherId.$error.pattern">Aadhar Number is required.</span>
<span class="error text-small block" ng-if="Form.otherId.$error.maxlength || Form.otherId.$error.minlength || Form.otherId.$error.pattern">Enter a Valid Details</span>
@ -328,7 +331,7 @@
<label>
Other ID Details
</label>
<input type="text" name="otherIdDetails" tabindex="29" placeholder="Other Id Details" class="form-control" ng-model="myModel.otherIdDetails"
<input type="text" name="otherIdDetails" tabindex="14" placeholder="Other Id Details" class="form-control" ng-model="myModel.otherIdDetails"
ng-minlength="1" ng-maxlength="20" ng-pattern="/^[a-zA-Z0-9 ._-]+$/">
<span class="error text-small block" ng-if="Form.otherIdDetails.$dirty && Form.otherIdDetails.$invalid" ng-hide="Form.otherIdDetails.$error.maxlength || Form.otherIdDetails.$error.minlength || Form.otherIdDetails.$error.pattern">Aadhar Number is required.</span>
<span class="error text-small block" ng-if="Form.otherIdDetails.$error.maxlength || Form.otherIdDetails.$error.minlength || Form.otherIdDetails.$error.pattern">Enter a Valid Details</span>
@ -339,14 +342,14 @@
<label>
Permenent Address
</label>
<textarea placeholder="Enter Permenent Address" tabindex="31" class="form-control textdsc" name="address1" ng-model="myModel.address1"></textarea>
<textarea placeholder="Enter Permenent Address" tabindex="15" class="form-control textdsc" name="address1" ng-model="myModel.address1"></textarea>
<span class="error text-small block" ng-if="Form.address1.$dirty && Form.address1.$invalid">Permenent Address is required</span>
</div>
<div class="col-md-4 form-group" ng-class="{'has-error':Form.address2.$dirty && Form.address2.$invalid}">
<label>
Current Address
</label>
<textarea placeholder="Enter Current Address" tabindex="31" class="form-control textdsc" name="address2" ng-model="myModel.address2"></textarea>
<textarea placeholder="Enter Current Address" tabindex="16" class="form-control textdsc" name="address2" ng-model="myModel.address2"></textarea>
<span class="error text-small block" ng-if="Form.address2.$dirty && Form.address2.$invalid">Current Address is required</span>
</div>
</div>
@ -361,7 +364,7 @@
Home Branch <span class="symbol required"></span>
</label>
<select class="form-control" class="cs-select cs-skin-elastic" name="homeBranch" ng-model="myModel.homeBranch" required>
<select class="form-control" tabindex="17" class="cs-select cs-skin-elastic" name="homeBranch" ng-model="myModel.homeBranch" required>
<option value="" disabled selected>Select Home Branch</option>
<option ng-repeat="item in branchDetails" value="{{item.BranchCode}}">{{item.BranchName}}</option>
</select>
@ -379,7 +382,7 @@
placeholder="Select Date of Birth" close-text="Close" required="required"
ng-change="getMaxEndDate(myModel.startDate)" />-->
<input type="text" tabindex="6" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofjoining"
<input type="text" tabindex="18" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateofjoining"
is-open="startOpen" ng-init="startOpen = false" name="dateofjoining" datepicker-options="dateOptions"
placeholder="Select Date of Joining" close-text="Close" required="required"
/>
@ -391,7 +394,7 @@
<label>
Role <span class="symbol required"></span>
</label>
<select class="form-control" name="role" ng-model="myModel.role" class="cs-select cs-skin-elastic" required>
<select class="form-control" tabindex="19" name="role" ng-model="myModel.role" class="cs-select cs-skin-elastic" required>
<option value="" disabled selected>Select Role</option>
<option ng-repeat="item in roleDetails" value="{{item.ListCode}}">{{item.ListName}}</option>
</select>
@ -421,10 +424,10 @@
<div class="row">
<div class="col-md-12">
<div class="pull-right">
<button type="submit" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
<button type="submit" tabindex="21" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
Submit
</button>
<button type="reset" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.reset(Form)">
<button type="reset" tabindex="22" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.reset(Form)">
Reset
</button>
</div>

View File

@ -85,11 +85,11 @@
</div>
</a>
<ul class="sub-menu">
<li ui-sref-active="active">
<!--<li ui-sref-active="active">
<a ui-sref="app.master.branch">
<span class="title" translate="sidebar.nav.master.BRANCH"> BRANCH DETAILS </span>
</a>
</li>
</li>-->
<!--<li ui-sref-active="active" >
<a ui-sref="app.master.employee">
<span class="title" translate="sidebar.nav.master.EMPLOYEE"> EMPLOYEE DETAILS </span>

View File

@ -1,7 +1,7 @@
<!-- start: SETTINGS -->
<button ct-toggle="toggle" target="settings" parent-active-class="active" class="btn btn-default">
<!--button ct-toggle="toggle" target="settings" parent-active-class="active" class="btn btn-default">
<i class="fa fa-spin fa-gear"></i>
</button>
</button-->
<div class="panel-heading ng-scope" translate="setting.MAIN">
Style Selector
</div>

View File

@ -94,6 +94,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-md5/0.1.10/angular-md5.js"></script>
<!--cdn for table pagination-->
<script src="https://cdn.jsdelivr.net/npm/angular-utils-pagination@0.11.1/dirPagination.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.1/ui-bootstrap-tpls.min.js"></script>
<!--new cookie set-->
<script src="bower_components/angular-cookie/angular-cookie.min.js"></script>
</body>