-
Notifications
You must be signed in to change notification settings - Fork 1
/
myindex.html
218 lines (202 loc) · 6.69 KB
/
myindex.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>click demo</title>
<style>
p {
color: #3d4246;
margin: 12px;
cursor: pointer;
font-size: 24px;
}
#mar { margin: 12px; }
#os-identifier {
padding: 10px;
border-radius: 10px 10px 10px 10px;
font-size: 20px;
border: 1px solid #949494;
background-color: #fff;}
#button_1 { text-align: center;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 15px;
padding: 14px;
background-color: #557b97;
color: #fff;
font-family: "Work Sans",sans-serif;
font-style: normal;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: normal;
font-size: 16px;
}
/* Style the header */
header {
background-color: #666;
padding: 30px;
text-align: center;
font-size: 35px;
color: white;
}
/* Style the footer */
footer {
background-color: #777;
padding: 20px;
text-align: center;
color: white;
}
#article {
padding: 20px;
/*width: 100%;*/
/*background-color: #f1f1f1;*/
/*height: 500px;*/
text-align: center;
}
#suc { display:none}
#error {display: none}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
<!--<script src="https://code.jquery.com/jquery-1.10.2.js"></script>-->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>-->
</head>
<body background="https://s3.ap-south-1.amazonaws.com/www.awesome.checkout.com/background.jpg">
<header>DevCon - Placing Order</header>
<div align="center">
<marquee behavior="alternate" bgcolor="#4286f4" direction="left" height="50px" scrollamount="1" scrolldelay="2" width="100%">
<span style="font-size: 25px;color:#FFFFFF; padding:30px">
DISKHA!! Offers teachers, students and parents engaging learning material.</span></marquee>
</div>
<div id="article">
<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
<div class="section-header text-center">
<h1>Dear Teachers, DIKSHA offers 10% discount to you on books. Grab it now!</h1>
</div>
<!--<p>You are checking out....</p>-->
<p>Please provide your DIKSHA identifier to claim offer</p>
<div id="mar">
<input type="text" id="os-identifier" placeholder="please add your identifier">
<button id="button_1" value="val_1" name="but1">Next ></button>
</div>
<div id="confirmBox"></div>
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<p>Congrats! You are a teacher... </p>
<div>Do you want to place your order with us?</div>
<!--<div><button>Allow</button> <button>Disallow</button></div>-->
</div>
</div>
<div id="suc">
<p>Congrats! Your order is placed with us!!</p>
</div>
<div id="error">
<p>Sorry, your order could not be placed </p>
</div>
</div>
</div>
</div>
</div>
<!--<footer>dev-con 2019</footer>-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
//var model = document.getElementById('').value;
$("#button_1").click(function () {
//var jsonObjects = '{"id": "open-saber.registry.read","ver": "1.0","ets": "11234","params": {"did": "","key": "","msgid": ""},"request": {"osid": "d3ec7dc7-74b6-41c2-a6f6-7ed6fa60e3da"}}';
//alert(JSON.stringify(jsonObjects));
var osid = document.getElementById('os-identifier').value;
var URL= 'http://52.172.187.3:8080/read-dev/'+osid;
var pref = osid.substr(0, 3);
console.log('pref '+pref);
if(pref == 'VIS'){
URL = 'http://104.211.78.0:8080/read-dev/'+osid;
}
console.log("starting ajax");
$.ajax({
url: URL,
type: "GET",
success: function (res) {
console.log(res);
if(res.result){ // unsuceesful result
var json = res.result;
$.each(json,function(key,value){
console.log("key = "+ key);
var name = '';
if(res.result.Teacher){console.log(res.result.Teacher.name);name= res.result.Teacher.name; myFunction(key,name);}
else{
console.log('not teacher '+key);
if ( key == undefined ) {
alert('Wrong identifier: please enter a correct identifier');
} else {
myFunction(key,'');
}
}
});
} else {
alert('Wrong identifier: please enter a correct identifier');
}
},
failure: function (res) { console.log(res); alert('failure'); },
error: function (res) {
alert('Wrong identifier: please enter a correct identifier');
console.log("finished invoking jax");
}
});
});
function myFunction(key, name) {
if(name == ''){
alert('Oops! You are a '+key+'.');
}else{
var retVal = confirm("Congratulations "+ name +", you are validated as "+ key+"... Do you want to avail any offers with DIKSHA?");
if( retVal == true ) {
window.location.href = "https://devcon-os-store.myshopify.com/pages/devcon-checkout";
return true;
} else {
window.location.href = "https://devcon-os-store.myshopify.com/pages/devcon-abort";
return false;
}
}
}
</script>
</body>
</html>