This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
212 lines (196 loc) · 8.42 KB
/
index.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Latest compiled and minified CSS -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>Online Registration</title>
<style>
h1, h4, h5 {
text-align: center;
}
</style>
</head>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>
Online Event Registration <small>CVR CSI Student Branch</small>
</h1>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<?php
$fp = fopen("eventdata.txt", "r");
echo '<h5><span class="label label-default">Event Title</span></h5>';
$string = fgets($fp);
echo "<h4>".$string."</h4>";
$string = fgets($fp);
if($string != NULL && $string != "" && $string != "\n") {
echo '<h5><span class="label label-default">Event Description</span></h5>';
echo "<h4>".$string."</h4>";
}
$string = fgets($fp);
if($string != NULL && $string != "" && $string != "\n") {
echo '<h5><span class="label label-default">Speaker</span></h5>';
echo "<h4>".$string."</h4>";
}
$string = fgets($fp);
if($string != NULL && $string != "" && $string != "\n") {
echo '<h5><span class="label label-default">Speaker Profile</span></h5>';
echo "<h4><a href='".$string."'>".$string."</a></h4>";
}
$string = fgets($fp);
if($string != NULL && $string != "" && $string != "\n") {
echo '<h5><span class="label label-default">Venue</span></h5>';
echo "<h4>".$string."</h4>";
}
$string = fgets($fp);
echo '<h5><span class="label label-default">Date & Time</span></h5>';
echo "<h4>".$string."</h4>";
$string = fgets($fp);
fclose($fp);
?>
</div>
<div class="col-md-6">
<form class="form-horizontal" name = "register" action = "submit.php" method = "post" onsubmit = "return validateForm()">
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="name">Name</label>
<div class="col-md-4">
<input id="name" name="name" type="text" placeholder="Abdul Kalam" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="email">Email address</label>
<div class="col-md-4">
<input id="email" name="email" type="email" placeholder="[email protected]" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="contact">Contact Number</label>
<div class="col-md-4">
<input id="contact" name="contact" type="text" placeholder="9999999999" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group" <?php if($string == "local\n") echo "hidden";?>>
<label class="col-md-4 control-label" for="contact">Institution</label>
<div class="col-md-4">
<input id="institution" name="institution" type="text" placeholder="CVR College of Engineering" value = "CVR College of Engineering" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="roll">Roll Number / Faculty ID</label>
<div class="col-md-4">
<input id="roll" name="roll" type="text" placeholder="13B81A0501" class="form-control input-md" required="">
<span class="help-block">Enter NA if not applicable</span>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="dept">Department</label>
<div class="col-md-4">
<select id="dept" name="dept" class="form-control">
<option value="CSE">CSE</option>
<option value="IT">IT</option>
<option value="Other">Other</option>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="dept-other">if Other, please specify department</label>
<div class="col-md-4">
<input id="dept-other" name="dept-other" type="text" placeholder="ECE, EIE, etc" class="form-control input-md">
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="submit"></label>
<div class="col-md-4">
<input id="submit" name="submit" class="btn btn-default" type = "submit" value = "Submit">
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
<script>
function validateEmail(email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
return re.test(email);
}
function validateForm() {
var name = document.forms["register"]["name"].value;
if (name == null || name == "") {
alert("Name must be filled out");
return false;
}
var email = document.forms["register"]["email"].value;
if (email == null || email == "") {
alert("Email must be filled out");
return false;
}
if(!validateEmail(email)) {
alert("Enter a valid email");
return false;
}
var roll = document.forms["register"]["roll"].value;
if (roll == null || roll == "") {
alert("Roll Number is mandatory, Enter NA if not applicable");
return false;
}
var contact = document.forms["register"]["contact"].value;
contact = contact.replace(/[^\d]/g, '');
if (contact.length < 8 || contact.length > 10) {
alert("Contact number must be valid");
return false;
}
var college = document.forms["register"]["institution"].value;
if (college == null || college == "") {
alert("Contact number must be filled out");
return false;
}
var dept = document.forms["register"]["dept"].value;
var deptOther = document.forms["register"]["dept-other"].value;
if (dept == "Other" && (deptOther == "" || deptOther == NULL)) {
alert("Please mention your branch");
return false;
}
}
</script>
</body>
</html>