var homeApp = angular.module('homeApp', ['ngRoute', 'angular-loading-bar', 'ngAnimate', 'angular-ezmark', 'ui.select2', 'angulartics', 'angulartics.google.analytics']); homeApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider.when('/dang-nhap', { templateUrl: 'partials/user/login.html?ver='+JS_VERSION, controller: 'UserController' }). when('/dang-ky', { templateUrl: 'partials/user/register.html?ver='+JS_VERSION, controller: 'UserController' }). when('/lay-mat-khau', { templateUrl: 'partials/user/reset-password.html?ver='+JS_VERSION, controller: 'ResetPasswordController' }). when('/doi-mat-khau', { templateUrl: 'partials/user/change-password.html?ver='+JS_VERSION, controller: 'ChangePasswordController' }). when('/lien-he', { templateUrl: 'partials/home/contact.html?ver='+JS_VERSION, controller: 'ContactController' }). when('/tai-lieu', { templateUrl: 'partials/home/document.html?ver='+JS_VERSION, controller: 'DocumentController' }). when('/tai-khoan', { templateUrl: 'partials/user/profile.html?ver='+JS_VERSION, controller: 'ProfileController' }). when('/tai-khoan/viec-da-luu', { templateUrl: 'partials/job/job-save-list.html?ver='+JS_VERSION, controller: 'JobSaveListController' }). when('/tai-khoan/viec-da-ung-tuyen', { templateUrl: 'partials/job/job-apply-list.html?ver='+JS_VERSION, controller: 'JobApplyListController' }). when('/tim-ho-so', { templateUrl: 'partials/resume/search.html?ver='+JS_VERSION, controller: 'ResumeSearchController' }). when('/tim-ho-so:query', { templateUrl: 'partials/resume/search.html?ver='+JS_VERSION, controller: 'ResumeSearchController' }). when('/tao-ho-so-ung-vien', { templateUrl: 'partials/resume/create.html?ver='+JS_VERSION, controller: 'ResumeCreateController' }). when('/xem-ho-so-ung-vien/:resume_id', { templateUrl: 'partials/resume/view.html?ver='+JS_VERSION, controller: 'ResumeViewController' }). when('/sua-ho-so-ung-vien/:resume_id', { templateUrl: 'partials/resume/create.html?ver='+JS_VERSION, controller: 'ResumeCreateController' }). when('/tai-khoan/ung-vien', { templateUrl: 'partials/resume/create.html?ver='+JS_VERSION, controller: 'ResumeCreateController' }). when('/tai-khoan/ho-so', { templateUrl: 'partials/resume/list-resume.html?ver='+JS_VERSION, controller: 'ResumeListController' }). when('/tai-khoan/nha-tuyen-dung', { templateUrl: 'partials/employer/profile-employer.html?ver='+JS_VERSION, controller: 'EmployerProfileController' }). when('/tai-khoan/tin-tuyen-dung', { templateUrl: 'partials/employer/list-job.html?ver='+JS_VERSION, controller: 'EmployerListJob' }). when('/tai-khoan/ho-so-ung-tuyen', { templateUrl: 'partials/employer/list-resume.html?ver='+JS_VERSION, controller: 'EmployerListResume' }). when('/ho-so-da-xem', { templateUrl: 'partials/employer/list-resume-bought.html?ver='+JS_VERSION, controller: 'EmployerListResumeBought' }). when('/tai-khoan/xem-ho-so/:apply_id', { templateUrl: 'partials/employer/view-resume-apply.html?ver='+JS_VERSION, controller: 'EmployerViewResumeApply' }). when('/tai-khoan/ho-so-ung-tuyen/:job_id', { templateUrl: 'partials/employer/list-resume.html?ver='+JS_VERSION, controller: 'EmployerListResume' }). when('/dang-tuyen', { templateUrl: 'partials/employer/job-create.html?ver='+JS_VERSION, controller: 'JobCreateController' }). when('/dang-tuyen/:job_id', { templateUrl: 'partials/employer/job-create.html?ver='+JS_VERSION, controller: 'JobCreateController' }). when('/tim-kiem', { templateUrl: 'partials/job/search.html?ver='+JS_VERSION, controller: 'JobSearchController' }). when('/tim-nha-tuyen-dung', { templateUrl: 'partials/employer/search.html?ver='+JS_VERSION, controller: 'SearchEmployerController' }). when('/tim-kiem/:query', { templateUrl: 'partials/job/search.html?ver='+JS_VERSION, controller: 'JobSearchController' }). when('/viec-lam/:slug', { templateUrl: 'partials/job/view.html?ver='+JS_VERSION, //controller: 'JobController' }). when('/nha-tuyen-dung/:slug', { templateUrl: 'partials/employer/view.html?ver='+JS_VERSION, controller: 'EmployerController' }). when('/nhan-tin-tuyen-dung', { templateUrl: 'partials/user/subscribe.html?ver='+JS_VERSION, controller: 'SubscribeController' }). when('/nhan-thong-tin-ung-vien', { templateUrl: 'partials/employer/employer-subscribe.html?ver='+JS_VERSION, controller: 'EmployerSubscribeController' }). when('/', { templateUrl: 'partials/home/home.html?ver='+JS_VERSION, controller: 'HomeController' }). when('/tinh-thanh', { templateUrl: 'partials/home/city.html?ver='+JS_VERSION, controller: 'CityController' }). when('/nganh-nghe', { templateUrl: 'partials/home/career.html?ver='+JS_VERSION, controller: 'CityController' }). when('/nap-tien', { templateUrl: 'partials/payment/cashin.html?ver='+JS_VERSION, controller: 'PaymentCashinController' }). /* when('/nap-tien2', { templateUrl: 'partials/payment/cashin2.html?ver='+JS_VERSION, controller: 'PaymentCashinController' }). */ /* when('/dich-vu', { templateUrl: 'partials/payment/price.html?ver='+JS_VERSION, controller: 'PriceController' }). when('/dich-vu/chon-phuong-thuc-thanh-toan/:vip/:month', { templateUrl: 'partials/payment/credit-card.html?ver='+JS_VERSION, controller: 'PaymentController' }). */ when('/viec-lam-thoi-vu-tet-2020', { templateUrl: 'partials/etc/viec-lam-thoi-vu.html?ver='+JS_VERSION, controller: 'EtcController' }). when('/viec-lam-thoi-vu-tet-2020-ha-noi', { templateUrl: 'partials/etc/viec-lam-thoi-vu.html?ver='+JS_VERSION, controller: 'EtcController' }). when('/viec-lam-thoi-vu-tet-2020-tp-ho-chi-minh', { templateUrl: 'partials/etc/viec-lam-thoi-vu.html?ver='+JS_VERSION, controller: 'EtcController' }). when('/unsubscribe', { templateUrl: 'partials/etc/unsubscribe.html?ver='+JS_VERSION, }). otherwise({ templateUrl: 'partials/home/notfound.html?ver='+JS_VERSION, }); $locationProvider.html5Mode(true); } ]); homeApp.config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.withCredentials = true; }]); homeApp.run(['$route', '$rootScope', '$location', function ($route, $rootScope, $location) { var original = $location.path; $location.path = function (path, reload) { if (reload === false) { var lastRoute = $route.current; var un = $rootScope.$on('$locationChangeSuccess', function () { $route.current = lastRoute; un(); }); } return original.apply($location, [path]); }; }]) homeApp.factory('siteData', function() { return { data : { employer : {}, temp: { showStatus: 1, }, }, user : { uid : -1, name : "", email : "", account_type : -1, money : -1, }, page: { title: 'Tìm việc | Tìm kiếm việc làm 2016 | Tìm việc nhanh | Việc làm 2h | Viec.me', keywords: 'viec lam, tim viec nhanh, viec lam thoi vu, tet 2016, Bính Thân, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, kiem viec lam, vietnamworks', description: 'Viêc.me tuyển dụng 2016 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', } }; }); homeApp.service('MetadataService', ['$window', function($window){ var self = this; self.setMetaTags = function (tagData){ if(typeof(tagData.title) != 'undefined'){ document.title = tagData.title; $('meta[property="og:title"]').attr('content', tagData.title); } if(typeof(tagData.keywords) != 'undefined'){ $('meta[name=keywords]').attr('content', tagData.keywords); $('meta[property="og:keywords"]').attr('content', tagData.keywords); } if(typeof(tagData.description) != 'undefined'){ $('meta[name=description]').attr('content', tagData.description); $('meta[property="og:description"]').attr('content', tagData.description); } if(typeof(tagData.image) != 'undefined'){ $('meta[property="og:image"]').attr('content', tagData.image); } }; }]); /* var adSenseTpl = ''; homeApp.directive('googleAdsense', function($window, $compile) { return { restrict: 'A', transclude: true, template: adSenseTpl, replace: false, link: function postLink(scope, element, iAttrs) { element.html(""); element.append(angular.element($compile(adSenseTpl)(scope))); if (!$window.adsbygoogle) { $window.adsbygoogle = []; } $window.adsbygoogle.push({}); } }; }); */ /*homeApp.run(function($rootScope, $templateCache) { document.cookie = 'cookie1=test; expires=Fri, 26 Feb 2016 20:47:11 UTC; path=/' console.log(document.cookie); $rootScope.$on('$viewContentLoaded', function() { $templateCache.removeAll(); }); });*/function _login($scope, $http, siteData, SERVER_DOMAIN, href, $location, callback){ $scope.loginMessage = false; if($scope.password != "undefined" && $scope.username != "undefined"){ $http({ url: SERVER_DOMAIN + "/user/login2", method: "POST", data: $.param({username: $('#input-username').val(), password: $('#input-password').val()}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data) { if(data.error){ $scope.loginMessage = data.message; if(data.error == 2){ $scope.showResetPassword = true; }else{ $scope.showResetPassword = false; } }else{ $http.get(SERVER_DOMAIN + '/home/info').success(function(res) { siteData.user.uid = res.data.user.uid; USER_ID = parseInt(res.data.user.uid); siteData.user.name = res.data.user.name; siteData.user.email = res.data.user.email; siteData.user.qr = res.data.user.qr; siteData.user.account_type = parseInt(res.data.user.account_type); siteData.user.money = parseInt(res.data.user.money); //window.history.go(-1); $scope.loginSuccess = true; if(href != false && href != 'undefined'){ $location.search(''); $location.path(href, true); } callback(); }); } }); } } function _register($scope, $http, siteData, SERVER_DOMAIN, redirectUrl, callback){ $scope.registerMessage = ""; if(!$scope.account_type > 0){ $scope.account_type = 0; } if($scope.register_pass != $scope.re_pass){ $scope.registerMessage = "Xác nhận nhận khẩu không đúng"; return; } if($scope.register_name != "undefined" && $scope.register_pass != "undefined" && $scope.email != "undefined"){ $http({ url: SERVER_DOMAIN + "/user/register", method: "POST", data: $.param({username: $scope.register_name, password: $scope.register_pass, email: $scope.email, account_type: $scope.account_type}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data) { if(data.error){ $scope.registerMessage = data.message; $scope.userExits = data.exist || false; }else{ $scope.registerMessage = "Ðang ký thành công"; $http.get(SERVER_DOMAIN + '/home/info').success(function(res) { siteData.user.uid = res.data.user.uid; siteData.user.name = res.data.user.name; siteData.user.email = res.data.user.email; siteData.user.qr = res.data.user.qr; siteData.user.account_type = parseInt(res.data.user.account_type); siteData.user.money = parseInt(res.data.user.money); if(redirectUrl) window.location = redirectUrl; callback(); }); } }); } } function _logout($scope, $http, siteData, SERVER_DOMAIN){ $http.get(SERVER_DOMAIN + "/user/logout2").success(function(data) { if(!data.error){ siteData.user.uid = 0; siteData.user.name = ""; siteData.user.email = ""; siteData.user.qr = ""; siteData.data.newWordList = []; location.reload(); } }); } function onTemplateLoad(){ } function shareTimHoSo() { if(!USER_ID > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } FB.ui( { method: 'share', href: "https://viec.me/tim-ho-so?r=" + USER_ID, }, // callback function(response) { console.log(response); if (response && !response.error_code) { console.log("OK: "+JSON.stringify(response)); $.ajax({ url: SERVER_DOMAIN + "/ref/on_share", xhrFields: { withCredentials: true }, success: function(res){ if(res.error === 0){ showModal('Chia sẻ thành công', '

Bạn đã được cộng ' + res.amount +' vào tài khoản

', 'Tải lại trang'); } } }); } else { //console.log("Not OK: "+JSON.stringify(response)); } } ); } function number_format(number, decimals = 0, dec_point = ',', thousands_point = '.') { number = parseFloat(number); if (!decimals) { var len = number.toString().split('.').length; decimals = len > 1 ? len : 0; } if (!dec_point) { dec_point = '.'; } if (!thousands_point) { thousands_point = ','; } number = parseFloat(number).toFixed(decimals); number = number.replace(".", dec_point); var splitNum = number.split(dec_point); splitNum[0] = splitNum[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousands_point); number = splitNum.join(dec_point); return number; } homeApp.controller('ChangePasswordController', function($scope, $http, siteData, $routeParams, MetadataService){ $scope.user = siteData.user; MetadataService.setMetaTags({ title: 'Đổi mật khẩu', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Lấy lại mật khẩu | Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.pass = {}; $scope.send = function(){ $scope.error = false; $scope.success = false; if($scope.pass.pass_new == $scope.pass.pass_re){ $http({ url: SERVER_DOMAIN + '/user/change_password/', method: "POST", data: $.param($scope.pass), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.error = false; $scope.success = true; }else{ $scope.error = res.message; } }); }else{ $scope.error = 'Mật khẩu xác nhận chưa chính xác'; } } });homeApp.controller('CityController', function($scope, $routeParams, $http, siteData, $location, $route, MetadataService){ if($route.current.originalPath == '/nganh-nghe'){ MetadataService.setMetaTags({ title: 'Tìm việc theo ngành nghề, lĩnh vực', keywords: 'viec lam theo nganh nghe, linh vuc', description: 'Danh sách các ngành nghề, lĩnh vực. Thống kê số vị trí đang tuyển theo ngành nghề, lĩnh vực', }); } if($route.current.originalPath == '/tinh-thanh'){ MetadataService.setMetaTags({ title: 'Tìm việc theo tỉnh thành, địa điểm', keywords: 'viec lam theo tinh thanh, dia diem, viec lam tai ha noi, viec lam tai thanh pho ho chi minh', description: 'Danh sách tỉnh thành phố, thống kê số vị trí đang tuyển theo từng địa điểm', }); } $scope.loading = true; $http.get(SERVER_DOMAIN + '/statistic').success(function(res){ if(res.error == 0){ $scope.statistic = res.statistic; $scope.loading = false; } }); }); homeApp.controller('ContactController', function($scope, $routeParams, $http, siteData, $location, MetadataService, $sce){ MetadataService.setMetaTags({ title: 'Liên hệ', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.faqList = []; $scope.info = {}; $scope.trustAsHtml = $sce.trustAsHtml; $scope.postInfo = function(){ $scope.saveError = false; $scope.saveSuccess = false; $http({ url: SERVER_DOMAIN + "/home/save_contact", method: "POST", data: $.param($scope.info), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.saveSuccess = true; }else{ if(res.emailExist == true){ $scope.emailExist = true; } $scope.saveError = res.message; $scope.saveSuccess = false; } }); } var i = 0; function getFaq(x){ $http({ url: SERVER_DOMAIN + "/faq/search?content=" + $scope.info.content, method: "GET", /* data: $.param($scope.info), headers: {'Content-Type': 'application/x-www-form-urlencoded'} */ }).success(function(res) { if(res.error == 0){ if(x == i) $scope.faqList = res.faqList; }else{ console.log(res); } }); } $scope.onContentChange = function(){ i++; getFaq(i); } });homeApp.controller('DocumentController', function($scope, $http, siteData, MetadataService){ MetadataService.setMetaTags({ title: 'Tài liệu tham khảo', keywords: 'tai lieu, mau cv, mau don xin viec', description: 'Mẫu cv, mẫu hồ sơ ứng tuyển, mẫu thư xin việc dành cho sinh viên mới ra trường và người đã có kinh nghiệm.', }); });homeApp.controller('EmployerController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $scope.slug = $routeParams.slug; var slugData = $routeParams.slug.split('-'); if((slugData[slugData.length - 1].split('.'))[0] != undefined){ var employerId = (slugData[slugData.length - 1].split('.'))[0]; $scope.loading = true; if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $http.get(SERVER_DOMAIN + '/employer/detail/' + employerId + '?page=' + $scope.page).success(function(res){ if(res.error == 0){ $scope.employer = res.employer; $scope.employer.description = $sce.trustAsHtml(res.employer.description); $scope.jobs = res.jobs; $scope.numFound = res.numFound; $scope.pageCount = res.pageCount; MetadataService.setMetaTags({ title: $scope.employer.name, keywords: $scope.employer.name + ' tuyển dụng', description: 'Thông tin và các vị trí đang tuyển của ' + $scope.employer.name, }); scroolTop(); } $scope.loading = false; }); } }); homeApp.controller('EmployerListJob', function($scope, $http, siteData, $location, $routeParams, $sce, $route, MetadataService){ MetadataService.setMetaTags({ title: 'Quản lý tin tuyển dụng', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $scope.loading = true; $scope.user = siteData.user; console.log(siteData.user); $scope.send_set_featured = function(job_id, value){ //value 1 set 0 cancel $http.get(SERVER_DOMAIN + '/job/set_featured/' + job_id + '?value=' + value).success(function(res){ if(res.error == 0){ $scope.loadData(0); $route.updateParams({page: 1}); }else{ alert(res.message); } }); } $scope.send_set_urgent= function(job_id, value){ //value 1 set 0 cancel $http.get(SERVER_DOMAIN + '/job/set_urgent/' + job_id + '?value=' + value).success(function(res){ if(res.error == 0){ $scope.loadData(0); $route.updateParams({page: 1}); }else{ alert(res.message); } }); } $scope.send_refresh = function(job_id){ $http.get(SERVER_DOMAIN + '/job/refresh/' + job_id).success(function(res){ if(res.error == 0){ $scope.loadData(0); $route.updateParams({page: 1}); } }); } $scope.job_ids = {}; $scope.send_refresh_bulk = function(){ var keys = Object.keys($scope.job_ids); var data_job_ids = []; keys.forEach(function(key){ if($scope.job_ids[key] != true){ delete $scope.job_ids[key]; }else{ data_job_ids.push(key); } }); if(data_job_ids.length > 0){ var job_ids_string = data_job_ids.join(','); $http.get(SERVER_DOMAIN + '/job/refresh/' + job_ids_string).success(function(res){ if(res.error == 0){ $scope.loadData(0); $route.updateParams({page: 1}); } $scope.job_ids = {}; }); } } $scope.send_delete = function(job_id){ if(confirm('Xác nhận xóa tin tuyển dụng')){ $http.get(SERVER_DOMAIN + '/job/delete_job/' + job_id).success(function(res){ if(res.error == 0){ $scope.loadData(0); $route.updateParams({page: 1}); } }); } } $scope.loadData = function(page){ $scope.loading = true; $http.get(SERVER_DOMAIN + '/employer/list_job?page=' + page).success(function(res){ if(res.error == 0){ $scope.jobs = res.jobs; $scope.employer = res.employer; $scope.nextPage = res.nextPage; } $scope.loading = false; scroolTop(); }); } $scope.loadData(($scope.page - 1)); });homeApp.controller('EmployerListResume', function($scope, $http, siteData, $location, $routeParams, $sce, $route, MetadataService){ MetadataService.setMetaTags({ title: 'Hồ sơ đã ứng tuyển', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); if($routeParams.job_id > 0){ $scope.job_id = $routeParams.job_id; }else{ $scope.job_id = 0; } if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $scope.loading = true; $scope.status = {}; $scope.save_status = function(apply_id){ $http.get(SERVER_DOMAIN + '/employer/update_resume_apply_status/' + apply_id + '/' + $scope.status[apply_id]).success(function(res){ if(res.error == 0){ } }); } $scope.loadData = function(page){ $scope.loading = true; $http.get(SERVER_DOMAIN + '/employer/list_resume/' + $scope.job_id + '?page=' + page).success(function(res){ if(res.error == 0){ $scope.resumes = res.resumes; $scope.nextPage = res.nextPage; } $scope.loading = false; scroolTop(); }); } $scope.loadData(($scope.page - 1)); });homeApp.controller('EmployerListResumeBought', function($scope, $http, siteData, $location, $routeParams, $sce, $route, MetadataService){ MetadataService.setMetaTags({ title: 'Hồ sơ ứng viên đã xem', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); if($routeParams.job_id > 0){ $scope.job_id = $routeParams.job_id; }else{ $scope.job_id = 0; } if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $scope.loading = true; /* $scope.status = {}; $scope.save_status = function(apply_id){ $http.get(SERVER_DOMAIN + '/employer/update_resume_apply_status/' + apply_id + '/' + $scope.status[apply_id]).success(function(res){ if(res.error == 0){ } }); } */ $scope.loadData = function(page){ $scope.loading = true; $http.get(SERVER_DOMAIN + '/employer/list_resume_bought/' + $scope.job_id + '?page=' + page).success(function(res){ if(res.error == 0){ $scope.resumes = res.resumes; $scope.nextPage = res.nextPage; } $scope.loading = false; scroolTop(); }); } $scope.loadData(($scope.page - 1)); });homeApp.controller('EmployerProfileController', function($scope, $http, siteData, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Thông tin tài khoản nhà tuyển dụng', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); initCroppic(); $scope.user = siteData.user; $scope.employer = siteData.data.employer; $scope.loading = true; $scope.$watch('user.uid', function() { if($scope.user.uid == 0){ $location.path('/dang-nhap', true); } }); //$scope.employer $http.get(SERVER_DOMAIN + '/profile/employer_info').success(function(res) { siteData.user.uid = parseInt(res.data.user.uid); siteData.user.name = res.data.user.name; siteData.user.email = res.data.user.email; siteData.user.account_type = parseInt(res.data.user.account_type); siteData.data.employer.id = parseInt(res.data.employer.id); siteData.data.employer.name = res.data.employer.name; siteData.data.employer.address = res.data.employer.address; siteData.data.employer.phone = res.data.employer.phone; siteData.data.employer.description = res.data.employer.description; siteData.data.employer.logo = res.data.employer.logo; siteData.data.employer.vip = res.data.employer.vip; siteData.data.employer.featuredUsage = res.data.employer.featuredUsage; siteData.data.employer.urgentUsage = res.data.employer.urgentUsage; siteData.data.employer.vipEndTime = res.data.employer.vipEndTime; siteData.data.employer.contact_name = res.data.employer.contact_name; siteData.data.employer.contact_email = res.data.employer.contact_email; siteData.data.employer.contact_phone = res.data.employer.contact_phone; siteData.data.employer.contact_address = res.data.employer.contact_address; $scope.loading = false; /* if(siteData.user.account_type != 2){ $location.path('/', true); } */ scroolTop(); }); $scope.updateEmployerInfo = function(){ $scope.updateError = false; $scope.updateSuccess = false; $http({ url: SERVER_DOMAIN + "/employer/save_info", method: "POST", data: $.param($scope.employer), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.updateSuccess = true; $scope.updateError = false; }else{ $scope.updateError = res.message; $scope.updateSuccess = false; } }); } });homeApp.controller('EmployerSubscribeController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Đăng ký nhận thông tin ứng viên', keywords: 'dang ky, nhan tin, dang ky nhan thong tin ung vien', description: 'Đăng ký nhận thông tin ứng viên tại Viêc.me, ứng viên thuộc tất cả các ngành nghề, lĩnh vực và trình độ trên khắp Việt Nam.', }); $scope.info = {}; $scope.user = siteData.user; $scope.token = $routeParams.t; if($scope.token){ $http.get(SERVER_DOMAIN + '/employer_subscribe/check_token_email/' + $scope.token).success(function(res) { if(res.error == 0){ $scope.token_error = false; $scope.info = res.info; $scope.info.token = $routeParams.t; }else{ $location.path('/notfound', true); $scope.token_error = true; } }); } $scope.$watch('user.uid', function() { if($scope.user.uid > 0 && !$scope.token){ $http.get(SERVER_DOMAIN + '/employer_subscribe/get_info/').success(function(res) { if(res.error == 0){ $scope.info = res.info; $scope.info.token = $routeParams.t; } }); } }); $scope.postInfo = function(){ $scope.saveError = false; $scope.saveSuccess = false; $http({ url: SERVER_DOMAIN + "/employer_subscribe/save", method: "POST", data: $.param($scope.info), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.saveSuccess = true; console.log($scope.info); }else{ if(res.emailExist == true){ $scope.emailExist = true; } $scope.saveError = res.message; $scope.saveSuccess = false; } }); } $scope.newEmail = function(){ $scope.emailExist = false; } $scope.reSendEmail = function(){ $http({ url: SERVER_DOMAIN + "/employer_subscribe/re_send_email", method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.reSendEmailSuccess = true; }else{ } }); } });homeApp.controller('EmployerViewResumeApply', function($scope, $http, siteData, $location, $routeParams, $sce, $route, MetadataService, $interval){ MetadataService.setMetaTags({ title: 'Hồ sơ đã ứng tuyển', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.apply_id = $routeParams.apply_id; $scope.user = siteData.user; $scope.errorLogin = true; $scope.$watch('user.uid', function() { if($scope.user.uid > 0){ $scope.errorLogin = false; } }); if($routeParams.apply_id > 0){ $scope.loading = true; $http.get(SERVER_DOMAIN + '/employer/get_resume_apply/' + $routeParams.apply_id).success(function(res){ if(res.error == 0){ $scope.applyInfo = res.data; }else{ $scope.errorMessage = res.message; } console.log(res.data.employer_vip); if(!parseInt(res.data.employer_vip) > 0){ //$('#popup-dich-vu').modal({backdrop: 'static', keyboard: false}) ; } $scope.loading = false; }); $scope.status = {}; $scope.save_status = function(apply_id){ $http.get(SERVER_DOMAIN + '/employer/update_resume_apply_status/' + apply_id + '/' + $scope.status[apply_id]).success(function(res){ if(res.error == 0){ } }); } } $scope.timeCountDown = 60; var started = false; $scope.closePopup = function(){ if(!started){ started = true; var mytimeout = $interval(function(){ $scope.timeCountDown--; if($scope.timeCountDown == 0){ $interval.cancel(mytimeout); } },1000,0); } if($scope.timeCountDown == 0){ $('#popup-dich-vu').modal('hide'); } } });homeApp.controller('EtcController', function($scope, $http, siteData, $location, $routeParams, MetadataService){ MetadataService.setMetaTags({ title: 'Việc làm thời vụ tết 2020', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.loading = true; $scope.temp = siteData.data.temp; $scope.numFound = -1; $scope.pageCount = -1; $scope.jobs = false; $scope.query = ''; $scope.search = { keyword: 'thời vụ', city: '', career: '', salary : {}, job_type : {}, urgent : 0, featured : 0, page: 1, }; if($routeParams.page > 1){ $scope.search.page = parseInt($routeParams.page); } if($location.path() == '/viec-lam-thoi-vu-tet-2020-tp-ho-chi-minh'){ $scope.search.city = 1; } if($location.path() == '/viec-lam-thoi-vu-tet-2020-ha-noi'){ $scope.search.city = 2; } $scope.location_path = $location.path(); $http.get(SERVER_DOMAIN + '/job/search/' + btoa(encodeURIComponent(JSON.stringify($scope.search)))).success(function(res){ if(res.error == 0){ $scope.numFound = res.data.numFound; $scope.pageCount = res.data.pageCount; $scope.jobs = res.data.jobs; if(res.data.searchString != ''){ $scope.searchString = res.data.searchString; } scroolTop(); } $scope.loading = false; }); });homeApp.controller('FooterController', function($scope){ });homeApp.controller('HeadTagController', function($scope, $http, siteData){ $scope.page = siteData.page; });homeApp.controller('HeaderController', function($scope, $http, siteData, $rootScope, $location){ //init $scope.data = siteData.data; $scope.user = siteData.user; $scope.number_format = number_format; $http.get(SERVER_DOMAIN + '/home/info').success(function(res) { siteData.user.uid = parseInt(res.data.user.uid); USER_ID = parseInt(res.data.user.uid); siteData.user.name = res.data.user.name; siteData.user.email = res.data.user.email; siteData.user.qr = res.data.user.qr; siteData.user.account_type = parseInt(res.data.user.account_type); siteData.user.money = parseInt(res.data.user.money); }); $scope.logout = function(){ _logout($scope, $http, siteData, SERVER_DOMAIN); } $scope.test = function(){ console.log('test zz'); showModal(); } $scope.checkAndShowModalLogin = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập hoặc đăng ký tài khoản tại viec.me để tiếp tục

', 'Đăng nhập Đăng ký'); return true; }else{ return false; } } $rootScope.$on("$locationChangeStart", function(event, next, current) { // handle route changes if($location.path() == '/nap-tien'){ siteData.data.popup_hide = 1; }else{ siteData.data.popup_hide = 0; } }); });homeApp.controller('HomeController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Tìm việc làm | Đăng tuyển | Tìm hồ sơ | Lọc ứng viên | Tìm việc nhanh | Viec.me', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim ho so, loc ung vien, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec', description: 'Hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $http.get(SERVER_DOMAIN + '/statistic').success(function(res){ if(res.error == 0){ $scope.statistic = res.statistic; } }); var search = { keyword: '', city: '', career: '', salary : {}, job_type : {}, urgent : 0, featured : 0, page: 1, } $http.get(SERVER_DOMAIN + '/job/search/' + btoa(encodeURIComponent(JSON.stringify(search)))).success(function(res){ if(res.error == 0){ $scope.new_jobs = res.data.jobs; } }); $http.get(SERVER_DOMAIN + '/home/get_hot_job/').success(function(res){ if(res.error == 0){ $scope.hot_jobs = res.data.jobs; } }); $http.get(SERVER_DOMAIN + '/employer/search/').success(function(res){ if(res.error == 0){ $scope.top_employers = res.employers; } }); $scope.search = { keyword: '', city: '', career: '' } $scope.onSearchSubmit = function(){ var stringQuery = ''; if($scope.search.keyword != ''){ stringQuery = stringQuery + 'keyword='+$scope.search.keyword+'&'; } if($scope.search.city > 0){ stringQuery = stringQuery + 'city='+$scope.search.city+'&'; } if($scope.search.career > 0){ stringQuery = stringQuery + 'career='+$scope.search.career+'&'; } if(stringQuery != ''){ stringQuery = stringQuery.substring(0, stringQuery.length - 1); } $location.path('/tim-kiem/'+stringQuery, true); } });homeApp.controller('JobApplyListController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ MetadataService.setMetaTags({ title: 'Việc đã ứng tuyển', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.loading = true; if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $scope.loadData = function(page){ $http.get(SERVER_DOMAIN + '/job/list_apply?page=' + page).success(function(res){ if(res.error == 0){ $scope.jobs = res.jobs; $scope.nextPage = res.nextPage; } $scope.loading = false; }); } $scope.loadData(($scope.page - 1)); }); homeApp.controller('JobController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $scope.applyError = false; $scope.applyData = {}; $scope.user = siteData.user; var slugData = $routeParams.slug.split('-'); if((slugData[slugData.length - 1].split('.'))[0] != undefined){ var jobId = (slugData[slugData.length - 1].split('.'))[0]; $scope.loading = true; $scope.notFound = false; $http.get(SERVER_DOMAIN + '/job/detail/' + jobId).success(function(res){ if(res.error == 0){ $scope.job = res.job; $scope.job.content = $sce.trustAsHtml(res.job.content); $scope.employer = res.employer; $scope.resumeList = res.resumeList; if($scope.resumeList.length > 0){ $scope.applyData = $scope.resumeList[0]; $scope.resume_id = $scope.resumeList[0].id; } $scope.jobSaved = res.jobSaved; $scope.refUpcv = btoa('https://viec.me' + res.job.job_url); var len = res.relateJobs.length, mid = len / 2; $scope.relate_jobs1 = res.relateJobs.slice(0, mid); $scope.relate_jobs2 = res.relateJobs.slice(mid, len); scroolTop(); MetadataService.setMetaTags({ title: $scope.job.title, keywords: 'Việc làm ' + $scope.job.title + ', tuyển ' + $scope.job.title, description: 'Việc làm ' + $scope.job.title + ' tại ' + $scope.employer.name, }); $http.get(SERVER_DOMAIN + '/captcha').success(function(res){ $scope.captcha = SERVER_DOMAIN + '' + res; }); $('#form_upload_file').attr('action', SERVER_DOMAIN + '/test/apply'); $('#form_upload_file').ajaxForm({ xhrFields: { withCredentials: true }, beforeSend: function() { }, success: function(res) { var scope = angular.element($("#main-wrapper")).scope(); if(res.error == 1){ scope.$apply(function(){ scope.applyError = res.message; scope.applySuccess = false; }); }else if(res.error == 0){ scope.$apply(function(){ scope.applySuccess = true; scope.applyError = false; }); } scroolTo('#apply_error', 300); $scope.reloadCaptcha(); }, complete: function() { } }); }else{ $scope.notFound = true; } $scope.loading = false; }); $scope.resumeSelect = function(i){ console.log(i); $scope.applyData = $scope.resumeList[i]; } $scope.reloadCaptcha = function(){ $http.get(SERVER_DOMAIN + '/captcha').success(function(res){ $scope.captcha = SERVER_DOMAIN + '/captcha' + res; }); } $scope.saveJob = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } //$scope.jobSaved = -1; console.log('zz'); $http.get(SERVER_DOMAIN + '/job/save_job/' + jobId + '?action=save').success(function(res){ if(res.error == 0){ console.log('tt'); $scope.jobSaved = res.jobSaved; } }); } $scope.removeSaveJob = function(){ //$scope.jobSaved = -1; $http.get(SERVER_DOMAIN + '/job/save_job/' + jobId + '?action=remove').success(function(res){ if(res.error == 0){ $scope.jobSaved = res.jobSaved; } }); } } });homeApp.controller('JobCreateController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $('.date_picker').datepicker({ format: "dd-mm-yyyy" }); MetadataService.setMetaTags({ title: 'Đăng tin tuyển dụng', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); siteData.data.popup_hide = false; $scope.user = siteData.user; $scope.loading = true; $scope.$watch('user.uid', function() { if($scope.user.uid == 0){ $location.path('/dang-nhap', true); } }); $scope.job = { salary: "0", job_type: "0", experience: "0", content: '

Mô tả công việc

.....vui lòng điền mô tả công việc tại đây......

Yêu cầu

.....vui lòng điền yêu cầu tại đây (vd: trình độ học vấn, kỹ năng, kinh nghiệm)......

Quyền lợi

.....vui lòng điền quyền lợi tại đây (vd: lương hấp dẫn, BHYT, BHXH)......

Hồ sơ

Ưu tiên nộp hồ sơ trực tuyến qua hệ thống

Hoặc gửi CV mô tả quá trình học tập và làm việc về email liên hệ.

', }; $scope.job.id = $routeParams.job_id; if($scope.job.id > 0){ $http.get(SERVER_DOMAIN + '/job/get_info/' + $scope.job.id).success(function(res){ if(res.error == 0){ $scope.job = res.job; $('.ckeditor-textarea').ckeditor({ height: 400, disallowedContent : 'a', toolbar : [ ['Bold', 'Italic', 'NumberedList','BulletedList'] ], }); } }); }else{ $('.ckeditor-textarea').ckeditor({ height: 400, disallowedContent : 'a', toolbar : [ ['Bold', 'Italic', 'NumberedList','BulletedList'] ], }); } $scope.employer_job_count = 0; $http.get(SERVER_DOMAIN + '/home/info?e=1&s=1').success(function(res){ if(res.error == 0 && res.data.employer != false){ $scope.site_data = res.data.site_data; $scope.job.contact_name = res.data.employer.contact_name; $scope.job.contact_address = res.data.employer.contact_address; $scope.job.contact_email = res.data.employer.contact_email; $scope.job.contact_phone = res.data.employer.contact_phone; $scope.employer_job_count = res.data.employer.job_count > 0 ? res.data.employer.job_count : 0; $scope.employerNotExist = false; }else{ $scope.employerNotExist = true; } $scope.loading = false; scroolTop(); }); $scope.submitForm = function(){ $scope.updateError = false; $scope.updateSuccess = false; $scope.job.content = $('.ckeditor-textarea').val(); $http({ url: SERVER_DOMAIN + "/job/update", method: "POST", data: $.param($scope.job), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.updateSuccess = true; $scope.updateError = false; $location.path('/dang-tuyen/'+res.job.id, true); }else{ $scope.updateError = res.message; $scope.updateSuccess = false; toastr.error(Object.values(res.message).join('
')); } }); } });homeApp.controller('JobSaveListController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $scope.loading = true; MetadataService.setMetaTags({ title: 'Việc đã lưu', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); if($routeParams.page > 0){ $scope.page = parseInt($routeParams.page); }else{ $scope.page = 1; } $scope.loadData = function(page){ $http.get(SERVER_DOMAIN + '/job/list_saved?page=' + page).success(function(res){ if(res.error == 0){ $scope.jobs = res.jobs; $scope.nextPage = res.nextPage; } $scope.loading = false; }); } $scope.loadData(($scope.page - 1)); $scope.removeSaveJob = function(jobId){ //$scope.jobSaved = -1; $http.get(SERVER_DOMAIN + '/job/save_job/' + jobId + '?action=remove').success(function(res){ if(res.error == 0){ $scope.loadData(0); } }); } }); homeApp.controller('JobSearchController', function($scope, $http, siteData, $location, $routeParams, MetadataService){ MetadataService.setMetaTags({ title: 'Tìm việc, kết quả tìm kiếm tin tuyển dụng', keywords: 'tim viec, viec lam, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, kiem viec lam, vietnamworks', description: 'Tìm việc với hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.loading = true; $scope.temp = siteData.data.temp; siteData.data.popup_hide = true; $scope.numFound = -1; $scope.pageCount = -1; $scope.jobs = false; $scope.query = ''; $scope.search = { keyword: '', city: '', career: '', salary : {}, job_type : {}, urgent : 0, featured : 0, page: 1, }; if($routeParams.query != undefined && $routeParams.query != ''){ $scope.query = $routeParams.query; $scope.query = ($scope.query != '')?($scope.query + '&'):''; var params =($routeParams.query).split('&'); var urlParams = {}; for(var i = 0; i < params.length; i++){ var data = params[i].split('='); if(data[0] != undefined && data[1] != undefined){ urlParams[data[0]] = data[1]; } } if(urlParams['keyword'] != undefined && urlParams['keyword'] != ''){ $scope.search.keyword = urlParams['keyword']; } if(urlParams['city'] != undefined && urlParams['city'] > 0){ $scope.search.city = urlParams['city']; } if(urlParams['career'] != undefined && urlParams['career'] > 0){ $scope.search.career = urlParams['career']; } if(urlParams['urgent'] != undefined && urlParams['urgent'] != ''){ $scope.search.urgent = true; } if(urlParams['featured'] != undefined && urlParams['featured'] != ''){ $scope.search.featured = true; } if(urlParams['page'] != undefined && urlParams['page'] > 0){ $scope.search.page = parseInt(urlParams['page']); $scope.query = ($scope.query).replace('&page='+$scope.search.page, ''); $scope.query = ($scope.query).replace('page='+$scope.search.page, ''); } if(urlParams['salary'] != undefined && urlParams['salary'] != ''){ var dataSalary = urlParams['salary'].split(','); for(var i = 0; i < dataSalary.length; i++){ $scope.search.salary[dataSalary[i]] = true; } } if(urlParams['job_type'] != undefined && urlParams['job_type'] != ''){ var dataJobType = urlParams['job_type'].split(','); for(var i = 0; i < dataJobType.length; i++){ $scope.search.job_type[dataJobType[i]] = true; } } } $scope.count_salary = Object.keys($scope.search.salary).length; $scope.count_job_type = Object.keys($scope.search.job_type).length; $scope.searchChange = function(){ $scope.search.page = 1; var keys = Object.keys($scope.search.salary); var salary_keys = []; keys.forEach(function(key){ if($scope.search.salary[key] != true){ delete $scope.search.salary[key]; }else{ salary_keys.push(key); } }); $scope.count_salary = Object.keys($scope.search.salary).length; var keys = Object.keys($scope.search.job_type); var job_type_keys = []; keys.forEach(function(key){ if($scope.search.job_type[key] != true){ delete $scope.search.job_type[key]; }else{ job_type_keys.push(key); } }); $scope.count_job_type = Object.keys($scope.search.job_type).length; var stringQuery = ''; if($scope.search.keyword != ''){ stringQuery = stringQuery + 'keyword='+$scope.search.keyword+'&'; } if($scope.search.city > 0){ stringQuery = stringQuery + 'city='+$scope.search.city+'&'; } if($scope.search.career > 0){ stringQuery = stringQuery + 'career='+$scope.search.career+'&'; } if($scope.search.urgent > 0){ stringQuery = stringQuery + 'urgent='+$scope.search.urgent+'&'; } if($scope.search.featured > 0){ stringQuery = stringQuery + 'featured='+$scope.search.featured+'&'; } if(salary_keys.length > 0){ stringQuery = stringQuery + 'salary='+salary_keys.join()+'&'; } if(job_type_keys.length > 0){ stringQuery = stringQuery + 'job_type='+job_type_keys.join()+'&'; } if($scope.search.page > 1){ stringQuery = stringQuery + 'page='+$scope.search.page+'&'; } if(stringQuery != ''){ stringQuery = stringQuery.substring(0, stringQuery.length - 1); } $scope.query = (stringQuery).replace('&page='+$scope.search.page, ''); $scope.query = (stringQuery).replace('page='+$scope.search.page, ''); $scope.query = ($scope.query != '')?($scope.query + '&'):''; $location.path('/tim-kiem/'+stringQuery, false); //$location.search('salary', JSON.stringify($scope.search.salary)); $scope.loading = true; $http.get(SERVER_DOMAIN + '/job/search/' + btoa(encodeURIComponent(JSON.stringify($scope.search)))).success(function(res){ if(res.error == 0){ $scope.numFound = res.data.numFound; $scope.pageCount = res.data.pageCount; $scope.jobs = res.data.jobs; if(res.data.searchString != ''){ siteData.page.title = 'Việc làm ' + res.data.searchString; $scope.searchString = res.data.searchString; } scroolTop(); } $scope.loading = false; }); } $http.get(SERVER_DOMAIN + '/job/search/' + btoa(encodeURIComponent(JSON.stringify($scope.search)))).success(function(res){ if(res.error == 0){ $scope.numFound = res.data.numFound; $scope.pageCount = res.data.pageCount; $scope.jobs = res.data.jobs; if(res.data.searchString != ''){ siteData.page.title = 'Việc làm ' + res.data.searchString; $scope.searchString = res.data.searchString; } scroolTop(); } $scope.loading = false; }); });homeApp.controller('PaymentCashinController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ $scope.user = siteData.user; console.log($scope.user); MetadataService.setMetaTags({ title: 'Chọn phương thức thanh toán', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); setTimeout(() => { scroolTop(); }, 200) let iv = setInterval(() => { if($scope.user.money >= 0 && $scope.user.uid){ $http.get(SERVER_DOMAIN + '/home/info').success(function(res) { let newMoney = parseInt(res.data.user.money); if(newMoney > $scope.user.money){ showModal('Cập nhật số dư', '

Số dư tài khoản của bạn mới được cập nhật.
Số dư hiện tại: '+number_format(newMoney)+'đ

', 'Đóng Tìm hồ sơ ứng viên'); } siteData.user.money = parseInt(res.data.user.money); }); } }, 3000) $scope.$on("$destroy", function(){ clearInterval(iv); }); $scope.tab = 2; if($routeParams.tab > 0){ $scope.tab = $routeParams.tab; } $scope.bankAmount = ''; $scope.bankMessage = false; if($routeParams.amount){ $scope.bankAmount = parseInt($routeParams.amount); } $scope.showCashinWayModal = function(way){ if(way == 1){ if($scope.checkAndShowModalLogin()){ return false; } } let header = $('#way-header-' + way).html(); let content = $('#way-content-' + way).html(); showModal(header, content, 'Đóng', true); } $scope.reloadPage = function() { window.location.reload(); } $scope.zeroPad = function(num, places) { let numZeroes = places - num.toString().length + 1; if (numZeroes > 0) { return Array(+numZeroes).join("0") + num; } return num } $scope.number_format = number_format; $scope.submitForm = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } $scope.bankMessage = false; var amount = parseInt($scope.bankAmount) || 0; if(!$scope.bankcode){ $scope.bankMessage = 'Bạn cần chọn một phương thức thanh toán để có thể tiếp tục'; showModal('Thông báo', '

Bạn cần chọn một phương thức thanh toán để có thể tiếp tục

', 'Đóng'); }else if(amount < 50000){ $scope.bankMessage = 'Số tiền nạp vào tài khoản tối thiểu 50.000 đ'; showModal('Thông báo', '

Số tiền nạp vào tài khoản tối thiểu 50.000 đ

', 'Đóng'); }else{ $('#payment-form').submit(); } } $scope.checkAndShowModalLogin = function(){ console.log($scope.user.uid); if(!$scope.user.uid){ showModal('Đăng nhập', '

Bạn cần đăng nhập hoặc đăng ký tài khoản tại viec.me để tiếp tục

', 'Đăng nhập Đăng ký'); return true; }else{ return false; } } $scope.showImgModal = function(img){ showModal('Hướng dẫn', '', 'Đóng'); } $scope.submitFormBank = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } $scope.bankMessage = false; var amount = parseInt($scope.bankAmount) || 0; if(amount < 10000){ $scope.bankMessage = 'Số tiền nạp vào tài khoản tối thiểu 50.000 đ'; showModal('Thông báo', '

Số tiền nạp vào tài khoản tối thiểu 50.000 đ

', 'Đóng'); }else{ $('#payment-form2').submit(); } } $scope.submitFormVisa = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } $scope.bankMessage = false; var amount = parseInt($scope.bankAmount) || 0; if(amount < 10000){ $scope.bankMessage = 'Số tiền nạp vào tài khoản tối thiểu 50.000 đ'; showModal('Thông báo', '

Số tiền nạp vào tài khoản tối thiểu 50.000 đ

', 'Đóng'); }else{ $('#payment-formVisa').submit(); } } $scope.cardType = ''; $scope.cardMessage = ''; $scope.cardMessageSuccess = ''; $scope.cardSubmit = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } if(!$scope.cardSeri || !$scope.cardCode){ $scope.cardMessage = 'Bạn cần điền số seri và mã thẻ'; }else if($scope.cardType == ''){ $scope.cardMessage = 'Bạn cần chọn loại thẻ'; }else{ $scope.cardMessage = ''; $http.get(SERVER_DOMAIN + '/payment/card?card_type=' + $scope.cardType + '&card_seri=' + $scope.cardSeri + '&card_code=' + $scope.cardCode).success(function(res){ if(res.error == 1){ $scope.cardMessage = res.message; } if(res.error == 0){ $scope.cardMessageSuccess = res.message; } }); } if($scope.cardMessage != ''){ showModal('Thông báo', '

' + $scope.cardMessage + '

', 'Đóng'); } } //thông báo thành công if($routeParams.thongbao == 'thanhcong' && parseInt($routeParams.amount) > 0){ //showModal('Thông báo', '

Bạn đã nạp thành công ' + $routeParams.amount + ' đ vào tài khoản

', 'Nâng cấp dịch vụ VIP Tìm hồ sơ ứng viên'); showModal('Thông báo', '

Bạn đã nạp thành công ' + $routeParams.amount + ' đ vào tài khoản

', 'Tìm hồ sơ ứng viên'); } }); homeApp.controller('PaymentController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ /* $scope.user = siteData.user; MetadataService.setMetaTags({ title: 'Chọn phương thức thanh toán', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2016 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.requireBankCode = false; $scope.vip = $routeParams.vip; $scope.month = $routeParams.month; $scope.submitForm = function(){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng nhập'); return; } $scope.requireBankCode = false; if($scope.bankcode){ $('#payment-form').submit(); }else{ $scope.requireBankCode = true; } } */ }); homeApp.controller('PriceController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Dịch vụ', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.user = siteData.user; $scope.item = 0; $scope.month = '1'; $scope.discount = { 1:0, 3:0.2, 6:0.3, 12:0.4 }; $scope.price = { 1:1000000, 2:1500000, 3:2500000, }; if($routeParams.thongbao){ $scope.paymentSuccess = true; } $scope.parseInt = function(value) { return parseInt(value); } $scope.formatMoney = function(n) { return n.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1."); }; $scope.payButtonClick = function(){ var money = $scope.price[$scope.item] * 0.5 * parseInt($scope.month) * (1 - $scope.discount[$scope.month]); if($scope.user.money >= money){ $http.get(SERVER_DOMAIN + '/employer/upgrade?item=' + $scope.item + '&month=' + $scope.month).success(function(res){ if(res.error == 1){ showModal('Có lỗi xảy ra', '

' + res.message + ' ...

', 'Đóng'); } if(res.error == 0){ location.href="/dich-vu?thongbao=thanhcong"; } }); return; return; }else{ showModal('Nạp tiền', '

Phí nâng cấp: '+money+' đ

Số tiền trong tài khoản của bạn không đủ để nâng cấp

', 'Nạp tiền'); return; } } //thông báo thành công if($routeParams.thongbao == 'thanhcong'){ showModal('Nâng cấp thành công', '

Tiếp tục: Chọn tin tuyển dụng NỔI BẬT và TUYỂN GẤP

', 'Tiếp tục'); } });homeApp.controller('ProfileController', function($scope, $http, siteData, $location, MetadataService){ $scope.user = siteData.user; MetadataService.setMetaTags({ title: 'Tài khoản', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); if(!siteData.user.uid > 0){ $location.path('/dang-nhap', true); } $http.get(SERVER_DOMAIN + '/home/info').success(function(res) { siteData.user.uid = parseInt(res.data.user.uid); siteData.user.name = res.data.user.name; siteData.user.account_type = parseInt(res.data.user.account_type); if(siteData.user.account_type == 2){ $location.path('/tai-khoan/nha-tuyen-dung', true); } if(siteData.user.account_type == 1){ $location.path('/tai-khoan/ung-vien', true); } }); $scope.saveAcountType = function(type){ $http({ url: SERVER_DOMAIN + "/profile/save_account_type", method: "POST", data: $.param({type: type}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ siteData.user.account_type = type; if(siteData.user.account_type == 2){ $location.path('/tai-khoan/nha-tuyen-dung', true); }else{ $location.path('/tai-khoan/ung-vien', true); } }else{ $location.path('/tai-khoan/ung-vien', true); } }); } });homeApp.controller('ResetPasswordController', function($scope, $http, siteData, $routeParams, MetadataService){ MetadataService.setMetaTags({ title: 'Lấy mật khẩu', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.token = $routeParams.t; $scope.token_error = false; $scope.user_exist = false; //check token if($scope.token){ $http.get(SERVER_DOMAIN + '/user/check_token_email/' + $scope.token).success(function(res) { if(res.error == 0){ $scope.token_error = false; if(res.user == true){ $scope.user_exist = true; }else{ $scope.user_exist = false; } }else{ $scope.token_error = true; } }); } $scope.sendMail = function(){ if(!$scope.email){ $scope.send_message_error = 'Bạn chưa nhập email';; } $http({ url: SERVER_DOMAIN + "/user/send_reset_passwor_email", method: "POST", data: $.param({email: $scope.email}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.send_message = true; }else{ } }); //$scope.send_message = true; } $scope.resetPassword = function(){ if($scope.new_password == $scope.re_new_password){ $scope.reset_password_error = false; $http({ url: SERVER_DOMAIN + '/user/reset_password/' + $scope.token, method: "POST", data: $.param({new_username: $scope.new_username, new_password: $scope.new_password}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.reset_password_success = res.userInfo; }else{ $scope.reset_password_error = res.message; } }); }else{ $scope.reset_password_error = 'Mật khẩu xác nhận chưa chính xác'; } } });homeApp.controller('ResumeCreateController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $scope.user = siteData.user; MetadataService.setMetaTags({ title: 'Tạo hồ sơ ứng viên', keywords: 'ho so, tao cv, tao cv online, tao ho so online', description: 'Tạo hồ sơ trực tuyển tại Việc.me, dễ dàng tiếp cần với hàng ngàn nhà tuyển dụng khắp Việt Nam', }); siteData.data.popup_hide = true; $scope.loading = true; $scope.step = 1; initCroppic(); $('.date_picker').datepicker({ format: "dd-mm-yyyy" }); $scope.resume = { study_desc : '', work_desc : '', skill : "", gender : 1, education : "0", experience : "0", salary : "0", }; $scope.resume.id = $routeParams.resume_id; if($routeParams.job_url && $routeParams.job_title){ $scope.job_title = $routeParams.job_title; $scope.job_url = $routeParams.job_url; }else{ $scope.job_title = false; $scope.job_url = false; } $scope.$watch('user.uid', function() { //console.log($scope.user); if($scope.user.uid == 0){ $scope.step = 1; $scope.loading = false; $('.ckeditor-textarea').ckeditor({ height: 300, disallowedContent : 'a', toolbar : [ ['Bold', 'Italic', 'NumberedList','BulletedList'] ], }); }else if($scope.user.uid > 0){ if($scope.resume.id > 0){ $http.get(SERVER_DOMAIN + '/resume/get_info/' + $scope.resume.id).success(function(res){ if(res.error == 0){ $scope.resume = res.resume; if($scope.resume.file != ''){ $scope.file_name = '1 file đã tải lên'; } $('.ckeditor-textarea').ckeditor({ height: 300, disallowedContent : 'a', toolbar : [ ['Bold', 'Italic', 'NumberedList','BulletedList'] ], }); } $scope.loading = false; }); }else{ $scope.loading = false; $('.ckeditor-textarea').ckeditor({ height: 300, disallowedContent : 'a', toolbar : [ ['Bold', 'Italic', 'NumberedList','BulletedList'] ], }); } } }); $scope.showLoginForm = false; $scope.showRegisterForm = false; $scope.submitStep1 = function(){ if($scope.user.uid == 0){ $scope.showRegisterForm = true; }else if($scope.user.uid > 0){ $scope.step = 2; } } $scope.doLogin = function(){ console.log($scope) _login($scope, $http, siteData, SERVER_DOMAIN, false, $location, function(){ $scope.logged = true; $scope.showLoginForm = false; $scope.step = 2; }) } $scope.doRegister = function(){ $scope.account_type = 1; _register($scope, $http, siteData, SERVER_DOMAIN, false, function(){ $scope.logged = true; $scope.showRegisterForm = false; $scope.step = 2; }); } $scope.saveTmpFile = function(){ var formData = new FormData(); formData.append('file', $("#input_file")[0].files[0]); $scope.file_name = 'đang tải lên ...'; $http({ url: SERVER_DOMAIN + "/resume/save_tmp_file", method: "POST", data: formData, headers: {'Content-Type':undefined} }).success(function(res) { if(res.error == 0){ $scope.file_name = '1 file đã tải lên'; $scope.resume.file = res.file; }else{ $scope.file_name = $res.message; } }); } $scope.saveResume = function(){ $scope.updateError = false; $scope.updateSuccess = false; $scope.resume.study_desc = $('#study_desc').val(); $scope.resume.work_desc = $('#work_desc').val(); $http({ url: SERVER_DOMAIN + "/resume/save_info", method: "POST", data: $.param($scope.resume), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.updateSuccess = true; $scope.updateError = false; $scope.resume.avatar = res.avatar; $scope.resume.file = res.file; $scope.resume.id = res.resume_id; $scope.is_create = res.is_create; scroolTo('.document-title', 300); if($routeParams.job_url && $routeParams.job_title){ $scope.job_title = $routeParams.job_title; $scope.job_url = $routeParams.job_url; /* var param = { job_title: $routeParams.job_title, job_url: $routeParams.job_url, save: 1, } $location.path('/sua-ho-so-ung-vien/' + $scope.resume.id, true).search(param); */ }else{ $scope.job_title = false; $scope.job_url = false; /* var param = { save: 1, } $location.path('/sua-ho-so-ung-vien/' + $scope.resume.id, true).search(param); */ } }else{ scroolTo('.document-title', 300); $scope.updateError = res.message; $scope.updateSuccess = false; } }); } $scope.showSample = function(i){ if(i==1) showModal('Quá trình học tập', '

Bằng cấp & chứng chỉ:

Bằng tốt nghiệp Cao đẳng Đông Đô
Chứng chỉ tin học văn phòng

Quá trình học tập:

Từ 2010 đến 2013: Cao đẳng HCM - chuyên ngành kế toán, tốt nghiệp loại khá.

Từ 4/2012 đến 9/2012: Chứng chỉ kế toán quốc tế

', 'Đóng'); if(i==2) showModal('Kinh nghiệm làm việc', '

Từ 5/2014 đến nay: Công ty TNHH VIEC.ME

Vị trí: Nhân viên bảo vệ

Mô tả công việc: Kiểm soát người, phương tiện ra vào, ghi chép sổ sách và báo cáo cho giám đốc.

Kết quả: Thực hiện tốt các công việc được giao.

Từ 5/2011 đến 5/2014: Công ty TNHH ABC

Vị trí: Nhân viên bảo vệ

Mô tả công việc: Kiểm soát người, phương tiện ra vào, ghi chép sổ sách và báo cáo cho giám đốc.

Kết quả: Thực hiện tốt các công việc được giao.

...

', 'Đóng'); if(i==3) showModal('Kỹ năng', '

-Tiếng Anh: nghe nói đọc viết thành thạo
-Excel: Khá
-Quản lý - điều hành
-Làm việc theo nhóm
...

', 'Đóng'); if(i==4) showModal('Thông tin khác', '

Mục tiêu nghề nghiệp: Mong muốn trở thành một quản lý xuất sắc trong 1 năm
Mong muốn làm việc ổn định lâu dài, thăng tiến trong công việc
Sở thích: Đọc sách , du lịch , tìm hiểu và khám phá , giao lưu kết bạn học hỏi
Kỹ năng đặc biệt/tài lẻ: Giao tiếp

', 'Đóng'); } });homeApp.controller('ResumeListController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ $scope.loading = true; MetadataService.setMetaTags({ title: 'Hồ sơ của tôi', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Tạo hồ sơ tại viec.me | Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.loadData = function(){ $http.get(SERVER_DOMAIN + '/resume/list_resume/').success(function(res){ if(res.error == 0){ $scope.resumes = res.resumes; } $scope.loading = false; }); } $scope.loadData(); $scope.send_refresh = function(resume_id){ $http.get(SERVER_DOMAIN + '/resume/refresh/' + resume_id).success(function(res){ if(res.error == 0){ $scope.loadData(); } }); } }); homeApp.controller('ResumeSearchController', function($scope, $http, siteData, $location, $routeParams, MetadataService){ MetadataService.setMetaTags({ title: 'Tìm hồ sơ ứng viên, tra cứu cv, tìm ứng viên miễn phí', keywords: 'tim ho so, ung vien, xem cv, ho so, cv, tim cv, tim ung vien, tuyen dung, mien phi', description: 'Tra cứu hồ sơ đăng tải tại viec.me, Tặng miễn phí hồ sơ khi chia sẻ với bạn bè, Gần 1 triệu ứng viên thuộc tất cả các ngành nghề, lĩnh vực. ', }); siteData.data.popup_hide = false; $scope.loading = true; $scope.user = siteData.user; /* var ref_id = $routeParams.r; if(ref_id > 0){ $http.get(SERVER_DOMAIN + '/ref/on_click/' + ref_id).success(function(res){}); } $http.get(SERVER_DOMAIN + '/ref/check_share/').success(function(res){ if(res.error == 0){ $scope.facebook_shared = res.facebook_shared; } }); */ var facebookCommentId = $routeParams.fbcm; console.log(facebookCommentId); if(facebookCommentId > 0){ $http({ url: SERVER_DOMAIN + "/fb/on_comment_click", method: "POST", data: $.param({comment_id: facebookCommentId}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { }); $routeParams.fbcm = ''; } $scope.resumes = false; $scope.nextPage = false; $scope.query = ''; $routeParams.keyword = $routeParams.keyword===true?'':$routeParams.keyword; $scope.search = { keyword: typeof($routeParams.keyword)!='undefined'?$routeParams.keyword:'', city: typeof($routeParams.city)!='undefined'?$routeParams.city:'', career: typeof($routeParams.career)!='undefined'?$routeParams.career:'', page: parseInt($routeParams.page)>0?parseInt($routeParams.page):1, experience: $routeParams.experience>0?$routeParams.experience:'', }; $scope.searchChange = function(p, changeLocation = true){ if(p > 0){ $scope.search.page = p; } console.log($routeParams); var stringQuery = ''; if($scope.search.keyword != ''){ stringQuery = stringQuery + 'keyword='+$scope.search.keyword+'&'; } if($scope.search.city > 0){ stringQuery = stringQuery + 'city='+$scope.search.city+'&'; } if($scope.search.career > 0){ stringQuery = stringQuery + 'career='+$scope.search.career+'&'; } if($scope.search.experience > 0){ stringQuery = stringQuery + 'experience='+$scope.search.experience+'&'; } $scope.query = (stringQuery).replace('&page='+$scope.search.page, ''); $scope.query = (stringQuery).replace('page='+$scope.search.page, ''); $scope.query = ($scope.query != '')?($scope.query + '&'):''; if($scope.search.page > 1){ stringQuery = stringQuery + 'page='+$scope.search.page+'&'; } if(changeLocation){ $location.path('/tim-ho-so', false).search($scope.search); } $scope.loading = true; $http.get(SERVER_DOMAIN + '/resume/search2/?' + stringQuery).success(function(res){ if(res.error == 0){ $scope.resumes = res.data.resumes; $scope.numFound = res.data.numFound; $scope.pageCount = res.data.pageCount; if(res.searchString != ''){ siteData.page.title = 'Hồ sơ ' + res.searchString; $scope.searchString = res.searchString; } scroolTop(); } $scope.loading = false; }); } $scope.searchChange(0, false); });homeApp.controller('ResumeViewController', function($scope, $http, siteData, $location, $routeParams, $sce, MetadataService){ MetadataService.setMetaTags({ title: 'Xem hồ sơ', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Tạo hồ sơ tại viec.me | Viêc.me tuyển dụng 2019 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.user = siteData.user; $scope.number_format = number_format; $scope.userInfo = false; $scope.resume_id = $routeParams.resume_id; $scope.loading = true; $scope.suggest_resumes = []; $scope.resumePrice = 20000; $scope.errorMessage = ''; if($scope.resume_id > 0){ $http.get(SERVER_DOMAIN + '/resume/detail/' + $scope.resume_id + '?token=' + $routeParams.token).success(function(res){ if(res.error == 0){ $scope.view_resume_error = res.view_resume_error; $scope.resume = res.resume; $scope.resume.study_desc = $sce.trustAsHtml(res.resume.study_desc); $scope.resume.work_desc = $sce.trustAsHtml(res.resume.work_desc); $scope.resume.skill = $sce.trustAsHtml(res.resume.skill); $scope.resume.other_info = $sce.trustAsHtml(res.resume.other_info); $scope.resume.file_iframe = $sce.trustAsResourceUrl(res.resume.file_iframe); $scope.resumePrice = res.resume.price; console.log($scope.resumePrice ); $scope.userInfo = res.user; $scope.suggest_resumes = res.suggest_resumes; $scope.relate_resumes = res.relate_resumes; console.log($scope.user); }else{ $scope.errorMessage = res.message; } $scope.loading = false; }); $http.get(SERVER_DOMAIN + '/ref/check_share/').success(function(res){ if(res.error == 0){ $scope.facebook_shared = res.facebook_shared; } }); } $scope.viewResumeButtonClick = function(alert = true){ if(!$scope.user.uid > 0){ showModal('Đăng nhập', '

Bạn cần đăng nhập để thực hiện thao tác này

', 'Đăng ký tài khoản     Đăng nhập'); return; } if($scope.userInfo.money >= $scope.resumePrice){ if($scope.resume.update_day_ago > 9 && alert){ $('#confirmViewModal').modal('show'); return; } $('#confirmBuyModal').modal('hide'); $scope.hidePaymentButton = true; $http.get(SERVER_DOMAIN + '/resume/buy2?resume_id=' + $scope.resume_id).success(function(res){ if(res.error == 1){ showModal('Có lỗi xảy ra', '

' + res.message + ' ...

', 'Đóng'); } if(res.error == 2){ showModal('Nạp tiền', '

Phí xem hồ sơ ứng viên '+$scope.resume.name +': '+ number_format($scope.resumePrice)+'đ

Số tiền trong tài khoản của bạn không đủ để thanh toán

' + '

Khuyến mãi tặng 50% khi nạp tiền xem hồ sơ:

' + '

', 'Nạp tiền'); return; } if(res.error == 0){ showModal('Thanh toán', '

' + res.message + '

Tài khoản bạn còn ' + $scope.userInfo.money + 'đ, Phí xem hồ sơ '+number_format($scope.resumePrice)+'đ

Đang tải thông tin ...

', 'Tải lại trang'); setTimeout(function(){ location.reload(); }, 2000); } }); return; }else{ /* showModal('Nạp tiền', '

Phí xem hồ sơ: 20.000 đ

Số tiền trong tài khoản của bạn không đủ để thanh toán

' + '

'+ '

Bạn cần mua thẻ điện thoại online? truy cập: https://thanhtoanonline.vn/mua-the-dien-thoai.html

', 'Nạp tiền'); */ showModal('Nạp tiền', '

Phí xem hồ sơ ứng viên '+$scope.resume.name+' vị trí '+ $scope.resume.position_string +': '+ number_format($scope.resumePrice)+'đ

Số tiền trong tài khoản của bạn không đủ để thanh toán

' + '

Khuyến mãi tặng 50% khi nạp tiền xem hồ sơ:

' + '

', 'Nạp tiền'); return; } //showModal('Thanh toán', '

Để xem hồ sơ này bạn cần thanh toán 10.000đ

', 'Đăng nhập'); } });homeApp.controller('SearchEmployerController', function($scope, $http, siteData, $location, $routeParams, MetadataService){ MetadataService.setMetaTags({ title: 'Tìm nhà tuyển dụng', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Tạo hồ sơ tại viec.me | Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.loading = true; $scope.page = ($routeParams.page > 1)?parseInt($routeParams.page):1; $http.get(SERVER_DOMAIN + '/employer/search?page='+($scope.page - 1) +'&order=job_count&rows=30').success(function(res){ if(res.error == 0){ $scope.top_employers = res.employers; $scope.nextPage = res.nextPage; $scope.isAdmin = res.isAdmin; } $scope.loading = false; }); //xóa logo $scope.deleteLogo = function(employer_id){ $http.get(SERVER_DOMAIN + '/employer/delete_logo/' + employer_id).success(function(res){ if(res.error == 0){ } }); } });homeApp.controller('SubscribeController', function($scope, $routeParams, $http, siteData, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Đăng ký nhận thông tin tuyển dụng', keywords: 'dang ky, nhan tin, dang ky nhan tin tuyen dung, nguoi tim viec', description: 'Đăng ký nhận thông tin tuyển dụng tại Viêc.me với hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); $scope.info = {}; $scope.user = siteData.user; $scope.token = $routeParams.t; if($scope.token){ $http.get(SERVER_DOMAIN + '/subscribe/check_token_email/' + $scope.token).success(function(res) { if(res.error == 0){ $scope.token_error = false; $scope.info = res.info; $scope.info.token = $routeParams.t; }else{ $location.path('/notfound', true); $scope.token_error = true; } }); } $scope.$watch('user.uid', function() { if($scope.user.uid > 0 && !$scope.token){ $http.get(SERVER_DOMAIN + '/subscribe/get_info/').success(function(res) { if(res.error == 0){ $scope.info = res.info; $scope.info.token = $routeParams.t; } }); } }); $scope.postInfo = function(){ $scope.saveError = false; $scope.saveSuccess = false; $http({ url: SERVER_DOMAIN + "/subscribe/save", method: "POST", data: $.param($scope.info), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.saveSuccess = true; }else{ if(res.emailExist == true){ $scope.emailExist = true; } $scope.saveError = res.message; $scope.saveSuccess = false; } }); } $scope.newEmail = function(){ $scope.emailExist = false; } $scope.reSendEmail = function(){ $http({ url: SERVER_DOMAIN + "/subscribe/re_send_email", method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(res) { if(res.error == 0){ $scope.reSendEmailSuccess = true; }else{ } }); } });homeApp.controller('UserController', function($scope, $http, siteData, $routeParams, $location, MetadataService){ MetadataService.setMetaTags({ title: 'Đăng nhập | Đăng ký', keywords: 'viec lam, ho so, tao ho so truc tuyen, tim viec nhanh, viec lam 24h, tuyen dung, tim viec, viec tim nguoi, nguoi tim viec, vietnamworks', description: 'Viêc.me tuyển dụng 2020 hàng ngàn công việc lương cao, các công việc hấp dẫn từ các nhà tuyển dụng hàng đầu khắp Việt Nam', }); onTemplateLoad(); $scope.user = siteData.user; $scope.showId = 0; $scope.loginMessage = ""; $scope.registerMessage = ""; $scope.doLogin = function(){ _login($scope, $http, siteData, SERVER_DOMAIN, $routeParams.href, $location, function(){}); } $scope.doRegister = function(){ _register($scope, $http, siteData, SERVER_DOMAIN, $routeParams.href ? $routeParams.href :'/tai-khoan', function(){}); } });showModal = function(title, body, footer, lg=false){ $('#myModalLabel').html(title); $('#myModal .modal-body').html(body); $('#myModal .modal-footer').html(footer); if(lg){ $('#myModal .modal-content').addClass('modal-lg'); }else{ $('#myModal .modal-content').removeClass('modal-lg'); } $('#myModal').modal('toggle'); } scroolTop = function(){ $('html, body').animate({scrollTop:$('#top-container').position().top}, 'slow'); } scroolTo = function(element, duration){ $('html, body').animate({scrollTop:$(element).position().top}, duration); } var croppicLoaded = false; function initCroppic(){ if(!croppicLoaded){ croppicLoaded = true; var onModalShow = false; var cropperHeader = new Croppic('cropContainerModal', { rotateControls:false, doubleZoomControls:false, customUploadButtonId:'upload_avatar_button', uploadUrl: 'img_save_to_file.php', cropUrl:'img_crop_to_file.php', modal:true, onAfterImgUpload: function(){ onModalShow = true; $('body').addClass('stop-scrolling') console.log('onAfterImgUpload') }, onAfterImgCrop:function(data){ onModalShow = false; $('body').removeClass('stop-scrolling') console.log('onAfterImgCrop'); if(data.status == 'success'){ $('#crop_img').attr('src', data.url); $('#crop_img_input').val(data.url); $('#crop_img_input').trigger('input'); } }, onReset:function(){ onModalShow = false; $('body').removeClass('stop-scrolling') console.log('onReset') }, onError:function(errormessage){ console.log('onError:'+errormessage) } }); function moveObject(event) { if(onModalShow){ var delta = 0; if (!event) event = window.event; if (event.wheelDelta) { delta = event.wheelDelta / 60; } else if (event.detail) { delta = -event.detail / 2; } if(delta > 0) cropperHeader.zoom(10); else{ cropperHeader.zoom(-10); } } } if (window.addEventListener) document.addEventListener('DOMMouseScroll', moveObject, false); document.onmousewheel = moveObject; } }