Commit dee1f7479d0e7ddfa3fb33a342a39b4f28d7f13a

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

validation use

Showing 2 changed files with 24 additions and 11 deletions   Show diff stats
pages/registration.html
1 <div class="header"> 1 <div class="header">
2 <div> 2 <div>
3 <img src="images/LOGO.png" class="logojalsa"><span class="jalsaheadr" style="">2018</span> 3 <img src="images/LOGO.png" class="logojalsa"><span class="jalsaheadr" style="">2018</span>
4 <!-- <img src="images/SartupJalsa_Logo.png" style="width:200px;position:relative;"> --> 4 <!-- <img src="images/SartupJalsa_Logo.png" style="width:200px;position:relative;"> -->
5 </div> 5 </div>
6 <div class="clearfix"></div> 6 <div class="clearfix"></div>
7 </div> 7 </div>
8 <!-- CLOSE HEADER --> 8 <!-- CLOSE HEADER -->
9 <form name="applicantForm"> 9 <form name="applicantForm">
10 <div class="col-xs-12 col-md-8 col-md-offset-2"> 10 <div class="col-xs-12 col-md-8 col-md-offset-2">
11 <div class="form-all"> 11 <div class="form-all">
12 <!-- <table style="width: 100%;"> 12 <!-- <table style="width: 100%;">
13 <tr> 13 <tr>
14 <td> 14 <td>
15 <div class="step-one-form" > --> 15 <div class="step-one-form" > -->
16 <!-- form step 1 --> 16 <!-- form step 1 -->
17 <div class="col-xs-12 col-md-6 input-wrapper" > 17 <div class="col-xs-12 col-md-6 input-wrapper" >
18 <div id="snackbar">Error ! Please fill in all fields.</div> 18 <div id="snackbar">Error ! Please fill in all fields.</div>
19 <div class="icon-circle-c"> 19 <div class="icon-circle-c">
20 <i class="material-icons" style="line-height: 31px;">person</i> 20 <i class="material-icons" style="line-height: 31px;">person</i>
21 </div> 21 </div>
22 <input type="text" class="text-input" required ng-model="data.name" placeholder="Name *" id="myBtn" name="name" ng-change="entername(data.name); firstNamekeyPress(data.name)"> 22 <input type="text" class="text-input" required ng-model="data.name" placeholder="Name *" id="myBtn" name="name" ng-change="entername(data.name); firstNamekeyPress(data.name)">
23 </div> 23 </div>
24 <div class="col-xs-12 col-md-6 input-wrapper" > 24 <div class="col-xs-12 col-md-6 input-wrapper" >
25 <div id="snackbar">Error ! Please fill in all fields.</div> 25 <div id="snackbar">Error ! Please fill in all fields.</div>
26 <div class="icon-circle-d"> 26 <div class="icon-circle-d">
27 <i class="material-icons" style="line-height: 30px;">email</i> 27 <i class="material-icons" style="line-height: 30px;">email</i>
28 </div> 28 </div>
29 <input type="email" name="email" ng-pattern="/^[^\s@]+@[^\s@]+\.[^\s@]+$/" class="text-input" required class="" ng-model="data.email" placeholder="Email Address *" ng-change="enteremail(data.email); emailkeyPress(data.email)"> 29 <input type="email" name="email" ng-pattern="/^[^\s@]+@[^\s@]+\.[^\s@]+$/" class="text-input" required class="" ng-model="data.email" ng-blur="emailcheck(data.email)" ng-focus="removeError()" placeholder="Email Address *" ng-change="enteremail(data.email); emailkeyPress(data.email)">
30 <!-- <label class="error-message f-family" id="invalidEmail">Please enter a valid email address.</label> 30 <label class="error-message f-family" id="invalidEmail">Please enter a valid email address.</label>
31 <label ng-if="check">Email already exist.</label> --> 31 <!-- <label ng-if="check">Email already exist.</label> -->
32 </div>
33 <div class="col-xs-12 col-md-6 input-wrapper" >
34 <div class="icon-circle-e">
35 <i class="material-icons" style="line-height: 30px;">phone</i>
36 </div>
37 <input type="text" ng-pattern="/^\d*(?:\.\d{1,2})?$/" title="Please enter only numberic numbers" maxlength="10" required class="text-input" ng-model="data.number" placeholder="Mobile No.*" ng-change="enternumber(data.number); phonekeyPress(data.number)">
38 <!-- <label class="error-message f-family" id="invalidNumber">Please enter only numeric value in mobile number field.</label> -->
39 <label ng-if="numberCheck">Contact Number already exist.</label>
40 </div> 32 </div>
41 <div class="col-xs-12 col-md-6 input-wrapper"> 33 <div class="col-xs-12 col-md-6 input-wrapper">
42 <div class="icon-circle-f"> 34 <div class="icon-circle-f">
43 <i class="material-icons" style="line-height: 30px;">location_city</i> 35 <i class="material-icons" style="line-height: 30px;">location_city</i>
44 </div> 36 </div>
45 <select ng-model="data.city" ng-change="selectcity(data.city); citykeyPress(data.city)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required> 37 <select ng-model="data.city" ng-change="selectcity(data.city); citykeyPress(data.city)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required>
46 <option name="city" selected disabled value="">{{data.city}}</option> 38 <option name="city" selected disabled value="">{{data.city}}</option>
47 <option value="Ahmedabad">Ahmedabad</option> 39 <option value="Ahmedabad">Ahmedabad</option>
48 <option value="Bengaluru">Bengaluru</option> 40 <option value="Bengaluru">Bengaluru</option>
49 <option value="Chennai">Chennai</option> 41 <option value="Chennai">Chennai</option>
50 <option value="Delhi">Delhi</option> 42 <option value="Delhi">Delhi</option>
51 <option value="Hyderabad">Hyderabad</option> 43 <option value="Hyderabad">Hyderabad</option>
52 <option value="Jaipur">Jaipur</option> 44 <option value="Jaipur">Jaipur</option>
53 <option value="Kanpur">Kanpur</option> 45 <option value="Kanpur">Kanpur</option>
54 <option value="Kolkata">Kolkata</option> 46 <option value="Kolkata">Kolkata</option>
55 <option value="Mumbai">Mumbai</option> 47 <option value="Mumbai">Mumbai</option>
56 </select> 48 </select>
57 </div> 49 </div>
50 <div class="col-xs-12 col-md-6 input-wrapper" >
51 <div class="icon-circle-e">
52 <i class="material-icons" style="line-height: 30px;">phone</i>
53 </div>
54 <input type="phone" name="phone" ng-pattern="/^\d*(?:\.\d{1,2})?$/" maxlength="10" class="text-input" required class="" ng-model="data.number" ng-blur="numbercheck(data.number)" ng-focus="removeNoError()" placeholder="Mobile No.*" ng-change="enternumber(data.number); phonekeyPress(data.number)">
55 <label class="error-message f-family" id="invalidNumber">Please enter only numeric value.</label>
56 <!-- <label ng-if="numberCheck">Contact Number already exist.</label> -->
57 </div>
58 <div class="col-xs-12 col-md-6 input-wrapper"> 58 <div class="col-xs-12 col-md-6 input-wrapper">
59 <div class="icon-circle-i"> 59 <div class="icon-circle-i">
60 <i class="material-icons" style="line-height: 30px;">perm_identity</i> 60 <i class="material-icons" style="line-height: 30px;">perm_identity</i>
61 </div> 61 </div>
62 <input type="text" class="text-input" ng-model="data.companyName" placeholder="Company Name *" ng-change="enternumber(data.companyName); companykeyPress(data.companyName)" required> 62 <input type="text" class="text-input" ng-model="data.companyName" placeholder="Company Name *" ng-change="enternumber(data.companyName); companykeyPress(data.companyName)" required>
63 </div> 63 </div>
64 <div class="col-xs-12 col-md-6 input-wrapper"> 64 <div class="col-xs-12 col-md-6 input-wrapper">
65 <div class="icon-circle-n"> 65 <div class="icon-circle-n">
66 <i class="material-icons" style="line-height: 30px;">web</i> 66 <i class="material-icons" style="line-height: 30px;">web</i>
67 </div> 67 </div>
68 <input name="website" class="text-input" ng-model="data.website" placeholder="Website link" ng-change="enterwebsite(data.website); revenuekeyPress(data.website)"></input> 68 <input name="website" class="text-input" ng-model="data.website" placeholder="Website link" ng-change="enterwebsite(data.website); revenuekeyPress(data.website)"></input>
69 </div> 69 </div>
70 <div class="col-xs-12 col-md-6 input-wrapper"> 70 <div class="col-xs-12 col-md-6 input-wrapper">
71 <div class="icon-circle-y"> 71 <div class="icon-circle-y">
72 <i class="material-icons" style="line-height: 30px;">assignment</i> 72 <i class="material-icons" style="line-height: 30px;">assignment</i>
73 </div> 73 </div>
74 <select ng-model="data.stage" ng-change="selectechnology(data.stage); fundkeyPress(data.stage)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required> 74 <select ng-model="data.stage" ng-change="selectechnology(data.stage); fundkeyPress(data.stage)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required>
75 <option name="stage" selected disabled value="">Choose Startup Stage *</option> 75 <option name="stage" selected disabled value="">Choose Startup Stage *</option>
76 <option value="Idea">Idea</option> 76 <option value="Idea">Idea</option>
77 <option value="Prototype">Prototype</option> 77 <option value="Prototype">Prototype</option>
78 <!-- <option value="Proof of Concept">Proof of Concept</option> 78 <!-- <option value="Proof of Concept">Proof of Concept</option>
79 <option value="Beta Launched">Beta Launched</option> 79 <option value="Beta Launched">Beta Launched</option>
80 <option value="Early Revenues">Early Revenues</option> 80 <option value="Early Revenues">Early Revenues</option>
81 <option value="Steady Revenues">Steady Revenues</option> 81 <option value="Steady Revenues">Steady Revenues</option>
82 <option value="Other">Other</option> 82 <option value="Other">Other</option>
83 --> </select> 83 --> </select>
84 </div> 84 </div>
85 <div class="col-xs-12 col-md-6 input-wrapper"> 85 <div class="col-xs-12 col-md-6 input-wrapper">
86 <div class="icon-circle-q"> 86 <div class="icon-circle-q">
87 <i class="material-icons" style="line-height: 30px;">business</i> 87 <i class="material-icons" style="line-height: 30px;">business</i>
88 </div> 88 </div>
89 <select ng-model="data.business" ng-change="selectechnology(data.business); ideakeyPress(data.business)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required> 89 <select ng-model="data.business" ng-change="selectechnology(data.business); ideakeyPress(data.business)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required>
90 <option name="business" selected disabled value="">Type of business *</option> 90 <option name="business" selected disabled value="">Type of business *</option>
91 <option value="B2B">B2B</option> 91 <option value="B2B">B2B</option>
92 <option value="B2C">B2C</option> 92 <option value="B2C">B2C</option>
93 </select> 93 </select>
94 </div> 94 </div>
95 <div class="col-xs-12 col-md-12 f-family line-adjust"> 95 <div class="col-xs-12 col-md-12 f-family line-adjust">
96 <strong>How many founders/teammates will be attending the meetup? *</strong> 96 <strong>How many founders/teammates will be attending the meetup? *</strong>
97 <p class="line-space" ></p> 97 <p class="line-space" ></p>
98 </div> 98 </div>
99 <div class="col-xs-12 col-md-12 input-wrapper" > 99 <div class="col-xs-12 col-md-12 input-wrapper" >
100 <div class="icon-circle-o"> 100 <div class="icon-circle-o">
101 <i class="material-icons" style="line-height: 30px;">confirmation_number</i> 101 <i class="material-icons" style="line-height: 30px;">confirmation_number</i>
102 </div> 102 </div>
103 <select ng-model="data.founder" ng-change="selectfounder(data.founder); discountkeyPress(data.founder)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required> 103 <select ng-model="data.founder" ng-change="selectfounder(data.founder); discountkeyPress(data.founder)" style="background-color: #fff; border-radius: 0; font-size: 12px; height: 44px;" required>
104 <option name="founder" selected disabled value="">Choose</option> 104 <option name="founder" selected disabled value="">Choose</option>
105 <option value="1">1</option> 105 <option value="1">1</option>
106 <option value="2">2</option> 106 <option value="2">2</option>
107 <option value="3">3</option> 107 <option value="3">3</option>
108 <option value="more than 3">more than 3</option> 108 <option value="more than 3">more than 3</option>
109 </select> 109 </select>
110 </div> 110 </div>
111 <!-- <div class="col-xs-12 col-md-12 f-family line-adjust"> 111 <!-- <div class="col-xs-12 col-md-12 f-family line-adjust">
112 <strong>In which city is your startup registered at?</strong> 112 <strong>In which city is your startup registered at?</strong>
113 <p class="line-space" ></p> 113 <p class="line-space" ></p>
114 </div> --> 114 </div> -->
115 <!-- <div class="col-xs-12 col-md-12 input-wrapper"> 115 <!-- <div class="col-xs-12 col-md-12 input-wrapper">
116 <div class="icon-circle-m"> 116 <div class="icon-circle-m">
117 <i class="material-icons" style="line-height: 30px;">assessment</i> 117 <i class="material-icons" style="line-height: 30px;">assessment</i>
118 </div> 118 </div>
119 <input type="text" class="text-input" ng-model="data.cityRegister" placeholder="Your Answer.." ng-change="entertechnology(data.cityRegister); annualkeyPress(data.cityRegister)"> 119 <input type="text" class="text-input" ng-model="data.cityRegister" placeholder="Your Answer.." ng-change="entertechnology(data.cityRegister); annualkeyPress(data.cityRegister)">
120 </div> --> 120 </div> -->
121 <div class="col-xs-12 col-md-12 f-family line-adjust"> 121 <div class="col-xs-12 col-md-12 f-family line-adjust">
122 <strong>Give us a brief introduction about your startup. *</strong> 122 <strong>Give us a brief introduction about your startup. *</strong>
123 <p class="line-space" >Kindly write a powerful Twitter Pitch (word limit-200).</p> 123 <p class="line-space" >Kindly write a powerful Twitter Pitch (word limit-200).</p>
124 </div> 124 </div>
125 <div class="col-xs-12 col-md-12 input-wrapper"> 125 <div class="col-xs-12 col-md-12 input-wrapper">
126 <div class="icon-circle-x"> 126 <div class="icon-circle-x">
127 <i class="material-icons" style="line-height: 30px;">line_weight</i> 127 <i class="material-icons" style="line-height: 30px;">line_weight</i>
128 </div> 128 </div>
129 <textarea name="intro" class="text-input textarea" ng-model="data.intro" placeholder="Your Answer.." maxlength="200" ng-change="enterproblem(data.intro); startupNamekeyPress(data.intro)" required></textarea> 129 <textarea name="intro" class="text-input textarea" ng-model="data.intro" placeholder="Your Answer.." maxlength="200" ng-change="enterproblem(data.intro); startupNamekeyPress(data.intro)" required></textarea>
130 </div> 130 </div>
131 <div class="col-xs-12 col-md-12 f-family line-adjust"> 131 <div class="col-xs-12 col-md-12 f-family line-adjust">
132 <strong>Who are your customers? *</strong> 132 <strong>Who are your customers? *</strong>
133 <p class="line-space" >We are looking for a simple and clear answer of who you are selling to.</p> 133 <p class="line-space" >We are looking for a simple and clear answer of who you are selling to.</p>
134 </div> 134 </div>
135 <div class="col-xs-12 col-md-12 input-wrapper"> 135 <div class="col-xs-12 col-md-12 input-wrapper">
136 <div class="icon-circle-k"> 136 <div class="icon-circle-k">
137 <i class="material-icons" style="line-height: 30px;">help</i> 137 <i class="material-icons" style="line-height: 30px;">help</i>
138 </div> 138 </div>
139 <textarea name="customer" class="text-input textarea" ng-model="data.customer" placeholder="Your Answer.." ng-change="entersolution(data.customer); websitekeyPress(data.customer)" required></textarea> 139 <textarea name="customer" class="text-input textarea" ng-model="data.customer" placeholder="Your Answer.." ng-change="entersolution(data.customer); websitekeyPress(data.customer)" required></textarea>
140 </div> 140 </div>
141 <div class="col-xs-12 col-md-12 f-family line-adjust"> 141 <div class="col-xs-12 col-md-12 f-family line-adjust">
142 <strong>What problem you are solving for them? *</strong> 142 <strong>What problem you are solving for them? *</strong>
143 <p class="line-space" >We want to understand how clearly you know the pain point, and how big of a problem it is for the customers.</p> 143 <p class="line-space" >We want to understand how clearly you know the pain point, and how big of a problem it is for the customers.</p>
144 </div> 144 </div>
145 <div class="col-xs-12 col-md-12 input-wrapper f-family"> 145 <div class="col-xs-12 col-md-12 input-wrapper f-family">
146 <div class="icon-circle-p"> 146 <div class="icon-circle-p">
147 <i class="material-icons" style="line-height: 30px;">business_center</i> 147 <i class="material-icons" style="line-height: 30px;">business_center</i>
148 </div> 148 </div>
149 <textarea name="problem" class="text-input textarea" ng-model="data.problem" placeholder="Your Answer.." ng-change="enterbusiness(data.problem); businesskeyPress(data.problem)" required> 149 <textarea name="problem" class="text-input textarea" ng-model="data.problem" placeholder="Your Answer.." ng-change="enterbusiness(data.problem); businesskeyPress(data.problem)" required>
150 </textarea> 150 </textarea>
151 </div> 151 </div>
152 <!-- <div class="col-xs-12 col-md-12 f-family line-adjust"> 152 <!-- <div class="col-xs-12 col-md-12 f-family line-adjust">
153 <strong>Link your pitch deck presentation. *</strong> 153 <strong>Link your pitch deck presentation. *</strong>
154 <p class="line-space" > Kindly upload the link to your pitch deck (Dropbox/Google Drive, if on google drive make the link open to all).</p> 154 <p class="line-space" > Kindly upload the link to your pitch deck (Dropbox/Google Drive, if on google drive make the link open to all).</p>
155 </div> 155 </div>
156 <div class="col-xs-12 col-md-12 input-wrapper f-family"> 156 <div class="col-xs-12 col-md-12 input-wrapper f-family">
157 <div class="icon-circle-h"> 157 <div class="icon-circle-h">
158 <i class="material-icons" style="line-height: 30px;">web</i> 158 <i class="material-icons" style="line-height: 30px;">web</i>
159 </div> 159 </div>
160 <input name="link" class="text-input" ng-pattern="/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/" ng-blur="emailcheck(data.link)" ng-focus="removeError()" ng-model="data.link" placeholder="link" ng-change="enterbusiness(data.link); linkedInkeyPress(data.link)" required> 160 <input name="link" class="text-input" ng-pattern="/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/" ng-blur="emailcheck(data.link)" ng-focus="removeError()" ng-model="data.link" placeholder="link" ng-change="enterbusiness(data.link); linkedInkeyPress(data.link)" required>
161 <label class="error-message f-family" id="invalidEmail">Please enter a valid link.</label> 161 <label class="error-message f-family" id="invalidEmail">Please enter a valid link.</label>
162 </div> --> 162 </div> -->
163 <div class="col-xs-12 col-md-12 f-family line-adjust"> 163 <div class="col-xs-12 col-md-12 f-family line-adjust">
164 <strong>Coupon Code.</strong> 164 <strong>Coupon Code.</strong>
165 <p class="line-space" >Only applicable for venue partner ecosystem</p> 165 <p class="line-space" >Only applicable for venue partner ecosystem</p>
166 </div> 166 </div>
167 <div class="col-xs-12 input-wrapper"> 167 <div class="col-xs-12 input-wrapper">
168 <div class="referel-icon" style="z-index: 999;"> 168 <div class="referel-icon" style="z-index: 999;">
169 <i class="material-icons" style="line-height: 30px;">code</i> 169 <i class="material-icons" style="line-height: 30px;">code</i>
170 </div> 170 </div>
171 <input class="text-input" ng-model="data.referalToken" placeholder="Enter Coupon code" style="position: relative;" ng-required="referalToken" ng-change="changeReferalIconColor(data.referalToken)"> 171 <input class="text-input" ng-model="data.referalToken" placeholder="Enter Coupon code" style="position: relative;" ng-required="referalToken" ng-change="changeReferalIconColor(data.referalToken)">
172 <i class="material-icons coupen-approved" ng-if="tokencheck == true">check</i> 172 <i class="material-icons coupen-approved" ng-if="tokencheck == true">check</i>
173 <i class="material-icons coupen-approved" style="color:red;" ng-if="tokencheck == false">close</i> 173 <i class="material-icons coupen-approved" style="color:red;" ng-if="tokencheck == false">close</i>
174 <button type="button" ng-click="tokenCall(data.referalToken)" class="pull-right apply-coupen-btn">Apply</button> 174 <button type="button" ng-click="tokenCall(data.referalToken)" class="pull-right apply-coupen-btn">Apply</button>
175 </div> 175 </div>
176 <div class="clearfix"></div> 176 <div class="clearfix"></div>
177 <!-- </div> --> 177 <!-- </div> -->
178 <!-- close step-one-form --> 178 <!-- close step-one-form -->
179 <!-- </td> 179 <!-- </td>
180 </tr> 180 </tr>
181 </table> --> 181 </table> -->
182 </div> 182 </div>
183 <!-- CLOSE form-all --> 183 <!-- CLOSE form-all -->
184 <!-- </div> --> 184 <!-- </div> -->
185 <div class="clearfix"></div> 185 <div class="clearfix"></div>
186 <div class="text-center"> 186 <div class="text-center">
187 <input type="submit" class="btn submit-button-form" ng-disabled="applicantForm.$invalid" value="Submit" ng-click="submit()"> 187 <input type="submit" class="btn submit-button-form" ng-disabled="applicantForm.$invalid" value="Submit" ng-click="submit()">
188 </div> 188 </div>
189 </div> 189 </div>
190 <!-- col-xs-12 col-md-8 col-md-offset-2 --> 190 <!-- col-xs-12 col-md-8 col-md-offset-2 -->
1 // create the module and name it scotchApp 1 // create the module and name it scotchApp
2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); 2 var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']);
3 3
4 // configure our routes 4 // configure our routes
5 scotchApp.config(function($routeProvider) { 5 scotchApp.config(function($routeProvider) {
6 $routeProvider 6 $routeProvider
7 7
8 // route for the Home page 8 // route for the Home page
9 .when('/', { 9 .when('/', {
10 templateUrl: 'pages/Home.html', 10 templateUrl: 'pages/Home.html',
11 controller: 'mainController' 11 controller: 'mainController'
12 }) 12 })
13 13
14 // route for the caricatures page 14 // route for the caricatures page
15 .when('/caricatures', { 15 .when('/caricatures', {
16 templateUrl: 'pages/caricatures.html', 16 templateUrl: 'pages/caricatures.html',
17 controller: 'mainController' 17 controller: 'mainController'
18 }) 18 })
19 19
20 // // route for the paymentVerify page 20 // // route for the paymentVerify page
21 // .when('/pendingPayment/:id', { 21 // .when('/pendingPayment/:id', {
22 // templateUrl: 'pages/verify.html', 22 // templateUrl: 'pages/verify.html',
23 // controller: 'verifyController' 23 // controller: 'verifyController'
24 // }) 24 // })
25 25
26 // route for the 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 ambassador page 32 // route for the ambassador page
33 .when('/startupJalsaPromocode', { 33 .when('/startupJalsaPromocode', {
34 templateUrl: 'pages/ambassador.html', 34 templateUrl: 'pages/ambassador.html',
35 controller: 'ambassadorController' 35 controller: 'ambassadorController'
36 }) 36 })
37 37
38 // route for the confirmation page 38 // route for the confirmation page
39 .when('/confirmation', { 39 .when('/confirmation', {
40 templateUrl: 'pages/confirmation.html', 40 templateUrl: 'pages/confirmation.html',
41 controller: 'registrationController' 41 controller: 'registrationController'
42 }) 42 })
43 43
44 }); 44 });
45 45
46 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { 46 scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) {
47 // Add configuration code as desired 47 // Add configuration code as desired
48 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code 48 AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code
49 49
50 // Track all routes (default is true). 50 // Track all routes (default is true).
51 AnalyticsProvider.trackPages(true); 51 AnalyticsProvider.trackPages(true);
52 52
53 // Track all URL query params (default is false). 53 // Track all URL query params (default is false).
54 AnalyticsProvider.trackUrlParams(true); 54 AnalyticsProvider.trackUrlParams(true);
55 55
56 }]).run(['Analytics', function(Analytics) { }]); 56 }]).run(['Analytics', function(Analytics) { }]);
57 57
58 scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") 58 scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1")
59 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") 59 //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1")
60 60
61 // create the controller and inject Angular's $scope 61 // create the controller and inject Angular's $scope
62 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { 62 scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) {
63 $scope.data = { 63 $scope.data = {
64 show: true, 64 show: true,
65 hide: false 65 hide: false
66 }; 66 };
67 67
68 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 68 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
69 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 69 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
70 // $scope.Textshow = "yes" 70 // $scope.Textshow = "yes"
71 $scope.max = 100; 71 $scope.max = 100;
72 $scope.formPage = false; 72 $scope.formPage = false;
73 $scope.current = 0; 73 $scope.current = 0;
74 $scope.payingAmnt = 0; 74 $scope.payingAmnt = 0;
75 $scope.data = {}; 75 $scope.data = {};
76 $scope.discountAmount = 0; 76 $scope.discountAmount = 0;
77 // $scope.data.quantity = "1"; 77 // $scope.data.quantity = "1";
78 $scope.check = false; 78 $scope.check = false;
79 $scope.numberCheck = false; 79 $scope.numberCheck = false;
80 $scope.paymentResult = {}; 80 $scope.paymentResult = {};
81 var data = { 81 var data = {
82 "amount": $scope.payingAmnt, 82 "amount": $scope.payingAmnt,
83 "currency": "INR", 83 "currency": "INR",
84 "status": "pending" 84 "status": "pending"
85 } 85 }
86 86
87 $scope.apply = function() { 87 $scope.apply = function() {
88 //Analytics.trackEvent('register', 'click', 'Registration'); 88 //Analytics.trackEvent('register', 'click', 'Registration');
89 $location.path("/caricatures") 89 $location.path("/caricatures")
90 } 90 }
91 91
92 $scope.data.city = ''; 92 $scope.data.city = '';
93 $scope.watch = function(value){ 93 $scope.watch = function(value){
94 console.log("cllll",value) 94 console.log("cllll",value)
95 $scope.data.city = value; 95 $scope.data.city = value;
96 localStorage.setItem("city" ,value); 96 localStorage.setItem("city" ,value);
97 //$location.path('/registration').search({city: value}); 97 //$location.path('/registration').search({city: value});
98 $location.path('/registration'); 98 $location.path('/registration');
99 //$state.go('registration', { 'city': value}) 99 //$state.go('registration', { 'city': value})
100 } 100 }
101 101
102 $scope.select = function(url){ 102 $scope.select = function(url){
103 console.log("cllll") 103 console.log("cllll")
104 window.open(url) 104 window.open(url)
105 } 105 }
106 106
107 $scope.stagekeyPress = function() { 107 $scope.stagekeyPress = function() {
108 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); 108 $('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)');
109 } 109 }
110 $scope.sectorkeyPress = function() { 110 $scope.sectorkeyPress = function() {
111 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); 111 $('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)');
112 } 112 }
113 113
114 $scope.productLaunchkeyPress = function() { 114 $scope.productLaunchkeyPress = function() {
115 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); 115 $('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)');
116 } 116 }
117 117
118 $scope.launchPeriodkeyPress = function() { 118 $scope.launchPeriodkeyPress = function() {
119 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); 119 $('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)');
120 } 120 }
121 121
122 $scope.industrykeyPress = function(quantity) { 122 $scope.industrykeyPress = function(quantity) {
123 console.log("fghj",quantity) 123 console.log("fghj",quantity)
124 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); 124 $('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)');
125 } 125 }
126 126
127 $scope.industryNamekeyPress = function(firstName) { 127 $scope.industryNamekeyPress = function(firstName) {
128 console.log("lastName==", firstName); 128 console.log("lastName==", firstName);
129 if (firstName == undefined) { 129 if (firstName == undefined) {
130 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 130 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
131 } else { 131 } else {
132 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 132 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
133 } 133 }
134 } 134 }
135 135
136 $scope.amountkeyPress = function() { 136 $scope.amountkeyPress = function() {
137 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); 137 $('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)');
138 } 138 }
139 139
140 $scope.firstNamekeyPress = function(name) { 140 $scope.firstNamekeyPress = function(name) {
141 console.log("lastName==", name); 141 console.log("lastName==", name);
142 if (name == undefined) { 142 if (name == undefined) {
143 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); 143 $('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)');
144 } else { 144 } else {
145 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); 145 $('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)');
146 } 146 }
147 } 147 }
148 148
149 $scope.emailkeyPress = function(email) { 149 $scope.emailkeyPress = function(email) {
150 console.log("email", email); 150 console.log("email", email);
151 if (email == undefined) { 151 if (email == undefined) {
152 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); 152 $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)');
153 } else { 153 } else {
154 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); 154 $('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)');
155 } 155 }
156 } 156 }
157 157
158 $scope.phonekeyPress = function(number) { 158 $scope.phonekeyPress = function(number) {
159 console.log("number", number); 159 console.log("number", number);
160 if (number == undefined || number == '') { 160 if (number == undefined || number == '') {
161 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); 161 $('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)');
162 } else { 162 } else {
163 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); 163 $('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)');
164 } 164 }
165 } 165 }
166 166
167 $scope.citykeyPress = function(city) { 167 $scope.citykeyPress = function(city) {
168 console.log("city", city); 168 console.log("city", city);
169 if (city == undefined) { 169 if (city == undefined) {
170 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); 170 $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)');
171 } else { 171 } else {
172 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); 172 $('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)');
173 } 173 }
174 } 174 }
175 175
176 $scope.startupNamekeyPress = function(q) { 176 $scope.startupNamekeyPress = function(q) {
177 if (q == undefined) { 177 if (q == undefined) {
178 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); 178 $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)');
179 } else { 179 } else {
180 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); 180 $('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)');
181 } 181 }
182 } 182 }
183 183
184 $scope.linkedInkeyPress = function(technology) { 184 $scope.linkedInkeyPress = function(technology) {
185 if (technology == undefined || technology == '') { 185 if (technology == undefined || technology == '') {
186 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); 186 $('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)');
187 } else { 187 } else {
188 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); 188 $('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)');
189 } 189 }
190 } 190 }
191 $scope.companykeyPress = function(problem) { 191 $scope.companykeyPress = function(problem) {
192 if (problem == undefined) { 192 if (problem == undefined) {
193 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); 193 $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)');
194 } else { 194 } else {
195 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); 195 $('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)');
196 } 196 }
197 } 197 }
198 $scope.productNamekeyPress = function(solution) { 198 $scope.productNamekeyPress = function(solution) {
199 if (solution == undefined) { 199 if (solution == undefined) {
200 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); 200 $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)');
201 } else { 201 } else {
202 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); 202 $('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)');
203 } 203 }
204 } 204 }
205 $scope.businesskeyPress = function(business) { 205 $scope.businesskeyPress = function(business) {
206 if (business == undefined) { 206 if (business == undefined) {
207 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)'); 207 $('.icon-circle-p').css('background-color', 'rgb(102, 102, 102)');
208 } else { 208 } else {
209 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); 209 $('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)');
210 } 210 }
211 } 211 }
212 212
213 $scope.websitekeyPress = function(prototype) { 213 $scope.websitekeyPress = function(prototype) {
214 if (prototype == undefined || prototype == '') { 214 if (prototype == undefined || prototype == '') {
215 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); 215 $('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)');
216 } else { 216 } else {
217 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); 217 $('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)');
218 } 218 }
219 } 219 }
220 220
221 $scope.employeekeyPress = function(market) { 221 $scope.employeekeyPress = function(market) {
222 if (market == undefined || market == '') { 222 if (market == undefined || market == '') {
223 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); 223 $('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)');
224 } else { 224 } else {
225 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); 225 $('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)');
226 } 226 }
227 } 227 }
228 228
229 $scope.annualkeyPress = function(risk) { 229 $scope.annualkeyPress = function(risk) {
230 if (risk == undefined || risk == '') { 230 if (risk == undefined || risk == '') {
231 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); 231 $('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)');
232 } else { 232 } else {
233 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); 233 $('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)');
234 } 234 }
235 } 235 }
236 236
237 $scope.revenuekeyPress = function(team) { 237 $scope.revenuekeyPress = function(team) {
238 if (team == undefined) { 238 if (team == undefined) {
239 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); 239 $('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)');
240 } else { 240 } else {
241 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); 241 $('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)');
242 } 242 }
243 } 243 }
244 244
245 $scope.descriptionkeyPress = function(pitch) { 245 $scope.descriptionkeyPress = function(pitch) {
246 if (pitch == undefined) { 246 if (pitch == undefined) {
247 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); 247 $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)');
248 } else { 248 } else {
249 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); 249 $('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)');
250 } 250 }
251 } 251 }
252 252
253 $scope.discountkeyPress = function(discount) { 253 $scope.discountkeyPress = function(discount) {
254 if (discount == undefined) { 254 if (discount == undefined) {
255 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); 255 $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)');
256 } else { 256 } else {
257 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); 257 $('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)');
258 } 258 }
259 } 259 }
260 260
261 $scope.removeNooError = function() { 261 $scope.removeNooError = function() {
262 $('#invalidIdea').css('display', 'block'); 262 $('#invalidIdea').css('display', 'block');
263 $('#noExist').css('display', 'none'); 263 $('#noExist').css('display', 'none');
264 }; 264 };
265 265
266 $scope.ideakeyPress = function(financial) { 266 $scope.ideakeyPress = function(financial) {
267 console.log("financial", financial); 267 console.log("financial", financial);
268 if (financial == undefined) { 268 if (financial == undefined) {
269 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); 269 $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)');
270 } else { 270 } else {
271 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); 271 $('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)');
272 } 272 }
273 } 273 }
274 274
275 $scope.fundkeyPress = function(financial) { 275 $scope.fundkeyPress = function(financial) {
276 console.log("financial", financial); 276 console.log("financial", financial);
277 if (financial == undefined) { 277 if (financial == undefined) {
278 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); 278 $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)');
279 } else { 279 } else {
280 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); 280 $('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)');
281 } 281 }
282 } 282 }
283 283
284 $scope.changeReferalIconColor = function(referalToken){ 284 $scope.changeReferalIconColor = function(referalToken){
285 if (referalToken == undefined || referalToken == '') { 285 if (referalToken == undefined || referalToken == '') {
286 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); 286 $('.referel-icon').css('background-color', 'rgb(102, 102, 102)');
287 }else { 287 }else {
288 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); 288 $('.referel-icon').css('background-color', 'rgb(25, 104, 157)');
289 } 289 }
290 } 290 }
291 291
292 }); 292 });
293 293
294 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) { 294 scotchApp.controller('registrationController', function($scope, $http, $location, $rootScope,$route,BASE_URL) {
295 $scope.data = {}; 295 $scope.data = {};
296 $scope.check = false; 296 $scope.check = false;
297 $scope.numberCheck = false; 297 $scope.numberCheck = false;
298 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 298 $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
299 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ 299 $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/
300 $scope.max = 100; 300 $scope.max = 100;
301 $scope.formPage = false; 301 $scope.formPage = false;
302 $scope.current = 0; 302 $scope.current = 0;
303 $scope.payingAmnt = 0; 303 $scope.payingAmnt = 0;
304 $scope.discountAmount = 0; 304 $scope.discountAmount = 0;
305 // $scope.data.quantity = "1"; 305 // $scope.data.quantity = "1";
306 $scope.check = false; 306 $scope.check = false;
307 $scope.numberCheck = false; 307 $scope.numberCheck = false;
308 $scope.paymentResult = {}; 308 $scope.paymentResult = {};
309 var data = { 309 var data = {
310 "amount": $scope.payingAmnt, 310 "amount": $scope.payingAmnt,
311 "currency": "INR", 311 "currency": "INR",
312 "status": "pending" 312 "status": "pending"
313 } 313 }
314 314
315 $scope.removeError = function() { 315 $scope.removeError = function() {
316 $('#invalidEmail').css('display', 'none'); 316 $('#invalidEmail').css('display', 'none');
317 $('#alreadyExist').css('display', 'none'); 317 $('#alreadyExist').css('display', 'none');
318 }; 318 };
319 319
320 $scope.emailcheck = function(val) { 320 $scope.emailcheck = function(val) {
321 if (val == undefined) { 321 if (val == undefined) {
322 $('#invalidEmail').css('display', 'block'); 322 $('#invalidEmail').css('display', 'block');
323 } else { 323 } else {
324 $('#alreadyExist').css('display', 'block'); 324 $('#alreadyExist').css('display', 'block');
325 } 325 }
326 }; 326 };
327 327
328 $scope.removeNoError = function() {
329 $('#invalidNumber').css('display', 'none');
330 $('#alreadyExist').css('display', 'none');
331 };
332
333 $scope.numbercheck = function(val) {
334 if (val == undefined) {
335 $('#invalidNumber').css('display', 'block');
336 } else {
337 $('#alreadyExist').css('display', 'block');
338 }
339 };
340
328 // $scope.$on('city', function (event, value) { 341 // $scope.$on('city', function (event, value) {
329 $scope.data.city = localStorage.getItem("city"); 342 $scope.data.city = localStorage.getItem("city");
330 console.log("HERE===",$scope.data.city ); 343 console.log("HERE===",$scope.data.city );
331 // }); 344 // });
332 345
333 $rootScope.tokenCall = function(val) { 346 $rootScope.tokenCall = function(val) {
334 console.log('val-------->', val); 347 console.log('val-------->', val);
335 if (val == undefined) { 348 if (val == undefined) {
336 $('#invalidToken').css('display', 'block'); 349 $('#invalidToken').css('display', 'block');
337 } else { 350 } else {
338 val = val.toUpperCase(); 351 val = val.toUpperCase();
339 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') 352 $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}')
340 .then(function(searchResult) { 353 .then(function(searchResult) {
341 console.log("searchResult",searchResult) 354 console.log("searchResult",searchResult)
342 if (searchResult.data.length == 0) { 355 if (searchResult.data.length == 0) {
343 $scope.tokencheck = false; 356 $scope.tokencheck = false;
344 $scope.discountAmount = 0; 357 $scope.discountAmount = 0;
345 } else { 358 } else {
346 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount); 359 console.log("===searchResult.data[0].discount===",searchResult.data[0].discount);
347 $scope.discountpercentage = searchResult.data[0].discount; 360 $scope.discountpercentage = searchResult.data[0].discount;
348 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage); 361 console.log("===searchResultdiscountpercentage===",$scope.discountpercentage);
349 $scope.tokencheck = true; 362 $scope.tokencheck = true;
350 } 363 }
351 },function(err){ 364 },function(err){
352 console.log(err) 365 console.log(err)
353 }); 366 });
354 367
355 } 368 }
356 }; 369 };
357 370
358 $scope.submit = function() { 371 $scope.submit = function() {
359 $scope.ticketAmnt = 500; 372 $scope.ticketAmnt = 500;
360 if($scope.tokencheck == false){ 373 if($scope.tokencheck == false){
361 $scope.data.referalToken = null; 374 $scope.data.referalToken = null;
362 } 375 }
363 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { 376 if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
364 var x = document.getElementById("snackbar") 377 var x = document.getElementById("snackbar")
365 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); 378 setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
366 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { 379 }else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
367 $scope.infoForm = true; 380 $scope.infoForm = true;
368 $scope.detail = {}; 381 $scope.detail = {};
369 $scope.data.phone = "+91"+$scope.data.number; 382 $scope.data.phone = "+91"+$scope.data.number;
370 if($scope.data.referalToken == null){ 383 if($scope.data.referalToken == null){
371 $scope.data.referalToken = "N.A." 384 $scope.data.referalToken = "N.A."
372 } 385 }
373 $http({ 386 $http({
374 method: 'POST', 387 method: 'POST',
375 url: BASE_URL+'/applicants', 388 url: BASE_URL+'/applicants',
376 data: $scope.data, 389 data: $scope.data,
377 headers: {} 390 headers: {}
378 }).then(function mySuccess(result) { 391 }).then(function mySuccess(result) {
379 console.log("=====result=====",result) 392 console.log("=====result=====",result)
380 $scope.detail = result; 393 $scope.detail = result;
381 data.applicantId = result.data.id; 394 data.applicantId = result.data.id;
382 $scope.userId = result.data.id; 395 $scope.userId = result.data.id;
383 console.log("=====data=====",data) 396 console.log("=====data=====",data)
384 var amount = $scope.ticketAmnt * 100 397 var amount = $scope.ticketAmnt * 100
385 if($scope.tokencheck == true){ 398 if($scope.tokencheck == true){
386 var amount = $scope.ticketAmnt 399 var amount = $scope.ticketAmnt
387 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 400 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
388 if($scope.discountpercentage == "100") { 401 if($scope.discountpercentage == "100") {
389 $scope.discountpercentage = "99.8"; 402 $scope.discountpercentage = "99.8";
390 console.log("$scope.discountpercentage====",$scope.discountpercentage) 403 console.log("$scope.discountpercentage====",$scope.discountpercentage)
391 } 404 }
392 console.log("====$scope.discountpercentage====",$scope.discountpercentage); 405 console.log("====$scope.discountpercentage====",$scope.discountpercentage);
393 $scope.percDiscount = $scope.discountpercentage/100; 406 $scope.percDiscount = $scope.discountpercentage/100;
394 console.log("====$scope.percDiscount====",$scope.percDiscount); 407 console.log("====$scope.percDiscount====",$scope.percDiscount);
395 console.log("====amount=====",amount); 408 console.log("====amount=====",amount);
396 $scope.discountAmount = amount * $scope.percDiscount; 409 $scope.discountAmount = amount * $scope.percDiscount;
397 console.log("finalAmount====>",$scope.discountAmount) 410 console.log("finalAmount====>",$scope.discountAmount)
398 } 411 }
399 var taxAmount = $scope.ticketAmnt - $scope.discountAmount 412 var taxAmount = $scope.ticketAmnt - $scope.discountAmount
400 console.log("$scope.taxTotal----",taxAmount) 413 console.log("$scope.taxTotal----",taxAmount)
401 $scope.payingAmnt = taxAmount; 414 $scope.payingAmnt = taxAmount;
402 console.log("====$scope.payingAmnt====",$scope.payingAmnt) 415 console.log("====$scope.payingAmnt====",$scope.payingAmnt)
403 $scope.payingAmnt = $scope.payingAmnt.toFixed() 416 $scope.payingAmnt = $scope.payingAmnt.toFixed()
404 data.amount = $scope.payingAmnt; 417 data.amount = $scope.payingAmnt;
405 console.log("data.amount==",data.amount) 418 console.log("data.amount==",data.amount)
406 if($scope.detail != null){ 419 if($scope.detail != null){
407 $http({ 420 $http({
408 method: 'POST', 421 method: 'POST',
409 url: BASE_URL+'/payments', 422 url: BASE_URL+'/payments',
410 data: data, 423 data: data,
411 headers: {} 424 headers: {}
412 }).then(function mySuccess(paymentResult) { 425 }).then(function mySuccess(paymentResult) {
413 $scope.paymentResult = paymentResult; 426 $scope.paymentResult = paymentResult;
414 }, function myError(error) { 427 }, function myError(error) {
415 }); 428 });
416 } 429 }
417 var i = 0; 430 var i = 0;
418 $scope.payingAmnt = $scope.payingAmnt * 100; 431 $scope.payingAmnt = $scope.payingAmnt * 100;
419 var options = { 432 var options = {
420 //"key": "rzp_test_YwHsVFiDIQ2WUQ", 433 //"key": "rzp_test_YwHsVFiDIQ2WUQ",
421 "key": "rzp_live_mkmCb4FkstuWaS", 434 "key": "rzp_live_mkmCb4FkstuWaS",
422 "amount": $scope.payingAmnt, 435 "amount": $scope.payingAmnt,
423 436
424 "name": "Startup Jalsa", 437 "name": "Startup Jalsa",
425 "description":"amount", 438 "description":"amount",
426 "currency": "INR", 439 "currency": "INR",
427 "status": "done", 440 "status": "done",
428 441
429 "prefill": { 442 "prefill": {
430 "email": $scope.detail.email, 443 "email": $scope.detail.email,
431 "contact": $scope.detail.phone 444 "contact": $scope.detail.phone
432 }, 445 },
433 446
434 "theme": { 447 "theme": {
435 "color": "#2196f3 ", 448 "color": "#2196f3 ",
436 "image_padding":"NO" 449 "image_padding":"NO"
437 }, 450 },
438 "modal": { 451 "modal": {
439 "ondismiss": function(){ 452 "ondismiss": function(){
440 } 453 }
441 }, 454 },
442 "handler": function (response){ 455 "handler": function (response){
443 createPayment(response); 456 createPayment(response);
444 } 457 }
445 }; 458 };
446 var rzp1 = new Razorpay(options); 459 var rzp1 = new Razorpay(options);
447 rzp1.open(); 460 rzp1.open();
448 $scope.paymentResponse = {}; 461 $scope.paymentResponse = {};
449 function createPayment(response){ 462 function createPayment(response){
450 console.log("response12333333",response) 463 console.log("response12333333",response)
451 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; 464 $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id;
452 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; 465 $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId;
453 $scope.paymentResponse.amount = data.amount; 466 $scope.paymentResponse.amount = data.amount;
454 $scope.paymentResponse.currency = "INR"; 467 $scope.paymentResponse.currency = "INR";
455 $scope.paymentResponse.status = $scope.paymentResult.data.status; 468 $scope.paymentResponse.status = $scope.paymentResult.data.status;
456 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount) 469 console.log("$scope.paymentResponse.amount=====",$scope.paymentResponse.amount)
457 $http({ 470 $http({
458 method: 'PUT', 471 method: 'PUT',
459 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, 472 url: BASE_URL+'/payments/'+$scope.paymentResult.data.id,
460 data: $scope.paymentResponse, 473 data: $scope.paymentResponse,
461 headers: {} 474 headers: {}
462 }).then(function mySuccess(searchResult) { 475 }).then(function mySuccess(searchResult) {
463 console.log("searchResult",searchResult) 476 console.log("searchResult",searchResult)
464 $location.path("/confirmation") 477 $location.path("/confirmation")
465 }, function myError(error) { 478 }, function myError(error) {
466 }); 479 });
467 } 480 }
468 481
469 }, function myError(error) { 482 }, function myError(error) {
470 483
471 }); 484 });
472 485
473 } 486 }
474 487
475 } 488 }
476 489
477 }); 490 });
478 491
479 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { 492 scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) {
480 $scope.data = {}; 493 $scope.data = {};
481 $scope.check = false; 494 $scope.check = false;
482 $scope.numberCheck = false; 495 $scope.numberCheck = false;
483 496
484 $scope.submit = function() { 497 $scope.submit = function() {
485 console.log($scope.data.name) 498 console.log($scope.data.name)
486 var randomNumber = ""+Math.random(); 499 var randomNumber = ""+Math.random();
487 var nameSpliced = $scope.data.name.slice(0,5); 500 var nameSpliced = $scope.data.name.slice(0,5);
488 var numberSpliced = randomNumber.slice(2,4);; 501 var numberSpliced = randomNumber.slice(2,4);;
489 $scope.data.referalToken = nameSpliced+numberSpliced; 502 $scope.data.referalToken = nameSpliced+numberSpliced;
490 $scope.data.referalToken = $scope.data.referalToken.toUpperCase(); 503 $scope.data.referalToken = $scope.data.referalToken.toUpperCase();
491 console.log("dsdfs",numberSpliced); 504 console.log("dsdfs",numberSpliced);
492 $http({ 505 $http({
493 method: 'POST', 506 method: 'POST',
494 url: BASE_URL + '/ambassadors', 507 url: BASE_URL + '/ambassadors',
495 data: $scope.data, 508 data: $scope.data,
496 headers: {} 509 headers: {}
497 }).then(function mySuccess(result) { 510 }).then(function mySuccess(result) {
498 console.log("result", result) 511 console.log("result", result)
499 $scope.detail = result; 512 $scope.detail = result;
500 $('#myModal').modal('show'); 513 $('#myModal').modal('show');
501 $scope.data.name = ''; 514 $scope.data.name = '';
502 $scope.data.email = ''; 515 $scope.data.email = '';
503 $scope.data.mobile = ''; 516 $scope.data.mobile = '';
504 //$scope.data.discount = ''; 517 //$scope.data.discount = '';
505 518
506 }, function myError(error) { 519 }, function myError(error) {
507 console.log(error) 520 console.log(error)
508 console.log(error.data.error.message) 521 console.log(error.data.error.message)
509 }); 522 });
510 } 523 }
511 }); 524 });
512 525
513 526
514 527
515 528
516 529