Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8cf22ca70b
@ -77,6 +77,9 @@ $route['chkUpdateEmpExistDetail'] = 'Employee_Controller/check_update_exist';
|
|||||||
$route['updateEmpExistDetail'] = 'Employee_Controller/updateEmployee';
|
$route['updateEmpExistDetail'] = 'Employee_Controller/updateEmployee';
|
||||||
$route['getEmpBranchDetails'] = 'Employee_Controller/getEmpBranchDetails';
|
$route['getEmpBranchDetails'] = 'Employee_Controller/getEmpBranchDetails';
|
||||||
$route['updateEmpBranchDetail'] = 'Employee_Controller/updateEmpBranchDetail';
|
$route['updateEmpBranchDetail'] = 'Employee_Controller/updateEmpBranchDetail';
|
||||||
|
$route['updateEmpImgExistDetail'] = 'Employee_Controller/updateEmployeeImage';
|
||||||
|
$route['insertEmployeeImage'] = 'Employee_Controller/addEmployeeImage';
|
||||||
|
|
||||||
// call tracking
|
// call tracking
|
||||||
$route['getTrackingLeadDetails'] = 'Call_Tracking_Controller/getTrackingLeadDetails';
|
$route['getTrackingLeadDetails'] = 'Call_Tracking_Controller/getTrackingLeadDetails';
|
||||||
$route['addLeadTrackingDetails'] = 'Call_Tracking_Controller/addLeadTrackingDetails';
|
$route['addLeadTrackingDetails'] = 'Call_Tracking_Controller/addLeadTrackingDetails';
|
||||||
|
|||||||
@ -43,7 +43,6 @@ class Employee_Controller extends REST_Controller {
|
|||||||
$this->methods['updateEmpBranchDetail_post']['limit'] = 100;
|
$this->methods['updateEmpBranchDetail_post']['limit'] = 100;
|
||||||
// load the employee model
|
// load the employee model
|
||||||
$this->load->model('Employee_model', 'employee_model');
|
$this->load->model('Employee_model', 'employee_model');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//This method used to get employee Details
|
//This method used to get employee Details
|
||||||
@ -152,11 +151,15 @@ class Employee_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add employee
|
// add employee with image
|
||||||
public function addEmployee_post() {
|
public function addEmployee_post() {
|
||||||
$data = $this->post('data');
|
$data = $this->post('data');
|
||||||
$createdBy = $this->post('createdBy');
|
$createdBy = $this->post('createdBy');
|
||||||
|
|
||||||
|
$imagename = '';
|
||||||
|
$size = '';
|
||||||
|
$imageSource = '';
|
||||||
|
|
||||||
$req['StaffID'] = $data['employeeId'];
|
$req['StaffID'] = $data['employeeId'];
|
||||||
$req['Firstname'] = $data['firstname'];
|
$req['Firstname'] = $data['firstname'];
|
||||||
$req['Lastname'] = $data['lastname'];
|
$req['Lastname'] = $data['lastname'];
|
||||||
@ -181,7 +184,60 @@ class Employee_Controller extends REST_Controller {
|
|||||||
$req['ListCode'] = $data['role'];
|
$req['ListCode'] = $data['role'];
|
||||||
$req['CreatedBy'] = $createdBy;
|
$req['CreatedBy'] = $createdBy;
|
||||||
// print_r($req);exit();
|
// print_r($req);exit();
|
||||||
$employeeAdd = $this->employee_model->add_employee( $req, $createdBy );// Check if the employee exist
|
$employeeAdd = $this->employee_model->add_employee( $req, $createdBy, $imagename, $imageSource, $size );// Check if the employee exist
|
||||||
|
if ($employeeAdd)
|
||||||
|
{
|
||||||
|
$employeeAdd['status'] = REST_Controller::HTTP_OK;
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response($employeeAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response([
|
||||||
|
'message' => 'No users were found',
|
||||||
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||||
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add employee with image
|
||||||
|
public function addEmployeeImage_post() {
|
||||||
|
// print_r($this->post('idProof'));exit();
|
||||||
|
$imagename = $_FILES['idProof']['name'];
|
||||||
|
|
||||||
|
$size = $_FILES['idProof']['size'];
|
||||||
|
$imageSource = $_FILES['idProof']['tmp_name'];
|
||||||
|
// echo $size;exit();
|
||||||
|
$data= $this->post('data');
|
||||||
|
$createdBy= $this->post('createdBy');
|
||||||
|
$temp = json_decode($data, true);
|
||||||
|
|
||||||
|
$req['StaffID'] = $temp['employeeId'];
|
||||||
|
$req['Firstname'] = $temp['firstname'];
|
||||||
|
$req['Lastname'] = $temp['lastname'];
|
||||||
|
$req['Fathername'] = $temp['fathername'];
|
||||||
|
$req['EmailID'] = $temp['emailId'];
|
||||||
|
$req['MotherName'] = $temp['mothername'];
|
||||||
|
$req['MobileNumber'] = $temp['primaryPhone'];
|
||||||
|
$req['AlternateNumber'] = $temp['secondaryPhone'];
|
||||||
|
$req['Gender'] = $temp['gender'];
|
||||||
|
$req['DOB'] = $temp['dateofbirth'];
|
||||||
|
// $req['DOB'] = $data['dateofbirth'];
|
||||||
|
$req['PresentAddress'] = $temp['address2'];
|
||||||
|
$req['PermanentAddress'] = $temp['address1'];
|
||||||
|
$req['AadharNumber'] = $temp['aadharNumber'];
|
||||||
|
$req['OtherID'] = $temp['otherId'];
|
||||||
|
$req['OtherIDDetails'] = $temp['otherIdDetails'];
|
||||||
|
$req['Qualification'] = $temp['qualificaion'];
|
||||||
|
$req['BranchCode'] = $temp['homeBranch'];
|
||||||
|
$req['IsActive'] = $temp['switchsetting'];
|
||||||
|
$req['DOJ'] = $temp['dateofjoining'];
|
||||||
|
// $req['DOJ'] = $data['dateofjoining'];
|
||||||
|
$req['ListCode'] = $temp['role'];
|
||||||
|
$req['CreatedBy'] = $createdBy;
|
||||||
|
|
||||||
|
$employeeAdd = $this->employee_model->add_employee( $req, $createdBy, $imagename, $imageSource, $size );// Check if the employee exist
|
||||||
if ($employeeAdd)
|
if ($employeeAdd)
|
||||||
{
|
{
|
||||||
$employeeAdd['status'] = REST_Controller::HTTP_OK;
|
$employeeAdd['status'] = REST_Controller::HTTP_OK;
|
||||||
@ -221,9 +277,17 @@ class Employee_Controller extends REST_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update employee details
|
// update employee with image
|
||||||
public function updateEmployee_post () {
|
public function updateEmployeeImage_post() {
|
||||||
$data = $this->post('data');
|
|
||||||
|
$imagename = $_FILES['idProof']['name'];
|
||||||
|
$size = $_FILES['idProof']['size'];
|
||||||
|
$imageSource = $_FILES['idProof']['tmp_name'];
|
||||||
|
|
||||||
|
$temp= $this->post('data');
|
||||||
|
$createdBy= $this->post('createdBy');
|
||||||
|
$data = json_decode($temp, true);
|
||||||
|
|
||||||
$updatedBy = $this->post('updatedBy');
|
$updatedBy = $this->post('updatedBy');
|
||||||
$updateStaff = $data['StaffID'];
|
$updateStaff = $data['StaffID'];
|
||||||
|
|
||||||
@ -243,6 +307,7 @@ class Employee_Controller extends REST_Controller {
|
|||||||
$req['OtherID'] = $data['OtherID'];
|
$req['OtherID'] = $data['OtherID'];
|
||||||
$req['OtherIDDetails'] = $data['OtherIDDetails'];
|
$req['OtherIDDetails'] = $data['OtherIDDetails'];
|
||||||
$req['Qualification'] = $data['Qualification'];
|
$req['Qualification'] = $data['Qualification'];
|
||||||
|
// $req['ProfilePicPath'] = $data['ProfilePicPath'];
|
||||||
// $req['BranchCode'] = $data['BranchCode'];
|
// $req['BranchCode'] = $data['BranchCode'];
|
||||||
$req['IsActive'] = $data['IsActive'];
|
$req['IsActive'] = $data['IsActive'];
|
||||||
// $req['DOJ'] = date('d-m-Y', strtotime($data['DOJ']) );
|
// $req['DOJ'] = date('d-m-Y', strtotime($data['DOJ']) );
|
||||||
@ -252,7 +317,60 @@ class Employee_Controller extends REST_Controller {
|
|||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
$req['UpdatedOn'] = $date;
|
$req['UpdatedOn'] = $date;
|
||||||
// print_r($req);exit();
|
// print_r($req);exit();
|
||||||
$employeeUpdate = $this->employee_model->update_employee( $req, $updateStaff );// Check if the employee exist
|
$employeeUpdate = $this->employee_model->update_employee( $req, $updateStaff, $imagename, $imageSource, $size );// Check if the employee exist
|
||||||
|
if ($employeeUpdate)
|
||||||
|
{
|
||||||
|
$employeeUpdate['status'] = REST_Controller::HTTP_OK;
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response($employeeUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response([
|
||||||
|
'message' => 'No users were found',
|
||||||
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||||
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update employee details without image
|
||||||
|
public function updateEmployee_post () {
|
||||||
|
$data = $this->post('data');
|
||||||
|
$updatedBy = $this->post('updatedBy');
|
||||||
|
$updateStaff = $data['StaffID'];
|
||||||
|
|
||||||
|
$imagename = '';
|
||||||
|
$size = '';
|
||||||
|
$imageSource = '';
|
||||||
|
|
||||||
|
$req['Firstname'] = $data['Firstname'];
|
||||||
|
$req['Lastname'] = $data['Lastname'];
|
||||||
|
$req['Fathername'] = $data['Fathername'];
|
||||||
|
$req['EmailID'] = $data['EmailID'];
|
||||||
|
$req['MotherName'] = $data['MotherName'];
|
||||||
|
$req['MobileNumber'] = $data['MobileNumber'];
|
||||||
|
$req['AlternateNumber'] = $data['AlternateNumber'];
|
||||||
|
$req['Gender'] = $data['Gender'];
|
||||||
|
// $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'];
|
||||||
|
$req['OtherID'] = $data['OtherID'];
|
||||||
|
$req['OtherIDDetails'] = $data['OtherIDDetails'];
|
||||||
|
$req['Qualification'] = $data['Qualification'];
|
||||||
|
$req['ProfilePicPath'] = $data['ProfilePicPath'];
|
||||||
|
// $req['BranchCode'] = $data['BranchCode'];
|
||||||
|
$req['IsActive'] = $data['IsActive'];
|
||||||
|
// $req['DOJ'] = date('d-m-Y', strtotime($data['DOJ']) );
|
||||||
|
$req['DOJ'] = $data['DOJ'];
|
||||||
|
// $req['ListCode'] = $data['ListCode'];
|
||||||
|
$req['UpdatedBy'] = $updatedBy;
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
$req['UpdatedOn'] = $date;
|
||||||
|
// print_r($req);exit();
|
||||||
|
$employeeUpdate = $this->employee_model->update_employee( $req, $updateStaff, $imagename, $imageSource, $size );// Check if the employee exist
|
||||||
if ($employeeUpdate)
|
if ($employeeUpdate)
|
||||||
{
|
{
|
||||||
$employeeUpdate['status'] = REST_Controller::HTTP_OK;
|
$employeeUpdate['status'] = REST_Controller::HTTP_OK;
|
||||||
|
|||||||
@ -254,8 +254,11 @@ class Employee_model extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add employee
|
// add employee
|
||||||
public function add_employee($empArr, $createdBy)
|
public function add_employee($empArr, $createdBy, $imageName, $imageSource, $imageSize)
|
||||||
{
|
{
|
||||||
|
if( $imageSource == '') { // add employee without image
|
||||||
|
$imageNameDb = 'default.jpeg';
|
||||||
|
$empArr['ProfilePicPath'] = "employee/".$imageNameDb;
|
||||||
$this->db->insert(STAFF, $empArr);
|
$this->db->insert(STAFF, $empArr);
|
||||||
if ($this->db->affected_rows() == '1') {
|
if ($this->db->affected_rows() == '1') {
|
||||||
$branchArr['StaffID'] = $empArr['StaffID'];
|
$branchArr['StaffID'] = $empArr['StaffID'];
|
||||||
@ -287,6 +290,43 @@ class Employee_model extends CI_Model
|
|||||||
$result['addEmpStatus'] = false;
|
$result['addEmpStatus'] = false;
|
||||||
$result['message'] = "Something went wrong.please try again";
|
$result['message'] = "Something went wrong.please try again";
|
||||||
}
|
}
|
||||||
|
} else { // add employee with image
|
||||||
|
$target = "../images/employee/";
|
||||||
|
$getUploadStatus = $this->upload_image($imageSource, $imageSize, $target);
|
||||||
|
$imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg';
|
||||||
|
$empArr['ProfilePicPath'] = "employee/".$imageNameDb;
|
||||||
|
$this->db->insert(STAFF, $empArr);
|
||||||
|
if ($this->db->affected_rows() == '1') {
|
||||||
|
$branchArr['StaffID'] = $empArr['StaffID'];
|
||||||
|
$branchArr['BranchCode'] = $empArr['BranchCode'];
|
||||||
|
$branchArr['IsActive'] = $empArr['IsActive'];
|
||||||
|
$branchArr['CreatedBy'] = $createdBy;
|
||||||
|
$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";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result['addEmpStatus'] = false;
|
||||||
|
$result['message'] = "Something went wrong.please try again";
|
||||||
|
}
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,8 +372,9 @@ class Employee_model extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update employee personal details
|
// update employee personal details
|
||||||
public function update_employee($empArr, $updateFor)
|
public function update_employee($empArr, $updateFor, $imageName, $imageSource, $imageSize)
|
||||||
{
|
{
|
||||||
|
if( $imageSource == '') { // update Employee without image
|
||||||
$this->db->where('StaffID', $updateFor);
|
$this->db->where('StaffID', $updateFor);
|
||||||
$this->db->update(STAFF, $empArr);
|
$this->db->update(STAFF, $empArr);
|
||||||
if ($this->db->affected_rows() == '1') {
|
if ($this->db->affected_rows() == '1') {
|
||||||
@ -344,16 +385,42 @@ class Employee_model extends CI_Model
|
|||||||
$updatedOn = $empArr['UpdatedOn'];
|
$updatedOn = $empArr['UpdatedOn'];
|
||||||
$sql = "UPDATE ".LOGIN." SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'";
|
$sql = "UPDATE ".LOGIN." SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'";
|
||||||
if($this->db->query($sql) == '1'){
|
if($this->db->query($sql) == '1'){
|
||||||
$result['addEmpStatus'] = true;
|
$result['updateEmpStatus'] = true;
|
||||||
$result['message'] = "Successfully employee details Updated";
|
$result['message'] = "Successfully employee details Updated";
|
||||||
} else {
|
} else {
|
||||||
$result['addEmpStatus'] = false;
|
$result['updateEmpStatus'] = false;
|
||||||
$result['message'] = "Something went wrong.please try again";
|
$result['message'] = "Something went wrong.please try again";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result['updateEmpStatus'] = false;
|
$result['updateEmpStatus'] = false;
|
||||||
$result['message'] = "Something went wrong.please try again";
|
$result['message'] = "Something went wrong.please try again";
|
||||||
}
|
}
|
||||||
|
} else { // update employee with image
|
||||||
|
$target = "../images/employee/";
|
||||||
|
$getUploadStatus = $this->upload_image($imageSource, $imageSize, $target);
|
||||||
|
$imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg';
|
||||||
|
$empArr['ProfilePicPath'] = "employee/".$imageNameDb;
|
||||||
|
$this->db->where('StaffID', $updateFor);
|
||||||
|
$this->db->update(STAFF, $empArr);
|
||||||
|
if ($this->db->affected_rows() == '1') {
|
||||||
|
$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['updateEmpStatus'] = true;
|
||||||
|
$result['message'] = "Successfully employee details Updated";
|
||||||
|
} else {
|
||||||
|
$result['updateEmpStatus'] = false;
|
||||||
|
$result['message'] = "Something went wrong.please try again";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result['updateEmpStatus'] = false;
|
||||||
|
$result['message'] = "Something went wrong.please try again";
|
||||||
|
}
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,14 +479,16 @@ class Employee_model extends CI_Model
|
|||||||
// echo $this->db->affected_rows();exit();
|
// echo $this->db->affected_rows();exit();
|
||||||
// update role to login table
|
// update role to login table
|
||||||
if ($this->db->affected_rows() == '1') {
|
if ($this->db->affected_rows() == '1') {
|
||||||
$branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]);
|
// $branchCode = $this->get_branch_code($reqBanch['BranchCode'][0]);
|
||||||
|
$branchCode = $reqBanch['BranchCode'][0];
|
||||||
$sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'";
|
$sql = "UPDATE ".STAFF." SET BranchCode='$branchCode' WHERE StaffID='$empFor'";
|
||||||
// update branch to staff table
|
// update branch to staff table
|
||||||
if ($this->db->query($sql) == '1') {
|
if ($this->db->query($sql) == '1') {
|
||||||
$this->db->where('StaffID', $empFor);
|
$this->db->where('StaffID', $empFor);
|
||||||
$this->db->delete(STAFF_BRANCH);
|
$this->db->delete(STAFF_BRANCH);
|
||||||
foreach($reqBanch['BranchCode'] as $something) {
|
foreach($reqBanch['BranchCode'] as $something) {
|
||||||
$branchCode = $this->get_branch_code($something);
|
// $branchCode = $this->get_branch_code($something);
|
||||||
|
$branchCode = $something;
|
||||||
$sql1 = "INSERT INTO ".STAFF_BRANCH." (StaffID, BranchCode, IsActive, CreatedBy, CreatedOn, UpdatedBy, UpdatedOn)
|
$sql1 = "INSERT INTO ".STAFF_BRANCH." (StaffID, BranchCode, IsActive, CreatedBy, CreatedOn, UpdatedBy, UpdatedOn)
|
||||||
VALUES ('$empFor', '$branchCode', '1','$createby', '$createon', '$createby', '$createon')";
|
VALUES ('$empFor', '$branchCode', '1','$createby', '$createon', '$createby', '$createon')";
|
||||||
// update branch to staff_branch table
|
// update branch to staff_branch table
|
||||||
@ -496,4 +565,20 @@ class Employee_model extends CI_Model
|
|||||||
$roleDetails = $this->db->get()->first_row();
|
$roleDetails = $this->db->get()->first_row();
|
||||||
return $roleDetails->StaffID;
|
return $roleDetails->StaffID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// image upload in taget path
|
||||||
|
public function upload_image( $imageSource, $size, $target ) {
|
||||||
|
$key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 12);
|
||||||
|
$new_regNo = "Dri_" . $key2 . "." . 'jpeg';
|
||||||
|
$targetPlace = $target . $new_regNo;
|
||||||
|
// echo $targetPlace;exit();
|
||||||
|
if(!move_uploaded_file($imageSource , $targetPlace))
|
||||||
|
{
|
||||||
|
return $result['status'] = false;
|
||||||
|
} else {
|
||||||
|
$result['status'] = true;
|
||||||
|
$result['imageName'] = $new_regNo;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -4,7 +4,7 @@
|
|||||||
* Simple table with sorting and filtering on AngularJS
|
* Simple table with sorting and filtering on AngularJS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http",'fileUpload', "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", function ($scope, toaster, $filter, ngTableParams, $http, fileUpload, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory) {
|
app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory) {
|
||||||
|
|
||||||
|
|
||||||
// $scope.removeImage = function () {
|
// $scope.removeImage = function () {
|
||||||
@ -166,9 +166,11 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
$scope.branchEditLoading = false;
|
$scope.branchEditLoading = false;
|
||||||
$scope.empBranchs = response.data.branch_details;
|
$scope.empBranchs = response.data.branch_details;
|
||||||
$scope.branchArr = [];
|
$scope.branchArr = [];
|
||||||
|
$scope.BranchName = '';
|
||||||
angular.forEach($scope.empBranchs, function (item, index) {
|
angular.forEach($scope.empBranchs, function (item, index) {
|
||||||
// alert(item.BranchName);
|
// alert(item.BranchName);
|
||||||
$scope.branchArr.push(item.BranchName);
|
$scope.BranchName = item.BranchName + '-' + item.BranchCode;
|
||||||
|
$scope.branchArr.push($scope.BranchName);
|
||||||
});
|
});
|
||||||
$scope.empBranchDetails = {
|
$scope.empBranchDetails = {
|
||||||
arr: $scope.branchArr,
|
arr: $scope.branchArr,
|
||||||
@ -216,9 +218,11 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
if (response.data.MeasterBranchDetailStatus == true) {
|
if (response.data.MeasterBranchDetailStatus == true) {
|
||||||
$scope.branchDetails = response.data.branch_details;
|
$scope.branchDetails = response.data.branch_details;
|
||||||
$scope.branchDetailsName = [];
|
$scope.branchDetailsName = [];
|
||||||
|
$scope.BranchName = '';
|
||||||
angular.forEach($scope.branchDetails, function (item, index) {
|
angular.forEach($scope.branchDetails, function (item, index) {
|
||||||
// alert(item.BranchName);
|
// alert(item.BranchName);
|
||||||
$scope.branchDetailsName.push(item.BranchName);
|
$scope.BranchName = item.BranchName + '-' + item.BranchCode;
|
||||||
|
$scope.branchDetailsName.push($scope.BranchName);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
@ -292,6 +296,49 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------->
|
||||||
|
// getting for image to show
|
||||||
|
//-------------------------------------------------------------->
|
||||||
|
|
||||||
|
$scope.stepsModel = [];
|
||||||
|
$scope.imageUpload = function (event) {
|
||||||
|
var files = event.target.files; //FileList object
|
||||||
|
|
||||||
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
var file = files[i];
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = $scope.imageIsLoaded;
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.imageIsLoaded = function (e) {
|
||||||
|
$scope.$apply(function () {
|
||||||
|
// $scope.stepsModel.push(e.target.result);
|
||||||
|
$scope.stepsModel[0] = e.target.result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//an array of files selected
|
||||||
|
$scope.files = [];
|
||||||
|
|
||||||
|
//listen for the file selected event
|
||||||
|
$scope.$on("fileSelected", function (event, args) {
|
||||||
|
$scope.$apply(function () {
|
||||||
|
//add the file object to the scope's files collection
|
||||||
|
$scope.files[0] = args.file;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// reset image
|
||||||
|
$scope.resetImage = function () {
|
||||||
|
$scope.files.length = 0;
|
||||||
|
$scope.stepsModel.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// add empolyee
|
// add empolyee
|
||||||
$scope.employeeForm = {
|
$scope.employeeForm = {
|
||||||
submit: function (form, myModel) {
|
submit: function (form, myModel) {
|
||||||
@ -314,6 +361,8 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
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");
|
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// alert($scope.files);
|
||||||
// alert($scope.myModel.dateofbirth);
|
// alert($scope.myModel.dateofbirth);
|
||||||
var formate = "dd-MM-yyyy";
|
var formate = "dd-MM-yyyy";
|
||||||
// var date = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
|
// var date = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
|
||||||
@ -321,6 +370,29 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
|
$scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate);
|
||||||
$scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), formate);
|
$scope.myModel.dateofjoining = $filter('date')(new Date($scope.myModel.dateofjoining), formate);
|
||||||
// alert($scope.myModel.dateofbirth)
|
// alert($scope.myModel.dateofbirth)
|
||||||
|
|
||||||
|
var idProof = $scope.files[0];
|
||||||
|
if (idProof !== undefined) {
|
||||||
|
var formData = new FormData();
|
||||||
|
var idProof = $scope.files[0];
|
||||||
|
// alert(idProof);
|
||||||
|
formData.append("data", JSON.stringify($scope.myModel));
|
||||||
|
formData.append("createdBy", localDetails.localUserID);
|
||||||
|
formData.append('idProof', idProof);
|
||||||
|
|
||||||
|
$http.post(apiPoint.url + 'insertEmployeeImage/', formData, {
|
||||||
|
transformRequest: angular.identity,
|
||||||
|
headers: { 'Content-Type': undefined, 'Process-Data': false },
|
||||||
|
}).success(function (data) {
|
||||||
|
if (data.addEmpStatus == true) {
|
||||||
|
swal("Success!", data.message, "success");
|
||||||
|
$state.go($state.current, {}, { reload: true });
|
||||||
|
} else {
|
||||||
|
// $scope.ldloading1[loading.replace('-', '_')] = false;
|
||||||
|
swal("Failed!", data.message, "error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
var req = {
|
var req = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'insertEmployee/',
|
url: apiPoint.url + 'insertEmployee/',
|
||||||
@ -330,7 +402,7 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
data: {
|
data: {
|
||||||
data: $scope.myModel,
|
data: $scope.myModel,
|
||||||
createdBy: localDetails.localUserID,
|
createdBy: localDetails.localUserID,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
$http(req).then(function (response) {
|
$http(req).then(function (response) {
|
||||||
if (response.data.addEmpStatus == true) {
|
if (response.data.addEmpStatus == true) {
|
||||||
@ -342,9 +414,11 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
reset: function (form) {
|
reset: function (form) {
|
||||||
|
$scope.files.length = 0;
|
||||||
|
$scope.stepsModel.length = 0;
|
||||||
// $scope.myModel = angular.copy($scope.master);
|
// $scope.myModel = angular.copy($scope.master);
|
||||||
form.$setPristine(true);
|
form.$setPristine(true);
|
||||||
$scope.myModel = {
|
$scope.myModel = {
|
||||||
@ -448,7 +522,10 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
p.IsActive = p.IsActive === true ? 1 : 0;
|
p.IsActive = p.IsActive === true ? 1 : 0;
|
||||||
p.DOB = p.DOB == hide_dob ? p.DOB : $filter('date')(new Date(p.DOB), formate);
|
p.DOB = p.DOB == hide_dob ? p.DOB : $filter('date')(new Date(p.DOB), formate);
|
||||||
p.DOJ = p.DOJ == hide_doj ? p.DOJ : $filter('date')(new Date(p.DOJ), formate);
|
p.DOJ = p.DOJ == hide_doj ? p.DOJ : $filter('date')(new Date(p.DOJ), formate);
|
||||||
|
var idProof = $scope.files[0];
|
||||||
|
// alert(idProof);
|
||||||
|
// alert(p.ProfilePicPath);
|
||||||
|
if (idProof === undefined) {
|
||||||
var req = {
|
var req = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'updateEmpExistDetail/',
|
url: apiPoint.url + 'updateEmpExistDetail/',
|
||||||
@ -470,6 +547,29 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
swal("Failed!", response.data.message, "error");
|
swal("Failed!", response.data.message, "error");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// update with image
|
||||||
|
var formData = new FormData();
|
||||||
|
var idProof = $scope.files[0];
|
||||||
|
// alert(idProof);
|
||||||
|
formData.append("data", JSON.stringify(p));
|
||||||
|
formData.append("updatedBy", localDetails.localUserID);
|
||||||
|
formData.append('idProof', idProof);
|
||||||
|
|
||||||
|
$http.post(apiPoint.url + 'updateEmpImgExistDetail/', formData, {
|
||||||
|
transformRequest: angular.identity,
|
||||||
|
headers: { 'Content-Type': undefined, 'Process-Data': false },
|
||||||
|
}).success(function (data) {
|
||||||
|
if (data.updateEmpStatus == true) {
|
||||||
|
swal("Success!", data.message, "success");
|
||||||
|
$scope.getEmployeeList();
|
||||||
|
$scope.editId = -1;
|
||||||
|
} else {
|
||||||
|
// $scope.ldloading1[loading.replace('-', '_')] = false;
|
||||||
|
swal("Failed!", data.message, "error");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,11 +594,18 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
} else {
|
} else {
|
||||||
// alert(JSON.stringify(p));
|
// alert(JSON.stringify(p));
|
||||||
// alert(JSON.stringify(empRole));
|
// alert(JSON.stringify(empRole));
|
||||||
// alert(JSON.stringify(empBranchs));
|
|
||||||
|
$scope.arr1 = [];
|
||||||
|
|
||||||
|
angular.forEach(empBranchs.arr, function (item) {
|
||||||
|
var newString = item.split("-").pop();
|
||||||
|
$scope.arr1.push(newString);
|
||||||
|
});
|
||||||
|
// alert(JSON.stringify($scope.arr1));
|
||||||
$scope.sendBranchData = {
|
$scope.sendBranchData = {
|
||||||
'empFor': p.StaffID,
|
'empFor': p.StaffID,
|
||||||
'updateRole': empRole.ListCode,
|
'updateRole': empRole.ListCode,
|
||||||
'updateBranch': empBranchs.arr,
|
'updateBranch': $scope.arr1,
|
||||||
'updateBy': localDetails.localUserID
|
'updateBy': localDetails.localUserID
|
||||||
}
|
}
|
||||||
// p.IsActive = p.IsActive === true ? 1 : 0;
|
// p.IsActive = p.IsActive === true ? 1 : 0;
|
||||||
@ -526,266 +633,22 @@ app.controller('staffCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.uploadFile = function () {
|
|
||||||
|
|
||||||
alert();
|
|
||||||
|
|
||||||
// var customer_name = $scope.customer_name;
|
|
||||||
// console.log(customer_name);
|
|
||||||
|
|
||||||
// var userId = $scope.userId;
|
|
||||||
// console.log(userId);
|
|
||||||
|
|
||||||
// var cafNo = $scope.cafNo;
|
|
||||||
// console.log(cafNo);
|
|
||||||
|
|
||||||
// var primaryEmail = $scope.primaryEmail;
|
|
||||||
// console.log(primaryEmail);
|
|
||||||
|
|
||||||
// var primaryPhone = $scope.primaryPhone;
|
|
||||||
// console.log(primaryPhone);
|
|
||||||
|
|
||||||
// var presentAddress = $scope.presentAddress;
|
|
||||||
// console.log(presentAddress);
|
|
||||||
|
|
||||||
// var createdBy = localStorage.getItem('id');
|
|
||||||
// // console.log('Id is ');
|
|
||||||
// console.log(createdBy);
|
|
||||||
|
|
||||||
// var idProof = $scope.idProof;
|
|
||||||
// console.log('Id Proof is ');
|
|
||||||
// console.dir(idProof);
|
|
||||||
|
|
||||||
// var addressProof = $scope.addressProof;
|
|
||||||
// console.log('address Proof is ');
|
|
||||||
// console.dir(addressProof);
|
|
||||||
|
|
||||||
// var cafForm = $scope.cafForm;
|
|
||||||
// console.log('caf Form is ');
|
|
||||||
// console.dir(cafForm);
|
|
||||||
|
|
||||||
var uploadUrl = apiPoint.url + "addschoolimage.php";
|
|
||||||
|
|
||||||
fileUpload.uploadFileToUrl(customer_name, userId, cafNo, primaryEmail, primaryPhone, presentAddress, createdBy, idProof, addressProof, cafForm, uploadUrl);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
// file upload directive
|
||||||
'use strict';
|
app.directive('fileUpload', function () {
|
||||||
/**
|
|
||||||
* controllers used for the dashboard
|
|
||||||
*/
|
|
||||||
|
|
||||||
app.directive('fileModel', ['$parse', function ($parse) {
|
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
scope: true, //create a new scope
|
||||||
link: function (scope, element, attrs) {
|
link: function (scope, el, attrs) {
|
||||||
var model = $parse(attrs.fileModel);
|
el.bind('change', function (event) {
|
||||||
var modelSetter = model.assign;
|
var files = event.target.files;
|
||||||
|
//iterate files since 'multiple' may be specified on the element
|
||||||
element.bind('change', function () {
|
for (var i = 0; i < files.length; i++) {
|
||||||
scope.$apply(function () {
|
//emit event upward
|
||||||
modelSetter(scope, element[0].files[0]);
|
scope.$emit("fileSelected", { file: files[i] });
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}]);
|
|
||||||
|
|
||||||
// We can write our own fileUpload service to reuse it in the controller
|
|
||||||
app.service('fileUpload', ['$http', '$state', function ($http, $state) {
|
|
||||||
this.uploadFileToUrl = function (customer_name, userId, cafNo, primaryEmail, primaryPhone, presentAddress, createdBy, idProof, addressProof, cafForm, uploadUrl) {
|
|
||||||
var fd = new FormData();
|
|
||||||
fd.append('customer_name', customer_name);
|
|
||||||
fd.append('userId', userId);
|
|
||||||
fd.append('cafNo', cafNo);
|
|
||||||
fd.append('primaryEmail', primaryEmail);
|
|
||||||
fd.append('primaryPhone', primaryPhone);
|
|
||||||
fd.append('presentAddress', presentAddress);
|
|
||||||
fd.append('createdBy', createdBy);
|
|
||||||
fd.append('idProof', idProof);
|
|
||||||
fd.append('addressProof', addressProof);
|
|
||||||
fd.append('cafForm', cafForm);
|
|
||||||
$http.post(uploadUrl, fd, {
|
|
||||||
transformRequest: angular.identity,
|
|
||||||
headers: {'Content-Type': undefined, 'Process-Data': false},
|
|
||||||
|
|
||||||
})
|
|
||||||
.success(function (data) {
|
|
||||||
if (data.status == true) {
|
|
||||||
console.log("Success");
|
|
||||||
swal("Success!", "Profile image is updated successfully!", "success");
|
|
||||||
$state.go($state.current, {}, {reload: true});
|
|
||||||
}else if(data.status_1 == true){
|
|
||||||
swal("Success!", "school logo is updated successfully!", "success");
|
|
||||||
$state.go($state.current, {}, {reload: true});
|
|
||||||
}else if(data.status_2 == false){
|
|
||||||
swal("Failed!", "Select Image for uploading!", "error");
|
|
||||||
}else if(data.status_3 == false){
|
|
||||||
swal("Failed!", "Image Size Should Be Less Than 5 Mb!", "error");
|
|
||||||
}
|
|
||||||
else if(data.status_4 == false){
|
|
||||||
swal("Failed!", "Image Size Should Be More Than 50 Kb!", "error");
|
|
||||||
}else{
|
|
||||||
swal("Failed!", "Image uploading has failed!", "error");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}]);
|
|
||||||
|
|
||||||
app.controller('tarrifimage', ['$scope', '$state', '$http', 'fileUpload', 'API_POINTS', 'ngTableParams', '$filter', function ($scope, $state, $http, fileUpload, apiPoint, ngTableParams, $filter) {
|
|
||||||
|
|
||||||
|
|
||||||
$scope.idProof_check = false;
|
|
||||||
$scope.customerID = '';
|
|
||||||
$scope.customerCafNo = '';
|
|
||||||
$scope.new_id_form = '';
|
|
||||||
|
|
||||||
|
|
||||||
$scope.address_check = false;
|
|
||||||
$scope.custID = '';
|
|
||||||
$scope.cusCafNo = '';
|
|
||||||
|
|
||||||
|
|
||||||
$scope.checked_check = false;
|
|
||||||
$scope.cafFormId = '';
|
|
||||||
$scope.cafFormNo = '';
|
|
||||||
$scope.customerId = '';
|
|
||||||
$scope.new_caf_form = '';
|
|
||||||
|
|
||||||
//$scope.uploadFile = function () {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// var idProof = $scope.idProof;
|
|
||||||
// console.log('Id Proof is ');
|
|
||||||
// console.dir(idProof);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// var uploadUrl = apiPoint.url + "addimage.php";
|
|
||||||
//
|
|
||||||
// fileUpload.uploadFileToUrl( idProof, uploadUrl);
|
|
||||||
//};
|
|
||||||
|
|
||||||
$scope.uploadFile_1 = function () {
|
|
||||||
|
|
||||||
//alert(idProof);
|
|
||||||
|
|
||||||
var customer_name = $scope.customer_name;
|
|
||||||
console.log(customer_name);
|
|
||||||
|
|
||||||
var userId = $scope.userId;
|
|
||||||
console.log(userId);
|
|
||||||
|
|
||||||
var cafNo = $scope.cafNo;
|
|
||||||
console.log(cafNo);
|
|
||||||
|
|
||||||
var primaryEmail = $scope.primaryEmail;
|
|
||||||
console.log(primaryEmail);
|
|
||||||
|
|
||||||
var primaryPhone = $scope.primaryPhone;
|
|
||||||
console.log(primaryPhone);
|
|
||||||
|
|
||||||
var presentAddress = $scope.presentAddress;
|
|
||||||
console.log(presentAddress);
|
|
||||||
|
|
||||||
var createdBy = localStorage.getItem('id');
|
|
||||||
// console.log('Id is ');
|
|
||||||
console.log(createdBy);
|
|
||||||
|
|
||||||
var idProof = $scope.idProof;
|
|
||||||
console.log('Id Proof is ');
|
|
||||||
console.dir(idProof);
|
|
||||||
|
|
||||||
var addressProof = $scope.addressProof;
|
|
||||||
console.log('address Proof is ');
|
|
||||||
console.dir(addressProof);
|
|
||||||
|
|
||||||
var cafForm = $scope.cafForm;
|
|
||||||
console.log('caf Form is ');
|
|
||||||
console.dir(cafForm);
|
|
||||||
|
|
||||||
var uploadUrl = apiPoint.url + "addschoolimage.php";
|
|
||||||
|
|
||||||
fileUpload.uploadFileToUrl(customer_name, userId, cafNo, primaryEmail, primaryPhone, presentAddress, createdBy, idProof, addressProof, cafForm, uploadUrl);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
$scope.uploadFile = function () {
|
});
|
||||||
|
|
||||||
//alert(idProof);
|
|
||||||
|
|
||||||
var customer_name = $scope.customer_name;
|
|
||||||
console.log(customer_name);
|
|
||||||
|
|
||||||
var userId = $scope.userId;
|
|
||||||
console.log(userId);
|
|
||||||
|
|
||||||
var cafNo = $scope.cafNo;
|
|
||||||
console.log(cafNo);
|
|
||||||
|
|
||||||
var primaryEmail = $scope.primaryEmail;
|
|
||||||
console.log(primaryEmail);
|
|
||||||
|
|
||||||
var primaryPhone = $scope.primaryPhone;
|
|
||||||
console.log(primaryPhone);
|
|
||||||
|
|
||||||
var presentAddress = $scope.presentAddress;
|
|
||||||
console.log(presentAddress);
|
|
||||||
|
|
||||||
var createdBy = localStorage.getItem('id');
|
|
||||||
// console.log('Id is ');
|
|
||||||
console.log(createdBy);
|
|
||||||
|
|
||||||
var idProof = $scope.idProof;
|
|
||||||
console.log('Id Proof is ');
|
|
||||||
console.dir(idProof);
|
|
||||||
|
|
||||||
var addressProof = $scope.addressProof;
|
|
||||||
console.log('address Proof is ');
|
|
||||||
console.dir(addressProof);
|
|
||||||
|
|
||||||
var cafForm = $scope.cafForm;
|
|
||||||
console.log('caf Form is ');
|
|
||||||
console.dir(cafForm);
|
|
||||||
|
|
||||||
var uploadUrl = apiPoint.url + "addprofileimage.php";
|
|
||||||
|
|
||||||
fileUpload.uploadFileToUrl(customer_name, userId, cafNo, primaryEmail, primaryPhone, presentAddress, createdBy, idProof, addressProof, cafForm, uploadUrl);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
$scope.viewId = -1;
|
|
||||||
$scope.viewMore = function (pid) {
|
|
||||||
$scope.viewId = pid;
|
|
||||||
$scope.editId = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
$scope.editId = -1;
|
|
||||||
|
|
||||||
$scope.setEditId = function (pid) {
|
|
||||||
|
|
||||||
$scope.editId = pid;
|
|
||||||
|
|
||||||
};
|
|
||||||
}]);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by ws040 on 10/1/17.
|
|
||||||
*/
|
|
||||||
|
|||||||
@ -82,6 +82,7 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage",
|
|||||||
* Get Top Nav user details
|
* Get Top Nav user details
|
||||||
*/
|
*/
|
||||||
$scope.resultData = response.data.details;
|
$scope.resultData = response.data.details;
|
||||||
|
$scope.loginImage = $scope.resultData.ProfilePicPath;
|
||||||
$scope.loginUser = {
|
$scope.loginUser = {
|
||||||
'staffID': $scope.resultData.StaffID,
|
'staffID': $scope.resultData.StaffID,
|
||||||
'fName': $scope.resultData.Firstname,
|
'fName': $scope.resultData.Firstname,
|
||||||
|
|||||||
@ -387,6 +387,84 @@
|
|||||||
<switch ng-model="p.IsActive" ng-init="p.IsActive = true" class="green"></switch>
|
<switch ng-model="p.IsActive" ng-init="p.IsActive = true" class="green"></switch>
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<img class="thumb prof" ng-src="images/{{p.ProfilePicPath}}" />
|
||||||
|
<style>
|
||||||
|
.thumb {
|
||||||
|
width: 130px;
|
||||||
|
height: 140px;
|
||||||
|
margin: 18px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.prof {
|
||||||
|
border: 2px solid #2C3543;
|
||||||
|
}
|
||||||
|
.uploader {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel)" method="post">
|
||||||
|
<div class="file-upload">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h5>Update Profile Picture</h5>
|
||||||
|
<div class=" margin-bottom-5">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<input type="file" accept="image/*" ng-init="resetImage()" file-upload onchange="angular.element(this).scope().imageUpload(event)" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="user-image">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--<input type="file" file-model="idProof"
|
||||||
|
accept="image/*" onchange="angular.element(this).scope().imageUpload(event)"/>-->
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div ng-repeat="step in stepsModel">
|
||||||
|
<!--<a class="close-thin"></a>-->
|
||||||
|
<img class="thumb" ng-src="{{step}}" />
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-right">
|
||||||
|
<button class="btn btn-success btn-o btn-sm margin-right-15" type="button" ng-click="resetImage()">Reset
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.thumb {
|
||||||
|
width: 130px;
|
||||||
|
height: 140px;
|
||||||
|
margin: 18px;
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploader {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--<pre>{{ p | json}}</pre>-->
|
<!--<pre>{{ p | json}}</pre>-->
|
||||||
|
|||||||
@ -420,7 +420,63 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel)"
|
||||||
|
method="post">
|
||||||
|
<div class="file-upload">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="user-image">
|
||||||
|
<h5>Profile Picture</h5>
|
||||||
|
<div class=" margin-bottom-5">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--<input type="file" file-model="idProof"
|
||||||
|
accept="image/*" onchange="angular.element(this).scope().imageUpload(event)"/>-->
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div ng-repeat="step in stepsModel">
|
||||||
|
<!--<a class="close-thin"></a>-->
|
||||||
|
<img class="thumb" ng-src="{{step}}" />
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-right">
|
||||||
|
<button class="btn btn-success btn-o btn-sm margin-right-15"
|
||||||
|
type="button"
|
||||||
|
ng-click="resetImage()">Reset
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="file" accept="image/*" file-upload onchange="angular.element(this).scope().imageUpload(event)"/>
|
||||||
|
<style>
|
||||||
|
.thumb{
|
||||||
|
width: 130px;
|
||||||
|
height: 140px;
|
||||||
|
margin: 18px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploader{
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--<pre>{{ myModel | json}}</pre>-->
|
<!--<pre>{{ myModel | json}}</pre>-->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -443,6 +499,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</tab>
|
</tab>
|
||||||
</tabset>
|
</tabset>
|
||||||
|
|
||||||
|
<!--<a-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- end: LIST GROUP -->
|
<!-- end: LIST GROUP -->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,10 @@
|
|||||||
<!-- start: USER OPTIONS DROPDOWN -->
|
<!-- start: USER OPTIONS DROPDOWN -->
|
||||||
<li class="dropdown current-user" dropdown on-toggle="toggled(open)">
|
<li class="dropdown current-user" dropdown on-toggle="toggled(open)">
|
||||||
<a href class="dropdown-toggle" dropdown-toggle>
|
<a href class="dropdown-toggle" dropdown-toggle>
|
||||||
<img src="assets/images/avatar-1.jpg" alt="{{user.name}}"> <span class="username" style = "text-transform: uppercase;">{{ loginUser.fName}} {{ loginUser.lName}} <i class="ti-angle-down"></i></i></span>
|
<!--<img src="assets/images/avatar-1.jpg" alt="{{user.name}}"> <span class="username" style = "text-transform: uppercase;">{{ loginUser.fName}} {{ loginUser.lName}} <i class="ti-angle-down"></i></i></span>-->
|
||||||
|
<img ng-src="images/{{loginImage}}" ng-if="loginImage !=null" alt="img">
|
||||||
|
<img src="images/default.jpeg" ng-if="loginImage == null" alt="img" >
|
||||||
|
<span class="username" style = "text-transform: uppercase;">{{ loginUser.fName}} <i class="ti-angle-down"></i></i></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dropdown-dark">
|
<ul class="dropdown-menu dropdown-dark">
|
||||||
<!--<li>
|
<!--<li>
|
||||||
|
|||||||
BIN
Apollo/images/default.jpeg
Normal file
BIN
Apollo/images/default.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Apollo/images/employee/default.jpeg
Normal file
BIN
Apollo/images/employee/default.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Loading…
Reference in New Issue
Block a user