Commit e9ea6fde8e27f9fa3105f2977ed062d78f70f82d
1 parent
b13934fca2
Exists in
master
changes in leh city
Showing
2 changed files
with
122 additions
and
124 deletions
Show diff stats
pages/registrationForm.html
1 | 1 | ||
2 | <div class="header"> | 2 | <div class="header"> |
3 | <div> | 3 | <div> |
4 | <!-- <img src="images/LOGO.png" class="logojalsa"><span class="jalsaheadr" style="">2018</span> --> | 4 | <!-- <img src="images/LOGO.png" class="logojalsa"><span class="jalsaheadr" style="">2018</span> --> |
5 | <!-- <img src="images/SartupJalsa_Logo.png" style="width:200px;position:relative;"> --> | 5 | <!-- <img src="images/SartupJalsa_Logo.png" style="width:200px;position:relative;"> --> |
6 | </div> | 6 | </div> |
7 | <div class="clearfix"></div> | 7 | <div class="clearfix"></div> |
8 | <div class="myLoaderWrap" ng-show="loading"> | 8 | <div class="myLoaderWrap" ng-show="loading"> |
9 | <img class="ajax-loader" src="images/loader.gif"> | 9 | <img class="ajax-loader" src="images/loader.gif"> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | <!-- CLOSE HEADER --> | 12 | <!-- CLOSE HEADER --> |
13 | <form name="applicantForm"> | 13 | <form name="applicantForm"> |
14 | <div class="col-xs-12 col-md-8 col-md-offset-2"> | 14 | <div class="col-xs-12 col-md-8 col-md-offset-2"> |
15 | <div class="form-all"> | 15 | <div class="form-all"> |
16 | <div class="col-xs-12 col-md-8 col-md-offset-2 input-wrapper"> | 16 | <div class="col-xs-12 col-md-8 col-md-offset-2 input-wrapper"> |
17 | <h4 class="title">REGISTRATION FORM</h4> | 17 | <h4 class="title">REGISTRATION FORM</h4> |
18 | <div style="color: #FF6600;margin-bottom: 15px;">GENERAL DETAILS</div> | 18 | <div style="color: #FF6600;margin-bottom: 15px;">GENERAL DETAILS</div> |
19 | <div> | 19 | <div> |
20 | <div class="form-group"> | 20 | <div class="form-group"> |
21 | <label>Name:</label> | 21 | <label>Name:</label> |
22 | <input type="name" class="form-control" ng-model="data.name" required> | 22 | <input type="name" class="form-control" ng-model="data.name" required> |
23 | </div> | 23 | </div> |
24 | <div class="form-group"> | 24 | <div class="form-group"> |
25 | <label>Contact Number:</label> | 25 | <label>Contact Number:</label> |
26 | <input type="text" class="form-control" ng-model="data.number" required> | 26 | <input type="text" class="form-control" ng-model="data.number" required> |
27 | <!-- <label class="error-message f-family" id="invalidNumber">Please enter only numeric value.</label> --> | 27 | <!-- <label class="error-message f-family" id="invalidNumber">Please enter only numeric value.</label> --> |
28 | </div> | 28 | </div> |
29 | <div class="form-group"> | 29 | <div class="form-group"> |
30 | <label>Email ID:</label> | 30 | <label>Email ID:</label> |
31 | <input type="email" class="form-control" ng-model="data.email" required> | 31 | <input type="email" class="form-control" ng-model="data.email" required> |
32 | </div> | 32 | </div> |
33 | <div class="form-group"> | 33 | <div class="form-group"> |
34 | <p style="font-weight: bold;">How do you want to register?</p> | 34 | <p style="font-weight: bold;">How do you want to register?</p> |
35 | <!-- <input type="community" class="form-control" ng-model="data.community" required> --> | 35 | <!-- <input type="community" class="form-control" ng-model="data.community" required> --> |
36 | <form> | 36 | <form> |
37 | <label class="radio-inline"> | 37 | <label class="radio-inline"> |
38 | <input type="radio" name="Attend" value="Attend" ng-model="data.register" required>Attend | 38 | <input type="radio" name="Attend" value="Attend" ng-model="data.register" required>Attend |
39 | </label> | 39 | </label> |
40 | <label class="radio-inline"> | 40 | <label class="radio-inline"> |
41 | <input type="radio" name="Pitch" value="Pitch" ng-model="data.register" required>Pitch | 41 | <input type="radio" name="Pitch" value="Pitch" ng-model="data.register" required>Pitch |
42 | </label> | 42 | </label> |
43 | </form> | 43 | </form> |
44 | </div> | 44 | </div> |
45 | </div> | 45 | </div> |
46 | <div ng-switch="data.register"> | 46 | <div ng-switch="data.register"> |
47 | <div ng-switch-when="Pitch"> | 47 | <div ng-switch-when="Pitch"> |
48 | <div class="form-group"> | 48 | <div class="form-group"> |
49 | <label>Startup Name:</label> | 49 | <label>Startup Name:</label> |
50 | <input type="startupName" class="form-control" ng-model="data.startupName" required> | 50 | <input type="startupName" class="form-control" ng-model="data.startupName" required> |
51 | </div> | 51 | </div> |
52 | <div class="form-group"> | 52 | <div class="form-group"> |
53 | <label>Introduction about your startup</label> | 53 | <label>Introduction about your startup</label> |
54 | <textarea type="intro" class="form-control" rows="5" ng-model="data.intro" required></textarea> | 54 | <textarea type="intro" class="form-control" rows="5" ng-model="data.intro" required></textarea> |
55 | </div> | 55 | </div> |
56 | <div class="form-group"> | 56 | <div class="form-group"> |
57 | <label>Stage</label> | 57 | <label>Stage</label> |
58 | <!-- <input type="people" class="form-control" ng-model="data.people" required> --> | 58 | <!-- <input type="people" class="form-control" ng-model="data.people" required> --> |
59 | <form> | 59 | <form> |
60 | <label class="radio-inline"> | 60 | <label class="radio-inline"> |
61 | <input type="radio" name="Idea" value="Idea" ng-model="data.stage" required>Idea | 61 | <input type="radio" name="Idea" value="Idea" ng-model="data.stage" required>Idea |
62 | </label> | 62 | </label> |
63 | <label class="radio-inline"> | 63 | <label class="radio-inline"> |
64 | <input type="radio" name="POC/Beta" value="POC/Beta" ng-model="data.stage" required>POC/Beta | 64 | <input type="radio" name="POC/Beta" value="POC/Beta" ng-model="data.stage" required>POC/Beta |
65 | </label> | 65 | </label> |
66 | <label class="radio-inline"> | 66 | <label class="radio-inline"> |
67 | <input type="radio" name="Revenue" value="Revenue" ng-model="data.stage" required>Revenue | 67 | <input type="radio" name="Revenue" value="Revenue" ng-model="data.stage" required>Revenue |
68 | </label> | 68 | </label> |
69 | </form> | 69 | </form> |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | </div> | 72 | </div> |
73 | <div class="form-group"> | 73 | <!-- <div class="form-group"> |
74 | <label>Coupon Code:</label> | 74 | <label>Coupon Code:</label> --> |
75 | <!-- <input type="text" class="form-control" placeholder="If you have a coupon code then apply here"ng-model="data.referalToken"> --> | 75 | <!-- <input type="text" class="form-control" placeholder="If you have a coupon code then apply here"ng-model="data.referalToken"> --> |
76 | <input type="text" class="form-control" ng-model="data.referalToken" style="position: relative;" placeholder="If you have a coupon code then apply here" ng-required="referalToken" ng-change="changeReferalIconColor(data.referalToken)"> | 76 | <!-- <input type="text" class="form-control" ng-model="data.referalToken" style="position: relative;" placeholder="If you have a coupon code then apply here" ng-required="referalToken" ng-change="changeReferalIconColor(data.referalToken)"> |
77 | <i class="material-icons coupon-approved" ng-if="tokencheck == true">check</i> | 77 | <i class="material-icons coupon-approved" ng-if="tokencheck == true">check</i> |
78 | <i class="material-icons coupon-approved" style="color:red;" ng-if="tokencheck == false">close</i> | 78 | <i class="material-icons coupon-approved" style="color:red;" ng-if="tokencheck == false">close</i> |
79 | <button type="button" ng-click="tokenCall(data.referalToken)" class="pull-right apply-coupon-btn">Apply</button> | 79 | <button type="button" ng-click="tokenCall(data.referalToken)" class="pull-right apply-coupon-btn">Apply</button> |
80 | </div> | 80 | </div> --> |
81 | </div> | 81 | </div> |
82 | <div class="clearfix"></div> | 82 | <div class="clearfix"></div> |
83 | <div class="text-center"> | 83 | <div class="text-center"> |
84 | <input type="submit" class="btn submit-button-form" style="outline: none;" ng-disabled="applicantForm.$invalid" value="Submit" ng-click="formRegister()"> | 84 | <input type="submit" class="btn submit-button-form" style="outline: none;" ng-disabled="applicantForm.$invalid" value="Submit" ng-click="formRegister()"> |
85 | </div> | 85 | </div> |
86 | </div> | 86 | </div> |
87 | </div> | 87 | </div> |
88 | </form> | 88 | </form> |
89 | <!-- CLOSE FORM --> | 89 | <!-- CLOSE FORM --> |
90 | <!-- </div> CLOSE CHECK VIEW --> | 90 | <!-- </div> CLOSE CHECK VIEW --> |
91 | <span ng-show="span == true"> | 91 | <span ng-show="span == true"> |
92 | <span id="chennai"></span> | 92 | <span id="chennai"></span> |
93 | <span id="mumbai"></span> | 93 | <span id="mumbai"></span> |
94 | <span id="hyderabad"></span> | 94 | <span id="hyderabad"></span> |
95 | <span id="kolkata"></span> | 95 | <span id="kolkata"></span> |
96 | <span id="delhi"></span> | 96 | <span id="delhi"></span> |
97 | <span id="ahmedabad"></span> | 97 | <span id="ahmedabad"></span> |
98 | <span id="bengaluru"></span> | 98 | <span id="bengaluru"></span> |
99 | <span id="jaipur"></span> | 99 | <span id="jaipur"></span> |
100 | <span id="kanpur"></span> | 100 | <span id="kanpur"></span> |
101 | <span id="dharamsala"></span> | 101 | <span id="dharamsala"></span> |
102 | </span> | 102 | </span> |
103 | 103 | ||
104 | 104 | ||
105 | 105 | ||
106 | 106 |
script.js
1 | // create the module and name it scotchApp | 1 | // create the module and name it scotchApp |
2 | var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); | 2 | var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
3 | 3 | ||
4 | // configure our routes | 4 | // configure our routes |
5 | scotchApp.config(function($routeProvider,$locationProvider) { | 5 | scotchApp.config(function($routeProvider,$locationProvider) { |
6 | 6 | ||
7 | // use the HTML5 History API | 7 | // use the HTML5 History API |
8 | // $locationProvider.html5Mode({ | 8 | // $locationProvider.html5Mode({ |
9 | // enabled: true, | 9 | // enabled: true, |
10 | // requireBase: false | 10 | // requireBase: false |
11 | // }); | 11 | // }); |
12 | //$locationProvider.hashPrefix('!'); | 12 | //$locationProvider.hashPrefix('!'); |
13 | $routeProvider | 13 | $routeProvider |
14 | // route for the Home page | 14 | // route for the Home page |
15 | .when('/', { | 15 | .when('/', { |
16 | templateUrl: 'pages/Home.html', | 16 | templateUrl: 'pages/Home.html', |
17 | controller: 'mainController' | 17 | controller: 'mainController' |
18 | }) | 18 | }) |
19 | 19 | ||
20 | // route for the caricatures page | 20 | // route for the caricatures page |
21 | .when('/caricatures', { | 21 | .when('/caricatures', { |
22 | templateUrl: 'pages/caricatures.html', | 22 | templateUrl: 'pages/caricatures.html', |
23 | controller: 'mainController' | 23 | controller: 'mainController' |
24 | }) | 24 | }) |
25 | 25 | ||
26 | // route for the registration page | 26 | // route for the registration page |
27 | .when('/registration', { | 27 | .when('/registration', { |
28 | templateUrl: 'pages/registration.html', | 28 | templateUrl: 'pages/registration.html', |
29 | controller: 'registrationController' | 29 | controller: 'registrationController' |
30 | }) | 30 | }) |
31 | 31 | ||
32 | // route for the registration page | 32 | // route for the registration page |
33 | .when('/registrationForm', { | 33 | .when('/registrationForm', { |
34 | templateUrl: 'pages/registrationForm.html', | 34 | templateUrl: 'pages/registrationForm.html', |
35 | controller: 'registrationFormController' | 35 | controller: 'registrationFormController' |
36 | }) | 36 | }) |
37 | 37 | ||
38 | //route for the ambassador page | 38 | //route for the ambassador page |
39 | .when('/startupJalsaPromocode', { | 39 | .when('/startupJalsaPromocode', { |
40 | templateUrl: 'pages/ambassador.html', | 40 | templateUrl: 'pages/ambassador.html', |
41 | controller: 'ambassadorController' | 41 | controller: 'ambassadorController' |
42 | }) | 42 | }) |
43 | 43 | ||
44 | //route for the campusAmbassador page | 44 | //route for the campusAmbassador page |
45 | .when('/campusAmbassador', { | 45 | .when('/campusAmbassador', { |
46 | templateUrl: 'pages/campusAmbassador.html', | 46 | templateUrl: 'pages/campusAmbassador.html', |
47 | controller: 'mainController' | 47 | controller: 'mainController' |
48 | }) | 48 | }) |
49 | 49 | ||
50 | //route for the campusAmbassador page | 50 | //route for the campusAmbassador page |
51 | .when('/campusAmbassadorForm', { | 51 | .when('/campusAmbassadorForm', { |
52 | templateUrl: 'pages/campusAmbassadorForm.html', | 52 | templateUrl: 'pages/campusAmbassadorForm.html', |
53 | controller: 'campusAmbassadorController' | 53 | controller: 'campusAmbassadorController' |
54 | }) | 54 | }) |
55 | 55 | ||
56 | // route for the confirmation page | 56 | // route for the confirmation page |
57 | // .when('/confirmation', { | 57 | // .when('/confirmation', { |
58 | // templateUrl: 'pages/confirmation.html', | 58 | // templateUrl: 'pages/confirmation.html', |
59 | // controller: 'confirmationController' | 59 | // controller: 'confirmationController' |
60 | // }) | 60 | // }) |
61 | 61 | ||
62 | // route for the confirmation page | 62 | // route for the confirmation page |
63 | .when('/confirmation', { | 63 | .when('/confirmation', { |
64 | templateUrl: 'pages/campusAmbassadorConfirm.html', | 64 | templateUrl: 'pages/campusAmbassadorConfirm.html', |
65 | controller: 'confirmationController' | 65 | controller: 'confirmationController' |
66 | }) | 66 | }) |
67 | 67 | ||
68 | // route for the confirmation page | 68 | // route for the confirmation page |
69 | .when('/confirm', { | 69 | .when('/confirm', { |
70 | templateUrl: 'pages/confirm.html', | 70 | templateUrl: 'pages/confirm.html', |
71 | controller: 'confirmationController' | 71 | controller: 'confirmationController' |
72 | }) | 72 | }) |
73 | 73 | ||
74 | // route for the paytm page | 74 | // route for the paytm page |
75 | .when('/paytm', { | 75 | .when('/paytm', { |
76 | templateUrl: 'pages/paytm.html', | 76 | templateUrl: 'pages/paytm.html', |
77 | controller: 'mainController' | 77 | controller: 'mainController' |
78 | }) | 78 | }) |
79 | 79 | ||
80 | // route for the paytm page | 80 | // route for the paytm page |
81 | .when('/paytm/caricatures', { | 81 | .when('/paytm/caricatures', { |
82 | templateUrl: 'pages/paytmCaricatures.html', | 82 | templateUrl: 'pages/paytmCaricatures.html', |
83 | controller: 'mainController' | 83 | controller: 'mainController' |
84 | }) | 84 | }) |
85 | 85 | ||
86 | // route for the paytm page | 86 | // route for the paytm page |
87 | .when('/paytm/checkout', { | 87 | .when('/paytm/checkout', { |
88 | templateUrl: 'pages/paytmCheckout.html', | 88 | templateUrl: 'pages/paytmCheckout.html', |
89 | controller: 'paytmController' | 89 | controller: 'paytmController' |
90 | }) | 90 | }) |
91 | 91 | ||
92 | // route for the confirmation page | 92 | // route for the confirmation page |
93 | .when('/paytm/confirm', { | 93 | .when('/paytm/confirm', { |
94 | templateUrl: 'pages/confirmed.html', | 94 | templateUrl: 'pages/confirmed.html', |
95 | controller: 'paytmController' | 95 | controller: 'paytmController' |
96 | }) | 96 | }) |
97 | 97 | ||
98 | .otherwise({ | 98 | .otherwise({ |
99 | redirectTo: '/' | 99 | redirectTo: '/' |
100 | }); | 100 | }); |
101 | 101 | ||
102 | }); | 102 | }); |
103 | 103 | ||
104 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { | 104 | scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { |
105 | // Add configuration code as desired | 105 | // Add configuration code as desired |
106 | AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code | 106 | AnalyticsProvider.setAccount('UA-123583154-1'); //UU-XXXXXXX-X should be your tracking code |
107 | 107 | ||
108 | // Track all routes (default is true). | 108 | // Track all routes (default is true). |
109 | AnalyticsProvider.trackPages(true); | 109 | AnalyticsProvider.trackPages(true); |
110 | 110 | ||
111 | // Track all URL query params (default is false). | 111 | // Track all URL query params (default is false). |
112 | AnalyticsProvider.trackUrlParams(true); | 112 | AnalyticsProvider.trackUrlParams(true); |
113 | 113 | ||
114 | }]).run(['Analytics', function(Analytics) { }]); | 114 | }]).run(['Analytics', function(Analytics) { }]); |
115 | 115 | ||
116 | scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") | 116 | scotchApp.constant("BASE_URL", "https://events.startupjalsa.com/v1") |
117 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") | 117 | //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
118 | 118 | ||
119 | scotchApp.directive('validFile',function(){ | 119 | scotchApp.directive('validFile',function(){ |
120 | return { | 120 | return { |
121 | require:'ngModel', | 121 | require:'ngModel', |
122 | link:function(scope,el,attrs,ngModel){ | 122 | link:function(scope,el,attrs,ngModel){ |
123 | //change event is fired when file is selected | 123 | //change event is fired when file is selected |
124 | el.bind('change',function(){ | 124 | el.bind('change',function(){ |
125 | scope.$apply(function(){ | 125 | scope.$apply(function(){ |
126 | ngModel.$setViewValue(el.val()); | 126 | ngModel.$setViewValue(el.val()); |
127 | ngModel.$render(); | 127 | ngModel.$render(); |
128 | }) | 128 | }) |
129 | }) | 129 | }) |
130 | } | 130 | } |
131 | } | 131 | } |
132 | }) | 132 | }) |
133 | 133 | ||
134 | // create the controller and inject Angular's $scope | 134 | // create the controller and inject Angular's $scope |
135 | scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { | 135 | scotchApp.controller('mainController', function($scope, $http, $window, $location, $route, $rootScope, BASE_URL, Analytics) { |
136 | $scope.data = { | 136 | $scope.data = { |
137 | show: true, | 137 | show: true, |
138 | hide: false | 138 | hide: false |
139 | }; | 139 | }; |
140 | jQuery('#defaultcountry').addClass('btn-active') | 140 | jQuery('#defaultcountry').addClass('btn-active') |
141 | // window.onload = function(){ | 141 | // window.onload = function(){ |
142 | // // var element = document.getElementById("defaultcountry"); | 142 | // // var element = document.getElementById("defaultcountry"); |
143 | // // element.classList.add("btn-active"); | 143 | // // element.classList.add("btn-active"); |
144 | // jQuery('#defaultcountry').addClass('btn-active') | 144 | // jQuery('#defaultcountry').addClass('btn-active') |
145 | // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; | 145 | // //document.getElementById("ahmedabad").src = "images/Ahmedabad_1.png"; |
146 | // } | 146 | // } |
147 | 147 | ||
148 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); | 148 | var chennai = new Date("Sept 19, 2018 12:00:00").getTime(); |
149 | // Update the count down every 1 second | 149 | // Update the count down every 1 second |
150 | var x = setInterval(function() { | 150 | var x = setInterval(function() { |
151 | // Get todays date and time | 151 | // Get todays date and time |
152 | var now = new Date().getTime(); | 152 | var now = new Date().getTime(); |
153 | // Find the distance between now an the count down date | 153 | // Find the distance between now an the count down date |
154 | var distance = chennai - now; | 154 | var distance = chennai - now; |
155 | // Time calculations for days, hours, minutes and seconds | 155 | // Time calculations for days, hours, minutes and seconds |
156 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 156 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
157 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 157 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
158 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 158 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
159 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 159 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
160 | $scope.timer = days + "d " + hours + "h " | 160 | $scope.timer = days + "d " + hours + "h " |
161 | + minutes + "m " + seconds + "s " | 161 | + minutes + "m " + seconds + "s " |
162 | // Output the result in an element with id="demo" | 162 | // Output the result in an element with id="demo" |
163 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " | 163 | document.getElementById("chennai").innerHTML = days + "d " + hours + "h " |
164 | + minutes + "m " + seconds + "s "; | 164 | + minutes + "m " + seconds + "s "; |
165 | // If the count down is over, write some text | 165 | // If the count down is over, write some text |
166 | if (distance < 0) { | 166 | if (distance < 0) { |
167 | clearInterval(x); | 167 | clearInterval(x); |
168 | document.getElementById("chennai").innerHTML = "EXPIRED"; | 168 | document.getElementById("chennai").innerHTML = "EXPIRED"; |
169 | } | 169 | } |
170 | }, 1000); | 170 | }, 1000); |
171 | 171 | ||
172 | var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); | 172 | var hyderabad = new Date("Sept 22, 2018 14:00:00").getTime(); |
173 | // Update the count down every 1 second | 173 | // Update the count down every 1 second |
174 | var x = setInterval(function() { | 174 | var x = setInterval(function() { |
175 | // Get todays date and time | 175 | // Get todays date and time |
176 | var now = new Date().getTime(); | 176 | var now = new Date().getTime(); |
177 | // Find the distance between now an the count down date | 177 | // Find the distance between now an the count down date |
178 | var distance = hyderabad - now; | 178 | var distance = hyderabad - now; |
179 | // Time calculations for days, hours, minutes and seconds | 179 | // Time calculations for days, hours, minutes and seconds |
180 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 180 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
181 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 181 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
182 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 182 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
183 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 183 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
184 | $scope.timer = days + "d " + hours + "h " | 184 | $scope.timer = days + "d " + hours + "h " |
185 | + minutes + "m " + seconds + "s " | 185 | + minutes + "m " + seconds + "s " |
186 | // Output the result in an element with id="demo" | 186 | // Output the result in an element with id="demo" |
187 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " | 187 | document.getElementById("hyderabad").innerHTML = days + "d " + hours + "h " |
188 | + minutes + "m " + seconds + "s "; | 188 | + minutes + "m " + seconds + "s "; |
189 | // If the count down is over, write some text | 189 | // If the count down is over, write some text |
190 | if (distance < 0) { | 190 | if (distance < 0) { |
191 | clearInterval(x); | 191 | clearInterval(x); |
192 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; | 192 | document.getElementById("hyderabad").innerHTML = "EXPIRED"; |
193 | } | 193 | } |
194 | }, 1000); | 194 | }, 1000); |
195 | 195 | ||
196 | var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); | 196 | var mumbai = new Date("Sept 26, 2018 14:00:00").getTime(); |
197 | // Update the count down every 1 second | 197 | // Update the count down every 1 second |
198 | var x = setInterval(function() { | 198 | var x = setInterval(function() { |
199 | // Get todays date and time | 199 | // Get todays date and time |
200 | var now = new Date().getTime(); | 200 | var now = new Date().getTime(); |
201 | // Find the distance between now an the count down date | 201 | // Find the distance between now an the count down date |
202 | var distance = mumbai - now; | 202 | var distance = mumbai - now; |
203 | // Time calculations for days, hours, minutes and seconds | 203 | // Time calculations for days, hours, minutes and seconds |
204 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 204 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
205 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 205 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
206 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 206 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
207 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 207 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
208 | $scope.timer = days + "d " + hours + "h " | 208 | $scope.timer = days + "d " + hours + "h " |
209 | + minutes + "m " + seconds + "s " | 209 | + minutes + "m " + seconds + "s " |
210 | // Output the result in an element with id="demo" | 210 | // Output the result in an element with id="demo" |
211 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " | 211 | document.getElementById("mumbai").innerHTML = days + "d " + hours + "h " |
212 | + minutes + "m " + seconds + "s "; | 212 | + minutes + "m " + seconds + "s "; |
213 | // If the count down is over, write some text | 213 | // If the count down is over, write some text |
214 | if (distance < 0) { | 214 | if (distance < 0) { |
215 | clearInterval(x); | 215 | clearInterval(x); |
216 | document.getElementById("mumbai").innerHTML = "EXPIRED"; | 216 | document.getElementById("mumbai").innerHTML = "EXPIRED"; |
217 | } | 217 | } |
218 | }, 1000); | 218 | }, 1000); |
219 | 219 | ||
220 | var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); | 220 | var kolkata = new Date("Oct 3, 2018 14:00:00").getTime(); |
221 | // Update the count down every 1 second | 221 | // Update the count down every 1 second |
222 | var x = setInterval(function() { | 222 | var x = setInterval(function() { |
223 | // Get todays date and time | 223 | // Get todays date and time |
224 | var now = new Date().getTime(); | 224 | var now = new Date().getTime(); |
225 | // Find the distance between now an the count down date | 225 | // Find the distance between now an the count down date |
226 | var distance = kolkata - now; | 226 | var distance = kolkata - now; |
227 | // Time calculations for days, hours, minutes and seconds | 227 | // Time calculations for days, hours, minutes and seconds |
228 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 228 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
229 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 229 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
230 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 230 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
231 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 231 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
232 | $scope.timer = days + "d " + hours + "h " | 232 | $scope.timer = days + "d " + hours + "h " |
233 | + minutes + "m " + seconds + "s " | 233 | + minutes + "m " + seconds + "s " |
234 | // Output the result in an element with id="demo" | 234 | // Output the result in an element with id="demo" |
235 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " | 235 | document.getElementById("kolkata").innerHTML = days + "d " + hours + "h " |
236 | + minutes + "m " + seconds + "s "; | 236 | + minutes + "m " + seconds + "s "; |
237 | // If the count down is over, write some text | 237 | // If the count down is over, write some text |
238 | if (distance < 0) { | 238 | if (distance < 0) { |
239 | clearInterval(x); | 239 | clearInterval(x); |
240 | document.getElementById("kolkata").innerHTML = "EXPIRED"; | 240 | document.getElementById("kolkata").innerHTML = "EXPIRED"; |
241 | } | 241 | } |
242 | }, 1000); | 242 | }, 1000); |
243 | 243 | ||
244 | var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); | 244 | var jaipur = new Date("Oct 5, 2018 14:00:00").getTime(); |
245 | // Update the count down every 1 second | 245 | // Update the count down every 1 second |
246 | var x = setInterval(function() { | 246 | var x = setInterval(function() { |
247 | // Get todays date and time | 247 | // Get todays date and time |
248 | var now = new Date().getTime(); | 248 | var now = new Date().getTime(); |
249 | // Find the distance between now an the count down date | 249 | // Find the distance between now an the count down date |
250 | var distance = jaipur - now; | 250 | var distance = jaipur - now; |
251 | // Time calculations for days, hours, minutes and seconds | 251 | // Time calculations for days, hours, minutes and seconds |
252 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 252 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
253 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 253 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
254 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 254 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
255 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 255 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
256 | $scope.timer = days + "d " + hours + "h " | 256 | $scope.timer = days + "d " + hours + "h " |
257 | + minutes + "m " + seconds + "s " | 257 | + minutes + "m " + seconds + "s " |
258 | // Output the result in an element with id="demo" | 258 | // Output the result in an element with id="demo" |
259 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " | 259 | document.getElementById("jaipur").innerHTML = days + "d " + hours + "h " |
260 | + minutes + "m " + seconds + "s "; | 260 | + minutes + "m " + seconds + "s "; |
261 | // If the count down is over, write some text | 261 | // If the count down is over, write some text |
262 | if (distance < 0) { | 262 | if (distance < 0) { |
263 | clearInterval(x); | 263 | clearInterval(x); |
264 | document.getElementById("jaipur").innerHTML = "EXPIRED"; | 264 | document.getElementById("jaipur").innerHTML = "EXPIRED"; |
265 | } | 265 | } |
266 | }, 1000); | 266 | }, 1000); |
267 | 267 | ||
268 | var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); | 268 | var delhi = new Date("Oct 8, 2018 14:00:00").getTime(); |
269 | // Update the count down every 1 second | 269 | // Update the count down every 1 second |
270 | var x = setInterval(function() { | 270 | var x = setInterval(function() { |
271 | // Get todays date and time | 271 | // Get todays date and time |
272 | var now = new Date().getTime(); | 272 | var now = new Date().getTime(); |
273 | // Find the distance between now an the count down date | 273 | // Find the distance between now an the count down date |
274 | var distance = delhi - now; | 274 | var distance = delhi - now; |
275 | // Time calculations for days, hours, minutes and seconds | 275 | // Time calculations for days, hours, minutes and seconds |
276 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 276 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
277 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 277 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
278 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 278 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
279 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 279 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
280 | $scope.timer = days + "d " + hours + "h " | 280 | $scope.timer = days + "d " + hours + "h " |
281 | + minutes + "m " + seconds + "s " | 281 | + minutes + "m " + seconds + "s " |
282 | // Output the result in an element with id="demo" | 282 | // Output the result in an element with id="demo" |
283 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " | 283 | document.getElementById("delhi").innerHTML = days + "d " + hours + "h " |
284 | + minutes + "m " + seconds + "s "; | 284 | + minutes + "m " + seconds + "s "; |
285 | // If the count down is over, write some text | 285 | // If the count down is over, write some text |
286 | if (distance < 0) { | 286 | if (distance < 0) { |
287 | clearInterval(x); | 287 | clearInterval(x); |
288 | document.getElementById("delhi").innerHTML = "EXPIRED"; | 288 | document.getElementById("delhi").innerHTML = "EXPIRED"; |
289 | } | 289 | } |
290 | }, 1000); | 290 | }, 1000); |
291 | 291 | ||
292 | var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); | 292 | var kanpur = new Date("Oct 10, 2018 14:00:00").getTime(); |
293 | // Update the count down every 1 second | 293 | // Update the count down every 1 second |
294 | var x = setInterval(function() { | 294 | var x = setInterval(function() { |
295 | // Get todays date and time | 295 | // Get todays date and time |
296 | var now = new Date().getTime(); | 296 | var now = new Date().getTime(); |
297 | // Find the distance between now an the count down date | 297 | // Find the distance between now an the count down date |
298 | var distance = kanpur - now; | 298 | var distance = kanpur - now; |
299 | // Time calculations for days, hours, minutes and seconds | 299 | // Time calculations for days, hours, minutes and seconds |
300 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 300 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
301 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 301 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
302 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 302 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
303 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 303 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
304 | $scope.timer = days + "d " + hours + "h " | 304 | $scope.timer = days + "d " + hours + "h " |
305 | + minutes + "m " + seconds + "s " | 305 | + minutes + "m " + seconds + "s " |
306 | // Output the result in an element with id="demo" | 306 | // Output the result in an element with id="demo" |
307 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " | 307 | document.getElementById("kanpur").innerHTML = days + "d " + hours + "h " |
308 | + minutes + "m " + seconds + "s "; | 308 | + minutes + "m " + seconds + "s "; |
309 | // If the count down is over, write some text | 309 | // If the count down is over, write some text |
310 | if (distance < 0) { | 310 | if (distance < 0) { |
311 | clearInterval(x); | 311 | clearInterval(x); |
312 | document.getElementById("kanpur").innerHTML = "EXPIRED"; | 312 | document.getElementById("kanpur").innerHTML = "EXPIRED"; |
313 | } | 313 | } |
314 | }, 1000); | 314 | }, 1000); |
315 | 315 | ||
316 | var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); | 316 | var ahmedabad = new Date("Oct 12, 2018 14:00:00").getTime(); |
317 | // Update the count down every 1 second | 317 | // Update the count down every 1 second |
318 | var x = setInterval(function() { | 318 | var x = setInterval(function() { |
319 | // Get todays date and time | 319 | // Get todays date and time |
320 | var now = new Date().getTime(); | 320 | var now = new Date().getTime(); |
321 | // Find the distance between now an the count down date | 321 | // Find the distance between now an the count down date |
322 | var distance = ahmedabad - now; | 322 | var distance = ahmedabad - now; |
323 | // Time calculations for days, hours, minutes and seconds | 323 | // Time calculations for days, hours, minutes and seconds |
324 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 324 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
325 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 325 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
326 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 326 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
327 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 327 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
328 | $scope.timer = days + "d " + hours + "h " | 328 | $scope.timer = days + "d " + hours + "h " |
329 | + minutes + "m " + seconds + "s " | 329 | + minutes + "m " + seconds + "s " |
330 | // Output the result in an element with id="demo" | 330 | // Output the result in an element with id="demo" |
331 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " | 331 | document.getElementById("ahmedabad").innerHTML = days + "d " + hours + "h " |
332 | + minutes + "m " + seconds + "s "; | 332 | + minutes + "m " + seconds + "s "; |
333 | // If the count down is over, write some text | 333 | // If the count down is over, write some text |
334 | if (distance < 0) { | 334 | if (distance < 0) { |
335 | clearInterval(x); | 335 | clearInterval(x); |
336 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; | 336 | document.getElementById("ahmedabad").innerHTML = "EXPIRED"; |
337 | } | 337 | } |
338 | }, 1000); | 338 | }, 1000); |
339 | 339 | ||
340 | var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); | 340 | var bengaluru = new Date("Oct 13, 2018 14:00:00").getTime(); |
341 | // Update the count down every 1 second | 341 | // Update the count down every 1 second |
342 | var x = setInterval(function() { | 342 | var x = setInterval(function() { |
343 | // Get todays date and time | 343 | // Get todays date and time |
344 | var now = new Date().getTime(); | 344 | var now = new Date().getTime(); |
345 | // Find the distance between now an the count down date | 345 | // Find the distance between now an the count down date |
346 | var distance = bengaluru - now; | 346 | var distance = bengaluru - now; |
347 | // Time calculations for days, hours, minutes and seconds | 347 | // Time calculations for days, hours, minutes and seconds |
348 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 348 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
349 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 349 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
350 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 350 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
351 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 351 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
352 | $scope.timer = days + "d " + hours + "h " | 352 | $scope.timer = days + "d " + hours + "h " |
353 | + minutes + "m " + seconds + "s " | 353 | + minutes + "m " + seconds + "s " |
354 | // Output the result in an element with id="demo" | 354 | // Output the result in an element with id="demo" |
355 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " | 355 | document.getElementById("bengaluru").innerHTML = days + "d " + hours + "h " |
356 | + minutes + "m " + seconds + "s "; | 356 | + minutes + "m " + seconds + "s "; |
357 | // If the count down is over, write some text | 357 | // If the count down is over, write some text |
358 | if (distance < 0) { | 358 | if (distance < 0) { |
359 | clearInterval(x); | 359 | clearInterval(x); |
360 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; | 360 | document.getElementById("bengaluru").innerHTML = "EXPIRED"; |
361 | } | 361 | } |
362 | }, 1000); | 362 | }, 1000); |
363 | 363 | ||
364 | var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); | 364 | var dharamsala = new Date("Dec 14, 2018 14:00:00").getTime(); |
365 | // Update the count down every 1 second | 365 | // Update the count down every 1 second |
366 | var x = setInterval(function() { | 366 | var x = setInterval(function() { |
367 | // Get todays date and time | 367 | // Get todays date and time |
368 | var now = new Date().getTime(); | 368 | var now = new Date().getTime(); |
369 | // Find the distance between now an the count down date | 369 | // Find the distance between now an the count down date |
370 | var distance = dharamsala - now; | 370 | var distance = dharamsala - now; |
371 | // Time calculations for days, hours, minutes and seconds | 371 | // Time calculations for days, hours, minutes and seconds |
372 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); | 372 | var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
373 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | 373 | var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
374 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | 374 | var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
375 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | 375 | var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
376 | $scope.timer = days + "d " + hours + "h " | 376 | $scope.timer = days + "d " + hours + "h " |
377 | + minutes + "m " + seconds + "s " | 377 | + minutes + "m " + seconds + "s " |
378 | // Output the result in an element with id="demo" | 378 | // Output the result in an element with id="demo" |
379 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " | 379 | document.getElementById("dharamsala").innerHTML = days + "d " + hours + "h " |
380 | + minutes + "m " + seconds + "s "; | 380 | + minutes + "m " + seconds + "s "; |
381 | // If the count down is over, write some text | 381 | // If the count down is over, write some text |
382 | if (distance < 0) { | 382 | if (distance < 0) { |
383 | clearInterval(x); | 383 | clearInterval(x); |
384 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; | 384 | document.getElementById("dharamsala").innerHTML = "EXPIRED"; |
385 | } | 385 | } |
386 | }, 1000); | 386 | }, 1000); |
387 | 387 | ||
388 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 388 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
389 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 389 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
390 | // $scope.Textshow = "yes" | 390 | // $scope.Textshow = "yes" |
391 | $scope.max = 100; | 391 | $scope.max = 100; |
392 | $scope.formPage = false; | 392 | $scope.formPage = false; |
393 | $scope.current = 0; | 393 | $scope.current = 0; |
394 | $scope.payingAmnt = 0; | 394 | $scope.payingAmnt = 0; |
395 | $scope.data = {}; | 395 | $scope.data = {}; |
396 | $scope.discountAmount = 0; | 396 | $scope.discountAmount = 0; |
397 | // $scope.data.quantity = "1"; | 397 | // $scope.data.quantity = "1"; |
398 | $scope.check = false; | 398 | $scope.check = false; |
399 | $scope.numberCheck = false; | 399 | $scope.numberCheck = false; |
400 | $scope.paymentResult = {}; | 400 | $scope.paymentResult = {}; |
401 | var data = { | 401 | var data = { |
402 | "amount": $scope.payingAmnt, | 402 | "amount": $scope.payingAmnt, |
403 | "currency": "INR", | 403 | "currency": "INR", |
404 | "status": "pending" | 404 | "status": "pending" |
405 | } | 405 | } |
406 | 406 | ||
407 | $scope.showval = true; | 407 | $scope.showval = true; |
408 | $scope.hideval = false; | 408 | $scope.hideval = false; |
409 | $scope.showvalue = false; | 409 | $scope.showvalue = false; |
410 | $scope.hidevalue = false; | 410 | $scope.hidevalue = false; |
411 | localStorage.setItem("country",'INDIA'); | 411 | localStorage.setItem("country",'INDIA'); |
412 | $scope.isShowHide = function (value) { | 412 | $scope.isShowHide = function (value) { |
413 | var element = document.getElementById("defaultcountry"); | 413 | var element = document.getElementById("defaultcountry"); |
414 | element.classList.remove("btn-active"); | 414 | element.classList.remove("btn-active"); |
415 | localStorage.setItem("country",value); | 415 | localStorage.setItem("country",value); |
416 | if (value == "INDIA") { | 416 | if (value == "INDIA") { |
417 | console.log("value",value) | 417 | console.log("value",value) |
418 | $scope.showval = true; | 418 | $scope.showval = true; |
419 | $scope.hideval = false; | 419 | $scope.hideval = false; |
420 | $scope.showvalue = false; | 420 | $scope.showvalue = false; |
421 | $scope.hidevalue = false; | 421 | $scope.hidevalue = false; |
422 | } | 422 | } |
423 | else if (value == "SRI LANKA") { | 423 | else if (value == "SRI LANKA") { |
424 | console.log("value1",value) | 424 | console.log("value1",value) |
425 | $scope.showval = false; | 425 | $scope.showval = false; |
426 | $scope.hideval = true; | 426 | $scope.hideval = true; |
427 | $scope.showvalue = false; | 427 | $scope.showvalue = false; |
428 | $scope.hidevalue = false; | 428 | $scope.hidevalue = false; |
429 | } | 429 | } |
430 | else { | 430 | else { |
431 | console.log("value2",value) | 431 | console.log("value2",value) |
432 | $scope.showval = false; | 432 | $scope.showval = false; |
433 | $scope.hideval = false; | 433 | $scope.hideval = false; |
434 | $scope.showvalue = true; | 434 | $scope.showvalue = true; |
435 | $scope.hidevalue = false; | 435 | $scope.hidevalue = false; |
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | $scope.apply = function() { | 439 | $scope.apply = function() { |
440 | $location.path("/caricatures") | 440 | $location.path("/caricatures") |
441 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; | 441 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowUp&utm_medium=Reg"; |
442 | 442 | ||
443 | } | 443 | } |
444 | 444 | ||
445 | $scope.applyRegister = function() { | 445 | $scope.applyRegister = function() { |
446 | $location.path("/paytm/caricatures") | 446 | $location.path("/paytm/caricatures") |
447 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; | 447 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; |
448 | } | 448 | } |
449 | 449 | ||
450 | $scope.applyForm = function() { | 450 | $scope.applyForm = function() { |
451 | //console.log("palak") | 451 | //console.log("palak") |
452 | $location.path("/campusAmbassadorForm") | 452 | $location.path("/campusAmbassadorForm") |
453 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; | 453 | //window.location.href = "https://startupjalsa.com/events#/caricatures?utm_source=RegisterNowDown&utm_medium=Register"; |
454 | } | 454 | } |
455 | 455 | ||
456 | $scope.click=function(){ | 456 | $scope.click=function(){ |
457 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); | 457 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); |
458 | let redirectUrl = "https://wa.me/919855051678"; | 458 | let redirectUrl = "https://wa.me/919855051678"; |
459 | window.open(redirectUrl,"_blank") | 459 | window.open(redirectUrl,"_blank") |
460 | } | 460 | } |
461 | 461 | ||
462 | // $scope.data.city = ''; | 462 | // $scope.data.city = ''; |
463 | $scope.watch = function(value){ | 463 | $scope.watch = function(value){ |
464 | //document.getElementById("ahmedabad").src = ""; | 464 | //document.getElementById("ahmedabad").src = ""; |
465 | // console.log("cllll",value) | 465 | // console.log("cllll",value) |
466 | $scope.data.city = value; | 466 | $scope.data.city = value; |
467 | // if($scope.data.city == "Chennai"){ | 467 | // if($scope.data.city == "Chennai"){ |
468 | // console.log("cllll1",value) | 468 | // console.log("cllll1",value) |
469 | // $window.location.href = 'http://35.154.24.158:8007'; | 469 | // $window.location.href = 'http://35.154.24.158:8007'; |
470 | // }else{ | 470 | // }else{ |
471 | // console.log("cllll2",value) | 471 | // console.log("cllll2",value) |
472 | localStorage.setItem("city" ,value); | 472 | localStorage.setItem("city" ,value); |
473 | 473 | ||
474 | //$location.path('/registration').search({city: value}); | 474 | //$location.path('/registration').search({city: value}); |
475 | // $location.path('/registration/'+value+''); | 475 | // $location.path('/registration/'+value+''); |
476 | $location.path('/registration'); | 476 | $location.path('/registration'); |
477 | //$state.go('registration', { 'city': value}) | 477 | //$state.go('registration', { 'city': value}) |
478 | // } | 478 | // } |
479 | } | 479 | } |
480 | 480 | ||
481 | $scope.watch1 = function(value){ | 481 | $scope.watch1 = function(value){ |
482 | //document.getElementById("ahmedabad").src = ""; | 482 | //document.getElementById("ahmedabad").src = ""; |
483 | // console.log("cllll",value) | 483 | // console.log("cllll",value) |
484 | $scope.data.city = value; | 484 | $scope.data.city = value; |
485 | // if($scope.data.city == "Chennai"){ | 485 | // if($scope.data.city == "Chennai"){ |
486 | // console.log("cllll1",value) | 486 | // console.log("cllll1",value) |
487 | // $window.location.href = 'http://35.154.24.158:8007'; | 487 | // $window.location.href = 'http://35.154.24.158:8007'; |
488 | // }else{ | 488 | // }else{ |
489 | // console.log("cllll2",value) | 489 | // console.log("cllll2",value) |
490 | localStorage.setItem("city" ,value); | 490 | localStorage.setItem("city" ,value); |
491 | 491 | ||
492 | //$location.path('/registration').search({city: value}); | 492 | //$location.path('/registration').search({city: value}); |
493 | // $location.path('/registration/'+value+''); | 493 | // $location.path('/registration/'+value+''); |
494 | $location.path('/registrationForm'); | 494 | $location.path('/registrationForm'); |
495 | //$state.go('registration', { 'city': value}) | 495 | //$state.go('registration', { 'city': value}) |
496 | // } | 496 | // } |
497 | } | 497 | } |
498 | 498 | ||
499 | 499 | ||
500 | $scope.watchCity = function(value){ | 500 | $scope.watchCity = function(value){ |
501 | $scope.data.city = value; | 501 | $scope.data.city = value; |
502 | localStorage.setItem("city" ,value); | 502 | localStorage.setItem("city" ,value); |
503 | $location.path('/paytm/checkout'); | 503 | $location.path('/paytm/checkout'); |
504 | } | 504 | } |
505 | 505 | ||
506 | $scope.select = function(url){ | 506 | $scope.select = function(url){ |
507 | console.log("cllll") | 507 | console.log("cllll") |
508 | window.open(url) | 508 | window.open(url) |
509 | } | 509 | } |
510 | 510 | ||
511 | $scope.stagekeyPress = function() { | 511 | $scope.stagekeyPress = function() { |
512 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); | 512 | $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
513 | } | 513 | } |
514 | $scope.sectorkeyPress = function() { | 514 | $scope.sectorkeyPress = function() { |
515 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); | 515 | $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
516 | } | 516 | } |
517 | 517 | ||
518 | $scope.productLaunchkeyPress = function() { | 518 | $scope.productLaunchkeyPress = function() { |
519 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); | 519 | $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
520 | } | 520 | } |
521 | 521 | ||
522 | $scope.launchPeriodkeyPress = function() { | 522 | $scope.launchPeriodkeyPress = function() { |
523 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); | 523 | $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
524 | } | 524 | } |
525 | 525 | ||
526 | $scope.industrykeyPress = function(quantity) { | 526 | $scope.industrykeyPress = function(quantity) { |
527 | console.log("fghj",quantity) | 527 | console.log("fghj",quantity) |
528 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); | 528 | $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
529 | } | 529 | } |
530 | 530 | ||
531 | $scope.industryNamekeyPress = function(firstName) { | 531 | $scope.industryNamekeyPress = function(firstName) { |
532 | console.log("lastName==", firstName); | 532 | console.log("lastName==", firstName); |
533 | if (firstName == undefined) { | 533 | if (firstName == undefined) { |
534 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 534 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
535 | } else { | 535 | } else { |
536 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 536 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
537 | } | 537 | } |
538 | } | 538 | } |
539 | 539 | ||
540 | $scope.amountkeyPress = function() { | 540 | $scope.amountkeyPress = function() { |
541 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); | 541 | $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
542 | } | 542 | } |
543 | 543 | ||
544 | $scope.firstNamekeyPress = function(name) { | 544 | $scope.firstNamekeyPress = function(name) { |
545 | console.log("lastName==", name); | 545 | console.log("lastName==", name); |
546 | if (name == undefined) { | 546 | if (name == undefined) { |
547 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); | 547 | $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); |
548 | } else { | 548 | } else { |
549 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); | 549 | $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | $scope.emailkeyPress = function(email) { | 553 | $scope.emailkeyPress = function(email) { |
554 | console.log("email", email); | 554 | console.log("email", email); |
555 | if (email == undefined) { | 555 | if (email == undefined) { |
556 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); | 556 | $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); |
557 | } else { | 557 | } else { |
558 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); | 558 | $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
559 | } | 559 | } |
560 | } | 560 | } |
561 | 561 | ||
562 | $scope.phonekeyPress = function(number) { | 562 | $scope.phonekeyPress = function(number) { |
563 | console.log("number", number); | 563 | console.log("number", number); |
564 | if (number == undefined || number == '') { | 564 | if (number == undefined || number == '') { |
565 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); | 565 | $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); |
566 | } else { | 566 | } else { |
567 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); | 567 | $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
568 | } | 568 | } |
569 | } | 569 | } |
570 | 570 | ||
571 | $scope.citykeyPress = function(city) { | 571 | $scope.citykeyPress = function(city) { |
572 | console.log("city", city); | 572 | console.log("city", city); |
573 | if (city == undefined) { | 573 | if (city == undefined) { |
574 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); | 574 | $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); |
575 | } else { | 575 | } else { |
576 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); | 576 | $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
577 | } | 577 | } |
578 | } | 578 | } |
579 | 579 | ||
580 | $scope.startupNamekeyPress = function(q) { | 580 | $scope.startupNamekeyPress = function(q) { |
581 | if (q == undefined) { | 581 | if (q == undefined) { |
582 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); | 582 | $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); |
583 | } else { | 583 | } else { |
584 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); | 584 | $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
585 | } | 585 | } |
586 | } | 586 | } |
587 | 587 | ||
588 | $scope.linkedInkeyPress = function(technology) { | 588 | $scope.linkedInkeyPress = function(technology) { |
589 | if (technology == undefined || technology == '') { | 589 | if (technology == undefined || technology == '') { |
590 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); | 590 | $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); |
591 | } else { | 591 | } else { |
592 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); | 592 | $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
593 | } | 593 | } |
594 | } | 594 | } |
595 | $scope.companykeyPress = function(problem) { | 595 | $scope.companykeyPress = function(problem) { |
596 | if (problem == undefined) { | 596 | if (problem == undefined) { |
597 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); | 597 | $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); |
598 | } else { | 598 | } else { |
599 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); | 599 | $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
600 | } | 600 | } |
601 | } | 601 | } |
602 | $scope.productNamekeyPress = function(solution) { | 602 | $scope.productNamekeyPress = function(solution) { |
603 | if (solution == undefined) { | 603 | if (solution == undefined) { |
604 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); | 604 | $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); |
605 | } else { | 605 | } else { |
606 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); | 606 | $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
607 | } | 607 | } |
608 | } | 608 | } |
609 | $scope.businesskeyPress = function(business) { | 609 | $scope.businesskeyPress = function(business) { |
610 | if (business == undefined) { | 610 | if (business == undefined) { |
611 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); | 611 | $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); |
612 | } else { | 612 | } else { |
613 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); | 613 | $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | 616 | ||
617 | $scope.websitekeyPress = function(prototype) { | 617 | $scope.websitekeyPress = function(prototype) { |
618 | if (prototype == undefined || prototype == '') { | 618 | if (prototype == undefined || prototype == '') { |
619 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); | 619 | $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); |
620 | } else { | 620 | } else { |
621 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); | 621 | $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
622 | } | 622 | } |
623 | } | 623 | } |
624 | 624 | ||
625 | $scope.employeekeyPress = function(market) { | 625 | $scope.employeekeyPress = function(market) { |
626 | if (market == undefined || market == '') { | 626 | if (market == undefined || market == '') { |
627 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); | 627 | $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); |
628 | } else { | 628 | } else { |
629 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); | 629 | $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
630 | } | 630 | } |
631 | } | 631 | } |
632 | 632 | ||
633 | $scope.annualkeyPress = function(risk) { | 633 | $scope.annualkeyPress = function(risk) { |
634 | if (risk == undefined || risk == '') { | 634 | if (risk == undefined || risk == '') { |
635 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); | 635 | $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); |
636 | } else { | 636 | } else { |
637 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); | 637 | $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
638 | } | 638 | } |
639 | } | 639 | } |
640 | 640 | ||
641 | $scope.revenuekeyPress = function(team) { | 641 | $scope.revenuekeyPress = function(team) { |
642 | if (team == undefined) { | 642 | if (team == undefined) { |
643 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); | 643 | $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); |
644 | } else { | 644 | } else { |
645 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); | 645 | $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
646 | } | 646 | } |
647 | } | 647 | } |
648 | 648 | ||
649 | $scope.descriptionkeyPress = function(pitch) { | 649 | $scope.descriptionkeyPress = function(pitch) { |
650 | if (pitch == undefined) { | 650 | if (pitch == undefined) { |
651 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); | 651 | $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); |
652 | } else { | 652 | } else { |
653 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); | 653 | $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
654 | } | 654 | } |
655 | } | 655 | } |
656 | 656 | ||
657 | $scope.discountkeyPress = function(discount) { | 657 | $scope.discountkeyPress = function(discount) { |
658 | if (discount == undefined) { | 658 | if (discount == undefined) { |
659 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); | 659 | $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); |
660 | } else { | 660 | } else { |
661 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); | 661 | $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
665 | $scope.removeNooError = function() { | 665 | $scope.removeNooError = function() { |
666 | $('#invalidIdea').css('display', 'block'); | 666 | $('#invalidIdea').css('display', 'block'); |
667 | $('#noExist').css('display', 'none'); | 667 | $('#noExist').css('display', 'none'); |
668 | }; | 668 | }; |
669 | 669 | ||
670 | $scope.ideakeyPress = function(financial) { | 670 | $scope.ideakeyPress = function(financial) { |
671 | console.log("financial", financial); | 671 | console.log("financial", financial); |
672 | if (financial == undefined) { | 672 | if (financial == undefined) { |
673 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); | 673 | $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); |
674 | } else { | 674 | } else { |
675 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); | 675 | $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
676 | } | 676 | } |
677 | } | 677 | } |
678 | 678 | ||
679 | $scope.fundkeyPress = function(financial) { | 679 | $scope.fundkeyPress = function(financial) { |
680 | console.log("financial", financial); | 680 | console.log("financial", financial); |
681 | if (financial == undefined) { | 681 | if (financial == undefined) { |
682 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); | 682 | $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); |
683 | } else { | 683 | } else { |
684 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); | 684 | $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
685 | } | 685 | } |
686 | } | 686 | } |
687 | 687 | ||
688 | $scope.changeReferalIconColor = function(referalToken){ | 688 | $scope.changeReferalIconColor = function(referalToken){ |
689 | if (referalToken == undefined || referalToken == '') { | 689 | if (referalToken == undefined || referalToken == '') { |
690 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); | 690 | $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); |
691 | }else { | 691 | }else { |
692 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); | 692 | $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
693 | } | 693 | } |
694 | } | 694 | } |
695 | 695 | ||
696 | }); | 696 | }); |
697 | 697 | ||
698 | scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 698 | scotchApp.controller('registrationController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
699 | $scope.data = {}; | 699 | $scope.data = {}; |
700 | $scope.check = false; | 700 | $scope.check = false; |
701 | $scope.numberCheck = false; | 701 | $scope.numberCheck = false; |
702 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 702 | $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
703 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ | 703 | $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
704 | $scope.max = 100; | 704 | $scope.max = 100; |
705 | $scope.formPage = false; | 705 | $scope.formPage = false; |
706 | $scope.current = 0; | 706 | $scope.current = 0; |
707 | $scope.payingAmnt = 0; | 707 | $scope.payingAmnt = 0; |
708 | $scope.discountAmount = 0; | 708 | $scope.discountAmount = 0; |
709 | $scope.approvedMsg = false; | 709 | $scope.approvedMsg = false; |
710 | $scope.disApprovedMsg = false; | 710 | $scope.disApprovedMsg = false; |
711 | 711 | ||
712 | // $scope.data.quantity = "1"; | 712 | // $scope.data.quantity = "1"; |
713 | $scope.check = false; | 713 | $scope.check = false; |
714 | $scope.numberCheck = false; | 714 | $scope.numberCheck = false; |
715 | $scope.paymentResult = {}; | 715 | $scope.paymentResult = {}; |
716 | // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] | 716 | // var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] |
717 | // if(myParam){ | 717 | // if(myParam){ |
718 | // if(myParam == "approved"){ | 718 | // if(myParam == "approved"){ |
719 | // $scope.showResponse = true; | 719 | // $scope.showResponse = true; |
720 | // }else{ | 720 | // }else{ |
721 | // $scope.disApprovedMsg = true; | 721 | // $scope.disApprovedMsg = true; |
722 | // } | 722 | // } |
723 | // }else{ | 723 | // }else{ |
724 | // $scope.disApprovedMsg = true; | 724 | // $scope.disApprovedMsg = true; |
725 | // } | 725 | // } |
726 | 726 | ||
727 | $scope.click=function(){ | 727 | $scope.click=function(){ |
728 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); | 728 | Analytics.trackEvent('whatsapp', 'click', 'Registration'); |
729 | let redirectUrl = "https://wa.me/919855051678"; | 729 | let redirectUrl = "https://wa.me/919855051678"; |
730 | window.open(redirectUrl,"_blank") | 730 | window.open(redirectUrl,"_blank") |
731 | } | 731 | } |
732 | 732 | ||
733 | $scope.removeError = function() { | 733 | $scope.removeError = function() { |
734 | $('#invalidEmail').css('display', 'none'); | 734 | $('#invalidEmail').css('display', 'none'); |
735 | $('#alreadyExist').css('display', 'none'); | 735 | $('#alreadyExist').css('display', 'none'); |
736 | }; | 736 | }; |
737 | 737 | ||
738 | $scope.emailcheck = function(val) { | 738 | $scope.emailcheck = function(val) { |
739 | if (val == undefined) { | 739 | if (val == undefined) { |
740 | $('#invalidEmail').css('display', 'block'); | 740 | $('#invalidEmail').css('display', 'block'); |
741 | } else { | 741 | } else { |
742 | $('#alreadyExist').css('display', 'block'); | 742 | $('#alreadyExist').css('display', 'block'); |
743 | } | 743 | } |
744 | }; | 744 | }; |
745 | 745 | ||
746 | $scope.removeNoError = function() { | 746 | $scope.removeNoError = function() { |
747 | $('#invalidNumber').css('display', 'none'); | 747 | $('#invalidNumber').css('display', 'none'); |
748 | $('#alreadyExist').css('display', 'none'); | 748 | $('#alreadyExist').css('display', 'none'); |
749 | }; | 749 | }; |
750 | 750 | ||
751 | $scope.numbercheck = function(val) { | 751 | $scope.numbercheck = function(val) { |
752 | if (val == undefined) { | 752 | if (val == undefined) { |
753 | $('#invalidNumber').css('display', 'block'); | 753 | $('#invalidNumber').css('display', 'block'); |
754 | } else { | 754 | } else { |
755 | $('#alreadyExist').css('display', 'block'); | 755 | $('#alreadyExist').css('display', 'block'); |
756 | } | 756 | } |
757 | }; | 757 | }; |
758 | 758 | ||
759 | // $scope.$on('city', function (event, value) { | 759 | // $scope.$on('city', function (event, value) { |
760 | $scope.data.city = localStorage.getItem("city"); | 760 | $scope.data.city = localStorage.getItem("city"); |
761 | $scope.data.country = localStorage.getItem("country"); | 761 | $scope.data.country = localStorage.getItem("country"); |
762 | // }); | 762 | // }); |
763 | var data = { | 763 | var data = { |
764 | "amount": $scope.payingAmnt, | 764 | "amount": $scope.payingAmnt, |
765 | "currency": "INR", | 765 | "currency": "INR", |
766 | "status": "pending", | 766 | "status": "pending", |
767 | "paymentType": $scope.data.country | 767 | "paymentType": $scope.data.country |
768 | } | 768 | } |
769 | 769 | ||
770 | var handleFileSelect = function(evt) { | 770 | var handleFileSelect = function(evt) { |
771 | var files = evt.target.files; | 771 | var files = evt.target.files; |
772 | var file = files[0]; | 772 | var file = files[0]; |
773 | 773 | ||
774 | if (files && file) { | 774 | if (files && file) { |
775 | var reader = new FileReader(); | 775 | var reader = new FileReader(); |
776 | 776 | ||
777 | reader.onload = function(readerEvt) { | 777 | reader.onload = function(readerEvt) { |
778 | var binaryString = readerEvt.target.result; | 778 | var binaryString = readerEvt.target.result; |
779 | $scope.base64textString = btoa(binaryString); | 779 | $scope.base64textString = btoa(binaryString); |
780 | //console.log("base64textarea",$scope.base64textString) | 780 | //console.log("base64textarea",$scope.base64textString) |
781 | //$scope.data.uploadFile = file.name; | 781 | //$scope.data.uploadFile = file.name; |
782 | $scope.fileSelect = false; | 782 | $scope.fileSelect = false; |
783 | if($scope.data.uploadFile == null){ | 783 | if($scope.data.uploadFile == null){ |
784 | $scope.fileSelect = true; | 784 | $scope.fileSelect = true; |
785 | }else{ | 785 | }else{ |
786 | $scope.fileSelect = false; | 786 | $scope.fileSelect = false; |
787 | }; | 787 | }; |
788 | } | 788 | } |
789 | 789 | ||
790 | reader.readAsBinaryString(file); | 790 | reader.readAsBinaryString(file); |
791 | } | 791 | } |
792 | }; | 792 | }; |
793 | if (window.File && window.FileReader && window.FileList && window.Blob) { | 793 | if (window.File && window.FileReader && window.FileList && window.Blob) { |
794 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | 794 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); |
795 | } | 795 | } |
796 | 796 | ||
797 | $scope.ngShowhide = false; | 797 | $scope.ngShowhide = false; |
798 | $scope.GetValue = function(){ | 798 | $scope.GetValue = function(){ |
799 | if($scope.data.sector == "Other"){ | 799 | if($scope.data.sector == "Other"){ |
800 | $scope.ngShowhide = true; | 800 | $scope.ngShowhide = true; |
801 | }else{ | 801 | }else{ |
802 | $scope.ngShowhide = false; | 802 | $scope.ngShowhide = false; |
803 | } | 803 | } |
804 | } | 804 | } |
805 | 805 | ||
806 | $scope.ngShow = false; | 806 | $scope.ngShow = false; |
807 | $scope.getValue = function(){ | 807 | $scope.getValue = function(){ |
808 | if($scope.data.hear == "Other"){ | 808 | if($scope.data.hear == "Other"){ |
809 | $scope.ngShow = true; | 809 | $scope.ngShow = true; |
810 | }else{ | 810 | }else{ |
811 | $scope.ngShow = false; | 811 | $scope.ngShow = false; |
812 | } | 812 | } |
813 | } | 813 | } |
814 | $scope.payingAmnt = 1180; | 814 | $scope.payingAmnt = 1180; |
815 | $rootScope.tokenCall = function(val) { | 815 | $rootScope.tokenCall = function(val) { |
816 | if (val == undefined) { | 816 | if (val == undefined) { |
817 | $('#invalidToken').css('display', 'block'); | 817 | $('#invalidToken').css('display', 'block'); |
818 | } else { | 818 | } else { |
819 | val = val.toUpperCase(); | 819 | val = val.toUpperCase(); |
820 | if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ | 820 | if(((val == "IITH99" || val == "IITH90") && $scope.data.city != "Hyderabad") || ((val == "OASIS" || val == "JALSA22") && $scope.data.city != "Jaipur") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ |
821 | $scope.tokencheck = false; | 821 | $scope.tokencheck = false; |
822 | return; | 822 | return; |
823 | } | 823 | } |
824 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | 824 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') |
825 | .then(function(searchResult) { | 825 | .then(function(searchResult) { |
826 | if (searchResult.data.length == 0) { | 826 | if (searchResult.data.length == 0) { |
827 | $scope.tokencheck = false; | 827 | $scope.tokencheck = false; |
828 | $scope.discountAmount = 0; | 828 | $scope.discountAmount = 0; |
829 | 829 | ||
830 | } else { | 830 | } else { |
831 | $scope.discountpercentage = searchResult.data[0].discount; | 831 | $scope.discountpercentage = searchResult.data[0].discount; |
832 | $scope.tokencheck = true; | 832 | $scope.tokencheck = true; |
833 | } | 833 | } |
834 | $scope.ticketAmnt = 1180; | 834 | $scope.ticketAmnt = 1180; |
835 | var amount = $scope.ticketAmnt * 100 | 835 | var amount = $scope.ticketAmnt * 100 |
836 | if($scope.tokencheck == true){ | 836 | if($scope.tokencheck == true){ |
837 | var amount = $scope.ticketAmnt | 837 | var amount = $scope.ticketAmnt |
838 | if($scope.discountpercentage == "100") { | 838 | if($scope.discountpercentage == "100") { |
839 | $scope.discountpercentage = "99.9"; | 839 | $scope.discountpercentage = "99.9"; |
840 | } | 840 | } |
841 | $scope.percDiscount = $scope.discountpercentage/100; | 841 | $scope.percDiscount = $scope.discountpercentage/100; |
842 | $scope.discountAmount = amount * $scope.percDiscount; | 842 | $scope.discountAmount = amount * $scope.percDiscount; |
843 | } | 843 | } |
844 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 844 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
845 | $scope.payingAmnt = taxAmount; | 845 | $scope.payingAmnt = taxAmount; |
846 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 846 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
847 | },function(err){ | 847 | },function(err){ |
848 | console.log(err) | 848 | console.log(err) |
849 | }); | 849 | }); |
850 | 850 | ||
851 | } | 851 | } |
852 | }; | 852 | }; |
853 | // if($scope.data.country == "INDIA"){ | 853 | // if($scope.data.country == "INDIA"){ |
854 | // $scope.submit = function() { | 854 | // $scope.submit = function() { |
855 | // Analytics.trackEvent('register', 'click', 'Registration'); | 855 | // Analytics.trackEvent('register', 'click', 'Registration'); |
856 | // $scope.loading = true; | 856 | // $scope.loading = true; |
857 | // $scope.data.uploadFile = $scope.base64textString; | 857 | // $scope.data.uploadFile = $scope.base64textString; |
858 | // console.log($scope.data.uploadFile) | 858 | // console.log($scope.data.uploadFile) |
859 | // // if($scope.tokencheck == false){ | 859 | // // if($scope.tokencheck == false){ |
860 | // // $scope.data.referalToken = null; | 860 | // // $scope.data.referalToken = null; |
861 | // // } | 861 | // // } |
862 | // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 862 | // // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
863 | // // var x = document.getElementById("snackbar") | 863 | // // var x = document.getElementById("snackbar") |
864 | // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 864 | // // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
865 | // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 865 | // // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
866 | // $scope.infoForm = true; | 866 | // $scope.infoForm = true; |
867 | // $scope.ticketAmnt = 1180; | 867 | // $scope.ticketAmnt = 1180; |
868 | // $scope.detail = {}; | 868 | // $scope.detail = {}; |
869 | // $scope.data.phone = "+91"+$scope.data.number; | 869 | // $scope.data.phone = "+91"+$scope.data.number; |
870 | // if($scope.data.referalToken == null){ | 870 | // if($scope.data.referalToken == null){ |
871 | // $scope.data.referalToken = "NA" | 871 | // $scope.data.referalToken = "NA" |
872 | // } | 872 | // } |
873 | // var file =document.getElementById('filePicker').files[0]; | 873 | // var file =document.getElementById('filePicker').files[0]; |
874 | // var image = BASE_URL+'/containers/images/download/' | 874 | // var image = BASE_URL+'/containers/images/download/' |
875 | // var imagePath = file.name; | 875 | // var imagePath = file.name; |
876 | // $scope.data.uploadFile = image + imagePath; | 876 | // $scope.data.uploadFile = image + imagePath; |
877 | // var fd = new FormData() | 877 | // var fd = new FormData() |
878 | // fd.append('filePicker',file); | 878 | // fd.append('filePicker',file); |
879 | // var deferred = $q.defer(); | 879 | // var deferred = $q.defer(); |
880 | // $http({ | 880 | // $http({ |
881 | // method:'POST', | 881 | // method:'POST', |
882 | // url: BASE_URL+'/containers/images/upload', | 882 | // url: BASE_URL+'/containers/images/upload', |
883 | // data:fd, | 883 | // data:fd, |
884 | // transformRequest:angular.identity, | 884 | // transformRequest:angular.identity, |
885 | // headers:{'Content-Type':undefined} | 885 | // headers:{'Content-Type':undefined} |
886 | // }) | 886 | // }) |
887 | // .success(function(result){ | 887 | // .success(function(result){ |
888 | // deferred.resolve(result); | 888 | // deferred.resolve(result); |
889 | // $http({ | 889 | // $http({ |
890 | // method: 'POST', | 890 | // method: 'POST', |
891 | // url: BASE_URL+'/applicants', | 891 | // url: BASE_URL+'/applicants', |
892 | // data: $scope.data, | 892 | // data: $scope.data, |
893 | // headers: {} | 893 | // headers: {} |
894 | // }).then(function mySuccess(result) { | 894 | // }).then(function mySuccess(result) { |
895 | // $scope.detail = result; | 895 | // $scope.detail = result; |
896 | // data.applicantId = result.data.id; | 896 | // data.applicantId = result.data.id; |
897 | // $scope.userId = result.data.id; | 897 | // $scope.userId = result.data.id; |
898 | // var amount = $scope.ticketAmnt * 100 | 898 | // var amount = $scope.ticketAmnt * 100 |
899 | // if($scope.tokencheck == true){ | 899 | // if($scope.tokencheck == true){ |
900 | // var amount = $scope.ticketAmnt | 900 | // var amount = $scope.ticketAmnt |
901 | // console.log("resultcity===",$scope.data.city) | 901 | // console.log("resultcity===",$scope.data.city) |
902 | // if($scope.discountpercentage == "100") { | 902 | // if($scope.discountpercentage == "100") { |
903 | // $scope.discountpercentage = "99.9"; | 903 | // $scope.discountpercentage = "99.9"; |
904 | // } | 904 | // } |
905 | // $scope.percDiscount = $scope.discountpercentage/100; | 905 | // $scope.percDiscount = $scope.discountpercentage/100; |
906 | // $scope.discountAmount = amount * $scope.percDiscount; | 906 | // $scope.discountAmount = amount * $scope.percDiscount; |
907 | // } | 907 | // } |
908 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 908 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
909 | // $scope.payingAmnt = taxAmount; | 909 | // $scope.payingAmnt = taxAmount; |
910 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 910 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
911 | // data.amount = $scope.payingAmnt; | 911 | // data.amount = $scope.payingAmnt; |
912 | // if($scope.detail != null){ | 912 | // if($scope.detail != null){ |
913 | // $http({ | 913 | // $http({ |
914 | // method: 'POST', | 914 | // method: 'POST', |
915 | // url: BASE_URL+'/payments', | 915 | // url: BASE_URL+'/payments', |
916 | // data: data, | 916 | // data: data, |
917 | // headers: {} | 917 | // headers: {} |
918 | // }).then(function mySuccess(paymentResult) { | 918 | // }).then(function mySuccess(paymentResult) { |
919 | // $scope.loading = false; | 919 | // $scope.loading = false; |
920 | // //$("p").html(paymentResult.data.data) | 920 | // //$("p").html(paymentResult.data.data) |
921 | // }, function myError(error) { | 921 | // }, function myError(error) { |
922 | // }); | 922 | // }); |
923 | // } | 923 | // } |
924 | // var i = 0; | 924 | // var i = 0; |
925 | // $scope.payingAmnt = $scope.payingAmnt * 100; | 925 | // $scope.payingAmnt = $scope.payingAmnt * 100; |
926 | // var options = { | 926 | // var options = { |
927 | // "key": "rzp_test_YwHsVFiDIQ2WUQ", | 927 | // "key": "rzp_test_YwHsVFiDIQ2WUQ", |
928 | // //"key": "rzp_live_mkmCb4FkstuWaS", | 928 | // //"key": "rzp_live_mkmCb4FkstuWaS", |
929 | // "amount": $scope.payingAmnt, | 929 | // "amount": $scope.payingAmnt, |
930 | 930 | ||
931 | // "name": "Startup Jalsa", | 931 | // "name": "Startup Jalsa", |
932 | // "description":"amount", | 932 | // "description":"amount", |
933 | // "currency": "INR", | 933 | // "currency": "INR", |
934 | // "status": "done", | 934 | // "status": "done", |
935 | 935 | ||
936 | // "prefill": { | 936 | // "prefill": { |
937 | // "email": $scope.detail.email, | 937 | // "email": $scope.detail.email, |
938 | // "contact": $scope.detail.phone | 938 | // "contact": $scope.detail.phone |
939 | // }, | 939 | // }, |
940 | 940 | ||
941 | // "theme": { | 941 | // "theme": { |
942 | // "color": "#2196f3 ", | 942 | // "color": "#2196f3 ", |
943 | // "image_padding":"NO" | 943 | // "image_padding":"NO" |
944 | // }, | 944 | // }, |
945 | // "modal": { | 945 | // "modal": { |
946 | // "ondismiss": function(){ | 946 | // "ondismiss": function(){ |
947 | // } | 947 | // } |
948 | // }, | 948 | // }, |
949 | // "handler": function (response){ | 949 | // "handler": function (response){ |
950 | // createPayment(response); | 950 | // createPayment(response); |
951 | // } | 951 | // } |
952 | // }; | 952 | // }; |
953 | // var rzp1 = new Razorpay(options); | 953 | // var rzp1 = new Razorpay(options); |
954 | // rzp1.open(); | 954 | // rzp1.open(); |
955 | // $scope.paymentResponse = {}; | 955 | // $scope.paymentResponse = {}; |
956 | // function createPayment(response){ | 956 | // function createPayment(response){ |
957 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 957 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
958 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 958 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
959 | // $scope.paymentResponse.amount = data.amount; | 959 | // $scope.paymentResponse.amount = data.amount; |
960 | // $scope.paymentResponse.currency = "INR"; | 960 | // $scope.paymentResponse.currency = "INR"; |
961 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; | 961 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; |
962 | // $http({ | 962 | // $http({ |
963 | // method: 'PUT', | 963 | // method: 'PUT', |
964 | // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 964 | // url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
965 | // data: $scope.paymentResponse, | 965 | // data: $scope.paymentResponse, |
966 | // headers: {} | 966 | // headers: {} |
967 | // }).then(function mySuccess(searchResult) { | 967 | // }).then(function mySuccess(searchResult) { |
968 | // Analytics.trackEvent('register', 'click', 'Registration'); | 968 | // Analytics.trackEvent('register', 'click', 'Registration'); |
969 | // $location.path("/confirm") | 969 | // $location.path("/confirm") |
970 | // }, function myError(error) { | 970 | // }, function myError(error) { |
971 | // }); | 971 | // }); |
972 | // } | 972 | // } |
973 | // //} | 973 | // //} |
974 | 974 | ||
975 | // }, function myError(error) { | 975 | // }, function myError(error) { |
976 | 976 | ||
977 | // }); | 977 | // }); |
978 | 978 | ||
979 | // }) | 979 | // }) |
980 | 980 | ||
981 | // // }) | 981 | // // }) |
982 | 982 | ||
983 | // //} | 983 | // //} |
984 | 984 | ||
985 | // } | 985 | // } |
986 | // }else{ | 986 | // }else{ |
987 | // $scope.ticketAmnt = 1180; | 987 | // $scope.ticketAmnt = 1180; |
988 | // var amount = $scope.ticketAmnt * 100 | 988 | // var amount = $scope.ticketAmnt * 100 |
989 | // console.log("amount",amount) | 989 | // console.log("amount",amount) |
990 | // console.log("amount",$scope.tokencheck) | 990 | // console.log("amount",$scope.tokencheck) |
991 | // if($scope.tokencheck == true){ | 991 | // if($scope.tokencheck == true){ |
992 | // var amount = $scope.ticketAmnt | 992 | // var amount = $scope.ticketAmnt |
993 | // console.log("amount",amount) | 993 | // console.log("amount",amount) |
994 | // if($scope.discountpercentage == "100") { | 994 | // if($scope.discountpercentage == "100") { |
995 | // $scope.discountpercentage = "99.9"; | 995 | // $scope.discountpercentage = "99.9"; |
996 | // } | 996 | // } |
997 | // $scope.percDiscount = $scope.discountpercentage/100; | 997 | // $scope.percDiscount = $scope.discountpercentage/100; |
998 | // console.log("$scope.percDiscount",$scope.percDiscount) | 998 | // console.log("$scope.percDiscount",$scope.percDiscount) |
999 | // $scope.discountAmount = amount * $scope.percDiscount; | 999 | // $scope.discountAmount = amount * $scope.percDiscount; |
1000 | // } | 1000 | // } |
1001 | // console.log("$scope.discountAmount",$scope.discountAmount) | 1001 | // console.log("$scope.discountAmount",$scope.discountAmount) |
1002 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1002 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1003 | // console.log("taxAmount",taxAmount) | 1003 | // console.log("taxAmount",taxAmount) |
1004 | // $scope.payingAmnt = taxAmount; | 1004 | // $scope.payingAmnt = taxAmount; |
1005 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1005 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1006 | 1006 | ||
1007 | $scope.submit = function() { | 1007 | $scope.submit = function() { |
1008 | Analytics.trackEvent('register', 'click', 'Registration'); | 1008 | Analytics.trackEvent('register', 'click', 'Registration'); |
1009 | $scope.loading = true; | 1009 | $scope.loading = true; |
1010 | $scope.data.uploadFile = $scope.base64textString; | 1010 | $scope.data.uploadFile = $scope.base64textString; |
1011 | // if($scope.tokencheck == false){ | 1011 | // if($scope.tokencheck == false){ |
1012 | // $scope.data.referalToken = null; | 1012 | // $scope.data.referalToken = null; |
1013 | // } | 1013 | // } |
1014 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { | 1014 | // if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { |
1015 | // var x = document.getElementById("snackbar") | 1015 | // var x = document.getElementById("snackbar") |
1016 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); | 1016 | // setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
1017 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { | 1017 | // }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
1018 | $scope.infoForm = true; | 1018 | $scope.infoForm = true; |
1019 | $scope.ticketAmnt = 1180; | 1019 | $scope.ticketAmnt = 1180; |
1020 | $scope.detail = {}; | 1020 | $scope.detail = {}; |
1021 | $scope.paymentResultt = {}; | 1021 | $scope.paymentResultt = {}; |
1022 | $rootScope.applicantResult = {}; | 1022 | $rootScope.applicantResult = {}; |
1023 | $scope.data.phone = "+91"+$scope.data.number; | 1023 | $scope.data.phone = "+91"+$scope.data.number; |
1024 | if($scope.data.referalToken == null){ | 1024 | if($scope.data.referalToken == null){ |
1025 | $scope.data.referalToken = "NA" | 1025 | $scope.data.referalToken = "NA" |
1026 | } | 1026 | } |
1027 | var file =document.getElementById('filePicker').files[0]; | 1027 | var file =document.getElementById('filePicker').files[0]; |
1028 | //console.log("file",filePicker) | 1028 | //console.log("file",filePicker) |
1029 | var image = BASE_URL+'/containers/images/download/' | 1029 | var image = BASE_URL+'/containers/images/download/' |
1030 | var imagePath = file.name; | 1030 | var imagePath = file.name; |
1031 | $scope.data.uploadFile = image + imagePath; | 1031 | $scope.data.uploadFile = image + imagePath; |
1032 | //console.log($scope.data.uploadFile) | 1032 | //console.log($scope.data.uploadFile) |
1033 | var fd = new FormData() | 1033 | var fd = new FormData() |
1034 | fd.append('filePicker',file); | 1034 | fd.append('filePicker',file); |
1035 | var deferred = $q.defer(); | 1035 | var deferred = $q.defer(); |
1036 | $http({ | 1036 | $http({ |
1037 | method:'POST', | 1037 | method:'POST', |
1038 | url: BASE_URL+'/containers/images/upload', | 1038 | url: BASE_URL+'/containers/images/upload', |
1039 | data:fd, | 1039 | data:fd, |
1040 | transformRequest:angular.identity, | 1040 | transformRequest:angular.identity, |
1041 | headers:{'Content-Type':undefined} | 1041 | headers:{'Content-Type':undefined} |
1042 | }) | 1042 | }) |
1043 | .success(function(result){ | 1043 | .success(function(result){ |
1044 | deferred.resolve(result); | 1044 | deferred.resolve(result); |
1045 | $http({ | 1045 | $http({ |
1046 | method: 'POST', | 1046 | method: 'POST', |
1047 | url: BASE_URL+'/applicants', | 1047 | url: BASE_URL+'/applicants', |
1048 | data: $scope.data, | 1048 | data: $scope.data, |
1049 | headers: {} | 1049 | headers: {} |
1050 | }).then(function mySuccess(result) { | 1050 | }).then(function mySuccess(result) { |
1051 | $scope.detail = result; | 1051 | $scope.detail = result; |
1052 | data.applicantId = result.data.id; | 1052 | data.applicantId = result.data.id; |
1053 | $scope.userId = result.data.id; | 1053 | $scope.userId = result.data.id; |
1054 | var amount = $scope.ticketAmnt * 100 | 1054 | var amount = $scope.ticketAmnt * 100 |
1055 | if($scope.tokencheck == true){ | 1055 | if($scope.tokencheck == true){ |
1056 | var amount = $scope.ticketAmnt | 1056 | var amount = $scope.ticketAmnt |
1057 | if($scope.discountpercentage == "100") { | 1057 | if($scope.discountpercentage == "100") { |
1058 | $scope.discountpercentage = "99.9"; | 1058 | $scope.discountpercentage = "99.9"; |
1059 | } | 1059 | } |
1060 | $scope.percDiscount = $scope.discountpercentage/100; | 1060 | $scope.percDiscount = $scope.discountpercentage/100; |
1061 | $scope.discountAmount = amount * $scope.percDiscount; | 1061 | $scope.discountAmount = amount * $scope.percDiscount; |
1062 | } | 1062 | } |
1063 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1063 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1064 | $scope.payingAmnt = taxAmount; | 1064 | $scope.payingAmnt = taxAmount; |
1065 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1065 | $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1066 | data.amount = $scope.payingAmnt; | 1066 | data.amount = $scope.payingAmnt; |
1067 | if($scope.detail != null){ | 1067 | if($scope.detail != null){ |
1068 | $http({ | 1068 | $http({ |
1069 | method: 'POST', | 1069 | method: 'POST', |
1070 | url: BASE_URL+'/payments', | 1070 | url: BASE_URL+'/payments', |
1071 | data: data, | 1071 | data: data, |
1072 | headers: {} | 1072 | headers: {} |
1073 | }).then(function mySuccess(paymentResult) { | 1073 | }).then(function mySuccess(paymentResult) { |
1074 | $scope.loading = false; | 1074 | $scope.loading = false; |
1075 | $scope.paymentResult = paymentResult; | 1075 | $scope.paymentResult = paymentResult; |
1076 | //$("p").html(paymentResult.data.data) | 1076 | //$("p").html(paymentResult.data.data) |
1077 | }, function myError(error) { | 1077 | }, function myError(error) { |
1078 | }); | 1078 | }); |
1079 | } | 1079 | } |
1080 | var i = 0; | 1080 | var i = 0; |
1081 | $scope.payingAmntt = $scope.payingAmnt * 100; | 1081 | $scope.payingAmntt = $scope.payingAmnt * 100; |
1082 | var options = { | 1082 | var options = { |
1083 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 1083 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
1084 | "key": "rzp_live_mkmCb4FkstuWaS", | 1084 | "key": "rzp_live_mkmCb4FkstuWaS", |
1085 | "amount": $scope.payingAmntt, | 1085 | "amount": $scope.payingAmntt, |
1086 | 1086 | ||
1087 | "name": "Startup Jalsa", | 1087 | "name": "Startup Jalsa", |
1088 | "description":"amount", | 1088 | "description":"amount", |
1089 | "currency": "INR", | 1089 | "currency": "INR", |
1090 | "status": "done", | 1090 | "status": "done", |
1091 | 1091 | ||
1092 | "prefill": { | 1092 | "prefill": { |
1093 | "email": $scope.detail.email, | 1093 | "email": $scope.detail.email, |
1094 | "contact": $scope.detail.phone | 1094 | "contact": $scope.detail.phone |
1095 | }, | 1095 | }, |
1096 | 1096 | ||
1097 | "theme": { | 1097 | "theme": { |
1098 | "color": "#2196f3 ", | 1098 | "color": "#2196f3 ", |
1099 | "image_padding":"NO" | 1099 | "image_padding":"NO" |
1100 | }, | 1100 | }, |
1101 | "modal": { | 1101 | "modal": { |
1102 | "ondismiss": function(){ | 1102 | "ondismiss": function(){ |
1103 | } | 1103 | } |
1104 | }, | 1104 | }, |
1105 | "handler": function (response){ | 1105 | "handler": function (response){ |
1106 | createPayment(response); | 1106 | createPayment(response); |
1107 | } | 1107 | } |
1108 | }; | 1108 | }; |
1109 | var rzp1 = new Razorpay(options); | 1109 | var rzp1 = new Razorpay(options); |
1110 | rzp1.open(); | 1110 | rzp1.open(); |
1111 | $scope.paymentResponse = {}; | 1111 | $scope.paymentResponse = {}; |
1112 | function createPayment(response){ | 1112 | function createPayment(response){ |
1113 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1113 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1114 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 1114 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
1115 | $scope.paymentResponse.amount = data.amount; | 1115 | $scope.paymentResponse.amount = data.amount; |
1116 | $scope.paymentResponse.currency = "INR"; | 1116 | $scope.paymentResponse.currency = "INR"; |
1117 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 1117 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
1118 | $http({ | 1118 | $http({ |
1119 | method: 'PUT', | 1119 | method: 'PUT', |
1120 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, | 1120 | url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, |
1121 | data: $scope.paymentResponse, | 1121 | data: $scope.paymentResponse, |
1122 | headers: {} | 1122 | headers: {} |
1123 | }).then(function mySuccess(searchResult) { | 1123 | }).then(function mySuccess(searchResult) { |
1124 | console.log("searchResult",searchResult) | 1124 | console.log("searchResult",searchResult) |
1125 | //$location.path("/confirm") | 1125 | //$location.path("/confirm") |
1126 | $rootScope.paymentResultt = searchResult.data; | 1126 | $rootScope.paymentResultt = searchResult.data; |
1127 | $http({ | 1127 | $http({ |
1128 | method: 'GET', | 1128 | method: 'GET', |
1129 | url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, | 1129 | url: BASE_URL+'/applicants/'+$rootScope.paymentResultt.applicantId, |
1130 | data: $scope.data, | 1130 | data: $scope.data, |
1131 | headers: {} | 1131 | headers: {} |
1132 | }).then(function mySuccess(result) { | 1132 | }).then(function mySuccess(result) { |
1133 | //console.log("result2323324434",result) | 1133 | //console.log("result2323324434",result) |
1134 | $rootScope.applicantResult = result.data; | 1134 | $rootScope.applicantResult = result.data; |
1135 | if (result.data.city == "Chennai") { | 1135 | if (result.data.city == "Chennai") { |
1136 | $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", | 1136 | $rootScope.applicantResult.location= "Auditorium, IITM Research Park, Kanagam Road, 32, Kanagam, Tharamani, Chennai, Tamil Nadu 600113", |
1137 | $rootScope.applicantResult.date= "October 1st, 2019", | 1137 | $rootScope.applicantResult.date= "October 1st, 2019", |
1138 | $rootScope.applicantResult.time= "3 PM" | 1138 | $rootScope.applicantResult.time= "3 PM" |
1139 | 1139 | ||
1140 | } else if (result.data.city == "Hyderabad") { | 1140 | } else if (result.data.city == "Hyderabad") { |
1141 | $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", | 1141 | $rootScope.applicantResult.location= "Academic block A, Room no. 220, IIT Hyderabad Kandi, Sangareddy 502285", |
1142 | $rootScope.applicantResult.date= "September 14th, 2019", | 1142 | $rootScope.applicantResult.date= "September 14th, 2019", |
1143 | $rootScope.applicantResult.time= "3 PM" | 1143 | $rootScope.applicantResult.time= "3 PM" |
1144 | 1144 | ||
1145 | } else if (result.data.city == "Mumbai") { | 1145 | } else if (result.data.city == "Mumbai") { |
1146 | $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", | 1146 | $rootScope.applicantResult.location= "LC 101, Lecture Hall Complex, Academic Area, IIT Bombay, Powai, Maharashtra - 40076", |
1147 | $rootScope.applicantResult.date= "September 4th, 2019", | 1147 | $rootScope.applicantResult.date= "September 4th, 2019", |
1148 | $rootScope.applicantResult.time= "3 PM" | 1148 | $rootScope.applicantResult.time= "3 PM" |
1149 | 1149 | ||
1150 | } else if (result.data.city == "Ahmedabad") { | 1150 | } else if (result.data.city == "Ahmedabad") { |
1151 | $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", | 1151 | $rootScope.applicantResult.location= "Sunil Mehta Conference Hall, First Floor, CIIE Building, IIM New Campus, Vastrapur Road, Ahmedabad 380015", |
1152 | $rootScope.applicantResult.date= "September 11th, 2019", | 1152 | $rootScope.applicantResult.date= "September 11th, 2019", |
1153 | $rootScope.applicantResult.time= "3 PM" | 1153 | $rootScope.applicantResult.time= "3 PM" |
1154 | 1154 | ||
1155 | } else if (result.data.city == "Jaipur") { | 1155 | } else if (result.data.city == "Jaipur") { |
1156 | $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", | 1156 | $rootScope.applicantResult.location= "Startup Oasis, M8, RIICO Software Complex, EPIP, Sitapura Industrial Area, Jaipur", |
1157 | $rootScope.applicantResult.date= "September 24th, 2019", | 1157 | $rootScope.applicantResult.date= "September 24th, 2019", |
1158 | $rootScope.applicantResult.time= "3 PM" | 1158 | $rootScope.applicantResult.time= "3 PM" |
1159 | 1159 | ||
1160 | } else if (result.data.city == "Kolkata") { | 1160 | } else if (result.data.city == "Kolkata") { |
1161 | $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", | 1161 | $rootScope.applicantResult.location= "New Academic Block, IIM Calcutta, Diamond Harbour Rd., Joka, Kolkata (700104)", |
1162 | $rootScope.applicantResult.time= "3 PM", | 1162 | $rootScope.applicantResult.time= "3 PM", |
1163 | $rootScope.applicantResult.date= "September 17th, 2019" | 1163 | $rootScope.applicantResult.date= "September 17th, 2019" |
1164 | 1164 | ||
1165 | } else if (result.data.city == "Bengaluru") { | 1165 | } else if (result.data.city == "Bengaluru") { |
1166 | $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", | 1166 | $rootScope.applicantResult.location= "NSRCEL, Indian Institute of Management Bangalore, Bannerghatta Main Road, Bengaluru 560076", |
1167 | $rootScope.applicantResult.time= "3 PM", | 1167 | $rootScope.applicantResult.time= "3 PM", |
1168 | $rootScope.applicantResult.date= "September 7th, 2019" | 1168 | $rootScope.applicantResult.date= "September 7th, 2019" |
1169 | 1169 | ||
1170 | } else if (result.data.city == "Delhi") { | 1170 | } else if (result.data.city == "Delhi") { |
1171 | $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", | 1171 | $rootScope.applicantResult.location= "Vishwakarma Bhavan Auditorium(Ground Floor), Vishwakarma Bhavan, IIT Delhi, Saheed Jeet Singh Marg, Hauz Khas, New Delhi, Delhi 110016", |
1172 | $rootScope.applicantResult.time= "12 PM", | 1172 | $rootScope.applicantResult.time= "12 PM", |
1173 | $rootScope.applicantResult.date= "October 16th, 2019" | 1173 | $rootScope.applicantResult.date= "October 16th, 2019" |
1174 | 1174 | ||
1175 | } else if (result.data.city == "Kanpur"){ | 1175 | } else if (result.data.city == "Kanpur"){ |
1176 | $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", | 1176 | $rootScope.applicantResult.location= "L14, Academic Area IIT Kanpur, Kanpur - 208016", |
1177 | $rootScope.applicantResult.time= "3 PM", | 1177 | $rootScope.applicantResult.time= "3 PM", |
1178 | $rootScope.applicantResult.date= "September 28th, 2019" | 1178 | $rootScope.applicantResult.date= "September 28th, 2019" |
1179 | 1179 | ||
1180 | }else if (result.data.city == "Colombo") { | 1180 | }else if (result.data.city == "Colombo") { |
1181 | $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", | 1181 | $rootScope.applicantResult.location= "Likuid Spcaes, Ground Floor, 5 Charles Place, Colpetty, Colombo, 00300, Sri Lanka", |
1182 | $rootScope.applicantResult.time= "3 PM", | 1182 | $rootScope.applicantResult.time= "3 PM", |
1183 | $rootScope.applicantResult.date= "October 5th, 2019" | 1183 | $rootScope.applicantResult.date= "October 5th, 2019" |
1184 | 1184 | ||
1185 | } else if (result.data.city == "Dhaka") { | 1185 | } else if (result.data.city == "Dhaka") { |
1186 | $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212", | 1186 | $rootScope.applicantResult.location= "The Business Center, The Inspiration Hall Level 2, Lift number-2, Celebration Point, Plot: 3 & 5 (Beside Shahabuddin Medical College) Road: 113/A, Gulshan-2, Dhaka-1212", |
1187 | $rootScope.applicantResult.date= "September 21st, 2019", | 1187 | $rootScope.applicantResult.date= "September 21st, 2019", |
1188 | $rootScope.applicantResult.time= "3 PM" | 1188 | $rootScope.applicantResult.time= "3 PM" |
1189 | 1189 | ||
1190 | } else { | 1190 | } else { |
1191 | $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", | 1191 | $rootScope.applicantResult.location= "Innovative Hive, 1st Floor, M&S Tower, Pulchowk, lalitpur Nepal, POB No 24445", |
1192 | $rootScope.applicantResult.time= "3 PM", | 1192 | $rootScope.applicantResult.time= "3 PM", |
1193 | $rootScope.applicantResult.date= "October 12th, 2019" | 1193 | $rootScope.applicantResult.date= "October 12th, 2019" |
1194 | } | 1194 | } |
1195 | Analytics.trackEvent('success', 'click', 'Registration'); | 1195 | Analytics.trackEvent('success', 'click', 'Registration'); |
1196 | $location.path("/confirm") | 1196 | $location.path("/confirm") |
1197 | }) | 1197 | }) |
1198 | }, function myError(error) { | 1198 | }, function myError(error) { |
1199 | }); | 1199 | }); |
1200 | } | 1200 | } |
1201 | //} | 1201 | //} |
1202 | 1202 | ||
1203 | }, function myError(error) { | 1203 | }, function myError(error) { |
1204 | 1204 | ||
1205 | }); | 1205 | }); |
1206 | 1206 | ||
1207 | }) | 1207 | }) |
1208 | 1208 | ||
1209 | // }) | 1209 | // }) |
1210 | 1210 | ||
1211 | //} | 1211 | //} |
1212 | 1212 | ||
1213 | } | 1213 | } |
1214 | //} | 1214 | //} |
1215 | 1215 | ||
1216 | }); | 1216 | }); |
1217 | 1217 | ||
1218 | scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { | 1218 | scotchApp.controller('confirmationController', function($scope, $http, $location, $route, BASE_URL) { |
1219 | $scope.approvedMsg = false; | 1219 | $scope.approvedMsg = false; |
1220 | $scope.disApprovedMsg = false; | 1220 | $scope.disApprovedMsg = false; |
1221 | 1221 | ||
1222 | var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] | 1222 | var myParam = window.location.href.split('status=').splice(1).join('').split('&')[0] |
1223 | // if(myParam){ | 1223 | // if(myParam){ |
1224 | if(myParam == "approved"){ | 1224 | if(myParam == "approved"){ |
1225 | $scope.approvedMsg = true; | 1225 | $scope.approvedMsg = true; |
1226 | $scope.disApprovedMsg = false; | 1226 | $scope.disApprovedMsg = false; |
1227 | }else{ | 1227 | }else{ |
1228 | $scope.approvedMsg = false; | 1228 | $scope.approvedMsg = false; |
1229 | $scope.disApprovedMsg = true; | 1229 | $scope.disApprovedMsg = true; |
1230 | } | 1230 | } |
1231 | // }else{ | 1231 | // }else{ |
1232 | // $scope.disApprovedMsg = true; | 1232 | // $scope.disApprovedMsg = true; |
1233 | // } | 1233 | // } |
1234 | 1234 | ||
1235 | }); | 1235 | }); |
1236 | 1236 | ||
1237 | scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 1237 | scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
1238 | $scope.data = {}; | 1238 | $scope.data = {}; |
1239 | $scope.data.city = localStorage.getItem("city"); | 1239 | $scope.data.city = localStorage.getItem("city"); |
1240 | $scope.data.country = localStorage.getItem("country");; | 1240 | $scope.data.country = localStorage.getItem("country");; |
1241 | var data = { | 1241 | var data = { |
1242 | //"amount": $scope.payingAmnt, | 1242 | //"amount": $scope.payingAmnt, |
1243 | //"currency": "INR", | 1243 | //"currency": "INR", |
1244 | "status": "captured", | 1244 | "status": "captured", |
1245 | "paymentType": "Manual_Paytm" | 1245 | "paymentType": "Manual_Paytm" |
1246 | } | 1246 | } |
1247 | var handleFileSelect = function(evt) { | 1247 | var handleFileSelect = function(evt) { |
1248 | var files = evt.target.files; | 1248 | var files = evt.target.files; |
1249 | var file = files[0]; | 1249 | var file = files[0]; |
1250 | 1250 | ||
1251 | if (files && file) { | 1251 | if (files && file) { |
1252 | var reader = new FileReader(); | 1252 | var reader = new FileReader(); |
1253 | 1253 | ||
1254 | reader.onload = function(readerEvt) { | 1254 | reader.onload = function(readerEvt) { |
1255 | var binaryString = readerEvt.target.result; | 1255 | var binaryString = readerEvt.target.result; |
1256 | $scope.base64textString = btoa(binaryString); | 1256 | $scope.base64textString = btoa(binaryString); |
1257 | //console.log("base64textarea",$scope.base64textString) | 1257 | //console.log("base64textarea",$scope.base64textString) |
1258 | //$scope.data.uploadFile = file.name; | 1258 | //$scope.data.uploadFile = file.name; |
1259 | $scope.fileSelect = false; | 1259 | $scope.fileSelect = false; |
1260 | if($scope.data.uploadFile == null){ | 1260 | if($scope.data.uploadFile == null){ |
1261 | $scope.fileSelect = true; | 1261 | $scope.fileSelect = true; |
1262 | }else{ | 1262 | }else{ |
1263 | $scope.fileSelect = false; | 1263 | $scope.fileSelect = false; |
1264 | }; | 1264 | }; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | reader.readAsBinaryString(file); | 1267 | reader.readAsBinaryString(file); |
1268 | } | 1268 | } |
1269 | }; | 1269 | }; |
1270 | if (window.File && window.FileReader && window.FileList && window.Blob) { | 1270 | if (window.File && window.FileReader && window.FileList && window.Blob) { |
1271 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | 1271 | document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | $scope.ngShowhide = false; | 1274 | $scope.ngShowhide = false; |
1275 | $scope.GetValue = function(){ | 1275 | $scope.GetValue = function(){ |
1276 | if($scope.data.sector == "Other"){ | 1276 | if($scope.data.sector == "Other"){ |
1277 | $scope.ngShowhide = true; | 1277 | $scope.ngShowhide = true; |
1278 | }else{ | 1278 | }else{ |
1279 | $scope.ngShowhide = false; | 1279 | $scope.ngShowhide = false; |
1280 | } | 1280 | } |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | $scope.ngShow = false; | 1283 | $scope.ngShow = false; |
1284 | $scope.getValue = function(){ | 1284 | $scope.getValue = function(){ |
1285 | if($scope.data.hear == "Other"){ | 1285 | if($scope.data.hear == "Other"){ |
1286 | $scope.ngShow = true; | 1286 | $scope.ngShow = true; |
1287 | }else{ | 1287 | }else{ |
1288 | $scope.ngShow = false; | 1288 | $scope.ngShow = false; |
1289 | } | 1289 | } |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | $scope.register = function() { | 1292 | $scope.register = function() { |
1293 | Analytics.trackEvent('register', 'click', 'Registration'); | 1293 | Analytics.trackEvent('register', 'click', 'Registration'); |
1294 | $scope.loading = true; | 1294 | $scope.loading = true; |
1295 | $scope.data.uploadFile = $scope.base64textString; | 1295 | $scope.data.uploadFile = $scope.base64textString; |
1296 | $scope.infoForm = true; | 1296 | $scope.infoForm = true; |
1297 | //$scope.ticketAmnt = 1180; | 1297 | //$scope.ticketAmnt = 1180; |
1298 | $scope.detail = {}; | 1298 | $scope.detail = {}; |
1299 | $scope.data.phone = "+91"+$scope.data.number; | 1299 | $scope.data.phone = "+91"+$scope.data.number; |
1300 | 1300 | ||
1301 | var file =document.getElementById('filePicker').files[0]; | 1301 | var file =document.getElementById('filePicker').files[0]; |
1302 | var image = BASE_URL+'/containers/images/download/' | 1302 | var image = BASE_URL+'/containers/images/download/' |
1303 | var imagePath = file.name; | 1303 | var imagePath = file.name; |
1304 | $scope.data.uploadFile = image + imagePath; | 1304 | $scope.data.uploadFile = image + imagePath; |
1305 | var fd = new FormData() | 1305 | var fd = new FormData() |
1306 | fd.append('filePicker',file); | 1306 | fd.append('filePicker',file); |
1307 | var deferred = $q.defer(); | 1307 | var deferred = $q.defer(); |
1308 | $http({ | 1308 | $http({ |
1309 | method:'POST', | 1309 | method:'POST', |
1310 | url: BASE_URL+'/containers/images/upload', | 1310 | url: BASE_URL+'/containers/images/upload', |
1311 | data:fd, | 1311 | data:fd, |
1312 | transformRequest:angular.identity, | 1312 | transformRequest:angular.identity, |
1313 | headers:{'Content-Type':undefined} | 1313 | headers:{'Content-Type':undefined} |
1314 | }) | 1314 | }) |
1315 | .success(function(result){ | 1315 | .success(function(result){ |
1316 | deferred.resolve(result); | 1316 | deferred.resolve(result); |
1317 | $http({ | 1317 | $http({ |
1318 | method: 'POST', | 1318 | method: 'POST', |
1319 | url: BASE_URL+'/applicantIns', | 1319 | url: BASE_URL+'/applicantIns', |
1320 | data: $scope.data, | 1320 | data: $scope.data, |
1321 | headers: {} | 1321 | headers: {} |
1322 | }).then(function mySuccess(result) { | 1322 | }).then(function mySuccess(result) { |
1323 | $scope.detail = result; | 1323 | $scope.detail = result; |
1324 | data.applicantInId = result.data.id; | 1324 | data.applicantInId = result.data.id; |
1325 | $scope.userId = result.data.id; | 1325 | $scope.userId = result.data.id; |
1326 | // var amount = $scope.ticketAmnt * 100 | 1326 | // var amount = $scope.ticketAmnt * 100 |
1327 | // if($scope.tokencheck == true){ | 1327 | // if($scope.tokencheck == true){ |
1328 | // var amount = $scope.ticketAmnt | 1328 | // var amount = $scope.ticketAmnt |
1329 | // console.log("resultcity===",$scope.data.city) | 1329 | // console.log("resultcity===",$scope.data.city) |
1330 | // if($scope.discountpercentage == "100") { | 1330 | // if($scope.discountpercentage == "100") { |
1331 | // $scope.discountpercentage = "99.9"; | 1331 | // $scope.discountpercentage = "99.9"; |
1332 | // } | 1332 | // } |
1333 | // $scope.percDiscount = $scope.discountpercentage/100; | 1333 | // $scope.percDiscount = $scope.discountpercentage/100; |
1334 | // $scope.discountAmount = amount * $scope.percDiscount; | 1334 | // $scope.discountAmount = amount * $scope.percDiscount; |
1335 | // } | 1335 | // } |
1336 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1336 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1337 | // $scope.payingAmnt = taxAmount; | 1337 | // $scope.payingAmnt = taxAmount; |
1338 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1338 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1339 | // data.amount = $scope.payingAmnt; | 1339 | // data.amount = $scope.payingAmnt; |
1340 | if($scope.detail != null){ | 1340 | if($scope.detail != null){ |
1341 | $http({ | 1341 | $http({ |
1342 | method: 'POST', | 1342 | method: 'POST', |
1343 | url: BASE_URL+'/paymentsIns', | 1343 | url: BASE_URL+'/paymentsIns', |
1344 | data: data, | 1344 | data: data, |
1345 | headers: {} | 1345 | headers: {} |
1346 | }).then(function mySuccess(paymentResult) { | 1346 | }).then(function mySuccess(paymentResult) { |
1347 | $scope.loading = false; | 1347 | $scope.loading = false; |
1348 | $scope.paymentResult = paymentResult; | 1348 | $scope.paymentResult = paymentResult; |
1349 | $location.path("/paytm/confirm") | 1349 | $location.path("/paytm/confirm") |
1350 | }, function myError(error) { | 1350 | }, function myError(error) { |
1351 | }); | 1351 | }); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | }, function myError(error) { | 1354 | }, function myError(error) { |
1355 | 1355 | ||
1356 | }); | 1356 | }); |
1357 | 1357 | ||
1358 | }) | 1358 | }) |
1359 | 1359 | ||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | }); | 1362 | }); |
1363 | 1363 | ||
1364 | scotchApp.controller('registrationFormController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 1364 | scotchApp.controller('registrationFormController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
1365 | $scope.data = {}; | 1365 | $scope.data = {}; |
1366 | $scope.data.city = localStorage.getItem("city"); | 1366 | $scope.data.city = localStorage.getItem("city"); |
1367 | var data = { | 1367 | var data = { |
1368 | "amount": $scope.payingAmnt, | 1368 | "status": "captured" |
1369 | "currency": "INR", | ||
1370 | "status": "pending" | ||
1371 | } | 1369 | } |
1372 | //$scope.payingAmnt = 590; | 1370 | //$scope.payingAmnt = 590; |
1373 | $rootScope.tokenCall = function(val) { | 1371 | // $rootScope.tokenCall = function(val) { |
1374 | if (val == undefined) { | 1372 | // if (val == undefined) { |
1375 | $('#invalidToken').css('display', 'block'); | 1373 | // $('#invalidToken').css('display', 'block'); |
1376 | } else { | 1374 | // } else { |
1377 | val = val.toUpperCase(); | 1375 | // val = val.toUpperCase(); |
1378 | if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){ | 1376 | // if(((val == "SMVDU") && $scope.data.city != "Katra") || ((val == "LEH") && $scope.data.city != "Leh")){ |
1379 | $scope.tokencheck = false; | 1377 | // $scope.tokencheck = false; |
1380 | return; | 1378 | // return; |
1381 | } | 1379 | // } |
1382 | $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | 1380 | // $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') |
1383 | .then(function(searchResult) { | 1381 | // .then(function(searchResult) { |
1384 | if (searchResult.data.length == 0) { | 1382 | // if (searchResult.data.length == 0) { |
1385 | $scope.tokencheck = false; | 1383 | // $scope.tokencheck = false; |
1386 | $scope.discountAmount = 0; | 1384 | // $scope.discountAmount = 0; |
1387 | 1385 | ||
1388 | } else { | 1386 | // } else { |
1389 | $scope.discountpercentage = searchResult.data[0].discount; | 1387 | // $scope.discountpercentage = searchResult.data[0].discount; |
1390 | $scope.tokencheck = true; | 1388 | // $scope.tokencheck = true; |
1391 | } | 1389 | // } |
1392 | $scope.ticketAmnt = 590; | 1390 | // $scope.ticketAmnt = 590; |
1393 | var amount = $scope.ticketAmnt * 100 | 1391 | // var amount = $scope.ticketAmnt * 100 |
1394 | if($scope.tokencheck == true){ | 1392 | // if($scope.tokencheck == true){ |
1395 | var amount = $scope.ticketAmnt | 1393 | // var amount = $scope.ticketAmnt |
1396 | if($scope.discountpercentage == "100") { | 1394 | // if($scope.discountpercentage == "100") { |
1397 | $scope.discountpercentage = "99.9"; | 1395 | // $scope.discountpercentage = "99.9"; |
1398 | } | 1396 | // } |
1399 | //console.log($scope.ticketAmnt) | 1397 | // //console.log($scope.ticketAmnt) |
1400 | $scope.percDiscount = $scope.discountpercentage/100; | 1398 | // $scope.percDiscount = $scope.discountpercentage/100; |
1401 | //console.log($scope.percDiscount) | 1399 | // //console.log($scope.percDiscount) |
1402 | $scope.discountAmount = amount * $scope.percDiscount; | 1400 | // $scope.discountAmount = amount * $scope.percDiscount; |
1403 | //console.log($scope.discountAmount) | 1401 | // //console.log($scope.discountAmount) |
1404 | } | 1402 | // } |
1405 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1403 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1406 | //console.log(taxAmount) | 1404 | // //console.log(taxAmount) |
1407 | $scope.payingAmnt = taxAmount; | 1405 | // $scope.payingAmnt = taxAmount; |
1408 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1406 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1409 | //console.log($scope.payingAmnt) | 1407 | // //console.log($scope.payingAmnt) |
1410 | },function(err){ | 1408 | // },function(err){ |
1411 | console.log(err) | 1409 | // console.log(err) |
1412 | }); | 1410 | // }); |
1413 | 1411 | ||
1414 | } | 1412 | // } |
1415 | }; | 1413 | // }; |
1416 | 1414 | ||
1417 | $scope.formRegister = function() { | 1415 | $scope.formRegister = function() { |
1418 | //Analytics.trackEvent('register', 'click', 'Registration'); | 1416 | //Analytics.trackEvent('register', 'click', 'Registration'); |
1419 | $scope.loading = true; | 1417 | $scope.loading = true; |
1420 | $scope.detail = {}; | 1418 | $scope.detail = {}; |
1421 | $scope.data.phone = "+91"+$scope.data.number; | 1419 | $scope.data.phone = "+91"+$scope.data.number; |
1422 | console.log($scope.data.register) | 1420 | console.log($scope.data.register) |
1423 | if($scope.data.referalToken == null){ | 1421 | // if($scope.data.referalToken == null){ |
1424 | $scope.data.referalToken = "NA" | 1422 | // $scope.data.referalToken = "NA" |
1425 | } | 1423 | // } |
1426 | if($scope.data.register == "Pitch"){ | 1424 | if($scope.data.register == "Pitch"){ |
1427 | $scope.ticketAmnt = 590; | 1425 | $scope.ticketAmnt = 0; |
1428 | }else { | 1426 | }else { |
1429 | $scope.ticketAmnt = 118; | 1427 | $scope.ticketAmnt = 0; |
1430 | } | 1428 | } |
1431 | $http({ | 1429 | $http({ |
1432 | method: 'POST', | 1430 | method: 'POST', |
1433 | url: BASE_URL+'/applicantIndia', | 1431 | url: BASE_URL+'/applicantIndia', |
1434 | data: $scope.data, | 1432 | data: $scope.data, |
1435 | headers: {} | 1433 | headers: {} |
1436 | }).then(function mySuccess(result) { | 1434 | }).then(function mySuccess(result) { |
1437 | $scope.detail = result; | 1435 | $scope.detail = result; |
1438 | data.applicantIndiaId = result.data.id; | 1436 | data.applicantIndiaId = result.data.id; |
1439 | var amount = $scope.ticketAmnt * 100 | 1437 | // var amount = $scope.ticketAmnt * 100 |
1440 | if($scope.tokencheck == true){ | 1438 | // if($scope.tokencheck == true){ |
1441 | //console.log("test") | 1439 | // //console.log("test") |
1442 | var amount = $scope.ticketAmnt | 1440 | // var amount = $scope.ticketAmnt |
1443 | //console.log("test",$scope.ticketAmnt) | 1441 | // //console.log("test",$scope.ticketAmnt) |
1444 | if($scope.discountpercentage == "100") { | 1442 | // if($scope.discountpercentage == "100") { |
1445 | $scope.discountpercentage = "99.9"; | 1443 | // $scope.discountpercentage = "99.9"; |
1446 | } | 1444 | // } |
1447 | $scope.percDiscount = $scope.discountpercentage/100; | 1445 | // $scope.percDiscount = $scope.discountpercentage/100; |
1448 | //console.log($scope.percDiscount) | 1446 | // //console.log($scope.percDiscount) |
1449 | $scope.discountAmount = amount * $scope.percDiscount; | 1447 | // $scope.discountAmount = amount * $scope.percDiscount; |
1450 | //console.log($scope.discountAmount) | 1448 | // //console.log($scope.discountAmount) |
1451 | } | 1449 | // } |
1452 | var taxAmount = $scope.ticketAmnt - $scope.discountAmount | 1450 | // var taxAmount = $scope.ticketAmnt - $scope.discountAmount |
1453 | $scope.payingAmnt = taxAmount; | 1451 | // $scope.payingAmnt = taxAmount; |
1454 | $scope.payingAmnt = $scope.payingAmnt.toFixed() | 1452 | // $scope.payingAmnt = $scope.payingAmnt.toFixed() |
1455 | //console.log($scope.payingAmnt) | 1453 | // //console.log($scope.payingAmnt) |
1456 | data.amount = $scope.payingAmnt; | 1454 | // data.amount = $scope.payingAmnt; |
1457 | //var amount = $scope.ticketAmnt * 100 | 1455 | //var amount = $scope.ticketAmnt * 100 |
1458 | if($scope.detail != null){ | 1456 | if($scope.detail != null){ |
1459 | $http({ | 1457 | $http({ |
1460 | method: 'POST', | 1458 | method: 'POST', |
1461 | url: BASE_URL+'/paymentsIndia', | 1459 | url: BASE_URL+'/paymentsIndia', |
1462 | data: data, | 1460 | data: data, |
1463 | headers: {} | 1461 | headers: {} |
1464 | }).then(function mySuccess(paymentResult) { | 1462 | }).then(function mySuccess(paymentResult) { |
1465 | console.log(paymentResult) | 1463 | console.log(paymentResult) |
1466 | $scope.loading = false; | 1464 | $scope.loading = false; |
1467 | //$scope.ambassadorId = paymentResult.data.ambassadorId | 1465 | //$scope.ambassadorId = paymentResult.data.ambassadorId |
1468 | $scope.paymentResult = paymentResult; | 1466 | $scope.paymentResult = paymentResult; |
1469 | //$location.path("/paytm/confirm") | 1467 | $location.path("/paytm/confirm") |
1470 | }, function myError(error) { | 1468 | }, function myError(error) { |
1471 | }); | 1469 | }); |
1472 | } | 1470 | } |
1473 | 1471 | ||
1474 | var i = 0; | 1472 | // var i = 0; |
1475 | $scope.payingAmntt = $scope.payingAmnt * 100; | 1473 | // $scope.payingAmntt = $scope.payingAmnt * 100; |
1476 | //console.log($scope.payingAmntt) | 1474 | // //console.log($scope.payingAmntt) |
1477 | var options = { | 1475 | // var options = { |
1478 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 1476 | // //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
1479 | "key": "rzp_live_mkmCb4FkstuWaS", | 1477 | // "key": "rzp_live_mkmCb4FkstuWaS", |
1480 | "amount": $scope.payingAmntt, | 1478 | // "amount": $scope.payingAmntt, |
1481 | 1479 | ||
1482 | "name": "Startup Jalsa", | 1480 | // "name": "Startup Jalsa", |
1483 | "description":"amount", | 1481 | // "description":"amount", |
1484 | "currency": "INR", | 1482 | // "currency": "INR", |
1485 | "status": "done", | 1483 | // "status": "done", |
1486 | 1484 | ||
1487 | "prefill": { | 1485 | // "prefill": { |
1488 | "email": $scope.detail.email, | 1486 | // "email": $scope.detail.email, |
1489 | "contact": $scope.detail.phone | 1487 | // "contact": $scope.detail.phone |
1490 | }, | 1488 | // }, |
1491 | 1489 | ||
1492 | "theme": { | 1490 | // "theme": { |
1493 | "color": "#2196f3 ", | 1491 | // "color": "#2196f3 ", |
1494 | "image_padding":"NO" | 1492 | // "image_padding":"NO" |
1495 | }, | 1493 | // }, |
1496 | "modal": { | 1494 | // "modal": { |
1497 | "ondismiss": function(){ | 1495 | // "ondismiss": function(){ |
1498 | } | 1496 | // } |
1499 | }, | 1497 | // }, |
1500 | "handler": function (response){ | 1498 | // "handler": function (response){ |
1501 | createPayment(response); | 1499 | // createPayment(response); |
1502 | } | 1500 | // } |
1503 | }; | 1501 | // }; |
1504 | var rzp1 = new Razorpay(options); | 1502 | // var rzp1 = new Razorpay(options); |
1505 | rzp1.open(); | 1503 | // rzp1.open(); |
1506 | $scope.paymentResponse = {}; | 1504 | // $scope.paymentResponse = {}; |
1507 | function createPayment(response){ | 1505 | // function createPayment(response){ |
1508 | console.log("response",response) | 1506 | // console.log("response",response) |
1509 | console.log($scope.paymentResult) | 1507 | // console.log($scope.paymentResult) |
1510 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1508 | // $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1511 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 1509 | // $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
1512 | $scope.paymentResponse.amount = data.amount; | 1510 | // $scope.paymentResponse.amount = data.amount; |
1513 | $scope.paymentResponse.currency = "INR"; | 1511 | // $scope.paymentResponse.currency = "INR"; |
1514 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 1512 | // $scope.paymentResponse.status = $scope.paymentResult.data.status; |
1515 | $http({ | 1513 | // $http({ |
1516 | method: 'PUT', | 1514 | // method: 'PUT', |
1517 | url: BASE_URL+'/paymentsIndia/'+$scope.paymentResult.data.id, | 1515 | // url: BASE_URL+'/paymentsIndia/'+$scope.paymentResult.data.id, |
1518 | data: $scope.paymentResponse, | 1516 | // data: $scope.paymentResponse, |
1519 | headers: {} | 1517 | // headers: {} |
1520 | }).then(function mySuccess(searchResult) { | 1518 | // }).then(function mySuccess(searchResult) { |
1521 | console.log("searchResult",searchResult) | 1519 | // console.log("searchResult",searchResult) |
1522 | $location.path("/confirm") | 1520 | // $location.path("/confirm") |
1523 | }, function myError(error) { | 1521 | // }, function myError(error) { |
1524 | }); | 1522 | // }); |
1525 | } | 1523 | // } |
1526 | //} | 1524 | //} |
1527 | 1525 | ||
1528 | }, function myError(error) { | 1526 | }, function myError(error) { |
1529 | 1527 | ||
1530 | }); | 1528 | }); |
1531 | 1529 | ||
1532 | //}) | 1530 | //}) |
1533 | 1531 | ||
1534 | } | 1532 | } |
1535 | 1533 | ||
1536 | }); | 1534 | }); |
1537 | 1535 | ||
1538 | scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { | 1536 | scotchApp.controller('campusAmbassadorController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL,Analytics) { |
1539 | $scope.data = {}; | 1537 | $scope.data = {}; |
1540 | var data = { | 1538 | var data = { |
1541 | "amount": $scope.ticketAmnt, | 1539 | "amount": $scope.ticketAmnt, |
1542 | "currency": "INR", | 1540 | "currency": "INR", |
1543 | "status": "pending" | 1541 | "status": "pending" |
1544 | } | 1542 | } |
1545 | 1543 | ||
1546 | $scope.formRegister = function() { | 1544 | $scope.formRegister = function() { |
1547 | //Analytics.trackEvent('register', 'click', 'Registration'); | 1545 | //Analytics.trackEvent('register', 'click', 'Registration'); |
1548 | $scope.loading = true; | 1546 | $scope.loading = true; |
1549 | $scope.ticketAmnt = 500; | 1547 | $scope.ticketAmnt = 500; |
1550 | $scope.detail = {}; | 1548 | $scope.detail = {}; |
1551 | $scope.data.phone = "+91"+$scope.data.number; | 1549 | $scope.data.phone = "+91"+$scope.data.number; |
1552 | var randomNumber = ""+Math.random(); | 1550 | var randomNumber = ""+Math.random(); |
1553 | var nameSpliced = $scope.data.name.slice(0,3); | 1551 | var nameSpliced = $scope.data.name.slice(0,3); |
1554 | var numberSpliced = randomNumber.slice(2,4); | 1552 | var numberSpliced = randomNumber.slice(2,4); |
1555 | //var numberSpliced = "90"; | 1553 | //var numberSpliced = "90"; |
1556 | $scope.data.referalToken = nameSpliced+numberSpliced; | 1554 | $scope.data.referalToken = nameSpliced+numberSpliced; |
1557 | //$scope.data.referalToken = nameSpliced; | 1555 | //$scope.data.referalToken = nameSpliced; |
1558 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1556 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1559 | var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken} | 1557 | var ambassDorpayload = {"name":$scope.data.name,"email":$scope.data.email,"mobile":$scope.data.phone,"discount":10,"referalToken":$scope.data.referalToken} |
1560 | 1558 | ||
1561 | $http({ | 1559 | $http({ |
1562 | method: 'POST', | 1560 | method: 'POST', |
1563 | url: BASE_URL+'/campusAmbassadors', | 1561 | url: BASE_URL+'/campusAmbassadors', |
1564 | data: $scope.data, | 1562 | data: $scope.data, |
1565 | headers: {} | 1563 | headers: {} |
1566 | }).then(function mySuccess(result) { | 1564 | }).then(function mySuccess(result) { |
1567 | $scope.detail = result; | 1565 | $scope.detail = result; |
1568 | data.campusAmbassadorId = result.data.id; | 1566 | data.campusAmbassadorId = result.data.id; |
1569 | $scope.userId = result.data.id; | 1567 | $scope.userId = result.data.id; |
1570 | var amount = $scope.ticketAmnt * 100 | 1568 | var amount = $scope.ticketAmnt * 100 |
1571 | $scope.ambassCall(ambassDorpayload); | 1569 | $scope.ambassCall(ambassDorpayload); |
1572 | if($scope.detail != null){ | 1570 | if($scope.detail != null){ |
1573 | $http({ | 1571 | $http({ |
1574 | method: 'POST', | 1572 | method: 'POST', |
1575 | url: BASE_URL+'/ambassadorPayments', | 1573 | url: BASE_URL+'/ambassadorPayments', |
1576 | data: data, | 1574 | data: data, |
1577 | headers: {} | 1575 | headers: {} |
1578 | }).then(function mySuccess(paymentResult) { | 1576 | }).then(function mySuccess(paymentResult) { |
1579 | console.log(paymentResult) | 1577 | console.log(paymentResult) |
1580 | $scope.loading = false; | 1578 | $scope.loading = false; |
1581 | //$scope.ambassadorId = paymentResult.data.ambassadorId | 1579 | //$scope.ambassadorId = paymentResult.data.ambassadorId |
1582 | $scope.paymentResult = paymentResult; | 1580 | $scope.paymentResult = paymentResult; |
1583 | //$location.path("/paytm/confirm") | 1581 | //$location.path("/paytm/confirm") |
1584 | }, function myError(error) { | 1582 | }, function myError(error) { |
1585 | }); | 1583 | }); |
1586 | } | 1584 | } |
1587 | 1585 | ||
1588 | var i = 0; | 1586 | var i = 0; |
1589 | $scope.payingAmntt = $scope.ticketAmnt * 100; | 1587 | $scope.payingAmntt = $scope.ticketAmnt * 100; |
1590 | data.amount = $scope.ticketAmnt; | 1588 | data.amount = $scope.ticketAmnt; |
1591 | var options = { | 1589 | var options = { |
1592 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", | 1590 | //"key": "rzp_test_YwHsVFiDIQ2WUQ", |
1593 | "key": "rzp_live_mkmCb4FkstuWaS", | 1591 | "key": "rzp_live_mkmCb4FkstuWaS", |
1594 | "amount": $scope.payingAmntt, | 1592 | "amount": $scope.payingAmntt, |
1595 | 1593 | ||
1596 | "name": "Startup Jalsa", | 1594 | "name": "Startup Jalsa", |
1597 | "description":"amount", | 1595 | "description":"amount", |
1598 | "currency": "INR", | 1596 | "currency": "INR", |
1599 | "status": "done", | 1597 | "status": "done", |
1600 | 1598 | ||
1601 | "prefill": { | 1599 | "prefill": { |
1602 | "email": $scope.detail.email, | 1600 | "email": $scope.detail.email, |
1603 | "contact": $scope.detail.phone | 1601 | "contact": $scope.detail.phone |
1604 | }, | 1602 | }, |
1605 | 1603 | ||
1606 | "theme": { | 1604 | "theme": { |
1607 | "color": "#2196f3 ", | 1605 | "color": "#2196f3 ", |
1608 | "image_padding":"NO" | 1606 | "image_padding":"NO" |
1609 | }, | 1607 | }, |
1610 | "modal": { | 1608 | "modal": { |
1611 | "ondismiss": function(){ | 1609 | "ondismiss": function(){ |
1612 | } | 1610 | } |
1613 | }, | 1611 | }, |
1614 | "handler": function (response){ | 1612 | "handler": function (response){ |
1615 | createPayment(response); | 1613 | createPayment(response); |
1616 | } | 1614 | } |
1617 | }; | 1615 | }; |
1618 | var rzp1 = new Razorpay(options); | 1616 | var rzp1 = new Razorpay(options); |
1619 | rzp1.open(); | 1617 | rzp1.open(); |
1620 | $scope.paymentResponse = {}; | 1618 | $scope.paymentResponse = {}; |
1621 | function createPayment(response){ | 1619 | function createPayment(response){ |
1622 | console.log("response",response) | 1620 | console.log("response",response) |
1623 | console.log($scope.paymentResult) | 1621 | console.log($scope.paymentResult) |
1624 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; | 1622 | $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; |
1625 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; | 1623 | $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; |
1626 | $scope.paymentResponse.amount = data.amount; | 1624 | $scope.paymentResponse.amount = data.amount; |
1627 | $scope.paymentResponse.currency = "INR"; | 1625 | $scope.paymentResponse.currency = "INR"; |
1628 | $scope.paymentResponse.status = $scope.paymentResult.data.status; | 1626 | $scope.paymentResponse.status = $scope.paymentResult.data.status; |
1629 | $http({ | 1627 | $http({ |
1630 | method: 'PUT', | 1628 | method: 'PUT', |
1631 | url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id, | 1629 | url: BASE_URL+'/ambassadorPayments/'+$scope.paymentResult.data.id, |
1632 | data: $scope.paymentResponse, | 1630 | data: $scope.paymentResponse, |
1633 | headers: {} | 1631 | headers: {} |
1634 | }).then(function mySuccess(searchResult) { | 1632 | }).then(function mySuccess(searchResult) { |
1635 | console.log("searchResult",searchResult) | 1633 | console.log("searchResult",searchResult) |
1636 | $location.path("/confirmation") | 1634 | $location.path("/confirmation") |
1637 | //$scope.paymentResultt = searchResult.data; | 1635 | //$scope.paymentResultt = searchResult.data; |
1638 | // $http({ | 1636 | // $http({ |
1639 | // method: 'GET', | 1637 | // method: 'GET', |
1640 | // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId, | 1638 | // url: BASE_URL+'/campusAmbassadors/'+$rootScope.paymentResultt.campusAmbassadorId, |
1641 | // data: $scope.data, | 1639 | // data: $scope.data, |
1642 | // headers: {} | 1640 | // headers: {} |
1643 | // }).then(function mySuccess(result) { | 1641 | // }).then(function mySuccess(result) { |
1644 | // //console.log("result2323324434",result) | 1642 | // //console.log("result2323324434",result) |
1645 | // //Analytics.trackEvent('success', 'click', 'Registration'); | 1643 | // //Analytics.trackEvent('success', 'click', 'Registration'); |
1646 | // $location.path("/confirm") | 1644 | // $location.path("/confirm") |
1647 | // }) | 1645 | // }) |
1648 | }, function myError(error) { | 1646 | }, function myError(error) { |
1649 | }); | 1647 | }); |
1650 | } | 1648 | } |
1651 | //} | 1649 | //} |
1652 | 1650 | ||
1653 | }, function myError(error) { | 1651 | }, function myError(error) { |
1654 | 1652 | ||
1655 | }); | 1653 | }); |
1656 | 1654 | ||
1657 | $scope.ambassCall = function(data){ | 1655 | $scope.ambassCall = function(data){ |
1658 | $http({ | 1656 | $http({ |
1659 | method: 'POST', | 1657 | method: 'POST', |
1660 | url: BASE_URL+'/ambassadors', | 1658 | url: BASE_URL+'/ambassadors', |
1661 | data: data, | 1659 | data: data, |
1662 | headers: {} | 1660 | headers: {} |
1663 | }).then(function mySuccess(result) { | 1661 | }).then(function mySuccess(result) { |
1664 | console.log(result) | 1662 | console.log(result) |
1665 | }); | 1663 | }); |
1666 | } | 1664 | } |
1667 | 1665 | ||
1668 | //}) | 1666 | //}) |
1669 | 1667 | ||
1670 | } | 1668 | } |
1671 | 1669 | ||
1672 | }); | 1670 | }); |
1673 | 1671 | ||
1674 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { | 1672 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { |
1675 | $scope.data = {}; | 1673 | $scope.data = {}; |
1676 | $scope.check = false; | 1674 | $scope.check = false; |
1677 | $scope.numberCheck = false; | 1675 | $scope.numberCheck = false; |
1678 | 1676 | ||
1679 | $scope.submit = function() { | 1677 | $scope.submit = function() { |
1680 | //var randomNumber = ""+Math.random(); | 1678 | //var randomNumber = ""+Math.random(); |
1681 | var nameSpliced = $scope.data.name.slice(0,5); | 1679 | var nameSpliced = $scope.data.name.slice(0,5); |
1682 | //var numberSpliced = randomNumber.slice(2,4); | 1680 | //var numberSpliced = randomNumber.slice(2,4); |
1683 | //var numberSpliced = "22"; | 1681 | //var numberSpliced = "22"; |
1684 | //$scope.data.referalToken = nameSpliced+numberSpliced; | 1682 | //$scope.data.referalToken = nameSpliced+numberSpliced; |
1685 | $scope.data.referalToken = nameSpliced; | 1683 | $scope.data.referalToken = nameSpliced; |
1686 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); | 1684 | $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); |
1687 | //$scope.data.referalToken = $scope.data.referalToken.toString(); | 1685 | //$scope.data.referalToken = $scope.data.referalToken.toString(); |
1688 | $http({ | 1686 | $http({ |
1689 | method: 'POST', | 1687 | method: 'POST', |
1690 | url: BASE_URL + '/ambassadors', | 1688 | url: BASE_URL + '/ambassadors', |
1691 | data: $scope.data, | 1689 | data: $scope.data, |
1692 | headers: {} | 1690 | headers: {} |
1693 | }).then(function mySuccess(result) { | 1691 | }).then(function mySuccess(result) { |
1694 | $scope.detail = result; | 1692 | $scope.detail = result; |
1695 | $('#myModal').modal('show'); | 1693 | $('#myModal').modal('show'); |
1696 | $scope.data.name = ''; | 1694 | $scope.data.name = ''; |
1697 | $scope.data.email = ''; | 1695 | $scope.data.email = ''; |
1698 | $scope.data.mobile = ''; | 1696 | $scope.data.mobile = ''; |
1699 | //$scope.data.discount = ''; | 1697 | //$scope.data.discount = ''; |
1700 | 1698 | ||
1701 | }, function myError(error) { | 1699 | }, function myError(error) { |
1702 | console.log(error) | 1700 | console.log(error) |
1703 | console.log(error.data.error.message) | 1701 | console.log(error.data.error.message) |
1704 | }); | 1702 | }); |
1705 | } | 1703 | } |
1706 | }); | 1704 | }); |
1707 | 1705 | ||
1708 | 1706 | ||
1709 | 1707 | ||
1710 | 1708 | ||
1711 | 1709 |