File manager - Edit - /home/gzbnyc5/pty-app/realstate/public/js/pty.front.angjs-agentprofile.js
Back
angularApp.directive('onErrorSrc', function() { return { link: function(scope, element, attrs) { element.bind('error', function() { if (attrs.src != attrs.onErrorSrc) { attrs.$set('src', attrs.onErrorSrc); } }); element.bind('load', function() { }); } } }); angularApp.controller('agentProfileController', ['$rootScope', '$scope', '$http', function($rootScope, $scope, $http) { var ctrl = this; /***************************************************************************** * * Pagination and Property Lists * *****************************************************************************/ ctrl.propertyPag = { length: 0, numPerPage: 6, currentPage: 1, maxSize: 10, }; ctrl.trans = GLOBAL_TRANSLATION; ctrl.propertyList = []; ctrl.loadAgentProperties = function() { $http({ method: 'POST', url: BASEURL + '/agent-properties/' + AGENT_ID, params: { currentPage: ctrl.propertyPag.currentPage, numPerPage: ctrl.propertyPag.numPerPage, } }) .then(function(result) { if (result.status != 200) { console.log('Unknown error. Please contact your administrator', data); } else { ctrl.propertyPag.length = result.data.length; ctrl.propertyList = result.data.records; } if(!$scope.$$phase) { $scope.$apply(); } },function(error) { console.log('error',error); }); } $scope.pageChanged = function() { ctrl.loadAgentProperties(); } ctrl.loadAgentProperties(); /***************************************************************************** * * Sending messages * *****************************************************************************/ ctrl.formHasError = false; ctrl.formHidden = false; ctrl.sendMessage = function() { ctrl.formHasError = false; if($scope.name && $scope.email && $scope.message && $scope.phone && $scope.captcha) { $http({ method: 'POST', url: BASEURL + '/send-message', data: { captcha: $scope.captcha, name: $scope.name, email: $scope.email, phone: $scope.phone, message: $scope.message, agent_id: AGENT_ID, } }) .then(function(result) { if (result.status != 200) { console.log('Unknown error. Please contact your administrator', data); } else { if(result.data.error == 0) { ctrl.formHidden = true; } else { ctrl.formHasError = true; var keys = Object.keys(result.data.errors); if(keys.length > 0) { ctrl.formError = result.data.errors[keys[0]][0]; } else { ctrl.formError = 'Unknown error. Please contact your administrator'; } $('#pty-captcha-container > img').replaceWith(result.data.image); } } if(!$scope.$$phase) { $scope.$apply(); } },function(error) { console.log('error',error); }); } else { ctrl.formHasError = true; ctrl.formError = ctrl.trans['all_fields_required']; } } ctrl.refreshCaptcha = function() { $('#pty-captcha-container > .input-group > .input-group-btn button i').addClass('fa-spin'); $http({ method: 'GET', url: BASEURL + '/refresh-captcha', }) .then(function(result) { if (result.status != 200) { console.log('Unknown error. Please contact your administrator', data); } else { if(result.data.error == 0) { $('#pty-captcha-container > .input-group > .input-group-btn > img').replaceWith(result.data.image); } } if(!$scope.$$phase) { $scope.$apply(); } $('#pty-captcha-container > .input-group > .input-group-btn button i').removeClass('fa-spin'); },function(error) { console.log('error',error); $('#pty-captcha-container > .input-group > .input-group-btn button i').removeClass('fa-spin'); }); } ctrl.shareLinksHidden = true; ctrl.showShareLinks = function() { ctrl.shareLinksHidden = ! ctrl.shareLinksHidden; } $(document).ready(function() { $(document).on('click', '.property_item', function(e) { window.location.href = $(this).parent().find('a:eq(0)').attr('href') }); $(document).on('click', '.share_expender, .toggle_share *', function(e) { e.stopPropagation(); }) }); }]);
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings