';
}
});
};
$scope.listTestimonial = function(page) {
if (!(angular.isNumber(page) && page >= 0)) {
page = 0;
}
httpGet($http, $scope, 'testimonial/list?page=' + page, function(data, status, headers, config) {
$scope.testimonialList = data;
});
};
$scope.listQanda = function(page) {
if (!(angular.isNumber(page) && page >= 0)) {
page = 0;
}
httpGet($http, $scope, 'qanda/list?page=' + page, function(data, status, headers, config) {
$scope.qandaList = data;
});
};
$scope.nextPage = function(type) {
if (type == 'testimonial') {
$scope.pageTestimonial++;
$scope.listTestimonial($scope.pageTestimonial);
} else if (type == 'qanda') {
$scope.pageQanda++;
$scope.listQanda($scope.pageQanda);
}
}
$scope.previousPage = function(type) {
if (type == 'testimonial') {
$scope.pageTestimonial--;
if ($scope.pageTestimonial >= 0) {
$scope.listTestimonial($scope.pageTestimonial);
} else {
$scope.pageTestimonial = 0;
}
} else if (type == 'qanda') {
$scope.pageQanda--;
if ($scope.pageQanda >= 0) {
$scope.listQanda($scope.pageQanda);
} else {
$scope.pageQanda = 0;
}
}
}
$scope.isImage = function(filename) {
if (filename.length >= 4) {
var ext = filename.substr(filename.length - 4, 4).toLowerCase();
if (ext == '.jpg' || ext == '.png' || ext == '.gif' || ext == '.bmp') {
return true;
}
}
return false;
}
$scope.pageTestimonial = 0;
$scope.pageQanda = 0;
$scope.email = new Object();
$scope.emailContainer = true;
$scope.testimonialContainer = true;
$scope.listTestimonial(0);
$scope.qandaContainer = true;
$scope.listQanda(0);
$scope.photoNumberList = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38];
$scope.article = 'one';
// /#/?navigation=
var parameter = $location.search();
if (angular.isDefined(parameter.navigation)) {
$scope.navigation = parameter.navigation;
} else {
$scope.navigation = 'qualification';
}
if (angular.isDefined(parameter.messageKey)) {
if (parameter.messageKey == 'testimonialPosted') {
$scope.testimonialNotification = '
Your testimonial has been posted, it will be displayed once it is approved';
} else if (parameter.messageKey == 'qandaPosted') {
$scope.qandaNotification = '
Your question has been posted, it will be displayed once it is approved and answered';
} else if (parameter.messageKey == 'testimonialError') {
$scope.testimonialNotification = '
Your testimonial has not been posted, maybe you did not answer the challenge correctly?';
} else if (parameter.messageKey == 'qandaError') {
$scope.qandaNotification = '
Your question has not been posted, maybe you did not answer the challenge correctly?';
}
}
}]);