Commit be44091b5e226115d744b5f78d79a8c0309ab024
1 parent
4c87e7b606
Exists in
master
and in
1 other branch
update
Showing
2 changed files
with
8 additions
and
5 deletions
Show diff stats
pages/verify.html
1 | <div class="panel-heading" style="background-color: #42b549;"><img src="../images/white.png" style="width: 100px;"></div> | 1 | <div class="panel-heading" style="background-color: #42b549;"><img src="../images/white.png" style="width: 100px;"></div> |
2 | <div class="container container1"> | 2 | <div class="container container1"> |
3 | <div class="row"> | 3 | <div class="row"> |
4 | <div class="col-md-6 col-md-offset-3"> | 4 | <div class="col-md-6 col-md-offset-3"> |
5 | <div class="panel panel-default"> | 5 | <div class="panel panel-default"> |
6 | <div class="panel-body"> | 6 | <div class="panel-body"> |
7 | <div class="box box-info"> | 7 | <div class="box box-info"> |
8 | <div class="box-body"> | 8 | <div class="box-body"> |
9 | <div style="text-align:center;padding-bottom:2%"> | 9 | <div style="text-align:center;padding-bottom:2%"> |
10 | <h4>Pending Payment</h4> | 10 | <h4>Pending Payment</h4> |
11 | </div> | 11 | </div> |
12 | <div class="clearfix"></div> | 12 | <div class="clearfix"></div> |
13 | <div style="margin:5px 0 5px 0;text-transform: capitalize;"> | 13 | <div style="margin:5px 0 5px 0;"> |
14 | <div class="col-sm-5 col-xs-6 tital">Email:</div> | 14 | <div class="col-sm-5 col-xs-6 tital">Email:</div> |
15 | <div class="col-sm-7 col-xs-6">{{data.email}}</div> | 15 | <div class="col-sm-7 col-xs-6">{{data.email}}</div> |
16 | <div class="clearfix"></div> | 16 | <div class="clearfix"></div> |
17 | <div class="bot-border"></div> | 17 | <div class="bot-border"></div> |
18 | <div class="col-sm-5 col-xs-6 tital">Amount:</div> | 18 | <div class="col-sm-5 col-xs-6 tital">Amount:</div> |
19 | <div class="col-sm-7 col-xs-6">{{paymentRecord[0].amount}}</div> | 19 | <div class="col-sm-7 col-xs-6">{{paymentRecord[0].amount}}</div> |
20 | <div class="clearfix"></div> | 20 | <div class="clearfix"></div> |
21 | <div class="bot-border"></div> | 21 | <div class="bot-border"></div> |
22 | <div class="col-sm-5 col-xs-6 tital">Currency:</div> | 22 | <div class="col-sm-5 col-xs-6 tital">Currency:</div> |
23 | <div class="col-sm-7 col-xs-6">INR</div> | 23 | <div class="col-sm-7 col-xs-6">INR</div> |
24 | <div class="clearfix"></div> | 24 | <div class="clearfix"></div> |
25 | <div class="bot-border"></div> | 25 | <div class="bot-border"></div> |
26 | <div class="col-sm-5 col-xs-6 tital">Status:</div> | 26 | <div class="col-sm-5 col-xs-6 tital">Status:</div> |
27 | <div class="col-sm-7 col-xs-6">{{paymentRecord[0].status}}</div> | 27 | <div class="col-sm-7 col-xs-6" style="text-transform: capitalize;">{{paymentRecord[0].status}}</div> |
28 | <div class="clearfix"></div> | 28 | <div class="clearfix"></div> |
29 | <div class="bot-border"></div> | 29 | <div class="bot-border"></div> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | <div style="text-align:center; margin-top:6%;margin-bottom:5%"> | 33 | <div style="text-align:center; margin-top:6%;margin-bottom:5%"> |
34 | <input type="button" class="btn submit-button" value="Pay Now" ng-click="update()"> | 34 | <input type="button" class="btn submit-button" value="Pay Now" ng-click="update()"> |
35 | </div> | 35 | </div> |
36 | </div> | 36 | </div> |
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | <div class="clearfix"></div> | 41 | <div class="clearfix"></div> |
42 | <footer style="margin-top:7%"> | 42 | <footer style="margin-top:7%"> |
43 | <img id="footer" class="img-responsive banner"> | 43 | <img id="footer" class="img-responsive banner"> |
44 | <center class="footer"> Powered By <a class="footer-link" href="http://www.viithiisys.com/" target="_blank">Viithiisys Technolgies.</a> | 44 | <center class="footer"> Powered By <a class="footer-link" href="http://www.viithiisys.com/" target="_blank">Viithiisys Technolgies.</a> |
45 | </center> | 45 | </center> |
46 | </footer> | 46 | </footer> |
47 | <span ng-show="span == true"> | 47 | <span ng-show="span == true"> |
48 | <span id="chennai"></span> | 48 | <span id="chennai"></span> |
49 | <span id="pune"></span> | 49 | <span id="pune"></span> |
50 | <span id="mumbai"></span> | 50 | <span id="mumbai"></span> |
51 | <span id="hyderabad"></span> | 51 | <span id="hyderabad"></span> |
52 | <span id="chandigarh"></span> | 52 | <span id="chandigarh"></span> |
53 | <span id="delhi"></span> | 53 | <span id="delhi"></span> |
54 | <span id="ahmedabad"></span> | 54 | <span id="ahmedabad"></span> |
55 | <span id="bangalore"></span> | 55 | <span id="bangalore"></span> |
56 | <span id="jaipur"></span> | 56 | <span id="jaipur"></span> |
57 | <span id="maininvest"></span> | 57 | <span id="maininvest"></span> |
58 | </span> | 58 | </span> |
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) { | 5 | scotchApp.config(function($routeProvider) { |
6 | $routeProvider | 6 | $routeProvider |
7 | 7 | ||
8 | // route for the Home page | 8 | // route for the Home page |
9 | .when('/', { | 9 | .when('/', { |
10 | templateUrl: 'pages/Home.html', | 10 | templateUrl: 'pages/Home.html', |
11 | controller: 'mainController' | 11 | controller: 'mainController' |
12 | }) | 12 | }) |
13 | 13 | ||
14 | // route for the registration page | 14 | // route for the registration page |
15 | .when('/registration', { | 15 | .when('/registration', { |
16 | templateUrl: 'pages/registration.html', | 16 | templateUrl: 'pages/registration.html', |
17 | controller: 'mainController' | 17 | controller: 'mainController' |
18 | }) | 18 | }) |
19 | 19 | ||
20 | // route for the paymentVerify page | 20 | // route for the paymentVerify page |
21 | .when('/pendingPayment/:id', { | 21 | .when('/pendingPayment/:id', { |
22 | templateUrl: 'pages/verify.html', | 22 | templateUrl: 'pages/verify.html', |
23 | controller: 'verifyController' | 23 | controller: 'verifyController' |
24 | }) | 24 | }) |
25 | 25 | ||
26 | // route for the ambassador page | 26 | // route for the ambassador page |
27 | .when('/startupJalsaPromocode', { | 27 | .when('/startupJalsaPromocode', { |
28 | templateUrl: 'pages/ambassador.html', | 28 | templateUrl: 'pages/ambassador.html', |
29 | controller: 'ambassadorController' | 29 | controller: 'ambassadorController' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | // route for the confirmation page | 32 | // route for the confirmation page |
33 | .when('/confirmation', { | 33 | .when('/confirmation', { |
34 | templateUrl: 'pages/confirmation.html', | 34 | templateUrl: 'pages/confirmation.html', |
35 | controller: 'mainController' | 35 | controller: 'mainController' |
36 | }) | 36 | }) |
37 | 37 | ||
38 | }); | 38 | }); |
39 | 39 | ||
40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 40 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
41 | // Add configuration code as desired | 41 | // Add configuration code as desired |
42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code | 42 | AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
43 | 43 | ||
44 | // Track all routes (default is true). | 44 | // Track all routes (default is true). |
45 | AnalyticsProvider.trackPages(true); | 45 | AnalyticsProvider.trackPages(true); |
46 | 46 | ||
47 | // Track all URL query params (default is false). | 47 | // Track all URL query params (default is false). |
48 | AnalyticsProvider.trackUrlParams(true); | 48 | AnalyticsProvider.trackUrlParams(true); |
49 | 49 | ||
50 | }]).run(['Analytics', function(Analytics) { }]); | 50 | }]).run(['Analytics', function(Analytics) { }]); |
51 | 51 | ||
52 | scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/v1") | 52 | scotchApp.constant("BASE_URL", "http://139.59.68.74:4001/v1") |
53 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | 53 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
54 | 54 | ||
55 | // create the controller and inject Angular's $scope | 55 | // create the controller and inject Angular's $scope |
56 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { | 56 | scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
57 | $scope.data = { | 57 | $scope.data = { |
58 | show: true, | 58 | show: true, |
59 | hide: false | 59 | hide: false |
60 | }; | 60 | }; |
61 | 61 | ||
62 | var maininvest = new Date("Nov 30, 2017 12:00:00").getTime(); | 62 | var maininvest = new Date("Nov 30, 2017 12:00:00").getTime(); |
63 | // Update the count down every 1 second | 63 | // Update the count down every 1 second |
64 | var x = setInterval(function() { | 64 | var x = setInterval(function() { |
65 | // Get todays date and time | 65 | // Get todays date and time |
66 | var now = new Date().getTime(); | 66 | var now = new Date().getTime(); |
67 | // Find the distance between now an the count down date | 67 | // Find the distance between now an the count down date |
68 | var distance = maininvest - now; | 68 | var distance = maininvest - now; |
69 | // Time calculations for days, hours, minutes and seconds | 69 | // Time calculations for days, hours, minutes and seconds |
70 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 70 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
71 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 71 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
72 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 72 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
73 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 73 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
74 | $scope.timer = days + "d " + hours + "h " | 74 | $scope.timer = days + "d " + hours + "h " |
75 | + minutes + "m " + seconds + "s " | 75 | + minutes + "m " + seconds + "s " |
76 | // Output the result in an element with id="demo" | 76 | // Output the result in an element with id="demo" |
77 | document.getElementById("maininvest").innerHTML = days + "d " + hours + "h " | 77 | document.getElementById("maininvest").innerHTML = days + "d " + hours + "h " |
78 | + minutes + "m " + seconds + "s "; | 78 | + minutes + "m " + seconds + "s "; |
79 | // If the count down is over, write some text | 79 | // If the count down is over, write some text |
80 | if (distance < 0) { | 80 | if (distance < 0) { |
81 | // $scope.extendedAmount = | 81 | // $scope.extendedAmount = |
82 | clearInterval(x); | 82 | clearInterval(x); |
83 | document.getElementById("maininvest").innerHTML = "EXPIRED"; | 83 | document.getElementById("maininvest").innerHTML = "EXPIRED"; |
84 | } | 84 | } |
85 | }, 1000); | 85 | }, 1000); |
86 | 86 | ||
87 | var pune = new Date("Nov 11, 2017 12:00:00").getTime(); | 87 | var pune = new Date("Nov 11, 2017 12:00:00").getTime(); |
88 | // Update the count down every 1 second | 88 | // Update the count down every 1 second |
89 | var x = setInterval(function() { | 89 | var x = setInterval(function() { |
90 | // Get todays date and time | 90 | // Get todays date and time |
91 | var now = new Date().getTime(); | 91 | var now = new Date().getTime(); |
92 | // Find the distance between now an the count down date | 92 | // Find the distance between now an the count down date |
93 | var distance = pune - now; | 93 | var distance = pune - now; |
94 | // Time calculations for days, hours, minutes and seconds | 94 | // Time calculations for days, hours, minutes and seconds |
95 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 95 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
96 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 96 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
97 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 97 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
98 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 98 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
99 | $scope.timer = days + "d " + hours + "h " | 99 | $scope.timer = days + "d " + hours + "h " |
100 | + minutes + "m " + seconds + "s " | 100 | + minutes + "m " + seconds + "s " |
101 | // Output the result in an element with id="demo" | 101 | // Output the result in an element with id="demo" |
102 | document.getElementById("pune").innerHTML = days + "d " + hours + "h " | 102 | document.getElementById("pune").innerHTML = days + "d " + hours + "h " |
103 | + minutes + "m " + seconds + "s "; | 103 | + minutes + "m " + seconds + "s "; |
104 | // If the count down is over, write some text | 104 | // If the count down is over, write some text |
105 | if (distance < 0) { | 105 | if (distance < 0) { |
106 | clearInterval(x); | 106 | clearInterval(x); |
107 | document.getElementById("pune").innerHTML = "EXPIRED"; | 107 | document.getElementById("pune").innerHTML = "EXPIRED"; |
108 | } | 108 | } |
109 | }, 1000); | 109 | }, 1000); |
110 | 110 | ||
111 | var mumbai = new Date("Nov 11, 2017 12:00:00").getTime(); | 111 | var mumbai = new Date("Nov 11, 2017 12:00:00").getTime(); |
112 | // Update the count down every 1 second | 112 | // Update the count down every 1 second |
113 | var x = setInterval(function() { | 113 | var x = setInterval(function() { |
114 | // Get todays date and time | 114 | // Get todays date and time |
115 | var now = new Date().getTime(); | 115 | var now = new Date().getTime(); |
116 | // Find the distance between now an the count down date | 116 | // Find the distance between now an the count down date |
117 | var distance = mumbai - now; | 117 | var distance = mumbai - now; |
118 | // Time calculations for days, hours, minutes and seconds | 118 | // Time calculations for days, hours, minutes and seconds |
119 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 119 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
120 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 120 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
121 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 121 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
122 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 122 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
123 | $scope.timer = days + "d " + hours + "h " | 123 | $scope.timer = days + "d " + hours + "h " |
124 | + minutes + "m " + seconds + "s " | 124 | + minutes + "m " + seconds + "s " |
125 | // Output the result in an element with id="demo" | 125 | // Output the result in an element with id="demo" |
126 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " | 126 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " |
127 | + minutes + "m " + seconds + "s "; | 127 | + minutes + "m " + seconds + "s "; |
128 | // If the count down is over, write some text | 128 | // If the count down is over, write some text |
129 | if (distance < 0) { | 129 | if (distance < 0) { |
130 | clearInterval(x); | 130 | clearInterval(x); |
131 | document.getElementById("mumbai").innerHTML = "EXPIRED"; | 131 | document.getElementById("mumbai").innerHTML = "EXPIRED"; |
132 | } | 132 | } |
133 | }, 1000); | 133 | }, 1000); |
134 | 134 | ||
135 | var ahmedabad = new Date("Nov 13, 2017 12:00:00").getTime(); | 135 | var ahmedabad = new Date("Nov 13, 2017 12:00:00").getTime(); |
136 | // Update the count down every 1 second | 136 | // Update the count down every 1 second |
137 | var x = setInterval(function() { | 137 | var x = setInterval(function() { |
138 | // Get todays date and time | 138 | // Get todays date and time |
139 | var now = new Date().getTime(); | 139 | var now = new Date().getTime(); |
140 | // Find the distance between now an the count down date | 140 | // Find the distance between now an the count down date |
141 | var distance = ahmedabad - now; | 141 | var distance = ahmedabad - now; |
142 | // Time calculations for days, hours, minutes and seconds | 142 | // Time calculations for days, hours, minutes and seconds |
143 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 143 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
144 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 144 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
145 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 145 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
146 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 146 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
147 | $scope.timer = days + "d " + hours + "h " | 147 | $scope.timer = days + "d " + hours + "h " |
148 | + minutes + "m " + seconds + "s " | 148 | + minutes + "m " + seconds + "s " |
149 | // Output the result in an element with id="demo" | 149 | // Output the result in an element with id="demo" |
150 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " | 150 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " |
151 | + minutes + "m " + seconds + "s "; | 151 | + minutes + "m " + seconds + "s "; |
152 | // If the count down is over, write some text | 152 | // If the count down is over, write some text |
153 | if (distance < 0) { | 153 | if (distance < 0) { |
154 | clearInterval(x); | 154 | clearInterval(x); |
155 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; | 155 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; |
156 | } | 156 | } |
157 | }, 1000); | 157 | }, 1000); |
158 | 158 | ||
159 | var jaipur = new Date("Nov 15, 2017 12:00:00").getTime(); | 159 | var jaipur = new Date("Nov 15, 2017 12:00:00").getTime(); |
160 | // Update the count down every 1 second | 160 | // Update the count down every 1 second |
161 | var x = setInterval(function() { | 161 | var x = setInterval(function() { |
162 | // Get todays date and time | 162 | // Get todays date and time |
163 | var now = new Date().getTime(); | 163 | var now = new Date().getTime(); |
164 | // Find the distance between now an the count down date | 164 | // Find the distance between now an the count down date |
165 | var distance = jaipur - now; | 165 | var distance = jaipur - now; |
166 | // Time calculations for days, hours, minutes and seconds | 166 | // Time calculations for days, hours, minutes and seconds |
167 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 167 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
168 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 168 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
169 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 169 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
170 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 170 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
171 | $scope.timer = days + "d " + hours + "h " | 171 | $scope.timer = days + "d " + hours + "h " |
172 | + minutes + "m " + seconds + "s " | 172 | + minutes + "m " + seconds + "s " |
173 | // Output the result in an element with id="demo" | 173 | // Output the result in an element with id="demo" |
174 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " | 174 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " |
175 | + minutes + "m " + seconds + "s "; | 175 | + minutes + "m " + seconds + "s "; |
176 | // If the count down is over, write some text | 176 | // If the count down is over, write some text |
177 | if (distance < 0) { | 177 | if (distance < 0) { |
178 | clearInterval(x); | 178 | clearInterval(x); |
179 | document.getElementById("jaipur").innerHTML = "EXPIRED"; | 179 | document.getElementById("jaipur").innerHTML = "EXPIRED"; |
180 | } | 180 | } |
181 | }, 1000); | 181 | }, 1000); |
182 | 182 | ||
183 | var bangalore = new Date("Nov 21, 2017 12:00:00").getTime(); | 183 | var bangalore = new Date("Nov 21, 2017 12:00:00").getTime(); |
184 | // Update the count down every 1 second | 184 | // Update the count down every 1 second |
185 | var x = setInterval(function() { | 185 | var x = setInterval(function() { |
186 | // Get todays date and time | 186 | // Get todays date and time |
187 | var now = new Date().getTime(); | 187 | var now = new Date().getTime(); |
188 | // Find the distance between now an the count down date | 188 | // Find the distance between now an the count down date |
189 | var distance = bangalore - now; | 189 | var distance = bangalore - now; |
190 | // Time calculations for days, hours, minutes and seconds | 190 | // Time calculations for days, hours, minutes and seconds |
191 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 191 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
192 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 192 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
193 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 193 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
194 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 194 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
195 | $scope.timer = days + "d " + hours + "h " | 195 | $scope.timer = days + "d " + hours + "h " |
196 | + minutes + "m " + seconds + "s " | 196 | + minutes + "m " + seconds + "s " |
197 | // Output the result in an element with id="demo" | 197 | // Output the result in an element with id="demo" |
198 | document.getElementById("bangalore").innerHTML = days + "d " + hours + "h " | 198 | document.getElementById("bangalore").innerHTML = days + "d " + hours + "h " |
199 | + minutes + "m " + seconds + "s "; | 199 | + minutes + "m " + seconds + "s "; |
200 | // If the count down is over, write some text | 200 | // If the count down is over, write some text |
201 | if (distance < 0) { | 201 | if (distance < 0) { |
202 | clearInterval(x); | 202 | clearInterval(x); |
203 | document.getElementById("bangalore").innerHTML = "EXPIRED"; | 203 | document.getElementById("bangalore").innerHTML = "EXPIRED"; |
204 | } | 204 | } |
205 | }, 1000); | 205 | }, 1000); |
206 | 206 | ||
207 | var hyderabad = new Date("Nov 19, 2017 12:00:00").getTime(); | 207 | var hyderabad = new Date("Nov 19, 2017 12:00:00").getTime(); |
208 | // Update the count down every 1 second | 208 | // Update the count down every 1 second |
209 | var x = setInterval(function() { | 209 | var x = setInterval(function() { |
210 | // Get todays date and time | 210 | // Get todays date and time |
211 | var now = new Date().getTime(); | 211 | var now = new Date().getTime(); |
212 | // Find the distance between now an the count down date | 212 | // Find the distance between now an the count down date |
213 | var distance = hyderabad - now; | 213 | var distance = hyderabad - now; |
214 | // Time calculations for days, hours, minutes and seconds | 214 | // Time calculations for days, hours, minutes and seconds |
215 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 215 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
216 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 216 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
217 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 217 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
218 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 218 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
219 | $scope.timer = days + "d " + hours + "h " | 219 | $scope.timer = days + "d " + hours + "h " |
220 | + minutes + "m " + seconds + "s " | 220 | + minutes + "m " + seconds + "s " |
221 | // Output the result in an element with id="demo" | 221 | // Output the result in an element with id="demo" |
222 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " | 222 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " |
223 | + minutes + "m " + seconds + "s "; | 223 | + minutes + "m " + seconds + "s "; |
224 | // If the count down is over, write some text | 224 | // If the count down is over, write some text |
225 | if (distance < 0) { | 225 | if (distance < 0) { |
226 | clearInterval(x); | 226 | clearInterval(x); |
227 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; | 227 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; |
228 | } | 228 | } |
229 | }, 1000); | 229 | }, 1000); |
230 | 230 | ||
231 | var delhi = new Date("Nov 27, 2017 12:00:00").getTime(); | 231 | var delhi = new Date("Nov 27, 2017 12:00:00").getTime(); |
232 | // Update the count down every 1 second | 232 | // Update the count down every 1 second |
233 | var x = setInterval(function() { | 233 | var x = setInterval(function() { |
234 | // Get todays date and time | 234 | // Get todays date and time |
235 | var now = new Date().getTime(); | 235 | var now = new Date().getTime(); |
236 | // Find the distance between now an the count down date | 236 | // Find the distance between now an the count down date |
237 | var distance = delhi - now; | 237 | var distance = delhi - now; |
238 | // Time calculations for days, hours, minutes and seconds | 238 | // Time calculations for days, hours, minutes and seconds |
239 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 239 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
240 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 240 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
241 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 241 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
242 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 242 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
243 | $scope.timer = days + "d " + hours + "h " | 243 | $scope.timer = days + "d " + hours + "h " |
244 | + minutes + "m " + seconds + "s " | 244 | + minutes + "m " + seconds + "s " |
245 | // Output the result in an element with id="demo" | 245 | // Output the result in an element with id="demo" |
246 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " | 246 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " |
247 | + minutes + "m " + seconds + "s "; | 247 | + minutes + "m " + seconds + "s "; |
248 | // If the count down is over, write some text | 248 | // If the count down is over, write some text |
249 | if (distance < 0) { | 249 | if (distance < 0) { |
250 | clearInterval(x); | 250 | clearInterval(x); |
251 | document.getElementById("delhi").innerHTML = "EXPIRED"; | 251 | document.getElementById("delhi").innerHTML = "EXPIRED"; |
252 | } | 252 | } |
253 | }, 1000); | 253 | }, 1000); |
254 | 254 | ||
255 | var chandigarh = new Date("Nov 30, 2017 12:00:00").getTime(); | 255 | var chandigarh = new Date("Nov 30, 2017 12:00:00").getTime(); |
256 | // Update the count down every 1 second | 256 | // Update the count down every 1 second |
257 | var x = setInterval(function() { | 257 | var x = setInterval(function() { |
258 | // Get todays date and time | 258 | // Get todays date and time |
259 | var now = new Date().getTime(); | 259 | var now = new Date().getTime(); |
260 | // Find the distance between now an the count down date | 260 | // Find the distance between now an the count down date |
261 | var distance = chandigarh - now; | 261 | var distance = chandigarh - now; |
262 | // Time calculations for days, hours, minutes and seconds | 262 | // Time calculations for days, hours, minutes and seconds |
263 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 263 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
264 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 264 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
265 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 265 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
266 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 266 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
267 | $scope.timer = days + "d " + hours + "h " | 267 | $scope.timer = days + "d " + hours + "h " |
268 | + minutes + "m " + seconds + "s " | 268 | + minutes + "m " + seconds + "s " |
269 | // Output the result in an element with id="demo" | 269 | // Output the result in an element with id="demo" |
270 | document.getElementById("chandigarh").innerHTML = days + "d " + hours + "h " | 270 | document.getElementById("chandigarh").innerHTML = days + "d " + hours + "h " |
271 | + minutes + "m " + seconds + "s "; | 271 | + minutes + "m " + seconds + "s "; |
272 | // If the count down is over, write some text | 272 | // If the count down is over, write some text |
273 | if (distance < 0) { | 273 | if (distance < 0) { |
274 | clearInterval(x); | 274 | clearInterval(x); |
275 | document.getElementById("chandigarh").innerHTML = "EXPIRED"; | 275 | document.getElementById("chandigarh").innerHTML = "EXPIRED"; |
276 | } | 276 | } |
277 | }, 1000); | 277 | }, 1000); |
278 | 278 | ||
279 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 279 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
280 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 280 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
281 | // $scope.Textshow = "yes" | 281 | // $scope.Textshow = "yes" |
282 | $scope.max = 100; | 282 | $scope.max = 100; |
283 | $scope.formPage = false; | 283 | $scope.formPage = false; |
284 | $scope.current = 0; | 284 | $scope.current = 0; |
285 | $scope.payingAmnt = 0; | 285 | $scope.payingAmnt = 0; |
286 | if ($scope.data.stage == 'select') { | 286 | if ($scope.data.stage == 'select') { |
287 | 287 | ||
288 | } | 288 | } |
289 | 289 | ||
290 | //$scope.author = 'Swarn Singh'; | 290 | //$scope.author = 'Swarn Singh'; |
291 | $scope.data = {}; | 291 | $scope.data = {}; |
292 | $scope.data.stage = 'Idea'; | 292 | $scope.data.stage = 'Idea'; |
293 | $scope.discountAmount = 0; | 293 | $scope.discountAmount = 0; |
294 | $scope.check = false; | 294 | $scope.check = false; |
295 | $scope.numberCheck = false; | 295 | $scope.numberCheck = false; |
296 | $scope.paymentResult = {}; | 296 | $scope.paymentResult = {}; |
297 | var data = { | 297 | var data = { |
298 | "amount": $scope.payingAmnt, | 298 | "amount": $scope.payingAmnt, |
299 | "currency": "INR", | 299 | "currency": "INR", |
300 | "status": "pending" | 300 | "status": "pending" |
301 | } | 301 | } |
302 | 302 | ||
303 | /*open videos in modal*/ | 303 | /*open videos in modal*/ |
304 | // $scope.openyoutube16 = function(){ | 304 | // $scope.openyoutube16 = function(){ |
305 | // $('#videoModel').modal('show'); | 305 | // $('#videoModel').modal('show'); |
306 | // } | 306 | // } |
307 | 307 | ||
308 | // $scope.openyoutube17 = function(){ | 308 | // $scope.openyoutube17 = function(){ |
309 | // $('#videoModels').modal('show'); | 309 | // $('#videoModels').modal('show'); |
310 | // } | 310 | // } |
311 | 311 | ||
312 | // $scope.closeModal = function(){ | 312 | // $scope.closeModal = function(){ |
313 | // var url = $('#youtubePlayer').attr('src'); | 313 | // var url = $('#youtubePlayer').attr('src'); |
314 | // $('#youtubePlayer').attr('src', ''); | 314 | // $('#youtubePlayer').attr('src', ''); |
315 | // $('#youtubePlayer').attr('src', url); | 315 | // $('#youtubePlayer').attr('src', url); |
316 | // } | 316 | // } |
317 | 317 | ||
318 | 318 | ||
319 | // $scope.closed = function(){ | 319 | // $scope.closed = function(){ |
320 | // var url = $('#youtubePlayersss').attr('src'); | 320 | // var url = $('#youtubePlayersss').attr('src'); |
321 | // $('#youtubePlayersss').attr('src', ''); | 321 | // $('#youtubePlayersss').attr('src', ''); |
322 | // $('#youtubePlayersss').attr('src', url); | 322 | // $('#youtubePlayersss').attr('src', url); |
323 | // } | 323 | // } |
324 | /*open videos ends here*/ | 324 | /*open videos ends here*/ |
325 | $scope.apply = function() { | 325 | $scope.apply = function() { |
326 | Analytics.trackEvent('register', 'click', 'Registration'); | 326 | Analytics.trackEvent('register', 'click', 'Registration'); |
327 | $location.path("/registration") | 327 | $location.path("/registration") |
328 | } | 328 | } |
329 | $scope.data.citymeetup = ''; | 329 | $scope.data.citymeetup = ''; |
330 | $scope.register = function(value){ | 330 | $scope.register = function(value){ |
331 | $scope.data.citymeetup = value; | 331 | $scope.data.citymeetup = value; |
332 | if (value == 'mainevent') { | 332 | if (value == 'mainevent') { |
333 | $scope.eventType = true; | 333 | $scope.eventType = true; |
334 | $scope.mainType = false; | 334 | $scope.mainType = false; |
335 | $scope.data.stage = null; | 335 | $scope.data.stage = null; |
336 | } | 336 | } |
337 | else{ | 337 | else{ |
338 | $scope.eventType = false; | 338 | $scope.eventType = false; |
339 | $scope.mainType = true; | 339 | $scope.mainType = true; |
340 | } | 340 | } |
341 | $('.hiddenForm').slideDown(); | 341 | $('.hiddenForm').slideDown(); |
342 | $('html, body').animate({ | 342 | $('html, body').animate({ |
343 | scrollTop: $('.hiddenForm').offset().top | 343 | scrollTop: $('.hiddenForm').offset().top |
344 | }, 1000); | 344 | }, 1000); |
345 | console.log('gdggsg', value); | 345 | console.log('gdggsg', value); |
346 | } | 346 | } |
347 | 347 | ||
348 | $scope.removeError = function() { | 348 | $scope.removeError = function() { |
349 | $('#invalidEmail').css('display', 'none'); | 349 | $('#invalidEmail').css('display', 'none'); |
350 | $('#alreadyExist').css('display', 'none'); | 350 | $('#alreadyExist').css('display', 'none'); |
351 | }; | 351 | }; |
352 | 352 | ||
353 | $scope.emailcheck = function(val) { | 353 | $scope.emailcheck = function(val) { |
354 | console.log(val) | 354 | console.log(val) |
355 | $scope.space = /\s/g.test(val); | 355 | $scope.space = /\s/g.test(val); |
356 | console.log("space",$scope.space) | 356 | console.log("space",$scope.space) |
357 | if (val == undefined) { | 357 | if (val == undefined) { |
358 | $('#invalidEmail').css('display', 'block'); | 358 | $('#invalidEmail').css('display', 'block'); |
359 | } else { | 359 | } else { |
360 | $http({ | 360 | $http({ |
361 | method: 'GET', | 361 | method: 'GET', |
362 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 362 | url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
363 | headers: {} | 363 | headers: {} |
364 | }).then(function mySuccess(searchResult) { | 364 | }).then(function mySuccess(searchResult) { |
365 | console.log("searchResult1===>", searchResult) | 365 | console.log("searchResult1===>", searchResult) |
366 | if (searchResult.data.length == 0) { | 366 | if (searchResult.data.length == 0) { |
367 | $scope.check = false; | 367 | $scope.check = false; |
368 | } else { | 368 | } else { |
369 | $scope.check = true; | 369 | $scope.check = true; |
370 | $scope.emailId = searchResult.data[0].id | 370 | $scope.emailId = searchResult.data[0].id |
371 | $('#alreadyExist').css('display', 'block'); | 371 | $('#alreadyExist').css('display', 'block'); |
372 | 372 | ||
373 | } | 373 | } |
374 | console.log("$scope.data.id",searchResult.data) | 374 | console.log("$scope.data.id",searchResult.data) |
375 | }, function myError(error) {}); | 375 | }, function myError(error) {}); |
376 | } | 376 | } |
377 | }; | 377 | }; |
378 | 378 | ||
379 | $scope.removeNoError = function() { | 379 | $scope.removeNoError = function() { |
380 | $('#noExist').css('display', 'none'); | 380 | $('#noExist').css('display', 'none'); |
381 | }; | 381 | }; |
382 | 382 | ||
383 | $scope.numbercheck = function(number) { | 383 | $scope.numbercheck = function(number) { |
384 | $http({ | 384 | $http({ |
385 | method: 'GET', | 385 | method: 'GET', |
386 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', | 386 | url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}', |
387 | data: $scope.data, | 387 | data: $scope.data, |
388 | headers: {} | 388 | headers: {} |
389 | }).then(function mySuccess(searchResult) { | 389 | }).then(function mySuccess(searchResult) { |
390 | console.log("searchResult===>", searchResult) | 390 | console.log("searchResult===>", searchResult) |
391 | if (searchResult.data.length == 0) { | 391 | if (searchResult.data.length == 0) { |
392 | $scope.numberCheck = false; | 392 | $scope.numberCheck = false; |
393 | 393 | ||
394 | } else { | 394 | } else { |
395 | $scope.numberCheck = true; | 395 | $scope.numberCheck = true; |
396 | $('#noExist').css('display', 'block'); | 396 | $('#noExist').css('display', 'block'); |
397 | } | 397 | } |
398 | }, function myError(error) {}); | 398 | }, function myError(error) {}); |
399 | }; | 399 | }; |
400 | 400 | ||
401 | $rootScope.tokenCall = function(val) { | 401 | $rootScope.tokenCall = function(val) { |
402 | console.log('val-------->', val); | 402 | console.log('val-------->', val); |
403 | if (val == undefined) { | 403 | if (val == undefined) { |
404 | $('#invalidToken').css('display', 'block'); | 404 | $('#invalidToken').css('display', 'block'); |
405 | } else { | 405 | } else { |
406 | val = val.toUpperCase(); | 406 | val = val.toUpperCase(); |
407 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') | 407 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}') |
408 | .then(function(searchResult) { | 408 | .then(function(searchResult) { |
409 | console.log("searchResult",searchResult) | 409 | console.log("searchResult",searchResult) |
410 | if (searchResult.data.length == 0) { | 410 | if (searchResult.data.length == 0) { |
411 | $scope.tokencheck = false; | 411 | $scope.tokencheck = false; |
412 | $scope.discountAmount = 0; | 412 | $scope.discountAmount = 0; |
413 | } else { | 413 | } else { |
414 | $scope.discountpercentage = searchResult.data[0].discount; | 414 | $scope.discountpercentage = searchResult.data[0].discount; |
415 | $scope.tokencheck = true; | 415 | $scope.tokencheck = true; |
416 | } | 416 | } |
417 | },function(err){ | 417 | },function(err){ |
418 | console.log(err) | 418 | console.log(err) |
419 | }); | 419 | }); |
420 | 420 | ||
421 | } | 421 | } |
422 | }; | 422 | }; |
423 | 423 | ||
424 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ | 424 | /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/ |
425 | $(document).ready( | 425 | $(document).ready( |
426 | function() { | 426 | function() { |
427 | $('input:submit').attr('disabled', true); | 427 | $('input:submit').attr('disabled', true); |
428 | $('input:file').change( | 428 | $('input:file').change( |
429 | function() { | 429 | function() { |
430 | if ($("#picture").val()) { | 430 | if ($("#picture").val()) { |
431 | $('input:submit').removeAttr('disabled'); | 431 | $('input:submit').removeAttr('disabled'); |
432 | } else { | 432 | } else { |
433 | $('input:submit').attr('disabled', true); | 433 | $('input:submit').attr('disabled', true); |
434 | } | 434 | } |
435 | }); | 435 | }); |
436 | }); | 436 | }); |
437 | 437 | ||
438 | /*****THIS IS FOR STEP ONE FORM ******/ | 438 | /*****THIS IS FOR STEP ONE FORM ******/ |
439 | // $scope.next = function() { | 439 | // $scope.next = function() { |
440 | // $scope.data.status = null | 440 | // $scope.data.status = null |
441 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { | 441 | // if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) { |
442 | // var x = document.getElementById("snackbar") | 442 | // var x = document.getElementById("snackbar") |
443 | // x.className = "show"; | 443 | // x.className = "show"; |
444 | // setTimeout(function() { | 444 | // setTimeout(function() { |
445 | // x.className = x.className.replace("show", ""); | 445 | // x.className = x.className.replace("show", ""); |
446 | // }, 3000); | 446 | // }, 3000); |
447 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { | 447 | // } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) { |
448 | // $scope.infoForm = true; | 448 | // $scope.infoForm = true; |
449 | // console.log("sdasdasdsa"); | 449 | // console.log("sdasdasdsa"); |
450 | // $scope.data.stage = $scope.data.stage; | 450 | // $scope.data.stage = $scope.data.stage; |
451 | // $scope.detail = {}; | 451 | // $scope.detail = {}; |
452 | // $scope.data.phone = "+91" + $scope.data.number; | 452 | // $scope.data.phone = "+91" + $scope.data.number; |
453 | // $http({ | 453 | // $http({ |
454 | // method: 'POST', | 454 | // method: 'POST', |
455 | // url: BASE_URL + '/information', | 455 | // url: BASE_URL + '/information', |
456 | // data: $scope.data, | 456 | // data: $scope.data, |
457 | // headers: {} | 457 | // headers: {} |
458 | // }).then(function mySuccess(result) { | 458 | // }).then(function mySuccess(result) { |
459 | // Analytics.trackEvent('information', 'click', 'django.mp4'); | 459 | // Analytics.trackEvent('information', 'click', 'django.mp4'); |
460 | // console.log("result", result) | 460 | // console.log("result", result) |
461 | // $scope.detail = result; | 461 | // $scope.detail = result; |
462 | // data.applicantId = result.data.id; | 462 | // data.applicantId = result.data.id; |
463 | // $scope.userId = result.data.id; | 463 | // $scope.userId = result.data.id; |
464 | 464 | ||
465 | // }, function myError(error) {}); | 465 | // }, function myError(error) {}); |
466 | 466 | ||
467 | // } | 467 | // } |
468 | 468 | ||
469 | // } | 469 | // } |
470 | 470 | ||
471 | $scope.calculateAmount = function(){ | 471 | $scope.calculateAmount = function(){ |
472 | if($scope.tokencheck == false){ | 472 | if($scope.tokencheck == false){ |
473 | $scope.data.referalToken = null; | 473 | $scope.data.referalToken = null; |
474 | } | 474 | } |
475 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 475 | if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
476 | var x = document.getElementById("snackbar") | 476 | var x = document.getElementById("snackbar") |
477 | x.className = "show"; | 477 | x.className = "show"; |
478 | setTimeout(function() { | 478 | setTimeout(function() { |
479 | x.className = x.className.replace("show", ""); | 479 | x.className = x.className.replace("show", ""); |
480 | }, 3000); | 480 | }, 3000); |
481 | } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 481 | } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
482 | $scope.infoForm = true; | 482 | $scope.infoForm = true; |
483 | console.log("sdasdasdsa"); | 483 | console.log("sdasdasdsa"); |
484 | $scope.data.stage = $scope.data.stage; | 484 | $scope.data.stage = $scope.data.stage; |
485 | $scope.detail = {}; | 485 | $scope.detail = {}; |
486 | $scope.data.phone = "+91" + $scope.data.number; | 486 | $scope.data.phone = "+91" + $scope.data.number; |
487 | $http({ | 487 | $http({ |
488 | method: 'POST', | 488 | method: 'POST', |
489 | url: BASE_URL + '/applicants', | 489 | url: BASE_URL + '/applicants', |
490 | data: $scope.data, | 490 | data: $scope.data, |
491 | headers: {} | 491 | headers: {} |
492 | }).then(function mySuccess(result) { | 492 | }).then(function mySuccess(result) { |
493 | Analytics.trackEvent('applicants', 'click','Users'); | 493 | Analytics.trackEvent('applicants', 'click','Users'); |
494 | console.log("result", result) | 494 | console.log("result", result) |
495 | $scope.detail = result; | 495 | $scope.detail = result; |
496 | data.applicantId = result.data.id; | 496 | data.applicantId = result.data.id; |
497 | //$scope.userId = result.data.id; | 497 | //$scope.userId = result.data.id; |
498 | 498 | ||
499 | if($scope.data.citymeetup == "pune"){ | 499 | if($scope.data.citymeetup == "pune"){ |
500 | if ($scope.data.stage == "Idea") { | 500 | if ($scope.data.stage == "Idea") { |
501 | console.log("$scope.data", $scope.data) | 501 | console.log("$scope.data", $scope.data) |
502 | $scope.ticketAmnt = 500; | 502 | $scope.ticketAmnt = 500; |
503 | } | 503 | } |
504 | 504 | ||
505 | if ($scope.data.stage == "Product") { | 505 | if ($scope.data.stage == "Product") { |
506 | $scope.ticketAmnt = 1000; | 506 | $scope.ticketAmnt = 1000; |
507 | } | 507 | } |
508 | 508 | ||
509 | if ($scope.data.stage == "Growth") { | 509 | if ($scope.data.stage == "Growth") { |
510 | $scope.ticketAmnt = 1000; | 510 | $scope.ticketAmnt = 1000; |
511 | } | 511 | } |
512 | } | 512 | } |
513 | else if($scope.data.citymeetup == "mainevent"){ | 513 | else if($scope.data.citymeetup == "mainevent"){ |
514 | // if ($scope.data.stage == '') { | 514 | // if ($scope.data.stage == '') { |
515 | console.log("$scope.data", $scope.data) | 515 | console.log("$scope.data", $scope.data) |
516 | $scope.ticketAmnt = 5000; | 516 | $scope.ticketAmnt = 5000; |
517 | // } | 517 | // } |
518 | 518 | ||
519 | // if ($scope.data.stage == "Product") { | 519 | // if ($scope.data.stage == "Product") { |
520 | // $scope.ticketAmnt = 1500; | 520 | // $scope.ticketAmnt = 1500; |
521 | // } | 521 | // } |
522 | 522 | ||
523 | // if ($scope.data.stage == "Growth") { | 523 | // if ($scope.data.stage == "Growth") { |
524 | // $scope.ticketAmnt = 1500; | 524 | // $scope.ticketAmnt = 1500; |
525 | // } | 525 | // } |
526 | } | 526 | } |
527 | else{ | 527 | else{ |
528 | if ($scope.data.stage == "Idea") { | 528 | if ($scope.data.stage == "Idea") { |
529 | console.log("$scope.data", $scope.data) | 529 | console.log("$scope.data", $scope.data) |
530 | $scope.ticketAmnt = 500; | 530 | $scope.ticketAmnt = 500; |
531 | } | 531 | } |
532 | 532 | ||
533 | if ($scope.data.stage == "Product") { | 533 | if ($scope.data.stage == "Product") { |
534 | $scope.ticketAmnt = 1000; | 534 | $scope.ticketAmnt = 1000; |
535 | } | 535 | } |
536 | 536 | ||
537 | if ($scope.data.stage == "Growth") { | 537 | if ($scope.data.stage == "Growth") { |
538 | $scope.ticketAmnt = 1000; | 538 | $scope.ticketAmnt = 1000; |
539 | } | 539 | } |
540 | } | 540 | } |
541 | // if ($scope.data.stage == "Visitor") { | 541 | // if ($scope.data.stage == "Visitor") { |
542 | // $scope.ticketAmnt = 500; | 542 | // $scope.ticketAmnt = 500; |
543 | // } | 543 | // } |
544 | var amount = $scope.ticketAmnt * 100 | 544 | var amount = $scope.ticketAmnt * 100 |
545 | if($scope.tokencheck == true){ | 545 | if($scope.tokencheck == true){ |
546 | var amount = $scope.ticketAmnt | 546 | var amount = $scope.ticketAmnt |
547 | $scope.discountAmount = (amount * $scope.discountpercentage)/100 | 547 | $scope.discountAmount = (amount * $scope.discountpercentage)/100 |
548 | console.log("finalAmount====>",$scope.discountAmount) | 548 | console.log("finalAmount====>",$scope.discountAmount) |
549 | } | 549 | } |
550 | 550 | ||
551 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 551 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
552 | console.log("$scope.taxTotal----",taxAmount) | 552 | console.log("$scope.taxTotal----",taxAmount) |
553 | $scope.taxTotal = (taxAmount * 18)/100 | 553 | $scope.taxTotal = (taxAmount * 18)/100 |
554 | $scope.payingAmnt = taxAmount + $scope.taxTotal | 554 | $scope.payingAmnt = taxAmount + $scope.taxTotal |
555 | console.log("taxincludedamount----", $scope.payingAmnt) | 555 | console.log("taxincludedamount----", $scope.payingAmnt) |
556 | console.log("$scope.taxTotal----", $scope.taxTotal) | 556 | console.log("$scope.taxTotal----", $scope.taxTotal) |
557 | // } | 557 | // } |
558 | 558 | ||
559 | /*****THIS IS FOR STEP THREE FORM ******/ | 559 | /*****THIS IS FOR STEP THREE FORM ******/ |
560 | // $scope.create = function() { | 560 | // $scope.create = function() { |
561 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 561 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
562 | // var x = document.getElementById("snackbar") | 562 | // var x = document.getElementById("snackbar") |
563 | // x.className = "show"; | 563 | // x.className = "show"; |
564 | // setTimeout(function() { | 564 | // setTimeout(function() { |
565 | // x.className = x.className.replace("show", ""); | 565 | // x.className = x.className.replace("show", ""); |
566 | // }, 3000); | 566 | // }, 3000); |
567 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 567 | // } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
568 | // $scope.infoForm = true; | 568 | // $scope.infoForm = true; |
569 | // console.log("sdasdasdsa"); | 569 | // console.log("sdasdasdsa"); |
570 | // $scope.data.stage = $scope.data.stage; | 570 | // $scope.data.stage = $scope.data.stage; |
571 | // $scope.detail = {}; | 571 | // $scope.detail = {}; |
572 | // $scope.data.phone = "+91" + $scope.data.number; | 572 | // $scope.data.phone = "+91" + $scope.data.number; |
573 | // $http({ | 573 | // $http({ |
574 | // method: 'POST', | 574 | // method: 'POST', |
575 | // url: BASE_URL + '/applicants', | 575 | // url: BASE_URL + '/applicants', |
576 | // data: $scope.data, | 576 | // data: $scope.data, |
577 | // headers: {} | 577 | // headers: {} |
578 | // }).then(function mySuccess(result) { | 578 | // }).then(function mySuccess(result) { |
579 | 579 | ||
580 | // console.log("=====result=====", result) | 580 | // console.log("=====result=====", result) |
581 | // $scope.detail = result; | 581 | // $scope.detail = result; |
582 | // data.applicantId = result.data.id; | 582 | // data.applicantId = result.data.id; |
583 | // $scope.userId = result.data.id; | 583 | // $scope.userId = result.data.id; |
584 | // console.log("=====data=====", data) | 584 | // console.log("=====data=====", data) |
585 | // data.amount = $scope.payingAmnt + $scope.taxTotal; | 585 | // data.amount = $scope.payingAmnt + $scope.taxTotal; |
586 | data.amount = $scope.payingAmnt; | 586 | data.amount = $scope.payingAmnt; |
587 | console.log("$scope.taxTotal",data.amount) | 587 | console.log("$scope.taxTotal",data.amount) |
588 | if ($scope.detail != null) { | 588 | if ($scope.detail != null) { |
589 | $http({ | 589 | $http({ |
590 | method: 'POST', | 590 | method: 'POST', |
591 | url: BASE_URL + '/payments', | 591 | url: BASE_URL + '/payments', |
592 | data: data, | 592 | data: data, |
593 | headers: {} | 593 | headers: {} |
594 | }).then(function mySuccess(paymentResult) { | 594 | }).then(function mySuccess(paymentResult) { |
595 | console.log("paymentResult",paymentResult) | 595 | console.log("paymentResult",paymentResult) |
596 | $scope.paymentResult = paymentResult; | 596 | $scope.paymentResult = paymentResult; |
597 | }, function myError(error) {}); | 597 | }, function myError(error) {}); |
598 | } | 598 | } |
599 | var i = 0; | 599 | var i = 0; |
600 | //$scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; | 600 | //$scope.payingAmnt = ($scope.payingAmnt + $scope.taxTotal) * 100; |
601 | 601 | ||
602 | $scope.payingAmnt = $scope.payingAmnt * 100; | 602 | $scope.payingAmnt = $scope.payingAmnt * 100; |
603 | console.log("$scope.taxTotal----", $scope.payingAmnt) | 603 | console.log("$scope.taxTotal----", $scope.payingAmnt) |
604 | var options = { | 604 | var options = { |
605 | "key": "rzp_live_mhSE1uOBlXvFyJ", | 605 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
606 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 606 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
607 | "amount": $scope.payingAmnt , | 607 | "amount": $scope.payingAmnt , |
608 | 608 | ||
609 | "name": "Startup Jalsa", | 609 | "name": "Startup Jalsa", |
610 | "description": "amount", | 610 | "description": "amount", |
611 | "currency": "INR", | 611 | "currency": "INR", |
612 | "status": "done", | 612 | "status": "done", |
613 | 613 | ||
614 | "theme": { | 614 | "theme": { |
615 | "color": "#2196f3 ", | 615 | "color": "#2196f3 ", |
616 | "image_padding": "NO" | 616 | "image_padding": "NO" |
617 | }, | 617 | }, |
618 | "modal": { | 618 | "modal": { |
619 | "ondismiss": function() {} | 619 | "ondismiss": function() {} |
620 | }, | 620 | }, |
621 | "handler": function(response) { | 621 | "handler": function(response) { |
622 | createPayment(response); | 622 | createPayment(response); |
623 | } | 623 | } |
624 | }; | 624 | }; |
625 | var rzp1 = new Razorpay(options); | 625 | var rzp1 = new Razorpay(options); |
626 | rzp1.open(); | 626 | rzp1.open(); |
627 | $scope.paymentResponse = {}; | 627 | $scope.paymentResponse = {}; |
628 | 628 | ||
629 | function createPayment(response) { | 629 | function createPayment(response) { |
630 | console.log("response====from===razorpay",response) | 630 | console.log("response====from===razorpay",response) |
631 | $route.reload(); | 631 | $route.reload(); |
632 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 632 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
633 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 633 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
634 | $scope.paymentResponse.amount = data.amount; | 634 | $scope.paymentResponse.amount = data.amount; |
635 | $scope.paymentResponse.currency = "INR"; | 635 | $scope.paymentResponse.currency = "INR"; |
636 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 636 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
637 | Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); | 637 | Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); |
638 | $http({ | 638 | $http({ |
639 | method: 'PUT', | 639 | method: 'PUT', |
640 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, | 640 | url: BASE_URL + '/payments/' + $scope.paymentResult.data.id, |
641 | data: $scope.paymentResponse, | 641 | data: $scope.paymentResponse, |
642 | headers: {} | 642 | headers: {} |
643 | }).then(function mySuccess(searchResult) { | 643 | }).then(function mySuccess(searchResult) { |
644 | // if(paymentResult.data.status == "created"){ | 644 | // if(paymentResult.data.status == "created"){ |
645 | 645 | ||
646 | // } | 646 | // } |
647 | console.log("searchResult", searchResult) | 647 | console.log("searchResult", searchResult) |
648 | $location.path("/confirmation") | 648 | $location.path("/confirmation") |
649 | //$scope.showToastr() | 649 | //$scope.showToastr() |
650 | //toaster.success("Registration done successfully"); | 650 | //toaster.success("Registration done successfully"); |
651 | 651 | ||
652 | }, function myError(error) {}); | 652 | }, function myError(error) {}); |
653 | } | 653 | } |
654 | }, function myError(error) {}); | 654 | }, function myError(error) {}); |
655 | } | 655 | } |
656 | 656 | ||
657 | } | 657 | } |
658 | 658 | ||
659 | //}, function myError(error) {}); | 659 | //}, function myError(error) {}); |
660 | //} | 660 | //} |
661 | 661 | ||
662 | //} | 662 | //} |
663 | 663 | ||
664 | // $scope.showToastr = function() { | 664 | // $scope.showToastr = function() { |
665 | // console.log("called toast") | 665 | // console.log("called toast") |
666 | // var x = document.getElementById("snacsskbar") | 666 | // var x = document.getElementById("snacsskbar") |
667 | // x.className = "show"; | 667 | // x.className = "show"; |
668 | // setTimeout(function() { | 668 | // setTimeout(function() { |
669 | // x.className = x.className.replace("show", ""); | 669 | // x.className = x.className.replace("show", ""); |
670 | // }, 3000); | 670 | // }, 3000); |
671 | // } | 671 | // } |
672 | 672 | ||
673 | /*kk***This code for change data when click to chooses stages***/ | 673 | /*kk***This code for change data when click to chooses stages***/ |
674 | $scope.proto = true; | 674 | $scope.proto = true; |
675 | $scope.businessmodel = true; | 675 | $scope.businessmodel = true; |
676 | $scope.Idea = true; | 676 | $scope.Idea = true; |
677 | $scope.current = true; | 677 | $scope.current = true; |
678 | 678 | ||
679 | $scope.stage = function(stage) { | 679 | $scope.stage = function(stage) { |
680 | $scope.stagekeyPress(); | 680 | $scope.stagekeyPress(); |
681 | console.log("stage--2",stage) | 681 | console.log("stage--2",stage) |
682 | 682 | ||
683 | if (stage == 'Idea') { | 683 | if (stage == 'Idea') { |
684 | $scope.Productshow = "no"; | 684 | $scope.Productshow = "no"; |
685 | $scope.current = 10; | 685 | $scope.current = 10; |
686 | $scope.proto = true; | 686 | $scope.proto = true; |
687 | // $scope.visitType = true; | 687 | // $scope.visitType = true; |
688 | $scope.prototyp = false; | 688 | $scope.prototyp = false; |
689 | $scope.protyp = false; | 689 | $scope.protyp = false; |
690 | $scope.market = false; | 690 | $scope.market = false; |
691 | $scope.risks = false; | 691 | $scope.risks = false; |
692 | $scope.team = false; | 692 | $scope.team = false; |
693 | $scope.pitch = false; | 693 | $scope.pitch = false; |
694 | $scope.financials = false; | 694 | $scope.financials = false; |
695 | $scope.businessmodel = true; | 695 | $scope.businessmodel = true; |
696 | $scope.data.stage = stage; | 696 | $scope.data.stage = stage; |
697 | // for right content | 697 | // for right content |
698 | $scope.Idea = true; | 698 | $scope.Idea = true; |
699 | $scope.Product = false; | 699 | $scope.Product = false; |
700 | $scope.Growth = false; | 700 | $scope.Growth = false; |
701 | // $scope.Visitor = false; | 701 | // $scope.Visitor = false; |
702 | } else if (stage == 'Product') { | 702 | } else if (stage == 'Product') { |
703 | $scope.Productshow = "no"; | 703 | $scope.Productshow = "no"; |
704 | $scope.current = 10; | 704 | $scope.current = 10; |
705 | $scope.proto = true; | 705 | $scope.proto = true; |
706 | // $scope.visitType = true; | 706 | // $scope.visitType = true; |
707 | $scope.prototyp = true; | 707 | $scope.prototyp = true; |
708 | $scope.protyp = true; | 708 | $scope.protyp = true; |
709 | $scope.market = true; | 709 | $scope.market = true; |
710 | $scope.risks = true; | 710 | $scope.risks = true; |
711 | $scope.team = true; | 711 | $scope.team = true; |
712 | $scope.pitch = true; | 712 | $scope.pitch = true; |
713 | $scope.financials = true; | 713 | $scope.financials = true; |
714 | $scope.businessmodel = false; | 714 | $scope.businessmodel = false; |
715 | $scope.data.stage = stage; | 715 | $scope.data.stage = stage; |
716 | // for right content | 716 | // for right content |
717 | $scope.Idea = false; | 717 | $scope.Idea = false; |
718 | $scope.Product = true; | 718 | $scope.Product = true; |
719 | $scope.Growth = false; | 719 | $scope.Growth = false; |
720 | // $scope.Visitor = false; | 720 | // $scope.Visitor = false; |
721 | } else if (stage == 'Growth') { | 721 | } else if (stage == 'Growth') { |
722 | $scope.Productshow = "yes"; | 722 | $scope.Productshow = "yes"; |
723 | $scope.current = 10; | 723 | $scope.current = 10; |
724 | $scope.proto = false; | 724 | $scope.proto = false; |
725 | // $scope.visitType = true; | 725 | // $scope.visitType = true; |
726 | $scope.prototyp = true; | 726 | $scope.prototyp = true; |
727 | $scope.protyp = false; | 727 | $scope.protyp = false; |
728 | $scope.market = true; | 728 | $scope.market = true; |
729 | $scope.risks = true; | 729 | $scope.risks = true; |
730 | $scope.team = true; | 730 | $scope.team = true; |
731 | $scope.pitch = true; | 731 | $scope.pitch = true; |
732 | $scope.financials = true; | 732 | $scope.financials = true; |
733 | $scope.businessmodel = false; | 733 | $scope.businessmodel = false; |
734 | // for right content | 734 | // for right content |
735 | $scope.Idea = false; | 735 | $scope.Idea = false; |
736 | $scope.Product = false; | 736 | $scope.Product = false; |
737 | $scope.Growth = true; | 737 | $scope.Growth = true; |
738 | // $scope.Visitor = false; | 738 | // $scope.Visitor = false; |
739 | // } else if (stage == 'Visitor') { | 739 | // } else if (stage == 'Visitor') { |
740 | // $scope.Productshow = "no"; | 740 | // $scope.Productshow = "no"; |
741 | // $scope.current = 10; | 741 | // $scope.current = 10; |
742 | // $scope.proto = false; | 742 | // $scope.proto = false; |
743 | // $scope.visitType = false; | 743 | // $scope.visitType = false; |
744 | // $scope.prototyp = false; | 744 | // $scope.prototyp = false; |
745 | // $scope.protyp = false; | 745 | // $scope.protyp = false; |
746 | // $scope.market = false; | 746 | // $scope.market = false; |
747 | // $scope.risks = false; | 747 | // $scope.risks = false; |
748 | // $scope.team = false; | 748 | // $scope.team = false; |
749 | // $scope.pitch = false; | 749 | // $scope.pitch = false; |
750 | // $scope.financials = false; | 750 | // $scope.financials = false; |
751 | // $scope.businessmodel = false; | 751 | // $scope.businessmodel = false; |
752 | // $scope.data.stage = stage; | 752 | // $scope.data.stage = stage; |
753 | // // for right content | 753 | // // for right content |
754 | // $scope.Idea = false; | 754 | // $scope.Idea = false; |
755 | // $scope.Product = false; | 755 | // $scope.Product = false; |
756 | // $scope.Growth = false; | 756 | // $scope.Growth = false; |
757 | // $scope.Visitor = true; | 757 | // $scope.Visitor = true; |
758 | $scope.data.stage = stage; | 758 | $scope.data.stage = stage; |
759 | } | 759 | } |
760 | 760 | ||
761 | } | 761 | } |
762 | 762 | ||
763 | $scope.emailTest = function(s){ | 763 | $scope.emailTest = function(s){ |
764 | $scope.space = /\s/g.test(s.delegateTarget.value); | 764 | $scope.space = /\s/g.test(s.delegateTarget.value); |
765 | console.log("space",$scope.space) | 765 | console.log("space",$scope.space) |
766 | 766 | ||
767 | } | 767 | } |
768 | // $scope.enterbusiness = function(business) { | 768 | // $scope.enterbusiness = function(business) { |
769 | // console.log("business", business); | 769 | // console.log("business", business); |
770 | // if (name == undefined) { | 770 | // if (name == undefined) { |
771 | // $scope.current = false; | 771 | // $scope.current = false; |
772 | 772 | ||
773 | // } else if (name != undefined) { | 773 | // } else if (name != undefined) { |
774 | // $scope.current = true; | 774 | // $scope.current = true; |
775 | // } | 775 | // } |
776 | // } | 776 | // } |
777 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ | 777 | /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/ |
778 | $scope.stagekeyPress = function() { | 778 | $scope.stagekeyPress = function() { |
779 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); | 779 | $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)'); |
780 | } | 780 | } |
781 | $scope.sectorkeyPress = function() { | 781 | $scope.sectorkeyPress = function() { |
782 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); | 782 | $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)'); |
783 | } | 783 | } |
784 | 784 | ||
785 | $scope.productLaunchkeyPress = function() { | 785 | $scope.productLaunchkeyPress = function() { |
786 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); | 786 | $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)'); |
787 | } | 787 | } |
788 | 788 | ||
789 | $scope.launchPeriodkeyPress = function() { | 789 | $scope.launchPeriodkeyPress = function() { |
790 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); | 790 | $('.icon-circle-abc').css('background-color', 'rgb(66, 181, 73)'); |
791 | } | 791 | } |
792 | 792 | ||
793 | $scope.industrykeyPress = function() { | 793 | $scope.industrykeyPress = function() { |
794 | $scope.addOther = false; | 794 | $scope.addOther = false; |
795 | $scope.hideSelectBox = true; | 795 | $scope.hideSelectBox = true; |
796 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); | 796 | $('.icon-circle-abcdefg').css('background-color', 'rgb(66, 181, 73)'); |
797 | var e = document.getElementById("dataIndustry"); | 797 | var e = document.getElementById("dataIndustry"); |
798 | var dataIndustry = e.options[e.selectedIndex].value; | 798 | var dataIndustry = e.options[e.selectedIndex].value; |
799 | if(dataIndustry == "others") { | 799 | if(dataIndustry == "others") { |
800 | $scope.addOther = true; | 800 | $scope.addOther = true; |
801 | $scope.hideSelectBox = false; | 801 | $scope.hideSelectBox = false; |
802 | } | 802 | } |
803 | } | 803 | } |
804 | 804 | ||
805 | $scope.industryNamekeyPress = function(firstName) { | 805 | $scope.industryNamekeyPress = function(firstName) { |
806 | console.log("lastName==", firstName); | 806 | console.log("lastName==", firstName); |
807 | if (firstName == undefined) { | 807 | if (firstName == undefined) { |
808 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 808 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
809 | } else { | 809 | } else { |
810 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); | 810 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); |
811 | } | 811 | } |
812 | } | 812 | } |
813 | 813 | ||
814 | $scope.amountkeyPress = function() { | 814 | $scope.amountkeyPress = function() { |
815 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); | 815 | $('.icon-circle-bc').css('background-color', 'rgb(66, 181, 73)'); |
816 | } | 816 | } |
817 | 817 | ||
818 | $scope.firstNamekeyPress = function(name) { | 818 | $scope.firstNamekeyPress = function(name) { |
819 | console.log("lastName==", name); | 819 | console.log("lastName==", name); |
820 | if (name == undefined) { | 820 | if (name == undefined) { |
821 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 821 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
822 | } else { | 822 | } else { |
823 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); | 823 | $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)'); |
824 | } | 824 | } |
825 | } | 825 | } |
826 | 826 | ||
827 | $scope.emailkeyPress = function(email) { | 827 | $scope.emailkeyPress = function(email) { |
828 | console.log("email", email); | 828 | console.log("email", email); |
829 | if (email == undefined) { | 829 | if (email == undefined) { |
830 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 830 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
831 | } else { | 831 | } else { |
832 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); | 832 | $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)'); |
833 | } | 833 | } |
834 | } | 834 | } |
835 | 835 | ||
836 | $scope.textCheck = function(){ | 836 | $scope.textCheck = function(){ |
837 | console.log("Val1:::", $scope.textCheck); | 837 | console.log("Val1:::", $scope.textCheck); |
838 | var e = document.getElementById("fundingDiv"); | 838 | var e = document.getElementById("fundingDiv"); |
839 | var funding = e.options[e.selectedIndex].value; | 839 | var funding = e.options[e.selectedIndex].value; |
840 | $scope.Textshow = "no"; | 840 | $scope.Textshow = "no"; |
841 | if(funding == "yes") { | 841 | if(funding == "yes") { |
842 | $scope.Textshow = "yes"; | 842 | $scope.Textshow = "yes"; |
843 | console.log("Val:::", $scope.Textshow); | 843 | console.log("Val:::", $scope.Textshow); |
844 | } | 844 | } |
845 | 845 | ||
846 | } | 846 | } |
847 | 847 | ||
848 | $scope.productCheck = function(){ | 848 | $scope.productCheck = function(){ |
849 | console.log("Val2:::", $scope.productCheck); | 849 | console.log("Val2:::", $scope.productCheck); |
850 | var e = document.getElementById("productDiv"); | 850 | var e = document.getElementById("productDiv"); |
851 | var product = e.options[e.selectedIndex].value; | 851 | var product = e.options[e.selectedIndex].value; |
852 | $scope.Productshow = "no"; | 852 | $scope.Productshow = "no"; |
853 | if(product == "yes") { | 853 | if(product == "yes") { |
854 | $scope.Productshow = "yes"; | 854 | $scope.Productshow = "yes"; |
855 | console.log("Val1:::", $scope.Productshow); | 855 | console.log("Val1:::", $scope.Productshow); |
856 | } | 856 | } |
857 | 857 | ||
858 | } | 858 | } |
859 | 859 | ||
860 | $scope.phonekeyPress = function(number) { | 860 | $scope.phonekeyPress = function(number) { |
861 | console.log("number", number); | 861 | console.log("number", number); |
862 | if (number == undefined || number == '') { | 862 | if (number == undefined || number == '') { |
863 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 863 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
864 | } else { | 864 | } else { |
865 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); | 865 | $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)'); |
866 | } | 866 | } |
867 | } | 867 | } |
868 | 868 | ||
869 | $scope.citykeyPress = function(city) { | 869 | $scope.citykeyPress = function(city) { |
870 | console.log("city", city); | 870 | console.log("city", city); |
871 | if (city == undefined) { | 871 | if (city == undefined) { |
872 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 872 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
873 | } else { | 873 | } else { |
874 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); | 874 | $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)'); |
875 | } | 875 | } |
876 | } | 876 | } |
877 | 877 | ||
878 | $scope.startupNamekeyPress = function(q) { | 878 | $scope.startupNamekeyPress = function(q) { |
879 | if (q == undefined) { | 879 | if (q == undefined) { |
880 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 880 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
881 | } else { | 881 | } else { |
882 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); | 882 | $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)'); |
883 | } | 883 | } |
884 | } | 884 | } |
885 | 885 | ||
886 | $scope.linkedInkeyPress = function(technology) { | 886 | $scope.linkedInkeyPress = function(technology) { |
887 | if (technology == undefined || technology == '') { | 887 | if (technology == undefined || technology == '') { |
888 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 888 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
889 | } else { | 889 | } else { |
890 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); | 890 | $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)'); |
891 | } | 891 | } |
892 | } | 892 | } |
893 | $scope.companykeyPress = function(problem) { | 893 | $scope.companykeyPress = function(problem) { |
894 | if (problem == undefined) { | 894 | if (problem == undefined) { |
895 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 895 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
896 | } else { | 896 | } else { |
897 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); | 897 | $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)'); |
898 | } | 898 | } |
899 | } | 899 | } |
900 | $scope.productNamekeyPress = function(solution) { | 900 | $scope.productNamekeyPress = function(solution) { |
901 | if (solution == undefined) { | 901 | if (solution == undefined) { |
902 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 902 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
903 | } else { | 903 | } else { |
904 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); | 904 | $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)'); |
905 | } | 905 | } |
906 | } | 906 | } |
907 | $scope.businesskeyPress = function(business) { | 907 | $scope.businesskeyPress = function(business) { |
908 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); | 908 | $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)'); |
909 | } | 909 | } |
910 | 910 | ||
911 | $scope.websitekeyPress = function(prototype) { | 911 | $scope.websitekeyPress = function(prototype) { |
912 | if (prototype == undefined || prototype == '') { | 912 | if (prototype == undefined || prototype == '') { |
913 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 913 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
914 | } else { | 914 | } else { |
915 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); | 915 | $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)'); |
916 | } | 916 | } |
917 | } | 917 | } |
918 | 918 | ||
919 | $scope.employeekeyPress = function(market) { | 919 | $scope.employeekeyPress = function(market) { |
920 | if (market == undefined || market == '') { | 920 | if (market == undefined || market == '') { |
921 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 921 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
922 | } else { | 922 | } else { |
923 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); | 923 | $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)'); |
924 | } | 924 | } |
925 | } | 925 | } |
926 | 926 | ||
927 | $scope.annualkeyPress = function(risk) { | 927 | $scope.annualkeyPress = function(risk) { |
928 | if (risk == undefined || risk == '') { | 928 | if (risk == undefined || risk == '') { |
929 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 929 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
930 | } else { | 930 | } else { |
931 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); | 931 | $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)'); |
932 | } | 932 | } |
933 | } | 933 | } |
934 | 934 | ||
935 | $scope.revenuekeyPress = function(team) { | 935 | $scope.revenuekeyPress = function(team) { |
936 | if (team == undefined || team == '') { | 936 | if (team == undefined || team == '') { |
937 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 937 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
938 | } else { | 938 | } else { |
939 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); | 939 | $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)'); |
940 | } | 940 | } |
941 | } | 941 | } |
942 | 942 | ||
943 | $scope.descriptionkeyPress = function(pitch) { | 943 | $scope.descriptionkeyPress = function(pitch) { |
944 | if (pitch == undefined) { | 944 | if (pitch == undefined) { |
945 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 945 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
946 | } else { | 946 | } else { |
947 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); | 947 | $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)'); |
948 | } | 948 | } |
949 | } | 949 | } |
950 | 950 | ||
951 | $scope.discountkeyPress = function(discount) { | 951 | $scope.discountkeyPress = function(discount) { |
952 | console.log("lastName==", name); | 952 | console.log("lastName==", name); |
953 | if (discount == undefined) { | 953 | if (discount == undefined) { |
954 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 954 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
955 | } else { | 955 | } else { |
956 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); | 956 | $('.icon-circle-o').css('background-color', 'rgb(66, 181, 73)'); |
957 | } | 957 | } |
958 | } | 958 | } |
959 | 959 | ||
960 | $scope.removeNooError = function() { | 960 | $scope.removeNooError = function() { |
961 | $('#invalidIdea').css('display', 'block'); | 961 | $('#invalidIdea').css('display', 'block'); |
962 | $('#noExist').css('display', 'none'); | 962 | $('#noExist').css('display', 'none'); |
963 | }; | 963 | }; |
964 | 964 | ||
965 | $scope.ideakeyPress = function(financial) { | 965 | $scope.ideakeyPress = function(financial) { |
966 | console.log("financial", financial); | 966 | console.log("financial", financial); |
967 | if (financial == undefined) { | 967 | if (financial == undefined) { |
968 | $('#invalidIdea').css('display', 'block'); | 968 | $('#invalidIdea').css('display', 'block'); |
969 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 969 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
970 | } else { | 970 | } else { |
971 | $('#invalidIdea').css('display', 'none'); | 971 | $('#invalidIdea').css('display', 'none'); |
972 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); | 972 | $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)'); |
973 | } | 973 | } |
974 | } | 974 | } |
975 | 975 | ||
976 | $scope.fundkeyPress = function(financial) { | 976 | $scope.fundkeyPress = function(financial) { |
977 | console.log("financial", financial); | 977 | console.log("financial", financial); |
978 | if (financial == undefined) { | 978 | if (financial == undefined) { |
979 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 979 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
980 | } else { | 980 | } else { |
981 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); | 981 | $('.icon-circle-y').css('background-color', 'rgb(66, 181, 73)'); |
982 | } | 982 | } |
983 | } | 983 | } |
984 | 984 | ||
985 | $scope.changeReferalIconColor = function(referalToken){ | 985 | $scope.changeReferalIconColor = function(referalToken){ |
986 | if (referalToken == undefined || referalToken == '') { | 986 | if (referalToken == undefined || referalToken == '') { |
987 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 987 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
988 | }else { | 988 | }else { |
989 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); | 989 | $('.referel-icon').css('background-color', 'rgb(66, 181, 73)'); |
990 | } | 990 | } |
991 | } | 991 | } |
992 | 992 | ||
993 | }); | 993 | }); |
994 | 994 | ||
995 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { | 995 | scotchApp.controller('verifyController', function($scope, $http, $location, $route,BASE_URL) { |
996 | |||
996 | $scope.pendingPaymentId = $route.current.params.id | 997 | $scope.pendingPaymentId = $route.current.params.id |
997 | $http({ | 998 | $http({ |
998 | method: "GET", | 999 | method: "GET", |
999 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, | 1000 | url: BASE_URL + '/applicants/' + $scope.pendingPaymentId, |
1000 | }).then(function mySuccess(response) { | 1001 | }).then(function mySuccess(response) { |
1001 | $scope.data = response.data; | 1002 | $scope.data = response.data; |
1002 | console.log("response-1", response); | 1003 | console.log("response-1", response); |
1003 | $scope.pendingPaymentId = $route.current.params.id; | 1004 | $scope.pendingPaymentId = $route.current.params.id; |
1004 | 1005 | ||
1005 | $http({ | 1006 | $http({ |
1006 | method: "GET", | 1007 | method: "GET", |
1007 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', | 1008 | url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}', |
1008 | }).then(function mySuccess(response) { | 1009 | }).then(function mySuccess(response) { |
1009 | $scope.paymentRecord = response.data; | 1010 | $scope.paymentRecord = response.data; |
1010 | }, function myError(response) { | 1011 | }, function myError(response) { |
1012 | console.log("response-2", response); | ||
1011 | }); | 1013 | }); |
1012 | }, function myError(response) { | 1014 | }, function myError(response) { |
1013 | $scope.myWelcome = response.statusText; | 1015 | $scope.myWelcome = response.statusText; |
1014 | }); | 1016 | }); |
1015 | 1017 | ||
1016 | $scope.checkView = false; | 1018 | $scope.checkView = false; |
1017 | $scope.verifyView = false; | 1019 | $scope.verifyView = false; |
1018 | 1020 | $scope.searchResult = {} | |
1019 | $scope.pendingPaymentId = ''; | 1021 | $scope.pendingPaymentId = ''; |
1020 | 1022 | ||
1021 | $scope.update = function() { | 1023 | $scope.update = function() { |
1022 | 1024 | ||
1023 | $http({ | 1025 | $http({ |
1024 | method: 'GET', | 1026 | method: 'GET', |
1025 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', | 1027 | url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}', |
1026 | headers: {} | 1028 | headers: {} |
1027 | }).then(function mySuccess(searchResult) { | 1029 | }).then(function mySuccess(searchResult) { |
1028 | if (searchResult.data[0].status == "created") { | 1030 | if (searchResult.data[0].status == "created") { |
1029 | //if (searchResult.data[0].status == "cancelled") { | 1031 | //if (searchResult.data[0].status == "cancelled") { |
1030 | $scope.checkView = true; | 1032 | $scope.checkView = true; |
1031 | $scope.verifyView = false; | 1033 | $scope.verifyView = false; |
1032 | $scope.amount = searchResult.data[0].amount; | 1034 | $scope.amount = searchResult.data[0].amount; |
1033 | $scope.searchResult = searchResult.data[0]; | 1035 | $scope.searchResult = searchResult.data[0]; |
1034 | console.log('====searchResult===', searchResult); | 1036 | console.log('====searchResult===', searchResult); |
1035 | console.log("searchResult=====",searchResult.data[0].razorOrderId) | 1037 | console.log("searchResult=====",searchResult.data[0].razorOrderId) |
1036 | var i = 0; | 1038 | var i = 0; |
1037 | $scope.amount = $scope.amount * 100; | 1039 | $scope.amount = $scope.amount * 100; |
1038 | var options = { | 1040 | var options = { |
1039 | "key": "rzp_live_mhSE1uOBlXvFyJ", | 1041 | "key": "rzp_live_mhSE1uOBlXvFyJ", |
1040 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", | 1042 | //"key" : "rzp_test_YwHsVFiDIQ2WUQ", |
1041 | "amount": $scope.amount, | 1043 | "amount": $scope.amount, |
1042 | 1044 | ||
1043 | "name": "Startup Jalsa", | 1045 | "name": "Startup Jalsa", |
1044 | "description": "amount", | 1046 | "description": "amount", |
1045 | "currency": "INR", | 1047 | "currency": "INR", |
1046 | "status": "done", | 1048 | "status": "done", |
1047 | 1049 | ||
1048 | "theme": { | 1050 | "theme": { |
1049 | "color": "#2196f3 ", | 1051 | "color": "#2196f3 ", |
1050 | "image_padding": "NO" | 1052 | "image_padding": "NO" |
1051 | }, | 1053 | }, |
1052 | "modal": { | 1054 | "modal": { |
1053 | "ondismiss": function() {} | 1055 | "ondismiss": function() {} |
1054 | }, | 1056 | }, |
1055 | "handler": function(response) { | 1057 | "handler": function(response) { |
1056 | createPayment(response); | 1058 | createPayment(response); |
1057 | } | 1059 | } |
1058 | }; | 1060 | }; |
1059 | var rzp1 = new Razorpay(options); | 1061 | var rzp1 = new Razorpay(options); |
1060 | rzp1.open(); | 1062 | rzp1.open(); |
1061 | $scope.paymentResponse = {}; | 1063 | $scope.paymentResponse = {}; |
1062 | function createPayment(response) { | 1064 | function createPayment(response) { |
1063 | Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); | ||
1064 | $scope.amount = $scope.amount/100; | ||
1065 | console.log("response======retepaymen",response); | 1065 | console.log("response======retepaymen",response); |
1066 | $scope.amount = $scope.amount/100; | ||
1067 | |||
1066 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1068 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1067 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; | 1069 | $scope.paymentResponse.razorOrderId = $scope.searchResult.razorOrderId; |
1068 | $scope.paymentResponse.amount = $scope.amount; | 1070 | $scope.paymentResponse.amount = $scope.amount; |
1069 | $scope.paymentResponse.currency = $scope.searchResult.currency; | 1071 | $scope.paymentResponse.currency = $scope.searchResult.currency; |
1070 | $scope.paymentResponse.status = $scope.searchResult.status; | 1072 | $scope.paymentResponse.status = $scope.searchResult.status; |
1071 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; | 1073 | $scope.paymentResponse.applicantId = $scope.searchResult.applicantId; |
1074 | Analytics.trackEvent('payment','Successfully Done',$scope.data.email,$scope.paymentResponse.amount); | ||
1072 | console.log("$scope.paymentResponse", $scope.paymentResponse) | 1075 | console.log("$scope.paymentResponse", $scope.paymentResponse) |
1073 | $http({ | 1076 | $http({ |
1074 | method: 'PUT', | 1077 | method: 'PUT', |
1075 | url: BASE_URL + '/payments/' + $scope.searchResult.id, | 1078 | url: BASE_URL + '/payments/' + $scope.searchResult.id, |
1076 | data: $scope.paymentResponse, | 1079 | data: $scope.paymentResponse, |
1077 | headers: {} | 1080 | headers: {} |
1078 | }).then(function mySuccess(searchResult) { | 1081 | }).then(function mySuccess(searchResult) { |
1079 | console.log("searchResult--->",searchResult) | 1082 | console.log("searchResult--->",searchResult) |
1080 | // if(paymentResult.data.status == "created"){ | 1083 | // if(paymentResult.data.status == "created"){ |
1081 | // Analytics.trackEvent('payments', 'click', 'Thankyou'); | 1084 | // Analytics.trackEvent('payments', 'click', 'Thankyou'); |
1082 | // } | 1085 | // } |
1083 | console.log("finalsearchResult",searchResult) | 1086 | console.log("finalsearchResult",searchResult) |
1084 | $location.path("/confirmation") | 1087 | $location.path("/confirmation") |
1085 | }, function myError(error) { | 1088 | }, function myError(error) { |
1086 | 1089 | ||
1087 | }); | 1090 | }); |
1088 | } | 1091 | } |
1089 | } else { | 1092 | } else { |
1090 | 1093 | ||
1091 | } | 1094 | } |
1092 | 1095 | ||
1093 | }, function myError(error) {}); | 1096 | }, function myError(error) {}); |
1094 | } | 1097 | } |
1095 | }); | 1098 | }); |
1096 | 1099 | ||
1097 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { | 1100 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
1098 | $scope.data = {}; | 1101 | $scope.data = {}; |
1099 | $scope.check = false; | 1102 | $scope.check = false; |
1100 | $scope.numberCheck = false; | 1103 | $scope.numberCheck = false; |
1101 | 1104 | ||
1102 | /*open videos in modal*/ | 1105 | /*open videos in modal*/ |
1103 | $scope.openyoutube16 = function(){ | 1106 | $scope.openyoutube16 = function(){ |
1104 | $('#videoModel').modal('show'); | 1107 | $('#videoModel').modal('show'); |
1105 | } | 1108 | } |
1106 | 1109 | ||
1107 | $scope.openyoutube17 = function(){ | 1110 | $scope.openyoutube17 = function(){ |
1108 | $('#videoModels').modal('show'); | 1111 | $('#videoModels').modal('show'); |
1109 | } | 1112 | } |
1110 | 1113 | ||
1111 | $scope.closeModal = function(){ | 1114 | $scope.closeModal = function(){ |
1112 | var url = $('#youtubePlayer').attr('src'); | 1115 | var url = $('#youtubePlayer').attr('src'); |
1113 | $('#youtubePlayer').attr('src', ''); | 1116 | $('#youtubePlayer').attr('src', ''); |
1114 | $('#youtubePlayer').attr('src', url); | 1117 | $('#youtubePlayer').attr('src', url); |
1115 | } | 1118 | } |
1116 | /*open videos ends here*/ | 1119 | /*open videos ends here*/ |
1117 | 1120 | ||
1118 | $scope.removeError = function() { | 1121 | $scope.removeError = function() { |
1119 | console.log("doooo") | 1122 | console.log("doooo") |
1120 | $('#invalidEmail').css('display', 'none'); | 1123 | $('#invalidEmail').css('display', 'none'); |
1121 | $('#alreadyExist').css('display', 'none'); | 1124 | $('#alreadyExist').css('display', 'none'); |
1122 | }; | 1125 | }; |
1123 | 1126 | ||
1124 | // $scope.emailcheck = function(val) { | 1127 | // $scope.emailcheck = function(val) { |
1125 | // consol.log("kdsbd") | 1128 | // consol.log("kdsbd") |
1126 | // $scope.space = /\s/g.test(val); | 1129 | // $scope.space = /\s/g.test(val); |
1127 | // console.log("space",$scope.space) | 1130 | // console.log("space",$scope.space) |
1128 | // if (val == undefined) { | 1131 | // if (val == undefined) { |
1129 | // $('#invalidEmail').css('display', 'block'); | 1132 | // $('#invalidEmail').css('display', 'block'); |
1130 | // } else { | 1133 | // } else { |
1131 | // $http({ | 1134 | // $http({ |
1132 | // method: 'GET', | 1135 | // method: 'GET', |
1133 | // url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | 1136 | // url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', |
1134 | // headers: {} | 1137 | // headers: {} |
1135 | // }).then(function mySuccess(searchResult) { | 1138 | // }).then(function mySuccess(searchResult) { |
1136 | // console.log("searchResult1===>", searchResult) | 1139 | // console.log("searchResult1===>", searchResult) |
1137 | // if (searchResult.data.length == 0) { | 1140 | // if (searchResult.data.length == 0) { |
1138 | // $scope.check = false; | 1141 | // $scope.check = false; |
1139 | // } else { | 1142 | // } else { |
1140 | // $scope.check = true; | 1143 | // $scope.check = true; |
1141 | // $('#alreadyExist').css('display', 'block'); | 1144 | // $('#alreadyExist').css('display', 'block'); |
1142 | // } | 1145 | // } |
1143 | // }, function myError(error) {}); | 1146 | // }, function myError(error) {}); |
1144 | // } | 1147 | // } |
1145 | // }; | 1148 | // }; |
1146 | 1149 | ||
1147 | // $scope.removeNoError = function() { | 1150 | // $scope.removeNoError = function() { |
1148 | // $('#invalidNumber').css('display', 'none'); | 1151 | // $('#invalidNumber').css('display', 'none'); |
1149 | // $('#noExist').css('display', 'none'); | 1152 | // $('#noExist').css('display', 'none'); |
1150 | // }; | 1153 | // }; |
1151 | 1154 | ||
1152 | // $scope.numbercheck = function(number) { | 1155 | // $scope.numbercheck = function(number) { |
1153 | // // if (val == undefined) { | 1156 | // // if (val == undefined) { |
1154 | // // $('#invalidNumber').css('display', 'block'); | 1157 | // // $('#invalidNumber').css('display', 'block'); |
1155 | // // } else { | 1158 | // // } else { |
1156 | // $http({ | 1159 | // $http({ |
1157 | // method: 'GET', | 1160 | // method: 'GET', |
1158 | // url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', | 1161 | // url: BASE_URL + '/ambassadors?filter={"where": {"mobile": {"like":"%25' + number + '%25"}}}', |
1159 | // data: $scope.data, | 1162 | // data: $scope.data, |
1160 | // headers: {} | 1163 | // headers: {} |
1161 | // }).then(function mySuccess(searchResult) { | 1164 | // }).then(function mySuccess(searchResult) { |
1162 | // console.log("searchResult===>", searchResult) | 1165 | // console.log("searchResult===>", searchResult) |
1163 | // if (searchResult.data.length == 0) { | 1166 | // if (searchResult.data.length == 0) { |
1164 | // $scope.numberCheck = false; | 1167 | // $scope.numberCheck = false; |
1165 | // } else { | 1168 | // } else { |
1166 | // $scope.numberCheck = true; | 1169 | // $scope.numberCheck = true; |
1167 | // $('#noExist').css('display', 'block'); | 1170 | // $('#noExist').css('display', 'block'); |
1168 | // } | 1171 | // } |
1169 | // }, function myError(error) {}); | 1172 | // }, function myError(error) {}); |
1170 | // //} | 1173 | // //} |
1171 | 1174 | ||
1172 | // }; | 1175 | // }; |
1173 | 1176 | ||
1174 | $scope.submit = function() { | 1177 | $scope.submit = function() { |
1175 | console.log($scope.data.name) | 1178 | console.log($scope.data.name) |
1176 | var randomNumber = ""+Math.random(); | 1179 | var randomNumber = ""+Math.random(); |
1177 | var nameSpliced = $scope.data.name.slice(0,3); | 1180 | var nameSpliced = $scope.data.name.slice(0,3); |
1178 | var numberSpliced = randomNumber.slice(2,5); | 1181 | var numberSpliced = randomNumber.slice(2,5); |
1179 | $scope.data.referalToken = nameSpliced+numberSpliced; | 1182 | $scope.data.referalToken = nameSpliced+numberSpliced; |
1180 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1183 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1181 | 1184 | ||
1182 | $http({ | 1185 | $http({ |
1183 | method: 'POST', | 1186 | method: 'POST', |
1184 | url: BASE_URL + '/ambassadors', | 1187 | url: BASE_URL + '/ambassadors', |
1185 | data: $scope.data, | 1188 | data: $scope.data, |
1186 | headers: {} | 1189 | headers: {} |
1187 | }).then(function mySuccess(result) { | 1190 | }).then(function mySuccess(result) { |
1188 | console.log("result", result) | 1191 | console.log("result", result) |
1189 | $scope.detail = result; | 1192 | $scope.detail = result; |
1190 | $('#myModal').modal('show'); | 1193 | $('#myModal').modal('show'); |
1191 | $scope.data.name = ''; | 1194 | $scope.data.name = ''; |
1192 | $scope.data.email = ''; | 1195 | $scope.data.email = ''; |
1193 | $scope.data.mobile = ''; | 1196 | $scope.data.mobile = ''; |
1194 | // $scope.data.discount = ''; | 1197 | // $scope.data.discount = ''; |
1195 | 1198 | ||
1196 | }, function myError(error) { | 1199 | }, function myError(error) { |
1197 | console.log(error) | 1200 | console.log(error) |
1198 | console.log(error.data.error.message) | 1201 | console.log(error.data.error.message) |
1199 | }); | 1202 | }); |
1200 | console.log($scope.data) | 1203 | console.log($scope.data) |
1201 | } | 1204 | } |
1202 | }); | 1205 | }); |
1203 | 1206 | ||
1204 | 1207 |