Commit 8586ba494bd40a4bb486c8e87e1b4fe5ff10f655
1 parent
0d7cf45ece
Exists in
master
and in
1 other branch
html5 mode
Showing
2 changed files
with
35 additions
and
8 deletions
Show diff stats
index.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | 2 | ||
3 | <!-- define angular app --> | 3 | <!-- define angular app --> |
4 | <html ng-app="scotchApp"> | 4 | <html ng-app="scotchApp"> |
5 | 5 | ||
6 | <head> | 6 | <head> |
7 | <meta charset="utf-8"> | 7 | <meta charset="utf-8"> |
8 | <base href="/"> | ||
8 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 9 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
9 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 10 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
10 | <title>Startup Jalsa</title> | 11 | <title>Startup Jalsa</title> |
11 | <link rel="shortcut icon" type="image/png" href="images/favicon.png"/> | 12 | <link rel="shortcut icon" type="image/png" href="images/favicon.png"/> |
12 | <!-- SCROLLS --> | 13 | <!-- SCROLLS --> |
13 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/> | 14 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/> |
14 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css"/> | 15 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css"/> |
15 | <link href="https://fonts.googleapis.com/css?family=BenchNine" rel="stylesheet"> | 16 | <link href="https://fonts.googleapis.com/css?family=BenchNine" rel="stylesheet"> |
16 | <!-- SPELLS --> | 17 | <!-- SPELLS --> |
17 | <script type="text/javascript" src="js/jquery-3.2.1.js"></script> | 18 | <script type="text/javascript" src="js/jquery-3.2.1.js"></script> |
18 | <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script> | 19 | <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script> |
19 | <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script> | 20 | <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script> |
20 | <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> | 21 | <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> |
21 | <link rel="stylesheet" type="text/css" href="css/custom.css"> | 22 | <link rel="stylesheet" type="text/css" href="css/custom.css"> |
22 | <script src="https://checkout.razorpay.com/v1/checkout.js"></script> | 23 | <script src="https://checkout.razorpay.com/v1/checkout.js"></script> |
23 | <link rel="stylesheet" href="css/circle.css"> | 24 | <link rel="stylesheet" href="css/circle.css"> |
24 | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | 25 | <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
25 | <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css"> | 26 | <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css"> |
26 | <script src="script.js"></script> | 27 | <script src="script.js"></script> |
27 | <script src="js/angular-svg-round-progressbar.js"></script> | 28 | <script src="js/angular-svg-round-progressbar.js"></script> |
28 | <script src="js/angular.js"></script> | 29 | <script src="js/angular.js"></script> |
29 | <script src="js/bootstrap.js"></script> | 30 | <script src="js/bootstrap.js"></script> |
30 | <script src="dist/angular-google-analytics.js"></script> | 31 | <script src="dist/angular-google-analytics.js"></script> |
31 | <!-- <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | 32 | <!-- <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
32 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | 33 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
33 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | 34 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
34 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | 35 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
35 | })(window,document,'script','dataLayer','GTM-KCXPCKF');</script> --> | 36 | })(window,document,'script','dataLayer','GTM-KCXPCKF');</script> --> |
36 | <!-- Google Tag Manager --> | 37 | <!-- Google Tag Manager --> |
37 | <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | 38 | <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': |
38 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | 39 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
39 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | 40 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
40 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | 41 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
41 | })(window,document,'script','dataLayer','GTM-WBTNXZB');</script> | 42 | })(window,document,'script','dataLayer','GTM-WBTNXZB');</script> |
43 | |||
42 | <!-- End Google Tag Manager --> | 44 | <!-- End Google Tag Manager --> |
43 | <!-- <script> | 45 | <!-- <script> |
44 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | 46 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
45 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | 47 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
46 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | 48 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
47 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | 49 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
48 | 50 | ||
49 | ga('create', 'UA-106416759-1', 'auto'); | 51 | ga('create', 'UA-106416759-1', 'auto'); |
50 | ga('send', 'pageview'); | 52 | ga('send', 'pageview'); |
51 | </script> --> | 53 | </script> --> |
52 | 54 | ||
53 | </head> | 55 | </head> |
54 | 56 | ||
55 | <!-- define angular controller --> | 57 | <!-- define angular controller --> |
56 | <body ng-controller="mainController" id="front"> | 58 | <body ng-controller="mainController" id="front"> |
57 | <!-- Google Tag Manager (noscript) --> | 59 | <!-- Google Tag Manager (noscript) --> |
58 | <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WBTNXZB" | 60 | <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WBTNXZB" |
59 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | 61 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> |
60 | <!-- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KCXPCKF" | 62 | <!-- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KCXPCKF" |
61 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> --> | 63 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> --> |
62 | <!-- End Google Tag Manager (noscript) --> | 64 | <!-- End Google Tag Manager (noscript) --> |
63 | <div class="bg_dots"></div> | 65 | <div class="bg_dots"></div> |
64 | <div id="main"> | 66 | <div id="main"> |
65 | <div ng-view id="front"></div> | 67 | <div ng-view id="front"></div> |
66 | </div> | 68 | </div> |
67 | 69 | ||
68 | </body> | 70 | </body> |
69 | <script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="7899c0bb-0bd6-4768-b64c-f2df38bc2e9a";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script> | 71 | <script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="7899c0bb-0bd6-4768-b64c-f2df38bc2e9a";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script> |
70 | 72 | ||
71 | </html> | 73 | </html> |
72 | 74 |
script.js
1 | // create the module and name it scotchApp | 1 | // create the module and name it scotchApp |
2 | var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); | 2 | var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
3 | 3 | ||
4 | // configure our routes | 4 | // configure our routes |
5 | scotchApp.config(function($routeProvider,$locationProvider) { | 5 | scotchApp.config(function($routeProvider,$locationProvider) { |
6 | |||
7 | // [system.webServer] | ||
8 | // [rewrite] | ||
9 | // [rules] | ||
10 | // [rule name="scotchApp" stopProcessing="true"] | ||
11 | // [match url=".*" /] | ||
12 | // [conditions logicalGrouping="MatchAll"] | ||
13 | // [add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /] | ||
14 | // [add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /] | ||
15 | // [add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /] | ||
16 | // [/conditions] | ||
17 | // [action type="Rewrite" url="/index.html" /] | ||
18 | // [/rule] | ||
19 | // [/rules] | ||
20 | // [/rewrite] | ||
21 | // [/system.webServer] | ||
22 | |||
23 | // use the HTML5 History API | ||
24 | $locationProvider.html5Mode({ | ||
25 | enabled: true, | ||
26 | requireBase: false | ||
27 | }); | ||
28 | $locationProvider.hashPrefix('!'); | ||
6 | $routeProvider | 29 | $routeProvider |
7 | 30 | ||
8 | // route for the Home page | 31 | // route for the Home page |
9 | .when('/', { | 32 | .when('/', { |
10 | templateUrl: 'pages/Home.html', | 33 | templateUrl: 'pages/Home.html', |
11 | controller: 'mainController' | 34 | controller: 'mainController' |
12 | }) | 35 | }) |
13 | 36 | ||
14 | // route for the caricatures page | 37 | // route for the caricatures page |
15 | .when('/caricatures', { | 38 | .when('/caricatures', { |
16 | templateUrl: 'pages/caricatures.html', | 39 | templateUrl: 'pages/caricatures.html', |
17 | controller: 'mainController' | 40 | controller: 'mainController' |
18 | }) | 41 | }) |
19 | 42 | ||
20 | // // route for the paymentVerify page | 43 | // // route for the paymentVerify page |
21 | // .when('/pendingPayment/:id', { | 44 | // .when('/pendingPayment/:id', { |
22 | // templateUrl: 'pages/verify.html', | 45 | // templateUrl: 'pages/verify.html', |
23 | // controller: 'verifyController' | 46 | // controller: 'verifyController' |
24 | // }) | 47 | // }) |
25 | 48 | ||
26 | // route for the registration page | 49 | // route for the registration page |
27 | .when('/registration/:city', { | 50 | .when('/registration/:city', { |
28 | templateUrl: 'pages/registration.html', | 51 | templateUrl: 'pages/registration.html', |
29 | controller: 'registrationController' | 52 | controller: 'registrationController' |
30 | }) | 53 | }) |
31 | 54 | ||
32 | // route for the ambassador page | 55 | //route for the ambassador page |
33 | // .when('/startupJalsaPromocode', { | 56 | .when('/startupJalsaPromocode', { |
34 | // templateUrl: 'pages/ambassador.html', | 57 | templateUrl: 'pages/ambassador.html', |
35 | // controller: 'ambassadorController' | 58 | controller: 'ambassadorController' |
36 | // }) | 59 | }) |
37 | 60 | ||
38 | // route for the confirmation page | 61 | // route for the confirmation page |
39 | .when('/confirmation', { | 62 | .when('/confirmation', { |
40 | templateUrl: 'pages/confirmation.html', | 63 | templateUrl: 'pages/confirmation.html', |
41 | controller: 'registrationController' | 64 | controller: 'registrationController' |
42 | }) | 65 | }) |
43 | 66 | ||
44 | // use the HTML5 History API | 67 | .otherwise({ |
45 | // $locationProvider.html5Mode(true); | 68 | redirectTo: '/' |
46 | // $routeProvider.otherwise({ redirectTo: '' }); | 69 | }); |
70 | |||
71 | |||
47 | 72 | ||
48 | }); | 73 | }); |
49 | 74 | ||
50 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 75 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
51 | // Add configuration code as desired | 76 | // Add configuration code as desired |
52 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code | 77 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
53 | 78 | ||
54 | // Track all routes (default is true). | 79 | // Track all routes (default is true). |
55 | AnalyticsProvider.trackPages(true); | 80 | AnalyticsProvider.trackPages(true); |
56 | 81 | ||
57 | // Track all URL query params (default is false). | 82 | // Track all URL query params (default is false). |
58 | AnalyticsProvider.trackUrlParams(true); | 83 | AnalyticsProvider.trackUrlParams(true); |
59 | 84 | ||
60 | }]).run(['Analytics', function(Analytics) { }]); | 85 | }]).run(['Analytics', function(Analytics) { }]); |
61 | 86 | ||
62 | scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") | 87 | scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") |
63 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | 88 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
64 | 89 | ||
65 | // create the controller and inject Angular's $scope | 90 | // create the controller and inject Angular's $scope |
66 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { | 91 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
67 | $scope.data = { | 92 | $scope.data = { |
68 | show: true, | 93 | show: true, |
69 | hide: false | 94 | hide: false |
70 | }; | 95 | }; |
71 | 96 | ||
72 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); | 97 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); |
73 | // Update the count down every 1 second | 98 | // Update the count down every 1 second |
74 | var x = setInterval(function() { | 99 | var x = setInterval(function() { |
75 | // Get todays date and time | 100 | // Get todays date and time |
76 | var now = new Date().getTime(); | 101 | var now = new Date().getTime(); |
77 | // Find the distance between now an the count down date | 102 | // Find the distance between now an the count down date |
78 | var distance = chennai - now; | 103 | var distance = chennai - now; |
79 | // Time calculations for days, hours, minutes and seconds | 104 | // Time calculations for days, hours, minutes and seconds |
80 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 105 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
81 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 106 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
82 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 107 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
83 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 108 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
84 | $scope.timer = days + "d " + hours + "h " | 109 | $scope.timer = days + "d " + hours + "h " |
85 | + minutes + "m " + seconds + "s " | 110 | + minutes + "m " + seconds + "s " |
86 | // Output the result in an element with id="demo" | 111 | // Output the result in an element with id="demo" |
87 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " | 112 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " |
88 | + minutes + "m " + seconds + "s "; | 113 | + minutes + "m " + seconds + "s "; |
89 | // If the count down is over, write some text | 114 | // If the count down is over, write some text |
90 | if (distance < 0) { | 115 | if (distance < 0) { |
91 | clearInterval(x); | 116 | clearInterval(x); |
92 | document.getElementById("chennai").innerHTML = "EXPIRED"; | 117 | document.getElementById("chennai").innerHTML = "EXPIRED"; |
93 | } | 118 | } |
94 | }, 1000); | 119 | }, 1000); |
95 | 120 | ||
96 | var hyderabad = new Date("Sept 21, 2018 12:00:00").getTime(); | 121 | var hyderabad = new Date("Sept 21, 2018 12:00:00").getTime(); |
97 | // Update the count down every 1 second | 122 | // Update the count down every 1 second |
98 | var x = setInterval(function() { | 123 | var x = setInterval(function() { |
99 | // Get todays date and time | 124 | // Get todays date and time |
100 | var now = new Date().getTime(); | 125 | var now = new Date().getTime(); |
101 | // Find the distance between now an the count down date | 126 | // Find the distance between now an the count down date |
102 | var distance = hyderabad - now; | 127 | var distance = hyderabad - now; |
103 | // Time calculations for days, hours, minutes and seconds | 128 | // Time calculations for days, hours, minutes and seconds |
104 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 129 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
105 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 130 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
106 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 131 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
107 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 132 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
108 | $scope.timer = days + "d " + hours + "h " | 133 | $scope.timer = days + "d " + hours + "h " |
109 | + minutes + "m " + seconds + "s " | 134 | + minutes + "m " + seconds + "s " |
110 | // Output the result in an element with id="demo" | 135 | // Output the result in an element with id="demo" |
111 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " | 136 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " |
112 | + minutes + "m " + seconds + "s "; | 137 | + minutes + "m " + seconds + "s "; |
113 | // If the count down is over, write some text | 138 | // If the count down is over, write some text |
114 | if (distance < 0) { | 139 | if (distance < 0) { |
115 | clearInterval(x); | 140 | clearInterval(x); |
116 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; | 141 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; |
117 | } | 142 | } |
118 | }, 1000); | 143 | }, 1000); |
119 | 144 | ||
120 | var mumbai = new Date("Sept 25, 2018 12:00:00").getTime(); | 145 | var mumbai = new Date("Sept 25, 2018 12:00:00").getTime(); |
121 | // Update the count down every 1 second | 146 | // Update the count down every 1 second |
122 | var x = setInterval(function() { | 147 | var x = setInterval(function() { |
123 | // Get todays date and time | 148 | // Get todays date and time |
124 | var now = new Date().getTime(); | 149 | var now = new Date().getTime(); |
125 | // Find the distance between now an the count down date | 150 | // Find the distance between now an the count down date |
126 | var distance = mumbai - now; | 151 | var distance = mumbai - now; |
127 | // Time calculations for days, hours, minutes and seconds | 152 | // Time calculations for days, hours, minutes and seconds |
128 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 153 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
129 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 154 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
130 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 155 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
131 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 156 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
132 | $scope.timer = days + "d " + hours + "h " | 157 | $scope.timer = days + "d " + hours + "h " |
133 | + minutes + "m " + seconds + "s " | 158 | + minutes + "m " + seconds + "s " |
134 | // Output the result in an element with id="demo" | 159 | // Output the result in an element with id="demo" |
135 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " | 160 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " |
136 | + minutes + "m " + seconds + "s "; | 161 | + minutes + "m " + seconds + "s "; |
137 | // If the count down is over, write some text | 162 | // If the count down is over, write some text |
138 | if (distance < 0) { | 163 | if (distance < 0) { |
139 | clearInterval(x); | 164 | clearInterval(x); |
140 | document.getElementById("mumbai").innerHTML = "EXPIRED"; | 165 | document.getElementById("mumbai").innerHTML = "EXPIRED"; |
141 | } | 166 | } |
142 | }, 1000); | 167 | }, 1000); |
143 | 168 | ||
144 | var kolkata = new Date("Oct 2, 2018 12:00:00").getTime(); | 169 | var kolkata = new Date("Oct 2, 2018 12:00:00").getTime(); |
145 | // Update the count down every 1 second | 170 | // Update the count down every 1 second |
146 | var x = setInterval(function() { | 171 | var x = setInterval(function() { |
147 | // Get todays date and time | 172 | // Get todays date and time |
148 | var now = new Date().getTime(); | 173 | var now = new Date().getTime(); |
149 | // Find the distance between now an the count down date | 174 | // Find the distance between now an the count down date |
150 | var distance = kolkata - now; | 175 | var distance = kolkata - now; |
151 | // Time calculations for days, hours, minutes and seconds | 176 | // Time calculations for days, hours, minutes and seconds |
152 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 177 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
153 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 178 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
154 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 179 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
155 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 180 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
156 | $scope.timer = days + "d " + hours + "h " | 181 | $scope.timer = days + "d " + hours + "h " |
157 | + minutes + "m " + seconds + "s " | 182 | + minutes + "m " + seconds + "s " |
158 | // Output the result in an element with id="demo" | 183 | // Output the result in an element with id="demo" |
159 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " | 184 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " |
160 | + minutes + "m " + seconds + "s "; | 185 | + minutes + "m " + seconds + "s "; |
161 | // If the count down is over, write some text | 186 | // If the count down is over, write some text |
162 | if (distance < 0) { | 187 | if (distance < 0) { |
163 | clearInterval(x); | 188 | clearInterval(x); |
164 | document.getElementById("kolkata").innerHTML = "EXPIRED"; | 189 | document.getElementById("kolkata").innerHTML = "EXPIRED"; |
165 | } | 190 | } |
166 | }, 1000); | 191 | }, 1000); |
167 | 192 | ||
168 | var jaipur = new Date("Oct 4, 2018 12:00:00").getTime(); | 193 | var jaipur = new Date("Oct 4, 2018 12:00:00").getTime(); |
169 | // Update the count down every 1 second | 194 | // Update the count down every 1 second |
170 | var x = setInterval(function() { | 195 | var x = setInterval(function() { |
171 | // Get todays date and time | 196 | // Get todays date and time |
172 | var now = new Date().getTime(); | 197 | var now = new Date().getTime(); |
173 | // Find the distance between now an the count down date | 198 | // Find the distance between now an the count down date |
174 | var distance = jaipur - now; | 199 | var distance = jaipur - now; |
175 | // Time calculations for days, hours, minutes and seconds | 200 | // Time calculations for days, hours, minutes and seconds |
176 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 201 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
177 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 202 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
178 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 203 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
179 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 204 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
180 | $scope.timer = days + "d " + hours + "h " | 205 | $scope.timer = days + "d " + hours + "h " |
181 | + minutes + "m " + seconds + "s " | 206 | + minutes + "m " + seconds + "s " |
182 | // Output the result in an element with id="demo" | 207 | // Output the result in an element with id="demo" |
183 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " | 208 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " |
184 | + minutes + "m " + seconds + "s "; | 209 | + minutes + "m " + seconds + "s "; |
185 | // If the count down is over, write some text | 210 | // If the count down is over, write some text |
186 | if (distance < 0) { | 211 | if (distance < 0) { |
187 | clearInterval(x); | 212 | clearInterval(x); |
188 | document.getElementById("jaipur").innerHTML = "EXPIRED"; | 213 | document.getElementById("jaipur").innerHTML = "EXPIRED"; |
189 | } | 214 | } |
190 | }, 1000); | 215 | }, 1000); |
191 | 216 | ||
192 | var delhi = new Date("Oct 7, 2018 12:00:00").getTime(); | 217 | var delhi = new Date("Oct 7, 2018 12:00:00").getTime(); |
193 | // Update the count down every 1 second | 218 | // Update the count down every 1 second |
194 | var x = setInterval(function() { | 219 | var x = setInterval(function() { |
195 | // Get todays date and time | 220 | // Get todays date and time |
196 | var now = new Date().getTime(); | 221 | var now = new Date().getTime(); |
197 | // Find the distance between now an the count down date | 222 | // Find the distance between now an the count down date |
198 | var distance = delhi - now; | 223 | var distance = delhi - now; |
199 | // Time calculations for days, hours, minutes and seconds | 224 | // Time calculations for days, hours, minutes and seconds |
200 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 225 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
201 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 226 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
202 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 227 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
203 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 228 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
204 | $scope.timer = days + "d " + hours + "h " | 229 | $scope.timer = days + "d " + hours + "h " |
205 | + minutes + "m " + seconds + "s " | 230 | + minutes + "m " + seconds + "s " |
206 | // Output the result in an element with id="demo" | 231 | // Output the result in an element with id="demo" |
207 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " | 232 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " |
208 | + minutes + "m " + seconds + "s "; | 233 | + minutes + "m " + seconds + "s "; |
209 | // If the count down is over, write some text | 234 | // If the count down is over, write some text |
210 | if (distance < 0) { | 235 | if (distance < 0) { |
211 | clearInterval(x); | 236 | clearInterval(x); |
212 | document.getElementById("delhi").innerHTML = "EXPIRED"; | 237 | document.getElementById("delhi").innerHTML = "EXPIRED"; |
213 | } | 238 | } |
214 | }, 1000); | 239 | }, 1000); |
215 | 240 | ||
216 | var kanpur = new Date("Oct 9, 2018 12:00:00").getTime(); | 241 | var kanpur = new Date("Oct 9, 2018 12:00:00").getTime(); |
217 | // Update the count down every 1 second | 242 | // Update the count down every 1 second |
218 | var x = setInterval(function() { | 243 | var x = setInterval(function() { |
219 | // Get todays date and time | 244 | // Get todays date and time |
220 | var now = new Date().getTime(); | 245 | var now = new Date().getTime(); |
221 | // Find the distance between now an the count down date | 246 | // Find the distance between now an the count down date |
222 | var distance = kanpur - now; | 247 | var distance = kanpur - now; |
223 | // Time calculations for days, hours, minutes and seconds | 248 | // Time calculations for days, hours, minutes and seconds |
224 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 249 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
225 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 250 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
226 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 251 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
227 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 252 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
228 | $scope.timer = days + "d " + hours + "h " | 253 | $scope.timer = days + "d " + hours + "h " |
229 | + minutes + "m " + seconds + "s " | 254 | + minutes + "m " + seconds + "s " |
230 | // Output the result in an element with id="demo" | 255 | // Output the result in an element with id="demo" |
231 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " | 256 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " |
232 | + minutes + "m " + seconds + "s "; | 257 | + minutes + "m " + seconds + "s "; |
233 | // If the count down is over, write some text | 258 | // If the count down is over, write some text |
234 | if (distance < 0) { | 259 | if (distance < 0) { |
235 | clearInterval(x); | 260 | clearInterval(x); |
236 | document.getElementById("kanpur").innerHTML = "EXPIRED"; | 261 | document.getElementById("kanpur").innerHTML = "EXPIRED"; |
237 | } | 262 | } |
238 | }, 1000); | 263 | }, 1000); |
239 | 264 | ||
240 | var ahmedabad = new Date("Oct 11, 2018 12:00:00").getTime(); | 265 | var ahmedabad = new Date("Oct 11, 2018 12:00:00").getTime(); |
241 | // Update the count down every 1 second | 266 | // Update the count down every 1 second |
242 | var x = setInterval(function() { | 267 | var x = setInterval(function() { |
243 | // Get todays date and time | 268 | // Get todays date and time |
244 | var now = new Date().getTime(); | 269 | var now = new Date().getTime(); |
245 | // Find the distance between now an the count down date | 270 | // Find the distance between now an the count down date |
246 | var distance = ahmedabad - now; | 271 | var distance = ahmedabad - now; |
247 | // Time calculations for days, hours, minutes and seconds | 272 | // Time calculations for days, hours, minutes and seconds |
248 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 273 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
249 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 274 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
250 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 275 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
251 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 276 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
252 | $scope.timer = days + "d " + hours + "h " | 277 | $scope.timer = days + "d " + hours + "h " |
253 | + minutes + "m " + seconds + "s " | 278 | + minutes + "m " + seconds + "s " |
254 | // Output the result in an element with id="demo" | 279 | // Output the result in an element with id="demo" |
255 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " | 280 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " |
256 | + minutes + "m " + seconds + "s "; | 281 | + minutes + "m " + seconds + "s "; |
257 | // If the count down is over, write some text | 282 | // If the count down is over, write some text |
258 | if (distance < 0) { | 283 | if (distance < 0) { |
259 | clearInterval(x); | 284 | clearInterval(x); |
260 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; | 285 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; |
261 | } | 286 | } |
262 | }, 1000); | 287 | }, 1000); |
263 | 288 | ||
264 | var bengaluru = new Date("Oct 12, 2018 12:00:00").getTime(); | 289 | var bengaluru = new Date("Oct 12, 2018 12:00:00").getTime(); |
265 | // Update the count down every 1 second | 290 | // Update the count down every 1 second |
266 | var x = setInterval(function() { | 291 | var x = setInterval(function() { |
267 | // Get todays date and time | 292 | // Get todays date and time |
268 | var now = new Date().getTime(); | 293 | var now = new Date().getTime(); |
269 | // Find the distance between now an the count down date | 294 | // Find the distance between now an the count down date |
270 | var distance = bengaluru - now; | 295 | var distance = bengaluru - now; |
271 | // Time calculations for days, hours, minutes and seconds | 296 | // Time calculations for days, hours, minutes and seconds |
272 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 297 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
273 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 298 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
274 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 299 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
275 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 300 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
276 | $scope.timer = days + "d " + hours + "h " | 301 | $scope.timer = days + "d " + hours + "h " |
277 | + minutes + "m " + seconds + "s " | 302 | + minutes + "m " + seconds + "s " |
278 | // Output the result in an element with id="demo" | 303 | // Output the result in an element with id="demo" |
279 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " | 304 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " |
280 | + minutes + "m " + seconds + "s "; | 305 | + minutes + "m " + seconds + "s "; |
281 | // If the count down is over, write some text | 306 | // If the count down is over, write some text |
282 | if (distance < 0) { | 307 | if (distance < 0) { |
283 | clearInterval(x); | 308 | clearInterval(x); |
284 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; | 309 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; |
285 | } | 310 | } |
286 | }, 1000); | 311 | }, 1000); |
287 | 312 | ||
288 | var dharamsala = new Date("Dec 13, 2018 12:00:00").getTime(); | 313 | var dharamsala = new Date("Dec 13, 2018 12:00:00").getTime(); |
289 | // Update the count down every 1 second | 314 | // Update the count down every 1 second |
290 | var x = setInterval(function() { | 315 | var x = setInterval(function() { |
291 | // Get todays date and time | 316 | // Get todays date and time |
292 | var now = new Date().getTime(); | 317 | var now = new Date().getTime(); |
293 | // Find the distance between now an the count down date | 318 | // Find the distance between now an the count down date |
294 | var distance = dharamsala - now; | 319 | var distance = dharamsala - now; |
295 | // Time calculations for days, hours, minutes and seconds | 320 | // Time calculations for days, hours, minutes and seconds |
296 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 321 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
297 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 322 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
298 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 323 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
299 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 324 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
300 | $scope.timer = days + "d " + hours + "h " | 325 | $scope.timer = days + "d " + hours + "h " |
301 | + minutes + "m " + seconds + "s " | 326 | + minutes + "m " + seconds + "s " |
302 | // Output the result in an element with id="demo" | 327 | // Output the result in an element with id="demo" |
303 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " | 328 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " |
304 | + minutes + "m " + seconds + "s "; | 329 | + minutes + "m " + seconds + "s "; |
305 | // If the count down is over, write some text | 330 | // If the count down is over, write some text |
306 | if (distance < 0) { | 331 | if (distance < 0) { |
307 | clearInterval(x); | 332 | clearInterval(x); |
308 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; | 333 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; |
309 | } | 334 | } |
310 | }, 1000); | 335 | }, 1000); |
311 | 336 | ||
312 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 337 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
313 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 338 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
314 | // $scope.Textshow = "yes" | 339 | // $scope.Textshow = "yes" |
315 | $scope.max = 100; | 340 | $scope.max = 100; |
316 | $scope.formPage = false; | 341 | $scope.formPage = false; |
317 | $scope.current = 0; | 342 | $scope.current = 0; |
318 | $scope.payingAmnt = 0; | 343 | $scope.payingAmnt = 0; |
319 | $scope.data = {}; | 344 | $scope.data = {}; |
320 | $scope.discountAmount = 0; | 345 | $scope.discountAmount = 0; |
321 | // $scope.data.quantity = "1"; | 346 | // $scope.data.quantity = "1"; |
322 | $scope.check = false; | 347 | $scope.check = false; |
323 | $scope.numberCheck = false; | 348 | $scope.numberCheck = false; |
324 | $scope.paymentResult = {}; | 349 | $scope.paymentResult = {}; |
325 | var data = { | 350 | var data = { |
326 | "amount": $scope.payingAmnt, | 351 | "amount": $scope.payingAmnt, |
327 | "currency": "INR", | 352 | "currency": "INR", |
328 | "status": "pending" | 353 | "status": "pending" |
329 | } | 354 | } |
330 | 355 | ||
331 | $scope.apply = function() { | 356 | $scope.apply = function() { |
332 | //Analytics.trackEvent('register', 'click', 'Registration'); | 357 | //Analytics.trackEvent('register', 'click', 'Registration'); |
333 | $location.path("/caricatures") | 358 | $location.path("/caricatures") |
334 | } | 359 | } |
335 | 360 | ||
336 | $scope.data.city = ''; | 361 | $scope.data.city = ''; |
337 | $scope.watch = function(value){ | 362 | $scope.watch = function(value){ |
338 | console.log("cllll",value) | 363 | console.log("cllll",value) |
339 | $scope.data.city = value; | 364 | $scope.data.city = value; |
340 | localStorage.setItem("city" ,value); | 365 | localStorage.setItem("city" ,value); |
341 | //$location.path('/registration').search({city: value}); | 366 | //$location.path('/registration').search({city: value}); |
342 | $location.path('/registration/'+value+''); | 367 | $location.path('/registration/'+value+''); |
343 | //$state.go('registration', { 'city': value}) | 368 | //$state.go('registration', { 'city': value}) |
344 | } | 369 | } |
345 | 370 | ||
346 | $scope.select = function(url){ | 371 | $scope.select = function(url){ |
347 | console.log("cllll") | 372 | console.log("cllll") |
348 | window.open(url) | 373 | window.open(url) |
349 | } | 374 | } |
350 | 375 | ||
351 | $scope.stagekeyPress = function() { | 376 | $scope.stagekeyPress = function() { |
352 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); | 377 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
353 | } | 378 | } |
354 | $scope.sectorkeyPress = function() { | 379 | $scope.sectorkeyPress = function() { |
355 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); | 380 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
356 | } | 381 | } |
357 | 382 | ||
358 | $scope.productLaunchkeyPress = function() { | 383 | $scope.productLaunchkeyPress = function() { |
359 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); | 384 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
360 | } | 385 | } |
361 | 386 | ||
362 | $scope.launchPeriodkeyPress = function() { | 387 | $scope.launchPeriodkeyPress = function() { |
363 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); | 388 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
364 | } | 389 | } |
365 | 390 | ||
366 | $scope.industrykeyPress = function(quantity) { | 391 | $scope.industrykeyPress = function(quantity) { |
367 | console.log("fghj",quantity) | 392 | console.log("fghj",quantity) |
368 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); | 393 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
369 | } | 394 | } |
370 | 395 | ||
371 | $scope.industryNamekeyPress = function(firstName) { | 396 | $scope.industryNamekeyPress = function(firstName) { |
372 | console.log("lastName==", firstName); | 397 | console.log("lastName==", firstName); |
373 | if (firstName == undefined) { | 398 | if (firstName == undefined) { |
374 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 399 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
375 | } else { | 400 | } else { |
376 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 401 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
377 | } | 402 | } |
378 | } | 403 | } |
379 | 404 | ||
380 | $scope.amountkeyPress = function() { | 405 | $scope.amountkeyPress = function() { |
381 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); | 406 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
382 | } | 407 | } |
383 | 408 | ||
384 | $scope.firstNamekeyPress = function(name) { | 409 | $scope.firstNamekeyPress = function(name) { |
385 | console.log("lastName==", name); | 410 | console.log("lastName==", name); |
386 | if (name == undefined) { | 411 | if (name == undefined) { |
387 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 412 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
388 | } else { | 413 | } else { |
389 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); | 414 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
390 | } | 415 | } |
391 | } | 416 | } |
392 | 417 | ||
393 | $scope.emailkeyPress = function(email) { | 418 | $scope.emailkeyPress = function(email) { |
394 | console.log("email", email); | 419 | console.log("email", email); |
395 | if (email == undefined) { | 420 | if (email == undefined) { |
396 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 421 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
397 | } else { | 422 | } else { |
398 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); | 423 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
399 | } | 424 | } |
400 | } | 425 | } |
401 | 426 | ||
402 | $scope.phonekeyPress = function(number) { | 427 | $scope.phonekeyPress = function(number) { |
403 | console.log("number", number); | 428 | console.log("number", number); |
404 | if (number == undefined || number == '') { | 429 | if (number == undefined || number == '') { |
405 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 430 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
406 | } else { | 431 | } else { |
407 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); | 432 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
408 | } | 433 | } |
409 | } | 434 | } |
410 | 435 | ||
411 | $scope.citykeyPress = function(city) { | 436 | $scope.citykeyPress = function(city) { |
412 | console.log("city", city); | 437 | console.log("city", city); |
413 | if (city == undefined) { | 438 | if (city == undefined) { |
414 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 439 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
415 | } else { | 440 | } else { |
416 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); | 441 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
417 | } | 442 | } |
418 | } | 443 | } |
419 | 444 | ||
420 | $scope.startupNamekeyPress = function(q) { | 445 | $scope.startupNamekeyPress = function(q) { |
421 | if (q == undefined) { | 446 | if (q == undefined) { |
422 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 447 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
423 | } else { | 448 | } else { |
424 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); | 449 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
425 | } | 450 | } |
426 | } | 451 | } |
427 | 452 | ||
428 | $scope.linkedInkeyPress = function(technology) { | 453 | $scope.linkedInkeyPress = function(technology) { |
429 | if (technology == undefined || technology == '') { | 454 | if (technology == undefined || technology == '') { |
430 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 455 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
431 | } else { | 456 | } else { |
432 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); | 457 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
433 | } | 458 | } |
434 | } | 459 | } |
435 | $scope.companykeyPress = function(problem) { | 460 | $scope.companykeyPress = function(problem) { |
436 | if (problem == undefined) { | 461 | if (problem == undefined) { |
437 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 462 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
438 | } else { | 463 | } else { |
439 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); | 464 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
440 | } | 465 | } |
441 | } | 466 | } |
442 | $scope.productNamekeyPress = function(solution) { | 467 | $scope.productNamekeyPress = function(solution) { |
443 | if (solution == undefined) { | 468 | if (solution == undefined) { |
444 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 469 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
445 | } else { | 470 | } else { |
446 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); | 471 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
447 | } | 472 | } |
448 | } | 473 | } |
449 | $scope.businesskeyPress = function(business) { | 474 | $scope.businesskeyPress = function(business) { |
450 | if (business == undefined) { | 475 | if (business == undefined) { |
451 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); | 476 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); |
452 | } else { | 477 | } else { |
453 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); | 478 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); |
454 | } | 479 | } |
455 | } | 480 | } |
456 | 481 | ||
457 | $scope.websitekeyPress = function(prototype) { | 482 | $scope.websitekeyPress = function(prototype) { |
458 | if (prototype == undefined || prototype == '') { | 483 | if (prototype == undefined || prototype == '') { |
459 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 484 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
460 | } else { | 485 | } else { |
461 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); | 486 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
462 | } | 487 | } |
463 | } | 488 | } |
464 | 489 | ||
465 | $scope.employeekeyPress = function(market) { | 490 | $scope.employeekeyPress = function(market) { |
466 | if (market == undefined || market == '') { | 491 | if (market == undefined || market == '') { |
467 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 492 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
468 | } else { | 493 | } else { |
469 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); | 494 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
470 | } | 495 | } |
471 | } | 496 | } |
472 | 497 | ||
473 | $scope.annualkeyPress = function(risk) { | 498 | $scope.annualkeyPress = function(risk) { |
474 | if (risk == undefined || risk == '') { | 499 | if (risk == undefined || risk == '') { |
475 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 500 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
476 | } else { | 501 | } else { |
477 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); | 502 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
478 | } | 503 | } |
479 | } | 504 | } |
480 | 505 | ||
481 | $scope.revenuekeyPress = function(team) { | 506 | $scope.revenuekeyPress = function(team) { |
482 | if (team == undefined) { | 507 | if (team == undefined) { |
483 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 508 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
484 | } else { | 509 | } else { |
485 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); | 510 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
486 | } | 511 | } |
487 | } | 512 | } |
488 | 513 | ||
489 | $scope.descriptionkeyPress = function(pitch) { | 514 | $scope.descriptionkeyPress = function(pitch) { |
490 | if (pitch == undefined) { | 515 | if (pitch == undefined) { |
491 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 516 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
492 | } else { | 517 | } else { |
493 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); | 518 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
494 | } | 519 | } |
495 | } | 520 | } |
496 | 521 | ||
497 | $scope.discountkeyPress = function(discount) { | 522 | $scope.discountkeyPress = function(discount) { |
498 | if (discount == undefined) { | 523 | if (discount == undefined) { |
499 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 524 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
500 | } else { | 525 | } else { |
501 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 526 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
502 | } | 527 | } |
503 | } | 528 | } |
504 | 529 | ||
505 | $scope.removeNooError = function() { | 530 | $scope.removeNooError = function() { |
506 | $('#invalidIdea').css('display', 'block'); | 531 | $('#invalidIdea').css('display', 'block'); |
507 | $('#noExist').css('display', 'none'); | 532 | $('#noExist').css('display', 'none'); |
508 | }; | 533 | }; |
509 | 534 | ||
510 | $scope.ideakeyPress = function(financial) { | 535 | $scope.ideakeyPress = function(financial) { |
511 | console.log("financial", financial); | 536 | console.log("financial", financial); |
512 | if (financial == undefined) { | 537 | if (financial == undefined) { |
513 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 538 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
514 | } else { | 539 | } else { |
515 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); | 540 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
516 | } | 541 | } |
517 | } | 542 | } |
518 | 543 | ||
519 | $scope.fundkeyPress = function(financial) { | 544 | $scope.fundkeyPress = function(financial) { |
520 | console.log("financial", financial); | 545 | console.log("financial", financial); |
521 | if (financial == undefined) { | 546 | if (financial == undefined) { |
522 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 547 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
523 | } else { | 548 | } else { |
524 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); | 549 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
525 | } | 550 | } |
526 | } | 551 | } |
527 | 552 | ||
528 | $scope.changeReferalIconColor = function(referalToken){ | 553 | $scope.changeReferalIconColor = function(referalToken){ |
529 | if (referalToken == undefined || referalToken == '') { | 554 | if (referalToken == undefined || referalToken == '') { |
530 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 555 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
531 | }else { | 556 | }else { |
532 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); | 557 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
533 | } | 558 | } |
534 | } | 559 | } |
535 | 560 | ||
536 | }); | 561 | }); |
537 | 562 | ||
538 | scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { | 563 | scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { |
539 | $scope.data = {}; | 564 | $scope.data = {}; |
540 | $scope.check = false; | 565 | $scope.check = false; |
541 | $scope.numberCheck = false; | 566 | $scope.numberCheck = false; |
542 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 567 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
543 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 568 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
544 | $scope.max = 100; | 569 | $scope.max = 100; |
545 | $scope.formPage = false; | 570 | $scope.formPage = false; |
546 | $scope.current = 0; | 571 | $scope.current = 0; |
547 | $scope.payingAmnt = 0; | 572 | $scope.payingAmnt = 0; |
548 | $scope.discountAmount = 0; | 573 | $scope.discountAmount = 0; |
549 | // $scope.data.quantity = "1"; | 574 | // $scope.data.quantity = "1"; |
550 | $scope.check = false; | 575 | $scope.check = false; |
551 | $scope.numberCheck = false; | 576 | $scope.numberCheck = false; |
552 | $scope.paymentResult = {}; | 577 | $scope.paymentResult = {}; |
553 | var data = { | 578 | var data = { |
554 | "amount": $scope.payingAmnt, | 579 | "amount": $scope.payingAmnt, |
555 | "currency": "INR", | 580 | "currency": "INR", |
556 | "status": "pending" | 581 | "status": "pending" |
557 | } | 582 | } |
558 | 583 | ||
559 | $scope.removeError = function() { | 584 | $scope.removeError = function() { |
560 | $('#invalidEmail').css('display', 'none'); | 585 | $('#invalidEmail').css('display', 'none'); |
561 | $('#alreadyExist').css('display', 'none'); | 586 | $('#alreadyExist').css('display', 'none'); |
562 | }; | 587 | }; |
563 | 588 | ||
564 | $scope.emailcheck = function(val) { | 589 | $scope.emailcheck = function(val) { |
565 | if (val == undefined) { | 590 | if (val == undefined) { |
566 | $('#invalidEmail').css('display', 'block'); | 591 | $('#invalidEmail').css('display', 'block'); |
567 | } else { | 592 | } else { |
568 | $('#alreadyExist').css('display', 'block'); | 593 | $('#alreadyExist').css('display', 'block'); |
569 | } | 594 | } |
570 | }; | 595 | }; |
571 | 596 | ||
572 | $scope.removeNoError = function() { | 597 | $scope.removeNoError = function() { |
573 | $('#invalidNumber').css('display', 'none'); | 598 | $('#invalidNumber').css('display', 'none'); |
574 | $('#alreadyExist').css('display', 'none'); | 599 | $('#alreadyExist').css('display', 'none'); |
575 | }; | 600 | }; |
576 | 601 | ||
577 | $scope.numbercheck = function(val) { | 602 | $scope.numbercheck = function(val) { |
578 | if (val == undefined) { | 603 | if (val == undefined) { |
579 | $('#invalidNumber').css('display', 'block'); | 604 | $('#invalidNumber').css('display', 'block'); |
580 | } else { | 605 | } else { |
581 | $('#alreadyExist').css('display', 'block'); | 606 | $('#alreadyExist').css('display', 'block'); |
582 | } | 607 | } |
583 | }; | 608 | }; |
584 | 609 | ||
585 | // $scope.$on('city', function (event, value) { | 610 | // $scope.$on('city', function (event, value) { |
586 | $scope.data.city = localStorage.getItem("city"); | 611 | $scope.data.city = localStorage.getItem("city"); |
587 | console.log("HERE===",$scope.data.city ); | 612 | console.log("HERE===",$scope.data.city ); |
588 | // }); | 613 | // }); |
589 | 614 | ||
590 | $rootScope.tokenCall = function(val) { | 615 | $rootScope.tokenCall = function(val) { |
591 | console.log('val-------->', val); | 616 | console.log('val-------->', val); |
592 | if (val == undefined) { | 617 | if (val == undefined) { |
593 | $('#invalidToken').css('display', 'block'); | 618 | $('#invalidToken').css('display', 'block'); |
594 | } else { | 619 | } else { |
595 | val = val.toUpperCase(); | 620 | val = val.toUpperCase(); |
596 | if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){ | 621 | if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMA99" && $scope.data.city != "Ahmedabad") || (val == "JAI40" && $scope.data.city != "Jaipur")){ |
597 | $scope.tokencheck = false; | 622 | $scope.tokencheck = false; |
598 | return; | 623 | return; |
599 | } | 624 | } |
600 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | 625 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') |
601 | .then(function(searchResult) { | 626 | .then(function(searchResult) { |
602 | console.log("searchResult",searchResult) | 627 | console.log("searchResult",searchResult) |
603 | if (searchResult.data.length == 0) { | 628 | if (searchResult.data.length == 0) { |
604 | $scope.tokencheck = false; | 629 | $scope.tokencheck = false; |
605 | $scope.discountAmount = 0; | 630 | $scope.discountAmount = 0; |
606 | } else { | 631 | } else { |
607 | console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); | 632 | console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); |
608 | $scope.discountpercentage = searchResult.data[0].discount; | 633 | $scope.discountpercentage = searchResult.data[0].discount; |
609 | console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); | 634 | console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); |
610 | $scope.tokencheck = true; | 635 | $scope.tokencheck = true; |
611 | } | 636 | } |
612 | },function(err){ | 637 | },function(err){ |
613 | console.log(err) | 638 | console.log(err) |
614 | }); | 639 | }); |
615 | 640 | ||
616 | } | 641 | } |
617 | }; | 642 | }; |
618 | 643 | ||
619 | $scope.submit = function() { | 644 | $scope.submit = function() { |
620 | $scope.ticketAmnt = 500; | 645 | $scope.ticketAmnt = 500; |
621 | if($scope.tokencheck == false){ | 646 | if($scope.tokencheck == false){ |
622 | $scope.data.referalToken = null; | 647 | $scope.data.referalToken = null; |
623 | } | 648 | } |
624 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 649 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
625 | var x = document.getElementById("snackbar") | 650 | var x = document.getElementById("snackbar") |
626 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 651 | setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
627 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 652 | }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
628 | $scope.infoForm = true; | 653 | $scope.infoForm = true; |
629 | $scope.detail = {}; | 654 | $scope.detail = {}; |
630 | $scope.data.phone = "+91"+$scope.data.number; | 655 | $scope.data.phone = "+91"+$scope.data.number; |
631 | if($scope.data.referalToken == null){ | 656 | if($scope.data.referalToken == null){ |
632 | $scope.data.referalToken = "N.A." | 657 | $scope.data.referalToken = "N.A." |
633 | } | 658 | } |
634 | $http({ | 659 | $http({ |
635 | method: 'POST', | 660 | method: 'POST', |
636 | url: BASE_URL+'/applicants', | 661 | url: BASE_URL+'/applicants', |
637 | data: $scope.data, | 662 | data: $scope.data, |
638 | headers: {} | 663 | headers: {} |
639 | }).then(function mySuccess(result) { | 664 | }).then(function mySuccess(result) { |
640 | console.log("=====result=====",result) | 665 | console.log("=====result=====",result) |
641 | $scope.detail = result; | 666 | $scope.detail = result; |
642 | data.applicantId = result.data.id; | 667 | data.applicantId = result.data.id; |
643 | $scope.userId = result.data.id; | 668 | $scope.userId = result.data.id; |
644 | console.log("=====data=====",data) | 669 | console.log("=====data=====",data) |
645 | var amount = $scope.ticketAmnt * 100 | 670 | var amount = $scope.ticketAmnt * 100 |
646 | if($scope.tokencheck == true){ | 671 | if($scope.tokencheck == true){ |
647 | var amount = $scope.ticketAmnt | 672 | var amount = $scope.ticketAmnt |
648 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); | 673 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); |
649 | console.log("resultcity===",$scope.data.city) | 674 | console.log("resultcity===",$scope.data.city) |
650 | if($scope.discountpercentage == "100") { | 675 | if($scope.discountpercentage == "100") { |
651 | $scope.discountpercentage = "99.8"; | 676 | $scope.discountpercentage = "99.8"; |
652 | console.log("$scope.discountpercentage====",$scope.discountpercentage) | 677 | console.log("$scope.discountpercentage====",$scope.discountpercentage) |
653 | } | 678 | } |
654 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); | 679 | console.log("====$scope.discountpercentage====",$scope.discountpercentage); |
655 | $scope.percDiscount = $scope.discountpercentage/100; | 680 | $scope.percDiscount = $scope.discountpercentage/100; |
656 | console.log("====$scope.percDiscount====",$scope.percDiscount); | 681 | console.log("====$scope.percDiscount====",$scope.percDiscount); |
657 | console.log("====amount=====",amount); | 682 | console.log("====amount=====",amount); |
658 | $scope.discountAmount = amount * $scope.percDiscount; | 683 | $scope.discountAmount = amount * $scope.percDiscount; |
659 | console.log("finalAmount====>",$scope.discountAmount) | 684 | console.log("finalAmount====>",$scope.discountAmount) |
660 | } | 685 | } |
661 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 686 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
662 | console.log("$scope.taxTotal----",taxAmount) | 687 | console.log("$scope.taxTotal----",taxAmount) |
663 | $scope.payingAmnt = taxAmount; | 688 | $scope.payingAmnt = taxAmount; |
664 | console.log("====$scope.payingAmnt====",$scope.payingAmnt) | 689 | console.log("====$scope.payingAmnt====",$scope.payingAmnt) |
665 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 690 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
666 | data.amount = $scope.payingAmnt; | 691 | data.amount = $scope.payingAmnt; |
667 | console.log("data.amount==",data.amount) | 692 | console.log("data.amount==",data.amount) |
668 | if($scope.detail != null){ | 693 | if($scope.detail != null){ |
669 | $http({ | 694 | $http({ |
670 | method: 'POST', | 695 | method: 'POST', |
671 | url: BASE_URL+'/payments', | 696 | url: BASE_URL+'/payments', |
672 | data: data, | 697 | data: data, |
673 | headers: {} | 698 | headers: {} |
674 | }).then(function mySuccess(paymentResult) { | 699 | }).then(function mySuccess(paymentResult) { |
675 | $scope.paymentResult = paymentResult; | 700 | $scope.paymentResult = paymentResult; |
676 | }, function myError(error) { | 701 | }, function myError(error) { |
677 | }); | 702 | }); |
678 | } | 703 | } |
679 | var i = 0; | 704 | var i = 0; |
680 | $scope.payingAmnt = $scope.payingAmnt * 100; | 705 | $scope.payingAmnt = $scope.payingAmnt * 100; |
681 | var options = { | 706 | var options = { |
682 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 707 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
683 | "key": "rzp_live_mkmCb4FkstuWaS", | 708 | "key": "rzp_live_mkmCb4FkstuWaS", |
684 | "amount": $scope.payingAmnt, | 709 | "amount": $scope.payingAmnt, |
685 | 710 | ||
686 | "name": "Startup Jalsa", | 711 | "name": "Startup Jalsa", |
687 | "description":"amount", | 712 | "description":"amount", |
688 | "currency": "INR", | 713 | "currency": "INR", |
689 | "status": "done", | 714 | "status": "done", |
690 | 715 | ||
691 | "prefill": { | 716 | "prefill": { |
692 | "email": $scope.detail.email, | 717 | "email": $scope.detail.email, |
693 | "contact": $scope.detail.phone | 718 | "contact": $scope.detail.phone |
694 | }, | 719 | }, |
695 | 720 | ||
696 | "theme": { | 721 | "theme": { |
697 | "color": "#2196f3 ", | 722 | "color": "#2196f3 ", |
698 | "image_padding":"NO" | 723 | "image_padding":"NO" |
699 | }, | 724 | }, |
700 | "modal": { | 725 | "modal": { |
701 | "ondismiss": function(){ | 726 | "ondismiss": function(){ |
702 | } | 727 | } |
703 | }, | 728 | }, |
704 | "handler": function (response){ | 729 | "handler": function (response){ |
705 | createPayment(response); | 730 | createPayment(response); |
706 | } | 731 | } |
707 | }; | 732 | }; |
708 | var rzp1 = new Razorpay(options); | 733 | var rzp1 = new Razorpay(options); |
709 | rzp1.open(); | 734 | rzp1.open(); |
710 | $scope.paymentResponse = {}; | 735 | $scope.paymentResponse = {}; |
711 | function createPayment(response){ | 736 | function createPayment(response){ |
712 | console.log("response12333333",response) | 737 | console.log("response12333333",response) |
713 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 738 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
714 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 739 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
715 | $scope.paymentResponse.amount = data.amount; | 740 | $scope.paymentResponse.amount = data.amount; |
716 | $scope.paymentResponse.currency = "INR"; | 741 | $scope.paymentResponse.currency = "INR"; |
717 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 742 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
718 | console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) | 743 | console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) |
719 | $http({ | 744 | $http({ |
720 | method: 'PUT', | 745 | method: 'PUT', |
721 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 746 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
722 | data: $scope.paymentResponse, | 747 | data: $scope.paymentResponse, |
723 | headers: {} | 748 | headers: {} |
724 | }).then(function mySuccess(searchResult) { | 749 | }).then(function mySuccess(searchResult) { |
725 | console.log("searchResult",searchResult) | 750 | console.log("searchResult",searchResult) |
726 | $location.path("/confirmation") | 751 | $location.path("/confirmation") |
727 | }, function myError(error) { | 752 | }, function myError(error) { |
728 | }); | 753 | }); |
729 | } | 754 | } |
730 | //} | 755 | //} |
731 | 756 | ||
732 | }, function myError(error) { | 757 | }, function myError(error) { |
733 | 758 | ||
734 | }); | 759 | }); |
735 | 760 | ||
736 | } | 761 | } |
737 | 762 | ||
738 | } | 763 | } |
739 | 764 | ||
740 | }); | 765 | }); |
741 | 766 | ||
742 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { | 767 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
743 | $scope.data = {}; | 768 | $scope.data = {}; |
744 | $scope.check = false; | 769 | $scope.check = false; |
745 | $scope.numberCheck = false; | 770 | $scope.numberCheck = false; |
746 | 771 | ||
747 | $scope.submit = function() { | 772 | $scope.submit = function() { |
748 | console.log($scope.data.name) | 773 | console.log($scope.data.name) |
749 | var randomNumber = ""+Math.random(); | 774 | var randomNumber = ""+Math.random(); |
750 | var nameSpliced = $scope.data.name.slice(0,5); | 775 | var nameSpliced = $scope.data.name.slice(0,5); |
751 | var numberSpliced = randomNumber.slice(2,4);; | 776 | var numberSpliced = randomNumber.slice(2,4);; |
752 | $scope.data.referalToken = nameSpliced+numberSpliced; | 777 | $scope.data.referalToken = nameSpliced+numberSpliced; |
753 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 778 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
754 | console.log("dsdfs",numberSpliced); | 779 | console.log("dsdfs",numberSpliced); |
755 | $http({ | 780 | $http({ |
756 | method: 'POST', | 781 | method: 'POST', |
757 | url: BASE_URL + '/ambassadors', | 782 | url: BASE_URL + '/ambassadors', |
758 | data: $scope.data, | 783 | data: $scope.data, |
759 | headers: {} | 784 | headers: {} |
760 | }).then(function mySuccess(result) { | 785 | }).then(function mySuccess(result) { |
761 | console.log("result", result) | 786 | console.log("result", result) |
762 | $scope.detail = result; | 787 | $scope.detail = result; |
763 | $('#myModal').modal('show'); | 788 | $('#myModal').modal('show'); |
764 | $scope.data.name = ''; | 789 | $scope.data.name = ''; |
765 | $scope.data.email = ''; | 790 | $scope.data.email = ''; |
766 | $scope.data.mobile = ''; | 791 | $scope.data.mobile = ''; |
767 | //$scope.data.discount = ''; | 792 | //$scope.data.discount = ''; |
768 | 793 | ||
769 | }, function myError(error) { | 794 | }, function myError(error) { |
770 | console.log(error) | 795 | console.log(error) |
771 | console.log(error.data.error.message) | 796 | console.log(error.data.error.message) |
772 | }); | 797 | }); |
773 | } | 798 | } |
774 | }); | 799 | }); |
775 | 800 | ||
776 | 801 | ||
777 | 802 | ||
778 | 803 | ||
779 | 804 |