diff --git a/app/partials/ContactView/ContactView.controller.js b/app/partials/ContactView/ContactView.controller.js
index 0b37c27..e4ccf47 100644
--- a/app/partials/ContactView/ContactView.controller.js
+++ b/app/partials/ContactView/ContactView.controller.js
@@ -5,7 +5,7 @@
.controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', function($scope, $uibModal, ContactViewService, ViewCompanyService) {
$(function() {
- $('#toggle-one12').bootstrapToggle();
+ $('#toggle-one120').bootstrapToggle();
$('#toggle-two21').bootstrapToggle();
})
@@ -16,6 +16,21 @@
ContactViewService.getContacts().then(function(result) {
console.log('==========',result);
$scope.contactList = result;
+ for(var i=0; i<$scope.contactList.length; i++){
+ console.log("adadas")
+ $scope.contactList[i].value = ""
+ console.log($scope.contactList[i].priceEmail)
+ if($scope.contactList[i].priceEmail == 'true'){
+ console.log(aaya)
+ $scope.contactList[i].value = 'on';
+ }else{
+ console.log("nai")
+ $scope.contactList[i].value = 'off'
+ }
+
+ $('#toggle-one12'+ [i]).bootstrapToggle($scope.contactList[i].value)
+ }
+ console.log($scope.contactList)
})
diff --git a/app/partials/ContactView/ContactView.html b/app/partials/ContactView/ContactView.html
index 07a0c91..e87cbc8 100644
--- a/app/partials/ContactView/ContactView.html
+++ b/app/partials/ContactView/ContactView.html
@@ -38,32 +38,41 @@
-
+
|
-
+
|
-
+
|
-
+
+ |
+
+
+ |
+
+
+
+ |
+
-
+
|
-
+
|
-
+
|
@@ -75,8 +84,15 @@
{{contact.workPhone}} |
{{contact.mobilePhone}} |
{{contact.title}} |
- {{contact.username}} |
- {{contact.priceEmail}} |
+
+
+ |
+ {{contact.userName}} |
+ {{contact.password}} |
diff --git a/app/partials/viewCompany/viewCompany.controller.js b/app/partials/viewCompany/viewCompany.controller.js
index f07a284..1cf32d6 100644
--- a/app/partials/viewCompany/viewCompany.controller.js
+++ b/app/partials/viewCompany/viewCompany.controller.js
@@ -57,7 +57,7 @@
$('#company-one2').bootstrapToggle(value)
})
- $(function() {
+ $scope.changeStatus = function(){
$('#company-one2').bootstrapToggle();
$('#company-one2').change(function() {
$('#console-event').html('Toggle: ' + $(this).prop('checked'));
@@ -65,10 +65,14 @@
console.log($scope.companyData.activate)
var statusData = "status=" + $scope.companyData.activate;
ViewCompanyService.changeStatus(companyId, statusData).then(function(result) {
-
+ if(result.success){
+ toastr.success(''+result.success+'', {
+ closeButton: true
+ })
+ }
})
})
- })
+ }
getContactList();
diff --git a/app/partials/viewCompany/viewCompany.html b/app/partials/viewCompany/viewCompany.html
index 844d35e..3953b6d 100644
--- a/app/partials/viewCompany/viewCompany.html
+++ b/app/partials/viewCompany/viewCompany.html
@@ -137,7 +137,7 @@
Company Details
-
+
diff --git a/app/partials/viewcontact/viewcontact.controller.js b/app/partials/viewcontact/viewcontact.controller.js
index e9fbffb..77ec34b 100644
--- a/app/partials/viewcontact/viewcontact.controller.js
+++ b/app/partials/viewcontact/viewcontact.controller.js
@@ -11,8 +11,10 @@
var contactId = $stateParams.id;
$scope.contactDetail = {};
+ var value = "";
ViewcontactService.getContact(contactId).then(function(result) {
$scope.contactDetail = result;
+ checkValue($scope.contactDetail.priceEmail);
})
$scope.contactIdList = {};
@@ -31,6 +33,7 @@
selectedId = $scope.contactIdList[index];
ViewcontactService.getContact(selectedId).then(function(result) {
$scope.contactDetail = result;
+ checkValue($scope.contactDetail.priceEmail);
})
}
@@ -39,9 +42,36 @@
selectedId = $scope.contactIdList[index];
ViewcontactService.getContact(selectedId).then(function(result) {
$scope.contactDetail = result;
+ checkValue($scope.contactDetail.priceEmail);
})
}
+ function checkValue(priceEmail){
+ if(priceEmail == true){
+ value = 'on';
+ }else{
+ console.log("nai")
+ value = 'off'
+ }
+ $('#toggle-five').bootstrapToggle(value)
+ }
+
+ $scope.changePriceEmail = function(){
+ $('#toggle-five').bootstrapToggle();
+ $('#toggle-five').change(function() {
+ $scope.activate = $(this).prop('checked');
+ console.log($scope.activate)
+ var statusData = "status=" + $scope.activate;
+ ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) {
+ if(result.success){
+ toastr.success(''+result.success+'', {
+ closeButton: true
+ })
+ }
+ })
+ })
+ }
+
setInterval(function(){
var checkMaxLength = $scope.contactIdList.length - one;
if (index === checkMaxLength) {
diff --git a/app/partials/viewcontact/viewcontact.html b/app/partials/viewcontact/viewcontact.html
index 4e9378a..842d6b9 100644
--- a/app/partials/viewcontact/viewcontact.html
+++ b/app/partials/viewcontact/viewcontact.html
@@ -25,8 +25,9 @@