var app_graph = angular.module('app', ['ngResource', 'angularCharts', 'ngRoute', 'ngCookies', 'ui.bootstrap']); app_graph.factory('Result', function ($resource) { return $resource('/wp-content/themes/whats-my-worth-theme/api/getstats.php', { id: '@id', ctrl: '@ctrl', prof: '@prof', role: '@role', jobt: '@jobt' }, { getrec: {method: 'GET', isArray: true}, getstats: {method: 'GET', params: {ctrl: 'getstats'}, isArray: true} }); }); //Get Salary... app_graph.factory('Search', function ($resource) { return $resource('/wp-content/themes/whats-my-worth-theme/api/getstats.php', { ctrl: '@ctrl', prof: '@prof', role: '@role', jobt: '@jobt' }, { getsalary: {method: 'GET', params: {ctrl: 'getsalary'}, isArray: true} }); }); //Get total count of each Profession... app_graph.factory('TotCount', function ($resource) { return $resource('/wp-content/themes/whats-my-worth-theme/api/getstats.php', { prof: '@prof' }, { get_tot_count: {method: 'GET', isArray: true} }); }); app_graph.factory('Collection', function ($resource) { return $resource('/wp-content/themes/whats-my-worth-theme/api/collection.json', { collectionname: '@collectionname', id: '@id' }, { update: {method: 'PUT'} }); }); app_graph.controller('WizardController', ['$scope', 'Result', 'Collection', 'Search', 'TotCount', '$http', '$location', '$cookies', '$uibModal', '$log', '$timeout', function($scope, Result, Collection, Search, TotCount, $http, $location, $cookies, $uibModal, $log, $timeout){ $scope.errors = {}; $scope.showQuestions = true; $scope.showValidation = false; $scope.loaded = false; $scope.admin = false; $scope.cansend = true; $scope.submitting = false; $scope.chartType = 'pie'; $scope.config = {labels: true, title : 'Mean Salary Stats', legend : {display: true, position: 'right'}}; $scope.data = {data: [], series: [1, 2, 3, 4, 5, 6, 7], median: 0, mean: 0, min: 0, max: 0, mySalary: 0}; $scope.experienceGraphType = 'point'; $scope.areadata = {data: []}; $scope.areaConfig = {labels: false, title: "", subtitle : '', subsubtitle: "", legend : {display: false, position: 'left'}}; $scope.showResults = false; //the trigger for the search salary... //Category / Job Roles static selection (for now) $scope.items = [{name: 'Accounting and Finance', value: '1045', options: [{role_id: '33', role_name: 'Accountant - Assistant'}, {role_id: '34', role_name: 'Accountant - Company/Bookkeeper'}, {role_id: '35', role_name: 'Accountant - Cost'}, {role_id: '36', role_name: 'Accountant - Financial'}, {role_id: '37', role_name: 'Accountant - Financial & Management'}, {role_id: '38', role_name: 'Accountant - Fund'}, {role_id: '39', role_name: 'Accountant - Management'}, {role_id: '40', role_name: 'Accountant - Systems'}, {role_id: '41', role_name: 'Accounts Clerk'}, {role_id: '42', role_name: 'Accounts Payable & Receivable Manager'}, {role_id: '43', role_name: 'Accounts Payable Manager'}, {role_id: '44', role_name: 'Accounts Payable Officer'}, {role_id: '45', role_name: 'Accounts Receivable Manager'}, {role_id: '46', role_name: 'Accounts Receivable Officer'}, {role_id: '47', role_name: 'Audit Manager - Accounting Firm'}, {role_id: '48', role_name: 'Audit Manager - Commercial'}, {role_id: '49', role_name: 'Audit Partner'}, {role_id: '50', role_name: 'Audit Senior'}, {role_id: '51', role_name: 'Auditor - Accounting Firm'}, {role_id: '52', role_name: 'Auditor - Commercial'}, {role_id: '53', role_name: 'BAS Accountant'}, {role_id: '54', role_name: 'BAS Manager'}, {role_id: '55', role_name: 'BAS Partner'}, {role_id: '56', role_name: 'Business Analyst'}, {role_id: '57', role_name: 'Business Analyst - Senior'}, {role_id: '58', role_name: 'Chief Financial Officer'}, {role_id: '59', role_name: 'Commercial Manager'}, {role_id: '60', role_name: 'Credit Controller'}, {role_id: '61', role_name: 'Credit Manager'}, {role_id: '62', role_name: 'Data Entry'}, {role_id: '63', role_name: 'Finance Manager'}, {role_id: '64', role_name: 'Financial Controller'}, {role_id: '65', role_name: 'Payroll - Manager'}, {role_id: '66', role_name: 'Payroll - Sole Charge'}, {role_id: '67', role_name: 'Payroll Officer'}, {role_id: '68', role_name: 'Project Manager'}, {role_id: '69', role_name: 'Tax Accountant - Accounting Firm'}, {role_id: '70', role_name: 'Tax Accountant - Commercial'}, {role_id: '71', role_name: 'Tax Manager - Accounting Firm'}, {role_id: '72', role_name: 'Tax Manager - Commercial'}, {role_id: '73', role_name: 'Tax Partner'}, ]},{name: 'Banking and Financial Services', value: '1049', options: [{role_id: '74', role_name: 'Advisor - Financial Planning'}, {role_id: '75', role_name: 'Advisor - Stockbroking'}, {role_id: '76', role_name: 'Advisor/Teller - Retail Banking'}, {role_id: '77', role_name: 'Analyst/Specialist - Business Banking'}, {role_id: '78', role_name: 'Analyst/Specialist - Corporate Finance'}, {role_id: '79', role_name: 'Analyst/Specialist - Credit'}, {role_id: '80', role_name: 'Analyst/Specialist - Funds Management'}, {role_id: '81', role_name: 'Analyst/Specialist - Institutional Banking'}, {role_id: '82', role_name: 'Analyst/Specialist - Insurance'}, {role_id: '83', role_name: 'Analyst/Specialist - Risk/Treasury'}, {role_id: '84', role_name: 'Analyst/Specialist - Rural Banking'}, {role_id: '85', role_name: 'Analyst/Specialist - Settlements'}, {role_id: '86', role_name: 'Analyst/Specialist - Wealth'}, {role_id: '87', role_name: 'Director - Corporate Finance'}, {role_id: '88', role_name: 'Director - Institutional Banking'}, {role_id: '89', role_name: 'Director - Risk/Treasury'}, {role_id: '90', role_name: 'Manager - Business Banking'}, {role_id: '91', role_name: 'Manager - Corporate Finance'}, {role_id: '92', role_name: 'Manager - Credit'}, {role_id: '93', role_name: 'Manager - Financial Planning'}, {role_id: '94', role_name: 'Manager - Funds Management'}, {role_id: '95', role_name: 'Manager - Institutional Banking'}, {role_id: '96', role_name: 'Manager - Insurance'}, {role_id: '97', role_name: 'Manager - Retail Banking'}, {role_id: '98', role_name: 'Manager - Risk/Treasury'}, {role_id: '99', role_name: 'Manager - Rural Banking'}, {role_id: '100', role_name: 'Manager - Settlements'}, {role_id: '101', role_name: 'Manager - Stockbroking'}, {role_id: '102', role_name: 'Manager - Wealth'}, {role_id: '103', role_name: 'Regional Manager - Business Banking'}, {role_id: '104', role_name: 'Regional Manager - Insurance'}, {role_id: '105', role_name: 'Regional Manager - Retail Banking'}, {role_id: '106', role_name: 'Regional Manager - Rural Banking'}, {role_id: '107', role_name: 'Regional Manager - Wealth'}, ]},{name: 'Information Technology', value: '1056', options: [{role_id: '199', role_name: 'Architect'}, {role_id: '200', role_name: 'Business / Systems Analyst'}, {role_id: '56', role_name: 'Business Analyst'}, {role_id: '201', role_name: 'Business Intelligence'}, {role_id: '202', role_name: 'Change Manager'}, {role_id: '203', role_name: 'Consultant'}, {role_id: '204', role_name: 'Customer Experience Design / UX'}, {role_id: '205', role_name: 'Data Analyst'}, {role_id: '206', role_name: 'Data Engineering'}, {role_id: '207', role_name: 'Developer'}, {role_id: '208', role_name: 'IT / Support'}, {role_id: '209', role_name: 'Management'}, {role_id: '210', role_name: 'Networks and Systems Engineer'}, {role_id: '211', role_name: 'Product Management / Development'}, {role_id: '212', role_name: 'Programme Manager'}, {role_id: '213', role_name: 'Project / Programme Coordinator'}, {role_id: '68', role_name: 'Project Manager'}, {role_id: '214', role_name: 'QA / Tester'}, {role_id: '215', role_name: 'Security'}, {role_id: '216', role_name: 'Senior Business Analyst'}, {role_id: '217', role_name: 'Senior Project Manager'}, {role_id: '218', role_name: 'Systems Analyst'}, {role_id: '219', role_name: 'Transformation Manager'}, ]},{name: 'Risk and Compliance', value: '1052', options: [{role_id: '138', role_name: 'Analyst - Risk Analytics'}, {role_id: '139', role_name: 'Chief Risk Officer'}, {role_id: '140', role_name: 'Compliance Analyst'}, {role_id: '141', role_name: 'Compliance Manager'}, {role_id: '142', role_name: 'Compliance Officer'}, {role_id: '143', role_name: 'Compliance Senior Manager'}, {role_id: '144', role_name: 'Credit Risk Analyst'}, {role_id: '145', role_name: 'Credit Risk Manager'}, {role_id: '146', role_name: 'Credit Risk Senior Manager'}, {role_id: '147', role_name: 'Head of Audit'}, {role_id: '148', role_name: 'Head of Compliance'}, {role_id: '149', role_name: 'Head of Conduct Risk'}, {role_id: '150', role_name: 'Head of Market Risk'}, {role_id: '151', role_name: 'Head of Operational Risk'}, {role_id: '152', role_name: 'Head of Risk'}, {role_id: '153', role_name: 'Head of Risk & Compliance'}, {role_id: '154', role_name: 'Head of Technology Risk'}, {role_id: '155', role_name: 'Internal Audit Manager'}, {role_id: '156', role_name: 'Internal Audit Senior Manager'}, {role_id: '157', role_name: 'Market Risk Manager'}, {role_id: '158', role_name: 'Market Risk Senior Manager'}, {role_id: '159', role_name: 'Operational Risk & Compliance Analyst'}, {role_id: '160', role_name: 'Operational Risk & Compliance Manager'}, {role_id: '161', role_name: 'Operational Risk & Compliance Senior Manager'}, {role_id: '162', role_name: 'Operational Risk Analyst'}, {role_id: '163', role_name: 'Operational Risk Manager'}, {role_id: '164', role_name: 'Operational Risk Senior Manager'}, {role_id: '165', role_name: 'Risk Analytics Manager'}, {role_id: '166', role_name: 'Senior Internal Auditor'}, {role_id: '167', role_name: 'Technology Risk Manager'}, {role_id: '168', role_name: 'Technology Risk Senior Manager'}, ]},{name: 'Sales and Marketing', value: '1054', options: [{role_id: '227', role_name: 'Account Manager'}, {role_id: '256', role_name: 'Area Manager'}, {role_id: '235', role_name: 'Assistant Brand Manager'}, {role_id: '248', role_name: 'Assistant Category Manager'}, {role_id: '181', role_name: 'Brand Manager'}, {role_id: '128', role_name: 'Business Development Manager'}, {role_id: '250', role_name: 'Category Analyst'}, {role_id: '249', role_name: 'Category Manager'}, {role_id: '242', role_name: 'Communications Specialist'}, {role_id: '237', role_name: 'Digital Marketing Assistant / Coordinator'}, {role_id: '239', role_name: 'Digital Marketing Manager'}, {role_id: '240', role_name: 'eCommerce Manager'}, {role_id: '182', role_name: 'Events Manager'}, {role_id: '229', role_name: 'Field Sales Manager'}, {role_id: '254', role_name: 'Head of Marketing / Marketing Director'}, {role_id: '132', role_name: 'Head of Sales / Sales Director'}, {role_id: '130', role_name: 'Key Account Executive'}, {role_id: '231', role_name: 'Key Account Manager'}, {role_id: '241', role_name: 'Loyalty Marketing Manager'}, {role_id: '184', role_name: 'Marketing Assistant / Coordinator'}, {role_id: '185', role_name: 'Marketing Executive'}, {role_id: '252', role_name: 'Marketing Insights Analyst'}, {role_id: '253', role_name: 'Marketing Insights Manager'}, {role_id: '186', role_name: 'Marketing Manager'}, {role_id: '233', role_name: 'National Business Manager'}, {role_id: '187', role_name: 'PR and Communications Manager'}, {role_id: '246', role_name: 'Product Manager'}, {role_id: '224', role_name: 'Sales Assistant / Coordinator'}, {role_id: '129', role_name: 'Sales Manager'}, {role_id: '134', role_name: 'Sales Support / Administrator'}, {role_id: '135', role_name: 'Senior / National Account Manager'}, {role_id: '236', role_name: 'Senior Brand Manager'}, {role_id: '251', role_name: 'Senior Category Manager'}, {role_id: '243', role_name: 'Senior Communications Manager'}, {role_id: '232', role_name: 'Senior Key Account Manager'}, {role_id: '247', role_name: 'Senior Product Manager'}, {role_id: '245', role_name: 'Shopper Marketing Manager'}, {role_id: '137', role_name: 'Territory Sales Manager'}, {role_id: '244', role_name: 'Trade / Retail Marketing Manager'}, ]},]; /*-Get the Location lists-*/ $scope.items_loc = [{name: 'Auckland Central', value: '1065'},{name: 'Auckland East', value: '1068'},{name: 'Auckland North', value: '1064'},{name: 'Auckland South', value: '1067'},{name: 'Auckland West', value: '1066'},{name: 'Christchurch', value: '1071'},{name: 'Nth Island – Other', value: '1070'},{name: 'Sth Island – Other', value: '1072'},{name: 'Wellington', value: '1069'},]; $scope.items_job_type = [{name: 'Contract or Temp', value: '1076'},{name: 'Permanent / Full Time', value: '1075'},{name: 'Permanent / Part-time', value: '1078'},]; $scope.items_education = [{name: 'Completed High School (Year 13)', value: '1095'},{name: 'Completed Year 12 or less (6th Form)', value: '1094'},{name: 'Diploma or Associate Diploma', value: '1096'},{name: 'Doctoral Degree', value: '1099'},{name: 'None', value: '1093'},{name: 'Postgraduate/Masters Degree', value: '1098'},{name: 'Undergraduate/Bachelors Degree', value: '1097'},]; $scope.items_industries = [{name: 'Accounting Services – Small', value: '1101'},{name: 'Accounting Services – Big 4', value: '1102'},{name: 'Accounting Services – Mid Tier', value: '1103'},{name: 'Advertising/Marketing/Media/Public Relations', value: '1104'},{name: 'Agriculture/Horticulture/Forestry/Fisheries', value: '1105'},{name: 'Arts & Entertainment', value: '1106'},{name: 'Banking & Finance', value: '1107'},{name: 'Business & Professional Services', value: '1108'},{name: 'Community / Not for Profit', value: '1109'},{name: 'Construction & Infrastructure', value: '1110'},{name: 'Dairy', value: '1111'},{name: 'Education', value: '1112'},{name: 'Engineering', value: '1113'},{name: 'FMCG', value: '1114'},{name: 'Freight and Logistics', value: '1115'},{name: 'Government – Central', value: '1116'},{name: 'Government – Local and Agency', value: '1117'},{name: 'Healthcare and Aged Care', value: '1118'},{name: 'Hospitality', value: '1119'},{name: 'Importer/Distributor', value: '1122'},{name: 'Insurance', value: '1123'},{name: 'IT', value: '1121'},{name: 'Legal', value: '1124'},{name: 'Manufacturing', value: '1125'},{name: 'Military and Defence', value: '1126'},{name: 'Other', value: '1134'},{name: 'Pharmaceutical/Biotechnology', value: '1127'},{name: 'Property', value: '1128'},{name: 'Real Estate and Property Management', value: '1129'},{name: 'Recruitment', value: '1130'},{name: 'Retail/Wholesale', value: '1131'},{name: 'Telecommunications', value: '1132'},{name: 'Tourism and Travel', value: '1120'},{name: 'Utilities', value: '1133'},]; $scope.items_employer_type = [{name: 'Foreign Owned – Listed', value: '1139'},{name: 'Foreign Owned – Private', value: '1138'},{name: 'NZ Owned – Listed', value: '1137'},{name: 'NZ Owned – Private', value: '1136'},{name: 'Public Sector', value: '1140'},]; var protocol = $location.protocol(); var host = $location.host(); var port = $location.port(); $scope.combined_url = protocol + '://' + host; $scope.items_post_survey = [{consultant: { name: "Adam Napper", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Senior Talent Advisor", email: "adam@consult.co.nz", phone: "027 700 0071", linkedin: "https://www.linkedin.com/in/adamnapper/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/adam_napper_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/adam-napper", } },{consultant: { name: "Alastair Shorten", category: "Information Technology", profession: "IT & Digital", role: "Principal", email: "alistair@haloconsulting.co.nz", phone: "021 420 657", linkedin: "https://www.linkedin.com/in/alastairshorten/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Alastair-1.png", url: "https://www.consultrecruitment.co.nz/team/member/alistair-shorten", } },{consultant: { name: "Alisa Moore", category: "Sales", profession: "Sales & Marketing", role: "Research Specialist", email: "alisa@consult.co.nz", phone: "022 046 6153", linkedin: "https://www.linkedin.com/in/alisamoore1/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/alisa_moore_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/alisa-moore", } },{consultant: { name: "Alisa Moore", category: "Marketing", profession: "Sales & Marketing", role: "Research Specialist", email: "alisa@consult.co.nz", phone: "022 046 6153", linkedin: "https://www.linkedin.com/in/alisamoore1/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/alisa_moore_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/alisa-moore", } },{consultant: { name: "Alric Wright", category: "Information Technology", profession: "IT & Digital", role: "Consultant", email: "alric@haloconsulting.co.nz", phone: "021 053 9800", linkedin: "https://www.linkedin.com/in/alricwright/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Alric-1.png", url: "https://www.consultrecruitment.co.nz/team/member/alric-wright", } },{consultant: { name: "Catherine Boudou", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Senior Talent Advisor", email: "catherine@consult.co.nz", phone: "021 212 0345", linkedin: "https://www.linkedin.com/in/catherinehalsechef/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/09/Catherine-1.png", url: "https://www.consultrecruitment.co.nz/team/member/catherine-boudou", } },{consultant: { name: "Crispin Robertson", category: "Accounting and Finance", profession: "Banking and Financial Services", role: "Advisor - Financial Planning", email: "crispin@consult.co.nz", phone: "022 506 3399", linkedin: "https://www.linkedin.com/in/crispinconsult", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/crispin_robertson_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/crispin-robertson", } },{consultant: { name: "Kym Farnham", category: "HR", profession: "HR", role: "Senior Talent Advisor", email: "kym@consult.co.nz", phone: "022 065 1678", linkedin: "https://www.linkedin.com/in/kym-farnham-931a2384/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/kym_farnham_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/kym-farnham", } },{consultant: { name: "Laura Douglas", category: "Information Technology", profession: "IT & Digital", role: "Senior Consultant", email: "laura@haloconsulting.co.nz", phone: "021 343 913", linkedin: "https://www.linkedin.com/in/lauraitdouglas/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Laura-1.png", url: "https://www.consultrecruitment.co.nz/team/member/laura-douglas", } },{consultant: { name: "Laura Sanford-Scutt", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Senior Talent Advisor", email: "lauras@consult.co.nz", phone: "022 618 8100", linkedin: "https://www.linkedin.com/in/laurasanfordscutt/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Laura1.png", url: "https://www.consultrecruitment.co.nz/team/member/laura-sanford-scutt", } },{consultant: { name: "Lucy Micklefield", category: "Business Support", profession: "Business Support", role: "Talent Advisor", email: "lucy@consult.co.nz", phone: "022 658 0544", linkedin: "https://www.linkedin.com/in/lucy-micklefield-553518159/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Lucy-3.png", url: "https://www.consultrecruitment.co.nz/team/member/lucy-micklefield", } },{consultant: { name: "Miguel Montanez", category: "Information Technology", profession: "IT & Digital", role: "Senior Talent Acquisition Specialist", email: "miguel@haloconsulting.co.nz", phone: "021 124 2749", linkedin: "https://www.linkedin.com/in/miguel-angel-montanez-ba29aa41/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Miguel-1.png", url: "https://www.consultrecruitment.co.nz/team/member/miguel-montanez", } },{consultant: { name: "Mike Messenger", category: "Information Technology", profession: "IT & Digital", role: "Senior Consultant", email: "mike@haloconsulting.co.nz", phone: "027 229 9118", linkedin: "https://www.linkedin.com/in/mmessenger/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Mike-1.png", url: "https://www.consultrecruitment.co.nz/team/member/mike-messenger", } },{consultant: { name: "Morgan Vincent", category: "Marketing", profession: "Sales & Marketing", role: "Talent Advisor", email: "morgan.vincent@consultrecruitment.co.nz", phone: "021 158 1808", linkedin: "https://www.linkedin.com/in/morgan-vincent-249182b9/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/11/Morgan-1.png", url: "https://www.consultrecruitment.co.nz/team/member/morgan-vincent", } },{consultant: { name: "Morgan Whittle", category: "Business Support", profession: "Business Support", role: "Senior Talent Advisor", email: "morgan@consult.co.nz", phone: "020 4076 5626", linkedin: "https://www.linkedin.com/in/morgan-whittle/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/morgan_whittle_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/morgan-whittle", } },{consultant: { name: "Nicki Triggs", category: "Business Support", profession: "Business Support", role: "Talent Advisor", email: "nicki@consult.co.nz", phone: "021 0881 3056", linkedin: "https://www.linkedin.com/in/nicki-triggs-98817885/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Nicki-1.png", url: "https://www.consultrecruitment.co.nz/team/member/nicki-triggs", } },{consultant: { name: "Oli Sanford-Scutt", category: "Accounting and Finance", profession: "Accounting & Finance (Temp)", role: "Division Manager", email: "oli@consult.co.nz", phone: "027 700 4616", linkedin: "https://www.linkedin.com/in/oliver-s-86a1404b/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/oliver_sanford_scutt_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/oli-sanford-scutt", } },{consultant: { name: "Olivia Howse", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Senior Talent Advisor", email: "olivia@consult.co.nz", phone: "022 6188 103", linkedin: "https://nz.linkedin.com/in/oliviahowse", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/olivia_howse_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/olivia-howse", } },{consultant: { name: "Richard Gray-Smith", category: "Sales", profession: "Sales & Marketing", role: "Div. Manager - Sales, Marketing, Business Support & HR", email: "richard.gray-smith@consult.co.nz", phone: "021 303 665", linkedin: "https://www.linkedin.com/in/richardgraysmith/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/richard_gray_smith_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/richard-gray-smith", } },{consultant: { name: "Richard Gray-Smith", category: "HR", profession: "HR", role: "Div. Manager - Sales, Marketing, Business Support & HR", email: "richard.gray-smith@consult.co.nz", phone: "021 303 665", linkedin: "https://www.linkedin.com/in/richardgraysmith/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/richard_gray_smith_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/richard-gray-smith", } },{consultant: { name: "Richard Gray-Smith", category: "Marketing", profession: "Sales & Marketing", role: "Div. Manager - Sales, Marketing, Business Support & HR", email: "richard.gray-smith@consult.co.nz", phone: "021 303 665", linkedin: "https://www.linkedin.com/in/richardgraysmith/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/richard_gray_smith_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/richard-gray-smith", } },{consultant: { name: "Richard Gray-Smith", category: "Business Support", profession: "Business Support", role: "Div. Manager - Sales, Marketing, Business Support & HR", email: "richard.gray-smith@consult.co.nz", phone: "021 303 665", linkedin: "https://www.linkedin.com/in/richardgraysmith/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/richard_gray_smith_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/richard-gray-smith", } },{consultant: { name: "Richard Lloyd", category: "Information Technology", profession: "IT & Digital", role: "Principal", email: "richard@haloconsulting.co.nz", phone: "021 545 792", linkedin: "https://www.linkedin.com/in/richlloyd1/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Rich-1.png", url: "https://www.consultrecruitment.co.nz/team/member/richard-lloyd", } },{consultant: { name: "Sam Patterson", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Talent Advisor", email: "sam@consult.co.nz", phone: "021 825 292", linkedin: "https://www.linkedin.com/in/sam-patterson-b727aa10a/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Sam-1.png", url: "https://www.consultrecruitment.co.nz/team/member/sam-patterson", } },{consultant: { name: "Sarah Quintal", category: "Information Technology", profession: "IT & Digital", role: "Client Solutions Manager", email: "sarah@haloconsulting.co.nz", phone: "027 538 5589", linkedin: "https://www.linkedin.com/in/sarahquintal/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Sarah-1.png", url: "https://www.consultrecruitment.co.nz/team/member/sarah-quintal", } },{consultant: { name: "Shannon Begley", category: "Information Technology", profession: "IT & Digital", role: "Talent Advisor", email: "shannon@haloconsulting.co.nz", phone: "027 247 3738", linkedin: "https://www.linkedin.com/in/shannonbegley/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Shannon-1.png", url: "https://www.consultrecruitment.co.nz/team/member/shannon-begley", } },{consultant: { name: "Teresa Jordan", category: "Information Technology", profession: "IT & Digital", role: "Senior Talent Acquisition Specialist", email: "teresa@haloconsulting.co.nz", phone: "021 772 103", linkedin: "https://www.linkedin.com/in/teresa-jordan/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/Teresa-1.png", url: "https://www.consultrecruitment.co.nz/team/member/teresa-jordan", } },{consultant: { name: "Vicky Guo", category: "Accounting and Finance", profession: "Accounting and Finance", role: "Talent Advisor", email: "vicky@consult.co.nz", phone: "022 586 8118", linkedin: "https://www.linkedin.com/in/vickyguo1/", image: "https://whatsmyworth.co.nz/wp-content/uploads/2020/05/vicky_guo_thumb-1.png", url: "https://www.consultrecruitment.co.nz/team/member/vicky-guo", } },]; /*-Homepage select options-*/ $scope.changeOption = function() { $scope.submitted = false; }; function getUrlParameter(param, dummyPath) { var sPageURL = dummyPath || window.location.search.substring(1), sURLVariables = sPageURL.split(/[&||?]/), res; for (var i = 0; i < sURLVariables.length; i += 1) { var paramName = sURLVariables[i], sParameterName = (paramName || '').split('='); if (sParameterName[0] === param) { res = sParameterName[1]; } } return res; } /*-get job function / category url parameter to be parsed-*/ var param_f = getUrlParameter('func'); var param_l = getUrlParameter('loc'); //get the survey ID here var param_s = getUrlParameter('sid'); //the contact us query string jump link var param_c = getUrlParameter('link'); //get the boolean values if exists... var getParaVal = angular.isUndefined(param_f);//determine if underfined var get_cLink = angular.isUndefined(param_c);//determine if underfined var get_sLink = angular.isUndefined(param_s);//determine if underfined if(get_sLink === false){ //query string detected $scope.param_sid = true; } $scope.sectorVar = ''; if(getParaVal === true){ //no query string exist... $scope.param_v_l = false; //set default values //$scope.catjob = $scope.items[0]; //$scope.jobloc = $scope.items_loc[0]; }else{ //query string detected $scope.param_v_l = true; if(param_f === '' && param_l === ''){ $scope.catjob = $scope.items[0]; $scope.jobloc = $scope.items_loc[0]; $scope.sectorVar = $scope.items[0].name; }else{ //$scope.cjob_r = $('.catjob_r').text(); /*var item_get = $scope.items.find(function(element) { return element.name === 'HR'; });*/ //return item && item.value; $scope.catjob = $scope.items[param_f]; $scope.jobloc = $scope.items_loc[param_l]; $scope.sectorVar = $scope.items[param_f].name; } } //prove if if exsist if(get_cLink === false){ setTimeout(function () { $('html,body').animate({scrollTop: $('#wpcf7-f4-p950-o1').offset().top - 100},'slow'); }, 1000); } $scope.setVal_catjob = function(c_val){ //alert(JSON.stringify(c_val.value)); //console.log(c_val.value); var index = $scope.items.indexOf(c_val); $scope.catjob = $scope.items[index]; } $scope.detectChange_sector = function(selected_index){ var indexno = $scope.items.indexOf(selected_index); $scope.catjob = $scope.items[indexno]; angular.element(document.querySelector('.catjob_r')).text($scope.catjob.name); $scope.sectorVar = $scope.items[indexno].name; } $scope.detectChange_sector_noqs = function(selected_index){ $scope.sectorVar = selected_index.name; /* //console.log($scope.sectorVar); //trigger isotope change var prof_d_val = $scope.sectorVar; //var prof_d_val = $('.prof_d_val').text(); var prof_d_val = prof_d_val = prof_d_val.replace(/\s+/g, '-').toLowerCase(); var $grid = $('.isotope_sort').isotope({ itemSelector: '.element-item', layoutMode: 'fitRows' }); var fVal_ang = '.'+prof_d_val; setTimeout(function () { $grid.isotope({ filter: fVal_ang }); }, 100); */ } $scope.detectChange_role_noqs = function(selected_index=0){ $scope.roleVar = selected_index.role_name; console.log($scope.roleVar); } $scope.setVal_jobloc = function(j_val){ $scope.jobloc = $scope.items_loc[j_val.value]; angular.element(document.querySelector('.jobloc_r')).text(j_val.name); angular.element(document.querySelector('.jobloc_rid')).text(j_val.value); } $scope.setVal_jobtype = function(jt_val){ $scope.jt_val = jt_val.name; } $scope.totPackage = 0; $scope.annualbasesalary = 0; $scope.annualbonus = 0; $scope.sumTotalPackage = 0; $scope.getVal_annualbasesalary = function(abs_val){ $scope.totalPackage = []; $scope.annualbasesalary = abs_val; $scope.sumTotalPackage = parseInt($scope.annualbasesalary) + parseInt($scope.annualbonus); for (inc=$scope.sumTotalPackage;inc<500000;inc+=1000) { $scope.totalPackage.push(inc); } //console.log($scope.sumTotalPackage); } $scope.getVal_annualbonus = function(ab_val){ $scope.totalPackage = []; $scope.annualbonus = ab_val; $scope.sumTotalPackage = parseInt($scope.annualbasesalary) + parseInt($scope.annualbonus); for (inc=$scope.sumTotalPackage;inc<500000;inc+=1000) { $scope.totalPackage.push(inc); } //console.log($scope.sumTotalPackage); } $scope.getVal_estTotPackage_on_rate = function(rt_val){ $scope.totalPackage = []; $scope.annualbasesalary = rt_val; $scope.sumTotalPackage = parseInt($scope.annualbasesalary); for (inc=$scope.sumTotalPackage;inc<1000;inc+=1) { $scope.totalPackage.push(inc); } } function downloadURI(uri, name) { var link = document.createElement("a"); link.download = name; link.href = uri; link.click(); document.body.removeChild(link); } function init_rec() { $scope.state = {}; $scope.page = 'page1'; $scope.answers = {Benefits : [], Qualification: [], Gender: 'Male', Important : ['Location', 'Salary/Rate', 'Office Culture', 'Career Development', 'Work Life Balance']}; setTimeout(function () { }, 100); } function median(values, jobtype) { var half = Math.floor(values.length/2); if(values.length % 2) { return values[half][jobtype]; } else { return (values[half-1][jobtype] + values[half][jobtype]) / 2.0; } } $scope.formatMoney = function (n, c, d, t){ c = isNaN(c = Math.abs(c)) ? 0 : c; d = d === undefined ? '.' : d; t = t === undefined ? ',' : t; var s = n < 0 ? '-$' : '$', i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + '', j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); }; function fm(val) { return $scope.formatMoney(val); } //make permalink...dashed texts like the WP permalink $scope.makePermalink = function (str){ var re = /[^a-z0-9]+/gi; // global and case insensitive matching of non-char/non-numeric var re2 = /^-*|-*$/g; // get rid of any leading/trailing dashes var re3 = /\s/g; str = str.replace(re, '-').toLowerCase(); // perform the 1st regexp return str.replace(re2, '').toLowerCase().replace(re3, ''); // ..aaand the second + return lowercased result } $scope.convertToSlug = function (str){ //return str.toLowerCase().replace(/[^\w ]+/g,'').replace(/ +/g,'-'); var slug = str.toLowerCase().trim(); // replace invalid chars with spaces slug = slug.replace(/[^a-z0-9\s-]/g, ' '); // replace multiple spaces or hyphens with a single hyphen slug = slug.replace(/[\s-]+/g, '-'); return slug; } /*-DROPDOWNs-*/ $scope.salaries = []; $scope.rates = []; $scope.bonuses = []; $scope.hoursPerWeek = []; $scope.yearsexperience = []; $scope.numberofreportees = []; /*** POPULATE THE DROPDOWNs***/ var inc; for (inc=35000;inc<500000;inc+=1000) { $scope.salaries.push(inc); } for (inc=20;inc<=200;inc+=1) { $scope.rates.push(inc); } for (inc=0;inc<200000;inc+=500) { $scope.bonuses.push(inc); } for (inc=10;inc<=100;inc+=5) { $scope.hoursPerWeek.push(inc); if (inc === 35) { $scope.hoursPerWeek.push(37.5); } } for (inc=0;inc<=60;inc+=1) { $scope.yearsexperience.push(inc); } for (inc=0;inc<=100;inc+=1) { $scope.numberofreportees.push(inc); } var reRecVal = ''; function loadResults(id, p1a, r1a, j1a) { $scope.id = id; Result.getstats({id:id, prof: p1a, role: r1a, jobt: j1a}, function(results) { $scope.results = results; //console.log(JSON.stringify($scope.results)); var reRecVal = $scope.results.filter(x => x._id === id); var _this = $scope.answers; var type = (results[0].JobType === 'Permanent / Full Time') ? 'Salary' : 'Rate'; //prep data for charts var percentile = 100, bonusCount=0, bonusTotal=0, benefits={}, totalSalary = 0; var min = results[0][type], max = results[results.length - 1][type]; var qt1 = Math.max(0, Math.round(0.25*(results.length)) - 1); var qt2 = Math.max(0, Math.round(0.5*(results.length)) - 1); var qt3 = Math.max(0, Math.round(0.75*(results.length)) - 1); var pt1 = results[qt1][type]; var pt2 = results[qt2][type]; var pt3 = results[qt3][type]; var first = results[0][type]; var last = results[results.length - 1][type]; var data = [{x:fm(first) + ' - ' + fm(pt1), y:[0, Math.round((pt1 - first)/(last - first)*100)], z:0}, {x:fm(pt1) + ' - ' + fm(pt2), y:[0, Math.round((pt2 - pt1)/(last - first)*100)], z:0}, {x:fm(pt2) + ' - ' + fm(pt3), y:[0, Math.round((pt3 - pt2)/(last - first)*100)], z:0}, {x:fm(pt3) + ' - ' + fm(last), y:[0, Math.round((last - pt3)/(last - first)*100)], z:0}]; var areadata = []; $scope.totalExperience = 0; $scope.hasExperience = false; for (var x = 0; x < results.length; x++) { totalSalary += results[x][type]; if (results[x][type] < pt1) { data[0].z++; } else if (results[x][type] < pt2) { data[1].z++; } else if (results[x][type] < pt3) { data[2].z++; } else { data[3].z++; } var getInd = _this.findIndex(x => x._id === id); if (results[x][type] <= _this[getInd][type] && results.length > 1) { percentile = Math.floor((x/results.length)*100); } if (results[x].Bonus && results[x].Bonus>0) { bonusCount++; bonusTotal+=results[x].Bonus; } for (var z =0;z0;z++) { if (results[x].Benefits[z] !== '') { if (benefits[results[x].Benefits[z]]) { benefits[results[x].Benefits[z]]++; }else{ benefits[results[x].Benefits[z]]=1; } } } //experience var found = false; if (results[x].Experience) { //check records already recorded to see if there is a match for (var f = 0; f < areadata.length; f++) { if (areadata[f][0] === results[x][type] && areadata[f][1] === results[x].Experience) { areadata[f][2]++; //there was so increase count found = true; if (results[x]._id === id ) { areadata[f][3] = true; $scope.hasExperience = true; } } } if (!found) { //none found so inialise record for experience yrs for this salary var myRecord = null; if (results[x]._id === id ) { $scope.hasExperience = true; myRecord = results[x]._id === id ? true : null } areadata.push([results[x][type], results[x].Experience, 1, myRecord]); } $scope.totalExperience++; } } var reorderData = []; var tempRec; for (var b=0; b < areadata.length; b++) { //make sure users record always appears on top - their record must be last if (areadata[b][3]) { tempRec = areadata[b]; } else { reorderData.push(areadata[b]); } } reorderData.push(tempRec); for (var benefit in benefits) { if (benefits.hasOwnProperty(benefit)) { benefits[benefit]=Math.floor(benefits[benefit]/results.length*100); } } for (var y = 0; y < data.length; y++) { data[y].y[0] = Math.round(data[y].z/results.length*100); //calculate percentage for this interval } $scope.data = {data : data, jobtype: type, median: median(results, type), min: results[0][type], max: results[results.length-1][type], emp_Type: type, mySalary: (results[0].JobType === 'Permanent / Full Time') ? $scope.results.filter(x => x._id === id)[0]['Salary'] : $scope.results.filter(x => x._id === id)[0]['Rate'], myTotalPackage: $scope.results.filter(x => x._id === id)[0]['TotalPackage'], percentile: percentile, upperQ: fm(pt3), lowerQ: fm(pt1), receiveBonus: Math.floor(bonusCount/results.length*100), averageBonus: fm(Math.floor(bonusTotal/results.length)), averageSalary: Math.floor(totalSalary/results.length), benefits: benefits }; //console.log($scope.data['benefits']); for (var kk = 0; kk < $scope.data.data.length; kk++) { $scope.data.data[kk].tooltip = $scope.data.data[kk].x; } //get experience data $scope.areadata = {data: reorderData, jobtype: type} }); } function loadSalary(p1a, r1a, j1a) { Search.getsalary({prof:p1a, role:r1a, jobt:j1a}, function(results) { $scope.results=results; $scope.searchProf = $scope.sectorVar; $scope.searchRole = $scope.roleVar; $scope.searchJobType = j1a; var ratetype = (j1a === 'Permanent / Full Time') ? 'Salary' : 'Rate'; $scope.ratetype = ratetype; var total = 0, count = 0, min = 0, max = 0; for (var i=0; i 0) { count++; total += result[ratetype]; if (min===0) {min = result[ratetype];} //first non-zero result will be the min max = result[ratetype]; //results are sorted by salary } } var average = total / count; var range = (max - min); var startA = ((average - min)/range) - 0.05; //- 5% var endA = startA + 0.1; //10% var graphwidth = 300; $scope.graph = {min:min, max:max, widthA:startA * graphwidth, avgWidth: 0.1 * graphwidth, widthB: (1 - endA) * graphwidth, average: average}; if (min === max || range === 0) { $scope.graph.avgWidth = graphwidth; $scope.graph.labelOffset = (300-85)/2; } else { $scope.graph.labelOffset = $scope.graph.widthA - 32; } $scope.showResults = true; }); }//loadSalary() function load(ir_rec, p_rec, r_rec, j_rec){ //var _id = $routeParams.id || $cookies._id; var _id = ir_rec; //the fetched ID from the newly-inserted record var p1 = p_rec; var r1 = r_rec; var j1 = j_rec; if (_id){ $scope.answers = Result.getrec({id:_id, prof: p1, role: r1, jobt: j1}, function(/*answer*/) { $scope.page = 'complete'; $scope.state = {}; $scope.localemail = $scope.answers.Email || ''; loadResults(_id, p1, r1, j1); }, function(/*response*/) { init_rec(); }); }else{ } } //test the json parse //load('59505dc8d592550400f50f3a', 'Accounting and Finance', 'Accountant - Financial & Management', 'Contract or Temp'); function load_tot_count(pp1){ TotCount.get_tot_count({prof:pp1}, function(results) { $scope.results=results; return false }); } $scope.permanent = true; $scope.timestamp = function(id) { if (!id) return; var timestamp = id.toString().substring(0,8) return moment( parseInt( timestamp, 16 ) * 1000).format('D MMM YYYY' ); }; $scope.displayDate = function(d) { return moment(d).format('D MMM YYYY HH:mm') } $scope.trig_imp = function() { //alert('ERROR DETECTED!'); console.log('TEST ERROR'); } $scope.filterPackage = function(item) { return item >= $scope.answers.Salary || !$scope.answers.Salary; }; $scope.gender = ['Male', 'Female']; $scope.professions = [{label: 'Accounting and Finance', roles: []}, {label: 'Banking and Financial Services', roles: []}]; Collection.get({}, function(col) { $scope.professions = [{label: 'Accounting and Finance', roles: col.Role}, {label: 'Banking and Financial Services', roles: col.FinanceRole}]; $scope.locations = col.Location; $scope.qualifications = col.Qualification; $scope.educationLevels = col.EducationLevel; $scope.benefits = col.Benefit; $scope.employerSize = col.EmploymentSize; $scope.employerTypes = col.EmployerType; $scope.industries = col.Industry; }); $scope.jobTypes = ['Permanent / Full Time', 'Contract or Temp', 'Permanent / Part-time']; $scope.loadTotCount = function(){ } //Model $scope.currentStep = 1; $scope.steps = [ { step: 1, name: "Current Job", template: "/wp-content/themes/whats-my-worth-theme/step1.php", desc: "Your Current Job Details" }, { step: 2, name: "Your Experience", template: "/wp-content/themes/whats-my-worth-theme/step2.php", desc: "Tell us about your experience" }, { step: 3, name: "Complete", template: "/wp-content/themes/whats-my-worth-theme/step3.php", desc: "Your Salary Survey Results" }, { step: 4, name: "Salary Search", template: "/wp-content/themes/whats-my-worth-theme/salary-search.php", desc: "Quick Salary Search" } ]; $scope.formarray = {}; $scope.gotoStep = function(newStep, $valid) { if($valid === true){ //signupform.$valid $scope.currentStep = newStep; location.href = "#wizard-step-container"; //$('html,body').animate({scrollTop: $('#wizard-step-container').offset().top - 10}); }else{ return false } } function setCookie(id_var) { //var date = new Date(); //date.setTime(date.getTime()+(365*24*60*60*1000)); document.cookie = id_var; //document.cookie = "_id=" + id + "; path=/; expires=" + date.toGMTString(); } function load_rec_ID(lID) { $cookies.put('insert-id-rec', lID); //setCookie(lID); //Get cookie value through variable var seshIDHandler = $cookies.get('insert-id-rec'); //alert(seshIDHandler); //$('.insertID_r').text(seshIDHandler); return seshIDHandler; } function showLoadingComponentModal() { $uibModal.open({ templateUrl: '/wp-content/themes/whats-my-worth-theme/loader.html', backdrop: 'static', size: 'xs', controller: function ($scope, $uibModalInstance) { $log.info('Modal opened at: ' + new Date()); $timeout(function () { $uibModalInstance.close("cancel"); //$log.info('Modal dismissed at: ' + new Date()); }, 1500); } }); } function checkID_insert($ins){ if($ins > 0 || $ins != '' || $ins != null){ $scope.param_success = true; $scope.param_link = 'https://whatsmyworth.co.nz/'+'salary-survey/?sid='+$ins; } } $scope.gotoNextStep = function($valid){ if($valid === true){ if($scope.currentStep == 2){ //process the data here.... var datetime_r = angular.element(document.querySelector('.date_time_r')).text(); var jobtitle_r = angular.element(document.querySelector('.jobtitle_r')).text(); var catjob_r = angular.element(document.querySelector('.catjob_r')).text(); var jobrole_r = angular.element(document.querySelector('.jobrole_r')).text(); var totYears_exp_slider_r = angular.element(document.querySelector('.totYears_exp_slider_r')).text(); var jobloc_r = angular.element(document.querySelector('.jobloc_r')).text(); var jobtype_r = angular.element(document.querySelector('.jobtype_r')).text(); var hoursworked_r = angular.element(document.querySelector('.hoursworked_r')).text(); var annualbasesalary_r = angular.element(document.querySelector('.annualbasesalary_r')).text(); var rateperhour_r = angular.element(document.querySelector('.rateperhour_r')).text(); var annualincent_r = angular.element(document.querySelector('.annualincent_r')).text(); var totalpackage_r = angular.element(document.querySelector('.totalpackage_r')).text(); var other_benefits_r = angular.element(document.querySelector('.other_benefits_r')).text(); var proc_chk_box_other_1_r = angular.element(document.querySelector('.proc_chk_box_other_1_r')).text(); var catjob_rid = angular.element(document.querySelector('.catjob_rid')).text(); var jobrole_rid = angular.element(document.querySelector('.jobrole_rid')).text(); var jobloc_rid = angular.element(document.querySelector('.jobloc_rid')).text(); var jobtype_rid = angular.element(document.querySelector('.jobtype_rid')).text(); //Tab Form 2 var higheduc_r = angular.element(document.querySelector('.higheduc_r')).text(); var numpeople_r = angular.element(document.querySelector('.numpeople_r')).text(); var gender_r = angular.element(document.querySelector('.gender_r')).text();//gender var currempindustry_r = angular.element(document.querySelector('.currempindustry_r')).text(); var currempsizey_r = angular.element(document.querySelector('.currempsizey_r')).text(); var curremptype_r = angular.element(document.querySelector('.curremptype_r')).text(); var perc_qualif_other_r = angular.element(document.querySelector('.perc_qualif_other_r')).text(); var perc_qualif_other_other_r = angular.element(document.querySelector('.perc_qualif_other_other_r')).text(); var dd_block_1 = angular.element(document.querySelector('.dd_block_1')).text(); var dd_block_2 = angular.element(document.querySelector('.dd_block_2')).text(); var dd_block_3 = angular.element(document.querySelector('.dd_block_3')).text(); var dd_block_4 = angular.element(document.querySelector('.dd_block_4')).text(); var dd_block_5 = angular.element(document.querySelector('.dd_block_5')).text(); var insertID_r_val = parseInt(angular.element(document.querySelector('.insertID_r')).text()); $http({ method: 'POST', url: '/wp-content/themes/whats-my-worth-theme/api/putstats.php', data: {"datetime": datetime_r, "profession": catjob_r, "job_title": jobtitle_r, "role": jobrole_r, "experience": totYears_exp_slider_r, "location": jobloc_r, "job_type":jobtype_r, "hours_worked": hoursworked_r, "salary": annualbasesalary_r, "rate": rateperhour_r, "bonus": annualincent_r, "total_package": totalpackage_r, "education": higheduc_r, "qualification": perc_qualif_other_r, "qualification_other": perc_qualif_other_other_r, "reportees": numpeople_r, "gender": gender_r, "industry_other": "", "industry": currempindustry_r, "type": curremptype_r, "size": currempsizey_r, "benefits": other_benefits_r, "other_benefits": proc_chk_box_other_1_r, "retake_reason": "", "email": "", "receive_updates": 1, "matching_profiles": 0, "reminders_sent": 0, "state": "", "updated_at": "", "updated_by": "user", "deleted": "", "importance_1": dd_block_1, "importance_2": dd_block_2, "importance_3": dd_block_3, "importance_4": dd_block_4, "importance_5": dd_block_5, "ctrl_id": insertID_r_val, "sector_id": catjob_rid, "role_id": jobrole_rid, "location_id": jobloc_rid, "job_type_id": jobtype_rid }, headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).then(function successCallback(response) { var id_newrec = JSON.stringify(response.data[0]['id']); $('.insertID_r').text(id_newrec); checkID_insert(id_newrec); load(id_newrec, catjob_rid, jobrole_rid, jobtype_r); $("#srtCont_order").fadeOut("slow", function() { $(this).removeClass("trig_err_imp"); }); showLoadingComponentModal(); $scope.currentStep += 1; //when successfully submitted, proceed with toing to the next page.. //alert(catjob_r); }, function errorCallback(response) { alert("Error! Something went wrong."); }); }else if($scope.currentStep == 1){ $scope.currentStep += 1; }else if($scope.currentStep == 3){ } location.href = "#wizard-step-container"; //$('html,body').animate({scrollTop: $('#wizard-step-container').offset().top - 10}); }else{ if($scope.currentStep == 2){ //alert('test'); } location.href = "#wizard-step-container"; //$('html,body').animate({scrollTop: $('#wizard-step-container').offset().top - 10}); return false; } } $scope.gotoPrevStep = function($valid){ if($valid === true){ $scope.currentStep -= 1; location.href = "#wizard-step-container"; //$('html,body').animate({scrollTop: $('#wizard-step-container').offset().top - 10}); $("#teamBlock__survey").removeClass('vis_tb'); }else{ return false; } } $scope.goSearchSalary = function($valid){ if($valid === true){ var pc_1b = $('option:selected', '#catjob').val(); var pc_1b_attr = $('option:selected', '#catjob').attr('label'); var jr_1b = $('option:selected', '#jobrole').val(); var jl_1b = $('#jobloc').val(); var jt_1b = $('#jobtype').val(); loadSalary(pc_1b, jr_1b, jt_1b, jl_1b); var prof_d_val = pc_1b_attr; var prof_d_val = prof_d_val = prof_d_val.replace(/\s+/g, '-').toLowerCase(); var jtype_r = jt_1b; var jtype_r = jtype_r = jtype_r.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, ""); var fVal_ang = '.'+prof_d_val+'.'+jtype_r; // init Isotope var $grid = $('.isotope_sort').isotope({ itemSelector: '.element-item' }); $grid.isotope({ filter: fVal_ang }); setTimeout(function () { $('html,body').animate({scrollTop: $('#result_salary_search').offset().top - 10}); $("#teamBlock__survey").addClass('vis_tb'); },1000) }else{ $('html,body').animate({scrollTop: $('#signupform').offset().top - 100},'slow'); return false; } } $scope.getStepTemplate = function($step_num){ if($step_num){ return $scope.steps[$step_num].template; }else{ for (var i = 0; i < $scope.steps.length; i++) { if ($scope.currentStep == $scope.steps[i].step) { return $scope.steps[i].template; } } } } $scope.getTopDesc = function($step_num){ if($step_num){ return $scope.steps[$step_num].desc; }else{ for (var i = 0; i < $scope.steps.length; i++) { if ($scope.currentStep == $scope.steps[i].step) { return $scope.steps[i].desc; } } } } $scope.getCurrStep = function(){ for (var i = 0; i < $scope.steps.length; i++) { if ($scope.currentStep == $scope.steps[i].step) { return $scope.steps[i].step; } } } //count the occurence of a page $scope.countPageLoad = function(pageint){ var countR = 0; for (var i = 0; i < $scope.steps.length; i++) { if (pageint == $scope.steps[i].step) { //return $scope.steps[i].step; if($scope.steps[i].step == 2){ //alert('Page 2'); countR += 1; }else{ countR = 0; } return countR; } } } $scope.click_counter = 0; $scope.count = function (inc) { $scope.click_counter += inc; }; $scope.selectedBenefits = function(){ var anyTrue = false; var countRec = $('input[name="proc_chk_box"]:checked').length; var countF = $("#chk_benefits_trig"); //alert(countRec); if(countRec === 0){ countRec = ''; } countF.val(countRec); if(countRec > 0){ anyTrue = true; //$(".othBen_chk").hide(); }else{ //$(".othBen_chk").show(); } console.log(countRec); return anyTrue; } $scope.datetime = new Date();//the datetime... }]); (function () { 'use strict'; angular .module('app') .filter('slugify', Filter); function Filter() { return function (input) { if (!input) return; // make lower case and trim var slug = input.toLowerCase().trim(); // replace invalid chars with spaces slug = slug.replace(/[^a-z0-9\s-]/g, ' '); slug = slug.replace(/[0-9]*\.?[0-9]+%/g, 'percent'); // replace multiple spaces or hyphens with a single hyphen slug = slug.replace(/[\s-]+/g, '-'); return slug; }; } })();