Commit 246b2c5cd7a633ad84e8ca8bf4e9687edee3bdc5
1 parent
29c3caac95
Exists in
master
icon add
Showing
3 changed files
with
152 additions
and
144 deletions
Show diff stats
index.html
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/> |
15 | 15 | <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css"/> |
16 | 16 | <link href="https://fonts.googleapis.com/css?family=BenchNine" rel="stylesheet"> |
17 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
17 | 18 | <!-- SPELLS --> |
18 | 19 | <script type="text/javascript" src="js/jquery-3.2.1.js"></script> |
19 | 20 | <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script> |
... | ... | @@ -65,6 +66,12 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
65 | 66 | |
66 | 67 | <!-- define angular controller --> |
67 | 68 | <body ng-controller="mainController" id="front"> |
69 | + <div style="font-size:24px;position: fixed; top:50%; right:0; width: 70px;height: 40px;background-color: #303030;border-top-left-radius: 25px; border-bottom-left-radius: 25px;border: 2px solid #303030; z-index: 999; padding: 5px;text-align: center;" > | |
70 | + <!-- <button style="font-size:24px;position: fixed; width: 70px;height: 40px;background-color: #303030;border-top-left-radius: 25px; border-bottom-left-radius: 25px;border: 2px solid #303030;"> --> | |
71 | + <a href="https://web.whatsapp.com/send?phone=+918283056881&text=Hello!" target="_blank" style= "color:#fff;cursor: pointer;"> <i class="fa fa-whatsapp" ></i> | |
72 | + </a> | |
73 | + <!-- </button> --> | |
74 | + </div> | |
68 | 75 | <!-- Google Tag Manager (noscript) --> |
69 | 76 | <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WBTNXZB" |
70 | 77 | height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | ... | ... |
pages/Home.html
script.js
... | ... | @@ -54,10 +54,10 @@ |
54 | 54 | }) |
55 | 55 | |
56 | 56 | // route for the paytm page |
57 | - // .when('/paytm', { | |
58 | - // templateUrl: 'pages/paytm.html', | |
59 | - // controller: 'paytmController' | |
60 | - // }) | |
57 | + .when('/paytm', { | |
58 | + templateUrl: 'pages/paytm.html', | |
59 | + controller: 'paytmController' | |
60 | + }) | |
61 | 61 | |
62 | 62 | .otherwise({ |
63 | 63 | redirectTo: '/' |
... | ... | @@ -1041,149 +1041,149 @@ scotchApp.controller('confirmationController', function($scope, $http, $location |
1041 | 1041 | |
1042 | 1042 | }); |
1043 | 1043 | |
1044 | -// scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) { | |
1045 | -// $scope.data = {}; | |
1046 | -// $scope.data.city = localStorage.getItem("city"); | |
1047 | -// $scope.data.country = localStorage.getItem("country");; | |
1048 | -// var data = { | |
1049 | -// "amount": $scope.payingAmnt, | |
1050 | -// "currency": "INR", | |
1051 | -// "status": "pending", | |
1052 | -// "paymentType": "Manual_Paytm" | |
1053 | -// } | |
1054 | -// var handleFileSelect = function(evt) { | |
1055 | -// var files = evt.target.files; | |
1056 | -// var file = files[0]; | |
1057 | - | |
1058 | -// if (files && file) { | |
1059 | -// var reader = new FileReader(); | |
1060 | - | |
1061 | -// reader.onload = function(readerEvt) { | |
1062 | -// var binaryString = readerEvt.target.result; | |
1063 | -// $scope.base64textString = btoa(binaryString); | |
1064 | -// //console.log("base64textarea",$scope.base64textString) | |
1065 | -// //$scope.data.uploadFile = file.name; | |
1066 | -// $scope.fileSelect = false; | |
1067 | -// if($scope.data.uploadFile == null){ | |
1068 | -// $scope.fileSelect = true; | |
1069 | -// }else{ | |
1070 | -// $scope.fileSelect = false; | |
1071 | -// }; | |
1072 | -// } | |
1073 | - | |
1074 | -// reader.readAsBinaryString(file); | |
1075 | -// } | |
1076 | -// }; | |
1077 | -// if (window.File && window.FileReader && window.FileList && window.Blob) { | |
1078 | -// document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | |
1079 | -// } | |
1080 | - | |
1081 | -// $scope.ngShowhide = false; | |
1082 | -// $scope.GetValue = function(){ | |
1083 | -// if($scope.data.sector == "Other"){ | |
1084 | -// $scope.ngShowhide = true; | |
1085 | -// }else{ | |
1086 | -// $scope.ngShowhide = false; | |
1087 | -// } | |
1088 | -// } | |
1089 | - | |
1090 | -// $rootScope.tokenCall = function(val) { | |
1091 | -// if (val == undefined) { | |
1092 | -// $('#invalidToken').css('display', 'block'); | |
1093 | -// } else { | |
1094 | -// val = val.toUpperCase(); | |
1095 | -// if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ | |
1096 | -// $scope.tokencheck = false; | |
1097 | -// return; | |
1098 | -// } | |
1099 | -// $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | |
1100 | -// .then(function(searchResult) { | |
1101 | -// if (searchResult.data.length == 0) { | |
1102 | -// $scope.tokencheck = false; | |
1103 | -// $scope.discountAmount = 0; | |
1104 | -// } else { | |
1105 | -// $scope.discountpercentage = searchResult.data[0].discount; | |
1106 | -// $scope.tokencheck = true; | |
1107 | -// } | |
1108 | -// },function(err){ | |
1109 | -// console.log(err) | |
1110 | -// }); | |
1044 | +scotchApp.controller('paytmController', function($q, $scope, $http, $location, $rootScope,$route,BASE_URL) { | |
1045 | + $scope.data = {}; | |
1046 | + $scope.data.city = localStorage.getItem("city"); | |
1047 | + $scope.data.country = localStorage.getItem("country");; | |
1048 | + var data = { | |
1049 | + "amount": $scope.payingAmnt, | |
1050 | + "currency": "INR", | |
1051 | + "status": "pending", | |
1052 | + "paymentType": "Manual_Paytm" | |
1053 | + } | |
1054 | + var handleFileSelect = function(evt) { | |
1055 | + var files = evt.target.files; | |
1056 | + var file = files[0]; | |
1057 | + | |
1058 | + if (files && file) { | |
1059 | + var reader = new FileReader(); | |
1060 | + | |
1061 | + reader.onload = function(readerEvt) { | |
1062 | + var binaryString = readerEvt.target.result; | |
1063 | + $scope.base64textString = btoa(binaryString); | |
1064 | + //console.log("base64textarea",$scope.base64textString) | |
1065 | + //$scope.data.uploadFile = file.name; | |
1066 | + $scope.fileSelect = false; | |
1067 | + if($scope.data.uploadFile == null){ | |
1068 | + $scope.fileSelect = true; | |
1069 | + }else{ | |
1070 | + $scope.fileSelect = false; | |
1071 | + }; | |
1072 | + } | |
1073 | + | |
1074 | + reader.readAsBinaryString(file); | |
1075 | + } | |
1076 | + }; | |
1077 | + if (window.File && window.FileReader && window.FileList && window.Blob) { | |
1078 | + document.getElementById('filePicker').addEventListener('change', handleFileSelect, false); | |
1079 | + } | |
1080 | + | |
1081 | + $scope.ngShowhide = false; | |
1082 | + $scope.GetValue = function(){ | |
1083 | + if($scope.data.sector == "Other"){ | |
1084 | + $scope.ngShowhide = true; | |
1085 | + }else{ | |
1086 | + $scope.ngShowhide = false; | |
1087 | + } | |
1088 | + } | |
1089 | + | |
1090 | + $rootScope.tokenCall = function(val) { | |
1091 | + if (val == undefined) { | |
1092 | + $('#invalidToken').css('display', 'block'); | |
1093 | + } else { | |
1094 | + val = val.toUpperCase(); | |
1095 | + if((val == "IITH99" && $scope.data.city != "Hyderabad") || (val == "IITM99" && $scope.data.city != "Chennai") || (val == "IITD99" && $scope.data.city != "Delhi") || (val == "IITB99" && $scope.data.city != "Mumbai") || (val == "IITK99" && $scope.data.city != "Kanpur") || (val == "IIMC99" && $scope.data.city != "Kolkata") || (val == "IIMB99" && $scope.data.city != "Bengaluru") || (val == "IIMA99" && $scope.data.city != "Ahmedabad")){ | |
1096 | + $scope.tokencheck = false; | |
1097 | + return; | |
1098 | + } | |
1099 | + $http.get(BASE_URL + '/ambassadors?filter={"where": {"referalToken": "' + val + '"}}') | |
1100 | + .then(function(searchResult) { | |
1101 | + if (searchResult.data.length == 0) { | |
1102 | + $scope.tokencheck = false; | |
1103 | + $scope.discountAmount = 0; | |
1104 | + } else { | |
1105 | + $scope.discountpercentage = searchResult.data[0].discount; | |
1106 | + $scope.tokencheck = true; | |
1107 | + } | |
1108 | + },function(err){ | |
1109 | + console.log(err) | |
1110 | + }); | |
1111 | 1111 | |
1112 | -// } | |
1113 | -// }; | |
1114 | - | |
1115 | -// $scope.submit = function() { | |
1116 | -// // Analytics.trackEvent('register', 'click', 'Registration'); | |
1117 | -// $scope.loading = true; | |
1118 | -// $scope.data.uploadFile = $scope.base64textString; | |
1119 | -// $scope.infoForm = true; | |
1120 | -// $scope.ticketAmnt = 1180; | |
1121 | -// $scope.detail = {}; | |
1122 | -// $scope.data.phone = "+91"+$scope.data.number; | |
1123 | -// if($scope.data.referalToken == null){ | |
1124 | -// $scope.data.referalToken = "NA" | |
1125 | -// } | |
1126 | -// var file =document.getElementById('filePicker').files[0]; | |
1127 | -// var image = BASE_URL+'/containers/images/download/' | |
1128 | -// var imagePath = file.name; | |
1129 | -// $scope.data.uploadFile = image + imagePath; | |
1130 | -// var fd = new FormData() | |
1131 | -// fd.append('filePicker',file); | |
1132 | -// var deferred = $q.defer(); | |
1133 | -// $http({ | |
1134 | -// method:'POST', | |
1135 | -// url: BASE_URL+'/containers/images/upload', | |
1136 | -// data:fd, | |
1137 | -// transformRequest:angular.identity, | |
1138 | -// headers:{'Content-Type':undefined} | |
1139 | -// }) | |
1140 | -// .success(function(result){ | |
1141 | -// deferred.resolve(result); | |
1142 | -// $http({ | |
1143 | -// method: 'POST', | |
1144 | -// url: BASE_URL+'/applicants', | |
1145 | -// data: $scope.data, | |
1146 | -// headers: {} | |
1147 | -// }).then(function mySuccess(result) { | |
1148 | -// $scope.detail = result; | |
1149 | -// data.applicantId = result.data.id; | |
1150 | -// $scope.userId = result.data.id; | |
1151 | -// var amount = $scope.ticketAmnt * 100 | |
1152 | -// if($scope.tokencheck == true){ | |
1153 | -// var amount = $scope.ticketAmnt | |
1154 | -// console.log("resultcity===",$scope.data.city) | |
1155 | -// if($scope.discountpercentage == "100") { | |
1156 | -// $scope.discountpercentage = "99.9"; | |
1157 | -// } | |
1158 | -// $scope.percDiscount = $scope.discountpercentage/100; | |
1159 | -// $scope.discountAmount = amount * $scope.percDiscount; | |
1160 | -// } | |
1161 | -// var taxAmount = $scope.ticketAmnt - $scope.discountAmount | |
1162 | -// $scope.payingAmnt = taxAmount; | |
1163 | -// $scope.payingAmnt = $scope.payingAmnt.toFixed() | |
1164 | -// data.amount = $scope.payingAmnt; | |
1165 | -// if($scope.detail != null){ | |
1166 | -// $http({ | |
1167 | -// method: 'POST', | |
1168 | -// url: BASE_URL+'/payments', | |
1169 | -// data: data, | |
1170 | -// headers: {} | |
1171 | -// }).then(function mySuccess(paymentResult) { | |
1172 | -// $scope.loading = false; | |
1173 | -// $scope.paymentResult = paymentResult; | |
1174 | -// }, function myError(error) { | |
1175 | -// }); | |
1176 | -// } | |
1177 | - | |
1178 | -// }, function myError(error) { | |
1179 | - | |
1180 | -// }); | |
1181 | - | |
1182 | -// }) | |
1112 | + } | |
1113 | + }; | |
1114 | + | |
1115 | + $scope.submit = function() { | |
1116 | + // Analytics.trackEvent('register', 'click', 'Registration'); | |
1117 | + $scope.loading = true; | |
1118 | + $scope.data.uploadFile = $scope.base64textString; | |
1119 | + $scope.infoForm = true; | |
1120 | + $scope.ticketAmnt = 1180; | |
1121 | + $scope.detail = {}; | |
1122 | + $scope.data.phone = "+91"+$scope.data.number; | |
1123 | + if($scope.data.referalToken == null){ | |
1124 | + $scope.data.referalToken = "NA" | |
1125 | + } | |
1126 | + var file =document.getElementById('filePicker').files[0]; | |
1127 | + var image = BASE_URL+'/containers/images/download/' | |
1128 | + var imagePath = file.name; | |
1129 | + $scope.data.uploadFile = image + imagePath; | |
1130 | + var fd = new FormData() | |
1131 | + fd.append('filePicker',file); | |
1132 | + var deferred = $q.defer(); | |
1133 | + $http({ | |
1134 | + method:'POST', | |
1135 | + url: BASE_URL+'/containers/images/upload', | |
1136 | + data:fd, | |
1137 | + transformRequest:angular.identity, | |
1138 | + headers:{'Content-Type':undefined} | |
1139 | + }) | |
1140 | + .success(function(result){ | |
1141 | + deferred.resolve(result); | |
1142 | + $http({ | |
1143 | + method: 'POST', | |
1144 | + url: BASE_URL+'/applicants', | |
1145 | + data: $scope.data, | |
1146 | + headers: {} | |
1147 | + }).then(function mySuccess(result) { | |
1148 | + $scope.detail = result; | |
1149 | + data.applicantId = result.data.id; | |
1150 | + $scope.userId = result.data.id; | |
1151 | + var amount = $scope.ticketAmnt * 100 | |
1152 | + if($scope.tokencheck == true){ | |
1153 | + var amount = $scope.ticketAmnt | |
1154 | + console.log("resultcity===",$scope.data.city) | |
1155 | + if($scope.discountpercentage == "100") { | |
1156 | + $scope.discountpercentage = "99.9"; | |
1157 | + } | |
1158 | + $scope.percDiscount = $scope.discountpercentage/100; | |
1159 | + $scope.discountAmount = amount * $scope.percDiscount; | |
1160 | + } | |
1161 | + var taxAmount = $scope.ticketAmnt - $scope.discountAmount | |
1162 | + $scope.payingAmnt = taxAmount; | |
1163 | + $scope.payingAmnt = $scope.payingAmnt.toFixed() | |
1164 | + data.amount = $scope.payingAmnt; | |
1165 | + if($scope.detail != null){ | |
1166 | + $http({ | |
1167 | + method: 'POST', | |
1168 | + url: BASE_URL+'/payments', | |
1169 | + data: data, | |
1170 | + headers: {} | |
1171 | + }).then(function mySuccess(paymentResult) { | |
1172 | + $scope.loading = false; | |
1173 | + $scope.paymentResult = paymentResult; | |
1174 | + }, function myError(error) { | |
1175 | + }); | |
1176 | + } | |
1177 | + | |
1178 | + }, function myError(error) { | |
1179 | + | |
1180 | + }); | |
1181 | + | |
1182 | + }) | |
1183 | 1183 | |
1184 | -// } | |
1184 | + } | |
1185 | 1185 | |
1186 | -// }); | |
1186 | +}); | |
1187 | 1187 | |
1188 | 1188 | |
1189 | 1189 | scotchApp.controller('ambassadorController', function($scope, $http, $location, $route, BASE_URL) { | ... | ... |