Commit 6ae8d3cdd34dbd04f3f96b7080b2c6c0bea9428d

Authored by Palak Handa
1 parent a78dd61bfd
Exists in master and in 1 other branch paytm

add new module

Showing 3 changed files with 777 additions and 694 deletions   Show diff stats
pages/ambassador.html
... ... @@ -0,0 +1,26 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <div style="text-align:center;margin-bottom:3%;">
  5 + <h4>Startup Ambassador</h4>
  6 + </div>
  7 +</head>
  8 +<body>
  9 + <div style="text-align:center">
  10 + <form>
  11 + Name:
  12 + <input type="text" name="name" ng-model="data.name">
  13 + <br><br>
  14 + Mobile:
  15 + <input type="text" name="mobile" ng-model="data.mobile">
  16 + <br><br>
  17 + Email:
  18 + <input type="text" name="email" ng-model="data.email">
  19 + <br><br>
  20 + <div>
  21 + <button type="button" class="btn btn-secondary" value="Submit" ng-click="submit()">Submit</button>
  22 + </div>
  23 + </form>
  24 + </div>
  25 +</body>
  26 +</html>
0 27 \ No newline at end of file
... ...
... ... @@ -106,13 +106,14 @@
106 106 <option name="city" selected disabled value="">Choose City</option>
107 107 <option value="Ahmedabad">Ahmedabad</option>
108 108 <option value="Bangalore">Bangalore</option>
109   - <option value="NCR">NCR</option>
  109 + <option value="NCR">Delhi-NCR</option>
110 110 <option value="Hyderabad">Hyderabad</option>
111 111 <option value="Jaipur">Jaipur</option>
112 112 <option value="Mumbai">Mumbai</option>
113 113 <option value="Pune">Pune</option>
114 114 <option value="Indore">Indore</option>
115 115 <option value="Chandigarh">Chandigarh</option>
  116 + <option value="anyOther">Any other</option>
116 117 </select>
117 118 </div>
118 119 <div class="clearfix"></div>
... ... @@ -435,7 +436,7 @@
435 436 <div class="identity-question">
436 437 <div class="col-xs-12 font f-family" style="margin:10px 10px 0px 10px;">
437 438 <b>Who are you?</b>
438   - <p style="color:grey">kindly choose one option (if you select the student then please upload the Id proof).</p>
  439 + <p style="color:grey">kindly choose one option.</p>
439 440 </div>
440 441 <div class="clearfix"></div>
441 442 </div>
... ... @@ -452,18 +453,27 @@
452 453 <label class="f-family">Others</label>
453 454 </label>
454 455 </div>
455   - <div class="col-xs-6">
  456 + <!-- <div class="col-xs-6">
456 457 <label class="card-small">
457 458  
458 459 <input type="file" file-model="data.pic" required id="picture" name="pic" accept="image/*" ng-show="show=='a'">
459 460 </label>
460   - </div>
  461 + </div> -->
461 462 </div><!-- CLOSE stages identity-align -->
462 463 <div class="clearfix"></div>
463 464 </div><!-- CLOSE identity-shadow -->
464   -
  465 + <div class="col-xs-12 col-md-10 input-wrapper">
  466 + <div class="icon-circle-h">
  467 + <i class="material-icons" style="line-height: 30px;">phone_android</i>
  468 + </div>
  469 + <input class="text-input" ng-model="data.referalToken" placeholder="Enter Coupon code">
  470 + <button type="button" ng-click="tokenCall(data.referalToken)">Apply</button>
  471 + </div>
  472 +
  473 + <div class="clearfix"></div>
  474 +
465 475 <div class="text-center">
466   - <input type="submit" class="btn submit-button" ng-disabled="applicantForm.$invalid|| check|| numberCheck||cc" value="Submit" ng-click="create()">
  476 + <input type="submit" class="btn submit-button" ng-disabled="applicantForm.$invalid|| check|| numberCheck" value="Submit" ng-click="create()">
467 477 </div>
468 478 </div> <!-- CLOSE step-two-form -->
469 479 </div> <!-- col-xs-12 col-md-8 col-md-offset-2 -->
... ... @@ -481,3 +491,4 @@
481 491 </div>
482 492 </div> <!-- CLOSE NEW-CONTROLLER -->
483 493 <div id="snacsskbar">Registration done successfully.</div>
  494 +
484 495 \ No newline at end of file
... ...
... ... @@ -3,705 +3,751 @@
3 3  
4 4 // configure our routes
5 5 scotchApp.config(function($routeProvider) {
6   - $routeProvider
  6 + $routeProvider
  7 +
  8 + // route for the home page
  9 + .when('/', {
  10 + templateUrl: 'pages/home.html',
  11 + controller: 'mainController'
  12 + })
  13 +
  14 + // route for the about page
  15 + .when('/verification/=:id', {
  16 + templateUrl: 'pages/verify.html',
  17 + controller: 'verifyController'
  18 + })
  19 +
  20 + // route for the ambassador page
  21 + .when('/ambassador', {
  22 + templateUrl: 'pages/ambassador.html',
  23 + controller: 'ambassadorController'
  24 + })
  25 + });
7 26  
8   - // route for the home page
9   - .when('/', {
10   - templateUrl : 'pages/home.html',
11   - controller : 'mainController'
12   - })
  27 + // create the controller and inject Angular's $scope
  28 + scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope) {
13 29  
14   - // route for the about page
15   - .when('/verification/=:id', {
16   - templateUrl : 'pages/verify.html',
17   - controller : 'verifyController'
18   - })
19   - });
20 30  
21   - // create the controller and inject Angular's $scope
22   - scotchApp.controller('mainController', function($scope, $http, $location,$route) {
23   -
24   - $scope.data = {
25   - show: true,
26   - hide: false
27   - };
28   -
29   - $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
30   -
31   - $scope.max = 100;
32   - $scope.current = 0;
33   - $scope.payingAmnt = 0;
34   - if ($scope.data.stage == 'select') {
35   - console.log("sdsaasd");
36   -
37   - }
38   -
39   - $scope.author = 'Swarn Singh';
40   - $scope.data = {};
41   - //$scope.data.stage = 'idea';
42   - //$scope.data.email = '';
43   - $scope.check = false;
44   - $scope.numberCheck = false;
45   - $scope.paymentResult = {};
46   - var BASE_URL = "http://0.0.0.0:4001/api";
47   - var data ={
48   - "amount":$scope.payingAmnt,
49   - "currency": "INR",
50   - "status": "pending"
51   - }
52   -
53   - $scope.removeError = function(){
54   - $('#invalidEmail').css('display', 'none');
55   - $('#alreadyExist').css('display', 'none');
56   - };
57   -
58   - $scope.emailcheck = function(val){
59   - //console.log('val', val);
60   - if (val == undefined) {
61   - $('#invalidEmail').css('display', 'block');
62   - }else{
63   - $http({
64   - method: 'GET',
65   - url: BASE_URL+'/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
66   - //data: email,
67   - headers: {}
68   - }).then(function mySuccess(searchResult) {
69   - console.log("searchResult1===>",searchResult)
70   - if(searchResult.data.length == 0){
71   - $scope.check = false;
72   - }else{
73   - $scope.check = true;
74   - $('#alreadyExist').css('display', 'block');
75   - }
76   - }, function myError(error) {
77   - });
78   - }
79   - };
80   -
81   - $scope.removeNoError = function(){
82   - $('#noExist').css('display', 'none');
83   - };
84   -
85   - $scope.numbercheck = function(number){
86   - $http({
87   - method: 'GET',
88   - url: BASE_URL+'/applicants?filter={"where": {"phone": {"like":"%25'+number+'%25"}}}',
89   - data: $scope.data,
90   - headers: {}
91   - }).then(function mySuccess(searchResult) {
92   - console.log("searchResult===>",searchResult)
93   - if(searchResult.data.length == 0){
94   - $scope.numberCheck = false;
95   - }else{
96   - $scope.numberCheck = true;
97   - $('#noExist').css('display', 'block');
98   - }
99   - }, function myError(error) {
100   - });
101   - };
102   -
103   - /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/
104   - $(document).ready(
105   - function(){
106   - $('input:submit').attr('disabled',true);
107   - $('input:file').change(
108   - function(){
109   - if ($("#picture").val()){
110   - $('input:submit').removeAttr('disabled');
111   - }
112   - else {
113   - $('input:submit').attr('disabled',true);
114   - }
115   - });
116   - });
117   -
118   - /*****THIS IS FOR STEP ONE FORM ******/
119   - $scope.next = function() {
120   - var BASE_URL = "http://0.0.0.0:4001/api";
121   - $scope.data.status = null
122   - if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
123   - var x = document.getElementById("snackbar")
124   - x.className = "show";
125   - setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
126   - }else if($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
127   - $scope.infoForm = true;
128   - console.log("sdasdasdsa");
129   - $scope.data.stage = $scope.data.stage;
130   - $scope.detail = {};
131   - $scope.data.phone = "+91"+$scope.data.number;
132   - $http({
133   - method: 'POST',
134   - url: BASE_URL+'/information',
135   - data: $scope.data,
136   - headers: {}
137   - }).then(function mySuccess(result) {
138   - console.log("result",result)
139   - $scope.detail = result;
140   - data.applicantId = result.data.id;
141   - $scope.userId = result.data.id;
142   -
143   - }, function myError(error) {
144   - });
145   - }
146   -
147   - }
148   -
149   - /*****THIS IS FOR STEP THREE FORM ******/
150   - $scope.create = function() {
151   - console.log("$scope.data.identity",$scope.data.identity)
152   - /*****PAYMENT WITH 18% GST*****/
153   - if($scope.data.stage == "Idea"){
154   - console.log("$scope.data",$scope.data)
155   - if($scope.data.identity == "student"){
156   - $scope.payingAmnt = 59000;
157   - }else{
158   - $scope.payingAmnt = 118000;
159   - }
160   - }
161   -
162   - if($scope.data.stage == "Product"){
163   - if($scope.data.identity == "student"){
164   - $scope.payingAmnt = 59000;
165   - }else{
166   - $scope.payingAmnt = 118000;
167   - }
168   - }
169   -
170   - if($scope.data.stage == "Growth"){
171   - if($scope.data.identity == "student"){
172   - $scope.payingAmnt = 59000;
173   - }else{
174   - $scope.payingAmnt = 118000;
175   - }
  31 +
  32 + $scope.data = {
  33 + show: true,
  34 + hide: false
  35 + };
  36 +
  37 + $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
  38 +
  39 + $scope.max = 100;
  40 + $scope.current = 0;
  41 + $scope.payingAmnt = 0;
  42 + if ($scope.data.stage == 'select') {
  43 + console.log("sdsaasd");
  44 +
176 45 }
177 46  
  47 + $scope.author = 'Swarn Singh';
  48 + $scope.data = {};
  49 + $scope.data.stage = 'Idea';
  50 +
  51 + //$scope.data.email = '';
  52 + $scope.check = false;
  53 + $scope.numberCheck = false;
  54 + $scope.tokencheck = false;
  55 + $scope.paymentResult = {};
  56 + var BASE_URL = "http://0.0.0.0:4001/api";
  57 + var data = {
  58 + "amount": $scope.payingAmnt,
  59 + "currency": "INR",
  60 + "status": "pending"
  61 + }
178 62  
179   - if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
180   - var x = document.getElementById("snackbar")
181   - x.className = "show";
182   - setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
183   - }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
184   -
185   - var BASE_URL = "http://0.0.0.0:4001/api";
186   -
187   - if($scope.data.identity == "student"){
188   -
189   - var image = BASE_URL+'/container1s/proof/download/'
190   - console.log("image",image)
191   - var image = document.getElementById('picture').files[0];
192   - var imagePath = image.name;
193   - $scope.NewIamge = image + imagePath;
194   - $scope.data.pic = $scope.NewIamge;
195   - var fd = new FormData()
196   - fd.append('file',image);
197   - $http({
198   - method:'POST',
199   - url: BASE_URL+'/container1s/proof/upload',
200   - data:fd,
201   - transformRequest:angular.identity,
202   - headers:{'Content-Type':undefined}
203   - }).then(function mySuccess(sucessResponse) {
204   -
205   -
206   - }, function myError(error) {
207   - });
208   -
209   - }
210   - var BASE_URL = "http://0.0.0.0:4001/api";
211   - console.log("BASE_URL",BASE_URL)
212   - $scope.infoForm = true;
213   - console.log("sdasdasdsa");
214   - $scope.data.stage = $scope.data.stage;
215   - $scope.detail = {};
216   - $scope.data.phone = "+91"+$scope.data.number;
217   - $http({
218   - method: 'POST',
219   - url: BASE_URL+'/applicants',
220   - data: $scope.data,
221   - headers: {}
222   - }).then(function mySuccess(result) {
  63 + $scope.removeError = function() {
  64 + $('#invalidEmail').css('display', 'none');
  65 + $('#alreadyExist').css('display', 'none');
  66 + };
  67 +
  68 + $scope.emailcheck = function(val) {
  69 + //console.log('val', val);
  70 + if (val == undefined) {
  71 + $('#invalidEmail').css('display', 'block');
  72 + } else {
  73 + $http({
  74 + method: 'GET',
  75 + url: BASE_URL + '/applicants?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}',
  76 + //data: email,
  77 + headers: {}
  78 + }).then(function mySuccess(searchResult) {
  79 + console.log("searchResult1===>", searchResult)
  80 + if (searchResult.data.length == 0) {
  81 + $scope.check = false;
  82 + } else {
  83 + $scope.check = true;
  84 + $('#alreadyExist').css('display', 'block');
  85 + }
  86 + }, function myError(error) {});
  87 + }
  88 + };
  89 +
  90 + $scope.removeNoError = function() {
  91 + $('#noExist').css('display', 'none');
  92 + };
  93 +
  94 + $scope.numbercheck = function(number) {
  95 + $http({
  96 + method: 'GET',
  97 + url: BASE_URL + '/applicants?filter={"where": {"phone": {"like":"%25' + number + '%25"}}}',
  98 + data: $scope.data,
  99 + headers: {}
  100 + }).then(function mySuccess(searchResult) {
  101 + console.log("searchResult===>", searchResult)
  102 + if (searchResult.data.length == 0) {
  103 + $scope.numberCheck = false;
  104 + } else {
  105 + $scope.numberCheck = true;
  106 + $('#noExist').css('display', 'block');
  107 + }
  108 + }, function myError(error) {});
  109 + };
  110 +
  111 + $rootScope.tokenCall = function(val) {
  112 + console.log('val-------->', val);
  113 + if (val == undefined) {
  114 + $('#invalidEmail').css('display', 'block');
  115 + } else {
  116 + val = val.toUpperCase();
  117 + $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": {"like":"%25' + val + '%25"}}}')
  118 + .then(function(searchResult) {
  119 + if (searchResult.data.length == 0) {
  120 + $scope.tokencheck = false;
  121 + console.log("kuch ni haiga")
  122 + } else {
  123 + console.log("haiga g haiga")
  124 + $scope.tokencheck = true;
  125 + // $('#alreadyExist').css('display', 'block');
  126 + }
  127 + },function(err){
  128 + console.log(err)
  129 + });
223 130  
224   - console.log("=====result=====",result)
225   - $scope.detail = result;
226   - data.applicantId = result.data.id;
227   - $scope.userId = result.data.id;
228   - console.log("=====data=====",data)
229   - data.amount = $scope.payingAmnt /100;
230   - if($scope.detail != null){
231   - $http({
232   - method: 'POST',
233   - url: BASE_URL+'/payments',
234   - data: data,
235   - headers: {}
236   - }).then(function mySuccess(paymentResult) {
237   - $scope.paymentResult = paymentResult;
238   - }, function myError(error) {
239   - });
240   - }
241   - var i = 0;
242   - var options = {
243   - "key": "rzp_test_YwHsVFiDIQ2WUQ",
244   - "amount": $scope.payingAmnt,
245   -
246   - "name": "Startup Jalsa",
247   - "description":"amount",
248   - "currency": "INR",
249   - "status": "done",
250   -
251   - "theme": {
252   - "color": "#2196f3 ",
253   - "image_padding":"NO"
254   - },
255   - "modal": {
256   - "ondismiss": function(){
257   - }
258   - },
259   - "handler": function (response){
260   - createPayment(response);
261   - }
262   - };
263   - var rzp1 = new Razorpay(options);
264   - rzp1.open();
265   - $scope.paymentResponse = {};
266   - function createPayment(response){
267   - $route.reload();
268   - $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
269   - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
270   - $scope.paymentResponse.amount = data.amount;
271   - $scope.paymentResponse.currency = "INR";
272   - $scope.paymentResponse.status = "captured";
273   - $http({
274   - method: 'PUT',
275   - url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
276   - data: $scope.paymentResponse,
277   - headers: {}
278   - }).then(function mySuccess(searchResult) {
279   - console.log("searchResult",searchResult)
280   - $scope.showToastr()
281   - //toaster.success("Registration done successfully");
282   -
283   - }, function myError(error) {
284   - });
285   - }
286   -
287   - }, function myError(error) {
  131 + }
  132 + };
  133 +
  134 + /*THIS CODE FOR ENABLED SUBMIT BUTTON AFTER UPLOAD IMAGE*/
  135 + $(document).ready(
  136 + function() {
  137 + $('input:submit').attr('disabled', true);
  138 + $('input:file').change(
  139 + function() {
  140 + if ($("#picture").val()) {
  141 + $('input:submit').removeAttr('disabled');
  142 + } else {
  143 + $('input:submit').attr('disabled', true);
  144 + }
  145 + });
288 146 });
289   - }
290   -
291   - }
292   -
293   - $scope.showToastr = function(){
294   - console.log("called toast")
295   - var x = document.getElementById("snacsskbar")
296   - x.className = "show";
297   - setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
298   - }
299   -
300   - // $scope.lastpage = function(){
301   - // console.log("sdasd");
302   - // $('.sectors-card').css('display', 'inherit');
303   - // $('.form-all').css('display', 'inherit');
304   - // $('.submit-button').css('display', 'inherit');
305   - // }
306   - /*kk***This code for change data when click to chooses stages***/
307   - $scope.businessmodel = true;
308   - $scope.Idea =true;
309   - $scope.current = true;
310   -
311   - $scope.stage = function(stage){
312   - // $('.sectors-card').css('display', 'block');
313   - // $('.form-all').css('display', 'block');
314   - // $('.identity-shadow').css('display', 'block');
315   - // $('.step-two-form').css('display', 'block');
316   - // $('.step-three-form').css('display', 'block');
317   -
318   - if (stage == 'Idea') {
319   - $scope.current = 10;
320   - $scope.prototyp = false;
321   - $scope.market = false;
322   - $scope.risks = false;
323   - $scope.team = false;
324   - $scope.pitch = false;
325   - $scope.financials = false;
326   - $scope.businessmodel = true;
327   - // for right content
328   - $scope.Idea =true;
329   - $scope.Product =false;
330   - $scope.Growth =false;
331   - }else if(stage == 'Product') {
332   - $scope.current = 10;
333   - $scope.prototyp= true;
334   - $scope.market = true;
335   - $scope.risks = true;
336   - $scope.team = true;
337   - $scope.pitch = true;
338   - $scope.financials = true;
339   - $scope.businessmodel = false;
340   - // for right content
341   - $scope.Idea =false;
342   - $scope.Product =true;
343   - $scope.Growth =false;
344   - }else if(stage == 'Growth') {
345   - $scope.current = 10;
346   - $scope.prototyp = true;
347   - $scope.market = true;
348   - $scope.risks = true;
349   - $scope.team = true;
350   - $scope.pitch = true;
351   - $scope.financials = true;
352   - $scope.businessmodel = false;
353   - // for right content
354   - $scope.Idea =false;
355   - $scope.Product =false;
356   - $scope.Growth =true;
357   - }
358   - }
359   -
360   - // $scope.sector = function(sector){
361   - // if (sector == 'retail') {
362   - // $scope.current = true;
363   -
364   - // }else if(sector == 'b2b commerce') {
365   - // $scope.current = true;
366   -
367   - // }else if(sector == 'agritech') {
368   - // $scope.current = true;
369   -
370   - // }else if(sector == 'travel') {
371   - // $scope.current = true;
372   -
373   - // }else if(sector == 'fintech') {
374   - // $scope.current = true;
375   -
376   - // }else if(sector == 'hyperlocal services') {
377   - // $scope.current = true;
378   -
379   - // }else if(sector == 'education') {
380   - // $scope.current = true;
381   -
382   - // }else if(sector == 'rural') {
383   - // $scope.current = true;
384   - // }
385   - // }
386   - // $scope.sector = function(sector){
387   - // if (sector == 'retail') {
388   - // $scope.current = true;
389   -
390   - // }else if(sector == 'b2b commerce') {
391   - // $scope.current = true;
392   -
393   - // }else if(sector == 'agritech') {
394   - // $scope.current = true;
395   -
396   - // }else if(sector == 'travel') {
397   - // $scope.current = true;
398   -
399   - // }else if(sector == 'fintech') {
400   - // $scope.current = true;
401   -
402   - // }else if(sector == 'hyperlocal services') {
403   - // $scope.current = true;
404   -
405   - // }else if(sector == 'education') {
406   - // $scope.current = true;
407   -
408   - // }else if(sector == 'rural') {
409   - // $scope.current = true;
410   - // }
411   - // }
412   -
413   - // $scope.entername = function(name){
414   - // if (name == undefined) {
415   - // $scope.current = false;
416   - // }else if (name != undefined){
417   - // $scope.current = true;
418   - // }
419   - // }
420   - // $scope.enteremail = function(email){
421   - // if (email == undefined) {
422   - // $scope.current = false;
423   - // }else if (email != undefined){
424   - // $scope.current = true;
425   - // }
426   - // }
427   - // $scope.enternumber = function(number){
428   - // if (name == undefined) {
429   - // $scope.current = false;
430   - // }else if (name != undefined){
431   - // $scope.current = true;
432   - // }
433   - // }
434   - // $scope.selectcity = function(city){
435   - // console.log("city",city);
436   - // if (name == undefined) {
437   - // $scope.current = false;
438   - // }else if (name != undefined){
439   - // $scope.current = true;
440   - // }
441   - // }
442   - // $scope.entertechnology = function(technology){
443   - // console.log("technology",technology);
444   - // if (name == undefined) {
445   - // $scope.current = false;
446   - // }else if (name != undefined){
447   - // $scope.current = true;
448   - // }
449   - // }
450   - // $scope.enterproblem = function(problem){
451   - // console.log("problem",problem);
452   - // if (name == undefined) {
453   - // $scope.current = false;
454   - // }else if (name != undefined){
455   - // $scope.current = true;
456   - // }
457   - // }
458   - // $scope.entersolution = function(solution){
459   - // console.log("solution",solution);
460   - // if (name == undefined) {
461   - // $scope.current = false;
462   - // }else if (name != undefined){
463   - // $scope.current = true;
464   - // }
465   - // }
466   - $scope.enterbusiness = function(business){
467   - console.log("business",business);
468   - if (name == undefined) {
469   - $scope.current = false;
470   - }else if (name != undefined){
471   - $scope.current = true;
472   - }
473   - }
474   - /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/
475   - $scope.stagekeyPress = function(){
476   - $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)');
477   - }
478   - $scope.sectorkeyPress = function(){
479   - $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)');
480   - }
481   -
482   - $scope.studentkeyPress = function(){
483   - $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)');
484   - }
485   -
486   - $scope.namekeyPress = function(name){
487   - console.log("name",name);
488   - if (name == undefined) {
489   - $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
490   - }else{
491   - $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)');
492   - }
493   - }
494   - $scope.emailkeyPress = function(email){
495   - console.log("email",email);
496   - if (email == undefined) {
497   - $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
498   - }else{
499   - $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)');
500   - }
501   - }
502   -
503   -
504   - $scope.phonekeyPress = function(number){
505   - console.log("number",number);
506   - if (number == undefined) {
507   - $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
508   - }else{
509   - $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)');
510   - }
511   - }
512   -
513   - $scope.citykeyPress = function(city){
514   - console.log("city",city);
515   - if (city == undefined) {
516   - $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
517   - }else{
518   - $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)');
519   - }
520   - }
521   -
522   - $scope.questionkeyPress = function(q){
523   - if (q == undefined) {
524   - $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
525   - }else{
526   - $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)');
527   - }
528   - }
529   -
530   - $scope.technologykeyPress = function(technology){
531   - if (technology == undefined) {
532   - $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
533   - }else{
534   - $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)');
535   - }
536   - }
537   - $scope.problemkeyPress = function(problem){
538   - if (problem == undefined) {
539   - $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
540   - }else{
541   - $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)');
542   - }
543   - }
544   - $scope.solutionkeyPress = function(solution){
545   - if (solution == undefined) {
546   - $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
547   - }else{
548   - $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)');
549   - }
550   - }
551   - $scope.businesskeyPress = function(business){
552   - $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)');
553   - }
554   -
555   - $scope.prototypekeyPress = function(prototype){
556   - if (prototype == undefined) {
557   - $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
558   - }else{
559   - $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)');
560   - }
561   - }
562   -
563   - $scope.marketkeyPress = function(market){
564   - if (market == undefined) {
565   - $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
566   - }else{
567   - $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)');
568   - }
569   - }
570   -
571   - $scope.riskkeyPress = function(risk){
572   - if (risk == undefined) {
573   - $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
574   - }else{
575   - $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)');
576   - }
577   - }
578   -
579   - $scope.teamkeyPress = function(team){
580   - if (team == undefined) {
581   - $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
582   - }else{
583   - $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)');
584   - }
585   - }
586   -
587   - $scope.pitchkeyPress = function(pitch){
588   - if (pitch == undefined) {
589   - $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
590   - }else{
591   - $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)');
592   - }
593   - }
594   -
595   - $scope.financialskeyPress = function(financial){
596   - console.log("financial",financial);
597   - if (financial == undefined) {
598   - $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
599   - }else{
600   - $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)');
601   - }
602   - }
603   -
604   - // create a message to display in our view
605   - // $scope.message = 'Everyone come and see how good I look!';
  147 +
  148 + /*****THIS IS FOR STEP ONE FORM ******/
  149 + $scope.next = function() {
  150 + var BASE_URL = "http://0.0.0.0:4001/api";
  151 + $scope.data.status = null
  152 + if ($scope.data.stage == undefined || $scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined || $scope.data.city == undefined) {
  153 + var x = document.getElementById("snackbar")
  154 + x.className = "show";
  155 + setTimeout(function() {
  156 + x.className = x.className.replace("show", "");
  157 + }, 3000);
  158 + } else if ($scope.data.stage != undefined && $scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined && $scope.data.city != undefined) {
  159 + $scope.infoForm = true;
  160 + console.log("sdasdasdsa");
  161 + $scope.data.stage = $scope.data.stage;
  162 + $scope.detail = {};
  163 + $scope.data.phone = "+91" + $scope.data.number;
  164 + $http({
  165 + method: 'POST',
  166 + url: BASE_URL + '/information',
  167 + data: $scope.data,
  168 + headers: {}
  169 + }).then(function mySuccess(result) {
  170 + console.log("result", result)
  171 + $scope.detail = result;
  172 + data.applicantId = result.data.id;
  173 + $scope.userId = result.data.id;
  174 +
  175 + }, function myError(error) {});
  176 + }
  177 +
  178 + }
  179 +
  180 + /*****THIS IS FOR STEP THREE FORM ******/
  181 + $scope.create = function() {
  182 + console.log("$scope.data.identity", $scope.data.identity)
  183 + /*****PAYMENT WITH 18% GST*****/
  184 + if ($scope.data.stage == "Idea") {
  185 + console.log("$scope.data", $scope.data)
  186 + $scope.payingAmnt = 59000;
  187 + }
  188 +
  189 + if ($scope.data.stage == "Product") {
  190 + $scope.payingAmnt = 118000;
  191 + }
  192 +
  193 + if ($scope.data.stage == "Growth") {
  194 + $scope.payingAmnt = 236000;
  195 + }
  196 +
  197 + if($scope.tokencheck == true){
  198 + var amount = $scope.payingAmnt
  199 + var discountAmount = (amount * 10)/100
  200 + $scope.payingAmnt = amount - discountAmount
  201 + console.log("finalAmount====>",$scope.payingAmnt)
  202 + }
  203 +
  204 +
  205 + if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
  206 + var x = document.getElementById("snackbar")
  207 + x.className = "show";
  208 + setTimeout(function() {
  209 + x.className = x.className.replace("show", "");
  210 + }, 3000);
  211 + } else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
  212 +
  213 + var BASE_URL = "http://0.0.0.0:4001/api";
  214 +
  215 + // if($scope.data.identity == "student"){
  216 +
  217 + // var image = BASE_URL+'/container1s/proof/download/'
  218 + // console.log("image",image)
  219 + // var image = document.getElementById('picture').files[0];
  220 + // var imagePath = image.name;
  221 + // $scope.NewIamge = image + imagePath;
  222 + // $scope.data.pic = $scope.NewIamge;
  223 + // var fd = new FormData()
  224 + // fd.append('file',image);
  225 + // $http({
  226 + // method:'POST',
  227 + // url: BASE_URL+'/container1s/proof/upload',
  228 + // data:fd,
  229 + // transformRequest:angular.identity,
  230 + // headers:{'Content-Type':undefined}
  231 + // }).then(function mySuccess(sucessResponse) {
  232 +
  233 +
  234 + // }, function myError(error) {
  235 + // });
  236 +
  237 + // }
  238 + var BASE_URL = "http://0.0.0.0:4001/api";
  239 + console.log("BASE_URL", BASE_URL)
  240 + $scope.infoForm = true;
  241 + console.log("sdasdasdsa");
  242 + $scope.data.stage = $scope.data.stage;
  243 + $scope.detail = {};
  244 + $scope.data.phone = "+91" + $scope.data.number;
  245 + $http({
  246 + method: 'POST',
  247 + url: BASE_URL + '/applicants',
  248 + data: $scope.data,
  249 + headers: {}
  250 + }).then(function mySuccess(result) {
  251 +
  252 + console.log("=====result=====", result)
  253 + $scope.detail = result;
  254 + data.applicantId = result.data.id;
  255 + $scope.userId = result.data.id;
  256 + console.log("=====data=====", data)
  257 + data.amount = $scope.payingAmnt / 100;
  258 + if ($scope.detail != null) {
  259 + $http({
  260 + method: 'POST',
  261 + url: BASE_URL + '/payments',
  262 + data: data,
  263 + headers: {}
  264 + }).then(function mySuccess(paymentResult) {
  265 + $scope.paymentResult = paymentResult;
  266 + }, function myError(error) {});
  267 + }
  268 + var i = 0;
  269 + var options = {
  270 + "key": "rzp_test_YwHsVFiDIQ2WUQ",
  271 + "amount": $scope.payingAmnt,
  272 +
  273 + "name": "Startup Jalsa",
  274 + "description": "amount",
  275 + "currency": "INR",
  276 + "status": "done",
  277 +
  278 + "theme": {
  279 + "color": "#2196f3 ",
  280 + "image_padding": "NO"
  281 + },
  282 + "modal": {
  283 + "ondismiss": function() {}
  284 + },
  285 + "handler": function(response) {
  286 + createPayment(response);
  287 + }
  288 + };
  289 + var rzp1 = new Razorpay(options);
  290 + rzp1.open();
  291 + $scope.paymentResponse = {};
  292 +
  293 + function createPayment(response) {
  294 + $route.reload();
  295 + $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
  296 + $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
  297 + $scope.paymentResponse.amount = data.amount;
  298 + $scope.paymentResponse.currency = "INR";
  299 + $scope.paymentResponse.status = "captured";
  300 + $http({
  301 + method: 'PUT',
  302 + url: BASE_URL + '/payments/' + $scope.paymentResult.data.id,
  303 + data: $scope.paymentResponse,
  304 + headers: {}
  305 + }).then(function mySuccess(searchResult) {
  306 + console.log("searchResult", searchResult)
  307 + $scope.showToastr()
  308 + //toaster.success("Registration done successfully");
  309 +
  310 + }, function myError(error) {});
  311 + }
  312 +
  313 + }, function myError(error) {});
  314 + }
  315 +
  316 + }
  317 +
  318 + $scope.showToastr = function() {
  319 + console.log("called toast")
  320 + var x = document.getElementById("snacsskbar")
  321 + x.className = "show";
  322 + setTimeout(function() {
  323 + x.className = x.className.replace("show", "");
  324 + }, 3000);
  325 + }
  326 +
  327 + // $scope.lastpage = function(){
  328 + // console.log("sdasd");
  329 + // $('.sectors-card').css('display', 'inherit');
  330 + // $('.form-all').css('display', 'inherit');
  331 + // $('.submit-button').css('display', 'inherit');
  332 + // }
  333 + /*kk***This code for change data when click to chooses stages***/
  334 + $scope.businessmodel = true;
  335 + $scope.Idea = true;
  336 + $scope.current = true;
  337 +
  338 + $scope.stage = function(stage) {
  339 + // $('.sectors-card').css('display', 'block');
  340 + // $('.form-all').css('display', 'block');
  341 + // $('.identity-shadow').css('display', 'block');
  342 + // $('.step-two-form').css('display', 'block');
  343 + // $('.step-three-form').css('display', 'block');
  344 +
  345 + if (stage == 'Idea') {
  346 + $scope.current = 10;
  347 + $scope.prototyp = false;
  348 + $scope.market = false;
  349 + $scope.risks = false;
  350 + $scope.team = false;
  351 + $scope.pitch = false;
  352 + $scope.financials = false;
  353 + $scope.businessmodel = true;
  354 + // for right content
  355 + $scope.Idea = true;
  356 + $scope.Product = false;
  357 + $scope.Growth = false;
  358 + } else if (stage == 'Product') {
  359 + $scope.current = 10;
  360 + $scope.prototyp = true;
  361 + $scope.market = true;
  362 + $scope.risks = true;
  363 + $scope.team = true;
  364 + $scope.pitch = true;
  365 + $scope.financials = true;
  366 + $scope.businessmodel = false;
  367 + // for right content
  368 + $scope.Idea = false;
  369 + $scope.Product = true;
  370 + $scope.Growth = false;
  371 + } else if (stage == 'Growth') {
  372 + $scope.current = 10;
  373 + $scope.prototyp = true;
  374 + $scope.market = true;
  375 + $scope.risks = true;
  376 + $scope.team = true;
  377 + $scope.pitch = true;
  378 + $scope.financials = true;
  379 + $scope.businessmodel = false;
  380 + // for right content
  381 + $scope.Idea = false;
  382 + $scope.Product = false;
  383 + $scope.Growth = true;
  384 + }
  385 + }
  386 +
  387 + // $scope.sector = function(sector){
  388 + // if (sector == 'retail') {
  389 + // $scope.current = true;
  390 +
  391 + // }else if(sector == 'b2b commerce') {
  392 + // $scope.current = true;
  393 +
  394 + // }else if(sector == 'agritech') {
  395 + // $scope.current = true;
  396 +
  397 + // }else if(sector == 'travel') {
  398 + // $scope.current = true;
  399 +
  400 + // }else if(sector == 'fintech') {
  401 + // $scope.current = true;
  402 +
  403 + // }else if(sector == 'hyperlocal services') {
  404 + // $scope.current = true;
  405 +
  406 + // }else if(sector == 'education') {
  407 + // $scope.current = true;
  408 +
  409 + // }else if(sector == 'rural') {
  410 + // $scope.current = true;
  411 + // }
  412 + // }
  413 + // $scope.sector = function(sector){
  414 + // if (sector == 'retail') {
  415 + // $scope.current = true;
  416 +
  417 + // }else if(sector == 'b2b commerce') {
  418 + // $scope.current = true;
  419 +
  420 + // }else if(sector == 'agritech') {
  421 + // $scope.current = true;
  422 +
  423 + // }else if(sector == 'travel') {
  424 + // $scope.current = true;
  425 +
  426 + // }else if(sector == 'fintech') {
  427 + // $scope.current = true;
  428 +
  429 + // }else if(sector == 'hyperlocal services') {
  430 + // $scope.current = true;
  431 +
  432 + // }else if(sector == 'education') {
  433 + // $scope.current = true;
  434 +
  435 + // }else if(sector == 'rural') {
  436 + // $scope.current = true;
  437 + // }
  438 + // }
  439 +
  440 + // $scope.entername = function(name){
  441 + // if (name == undefined) {
  442 + // $scope.current = false;
  443 + // }else if (name != undefined){
  444 + // $scope.current = true;
  445 + // }
  446 + // }
  447 + // $scope.enteremail = function(email){
  448 + // if (email == undefined) {
  449 + // $scope.current = false;
  450 + // }else if (email != undefined){
  451 + // $scope.current = true;
  452 + // }
  453 + // }
  454 + // $scope.enternumber = function(number){
  455 + // if (name == undefined) {
  456 + // $scope.current = false;
  457 + // }else if (name != undefined){
  458 + // $scope.current = true;
  459 + // }
  460 + // }
  461 + // $scope.selectcity = function(city){
  462 + // console.log("city",city);
  463 + // if (name == undefined) {
  464 + // $scope.current = false;
  465 + // }else if (name != undefined){
  466 + // $scope.current = true;
  467 + // }
  468 + // }
  469 + // $scope.entertechnology = function(technology){
  470 + // console.log("technology",technology);
  471 + // if (name == undefined) {
  472 + // $scope.current = false;
  473 + // }else if (name != undefined){
  474 + // $scope.current = true;
  475 + // }
  476 + // }
  477 + // $scope.enterproblem = function(problem){
  478 + // console.log("problem",problem);
  479 + // if (name == undefined) {
  480 + // $scope.current = false;
  481 + // }else if (name != undefined){
  482 + // $scope.current = true;
  483 + // }
  484 + // }
  485 + // $scope.entersolution = function(solution){
  486 + // console.log("solution",solution);
  487 + // if (name == undefined) {
  488 + // $scope.current = false;
  489 + // }else if (name != undefined){
  490 + // $scope.current = true;
  491 + // }
  492 + // }
  493 + $scope.enterbusiness = function(business) {
  494 + console.log("business", business);
  495 + if (name == undefined) {
  496 + $scope.current = false;
  497 + } else if (name != undefined) {
  498 + $scope.current = true;
  499 + }
  500 + }
  501 + /*******FOR FILL THE DATA AND SHOWS ICON GREEN*/
  502 + $scope.stagekeyPress = function() {
  503 + $('.icon-circle-a').css('background-color', 'rgb(66, 181, 73)');
  504 + }
  505 + $scope.sectorkeyPress = function() {
  506 + $('.icon-circle-b').css('background-color', 'rgb(66, 181, 73)');
  507 + }
  508 +
  509 + $scope.studentkeyPress = function() {
  510 + $('.icon-circle-ab').css('background-color', 'rgb(66, 181, 73)');
  511 + }
  512 +
  513 + $scope.namekeyPress = function(name) {
  514 + console.log("name", name);
  515 + if (name == undefined) {
  516 + $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
  517 + } else {
  518 + $('.icon-circle-c').css('background-color', 'rgb(66, 181, 73)');
  519 + }
  520 + }
  521 + $scope.emailkeyPress = function(email) {
  522 + console.log("email", email);
  523 + if (email == undefined) {
  524 + $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
  525 + } else {
  526 + $('.icon-circle-d').css('background-color', 'rgb(66, 181, 73)');
  527 + }
  528 + }
  529 +
  530 +
  531 + $scope.phonekeyPress = function(number) {
  532 + console.log("number", number);
  533 + if (number == undefined) {
  534 + $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
  535 + } else {
  536 + $('.icon-circle-e').css('background-color', 'rgb(66, 181, 73)');
  537 + }
  538 + }
  539 +
  540 + $scope.citykeyPress = function(city) {
  541 + console.log("city", city);
  542 + if (city == undefined) {
  543 + $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
  544 + } else {
  545 + $('.icon-circle-f').css('background-color', 'rgb(66, 181, 73)');
  546 + }
  547 + }
  548 +
  549 + $scope.questionkeyPress = function(q) {
  550 + if (q == undefined) {
  551 + $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
  552 + } else {
  553 + $('.icon-circle-x').css('background-color', 'rgb(66, 181, 73)');
  554 + }
  555 + }
  556 +
  557 + $scope.technologykeyPress = function(technology) {
  558 + if (technology == undefined) {
  559 + $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
  560 + } else {
  561 + $('.icon-circle-h').css('background-color', 'rgb(66, 181, 73)');
  562 + }
  563 + }
  564 + $scope.problemkeyPress = function(problem) {
  565 + if (problem == undefined) {
  566 + $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
  567 + } else {
  568 + $('.icon-circle-i').css('background-color', 'rgb(66, 181, 73)');
  569 + }
  570 + }
  571 + $scope.solutionkeyPress = function(solution) {
  572 + if (solution == undefined) {
  573 + $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
  574 + } else {
  575 + $('.icon-circle-j').css('background-color', 'rgb(66, 181, 73)');
  576 + }
  577 + }
  578 + $scope.businesskeyPress = function(business) {
  579 + $('.icon-circle-p').css('background-color', 'rgb(66, 181, 73)');
  580 + }
  581 +
  582 + $scope.prototypekeyPress = function(prototype) {
  583 + if (prototype == undefined) {
  584 + $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
  585 + } else {
  586 + $('.icon-circle-k').css('background-color', 'rgb(66, 181, 73)');
  587 + }
  588 + }
  589 +
  590 + $scope.marketkeyPress = function(market) {
  591 + if (market == undefined) {
  592 + $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
  593 + } else {
  594 + $('.icon-circle-l').css('background-color', 'rgb(66, 181, 73)');
  595 + }
  596 + }
  597 +
  598 + $scope.riskkeyPress = function(risk) {
  599 + if (risk == undefined) {
  600 + $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
  601 + } else {
  602 + $('.icon-circle-m').css('background-color', 'rgb(66, 181, 73)');
  603 + }
  604 + }
  605 +
  606 + $scope.teamkeyPress = function(team) {
  607 + if (team == undefined) {
  608 + $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
  609 + } else {
  610 + $('.icon-circle-n').css('background-color', 'rgb(66, 181, 73)');
  611 + }
  612 + }
  613 +
  614 + $scope.pitchkeyPress = function(pitch) {
  615 + if (pitch == undefined) {
  616 + $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
  617 + } else {
  618 + $('.icon-circle-z').css('background-color', 'rgb(66, 181, 73)');
  619 + }
  620 + }
  621 +
  622 + $scope.financialskeyPress = function(financial) {
  623 + console.log("financial", financial);
  624 + if (financial == undefined) {
  625 + $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
  626 + } else {
  627 + $('.icon-circle-q').css('background-color', 'rgb(66, 181, 73)');
  628 + }
  629 + }
  630 +
  631 + // create a message to display in our view
  632 + // $scope.message = 'Everyone come and see how good I look!';
606 633 });
607 634  
608 635 scotchApp.controller('verifyController', function($scope, $http, $location) {
609 636  
610   - $scope.pendingPaymentId = $location.absUrl().split('=')[1]
611   - var BASE_URL = "http://0.0.0.0:4001/api";
612   - $http({
613   - method : "GET",
614   - url : BASE_URL+'/applicants/'+$scope.pendingPaymentId,
615   - }).then(function mySuccess(response) {
616   - $scope.data = response.data;
617   - console.log("response-1",response);
618   - $scope.pendingPaymentId = $location.absUrl().split('=')[1]
619   - $http({
620   - method : "GET",
621   - url : BASE_URL+'/payments?filter={"where":{"applicantId":'+$scope.pendingPaymentId+'}}',
622   - }).then(function mySuccess(response) {
623   - $scope.paymentRecord = response.data;
624   - }, function myError(response) {
625   - // $scope.paymentRecord = response.data;
626   - });
627   - }, function myError(response) {
628   - $scope.myWelcome = response.statusText;
629   - });
630   -
631   - $scope.checkView = false;
632   - $scope.verifyView = false;
633   -
634   - $scope.pendingPaymentId = '';
635   -
636   - var BASE_URL = "http://0.0.0.0:4001/api";
637   -
638   - $scope.update = function(){
639   -
640   - $http({
641   - method: 'GET',
642   - url: BASE_URL+'/payments?filter={"where":{"applicantId": '+$scope.pendingPaymentId+'}}',
643   - //data: email,
644   - headers: {}
645   - }).then(function mySuccess(searchResult) {
646   - if(searchResult.data[0].status == "pending"){
647   - $scope.checkView = true;
648   - $scope.verifyView = false;
649   - $scope.amount = searchResult.data[0].amount * 100;
650   - console.log('pending data', searchResult);
651   - var i = 0;
652   - var options = {
653   - "key": "rzp_test_YwHsVFiDIQ2WUQ",
654   - "amount": $scope.amount,
655   -
656   - "name": "Startup Jalsa",
657   - "description":"amount",
658   - "currency": "INR",
659   - "status": "done",
660   -
661   - "theme": {
662   - "color": "#2196f3 ",
663   - "image_padding":"NO"
664   - },
665   - "modal": {
666   - "ondismiss": function(){
667   - }
668   - },
669   - "handler": function (response){
670   - createPayment(response);
671   - }
672   - };
673   - var rzp1 = new Razorpay(options);
674   - rzp1.open();
675   - $scope.paymentResponse = {};
676   - function createPayment(response){
677   - $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
678   - $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
679   - $scope.paymentResponse.amount = $scope.amount;
680   - $scope.paymentResponse.currency = "INR";
681   - $scope.paymentResponse.status = "captured";
682   - $scope.paymentResponse.applicantId = $scope.userId;
683   - console.log("$scope.paymentResponse",$scope.paymentResponse)
684   - $http({
685   - method: 'PUT',
686   - url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
687   - data: $scope.paymentResponse,
688   - headers: {}
689   - }).then(function mySuccess(searchResult) {
690   -
691   - }, function myError(error) {
  637 + $scope.pendingPaymentId = $location.absUrl().split('=')[1]
  638 + var BASE_URL = "http://0.0.0.0:4001/api";
  639 + $http({
  640 + method: "GET",
  641 + url: BASE_URL + '/applicants/' + $scope.pendingPaymentId,
  642 + }).then(function mySuccess(response) {
  643 + $scope.data = response.data;
  644 + console.log("response-1", response);
  645 + $scope.pendingPaymentId = $location.absUrl().split('=')[1]
  646 + $http({
  647 + method: "GET",
  648 + url: BASE_URL + '/payments?filter={"where":{"applicantId":' + $scope.pendingPaymentId + '}}',
  649 + }).then(function mySuccess(response) {
  650 + $scope.paymentRecord = response.data;
  651 + }, function myError(response) {
  652 + // $scope.paymentRecord = response.data;
  653 + });
  654 + }, function myError(response) {
  655 + $scope.myWelcome = response.statusText;
  656 + });
  657 +
  658 + $scope.checkView = false;
  659 + $scope.verifyView = false;
  660 +
  661 + $scope.pendingPaymentId = '';
  662 +
  663 + var BASE_URL = "http://0.0.0.0:4001/api";
  664 +
  665 + $scope.update = function() {
  666 +
  667 + $http({
  668 + method: 'GET',
  669 + url: BASE_URL + '/payments?filter={"where":{"applicantId": ' + $scope.pendingPaymentId + '}}',
  670 + //data: email,
  671 + headers: {}
  672 + }).then(function mySuccess(searchResult) {
  673 + if (searchResult.data[0].status == "pending") {
  674 + $scope.checkView = true;
  675 + $scope.verifyView = false;
  676 + $scope.amount = searchResult.data[0].amount * 100;
  677 + console.log('pending data', searchResult);
  678 + var i = 0;
  679 + var options = {
  680 + "key": "rzp_test_YwHsVFiDIQ2WUQ",
  681 + "amount": $scope.amount,
  682 +
  683 + "name": "Startup Jalsa",
  684 + "description": "amount",
  685 + "currency": "INR",
  686 + "status": "done",
  687 +
  688 + "theme": {
  689 + "color": "#2196f3 ",
  690 + "image_padding": "NO"
  691 + },
  692 + "modal": {
  693 + "ondismiss": function() {}
  694 + },
  695 + "handler": function(response) {
  696 + createPayment(response);
  697 + }
  698 + };
  699 + var rzp1 = new Razorpay(options);
  700 + rzp1.open();
  701 + $scope.paymentResponse = {};
  702 +
  703 + function createPayment(response) {
  704 + $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
  705 + $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
  706 + $scope.paymentResponse.amount = $scope.amount;
  707 + $scope.paymentResponse.currency = "INR";
  708 + $scope.paymentResponse.status = "captured";
  709 + $scope.paymentResponse.applicantId = $scope.userId;
  710 + console.log("$scope.paymentResponse", $scope.paymentResponse)
  711 + $http({
  712 + method: 'PUT',
  713 + url: BASE_URL + '/payments/' + $scope.paymentResult.data.id,
  714 + data: $scope.paymentResponse,
  715 + headers: {}
  716 + }).then(function mySuccess(searchResult) {
  717 +
  718 + }, function myError(error) {
  719 +
  720 + });
  721 + }
  722 + } else {
  723 +
  724 + }
  725 +
  726 + }, function myError(error) {});
  727 + }
  728 + });
692 729  
693   - });
694   - }
695   - }else{
696   -
697   - }
698   -
699   - }, function myError(error) {
700   - });
701   - }
702   -});
703   -
704   - // scotchApp.controller('contactController', function($scope) {
705   - // $scope.message = 'Contact us! JK. This is just a demo.';
706   - // });
  730 + scotchApp.controller('ambassadorController', function($scope, $http, $location, $route) {
  731 +
  732 + $scope.data = {};
  733 + $scope.submit = function() {
  734 + console.log($scope.data.name)
  735 + var randomNumber = ""+Math.random();
  736 + var nameSpliced = $scope.data.name.slice(0,3);
  737 + var numberSpliced = randomNumber.slice(2,5);
  738 + $scope.data.referalToken = nameSpliced+numberSpliced;
  739 + $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
  740 + var BASE_URL = "http://0.0.0.0:4001/api";
  741 + $http({
  742 + method: 'POST',
  743 + url: BASE_URL + '/ambassadors',
  744 + data: $scope.data,
  745 + headers: {}
  746 + }).then(function mySuccess(result) {
  747 + console.log("result", result)
  748 + $scope.detail = result;
  749 +
  750 + }, function myError(error) {});
  751 + }
  752 + });
707 753  
... ...