forked from vivekpavaskar/odyssey2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg_codezilla.php
More file actions
94 lines (74 loc) · 2.36 KB
/
Copy pathreg_codezilla.php
File metadata and controls
94 lines (74 loc) · 2.36 KB
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
<?php
/**
* Created by PhpStorm.
* User: Vivek
* Date: 23-03-2018
* Time: 06:00 PM
*/
$name1 = $email1 = $mobile1 = $name2 = $email2 = $mobile2 = $college = "";
$event_id = "ODCS01-";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST['name1'])) {
$name1 = $_POST['name1'];
}
if (!empty($_POST['email1'])) {
$email1 = $_POST['email1'];
}
if (!empty($_POST['mobile1'])) {
$mobile1 = $_POST['mobile1'];
}
if (!empty($_POST['name2'])) {
$name2 = $_POST['name2'];
}
if (!empty($_POST['email2'])) {
$email2 = $_POST['email2'];
}
if (!empty($_POST['mobile2'])) {
$mobile2 = $_POST['mobile2'];
}
if (!empty($_POST['college'])) {
$college = $_POST['college'];
}
include 'connection.php';
if ($conn) {
$sql = "SELECT max(part_id) FROM codezilla";
$retval = mysqli_query($conn, $sql);
if(!$retval)
{
die('could not get data:'.mysqli_error());
}
while($row=mysqli_fetch_array($retval,MYSQLI_ASSOC))
{
$id=$row['max(part_id)'];
$id=$id+1;
}
$event_id=$event_id.$id;
$sql = "insert into codezilla values('$name1','$mobile1','$email1','$name2','$mobile2','$email2','$college','$id')";
if (mysqli_query($conn, $sql) == 1) {
//sending email
$email_body = "Thank you for registering in Codezilla.\nYour Participation ID is ".$event_id;
include 'email.php';
//sending sms
include('way2sms-api.php');
sendWay2SMS ( "8197508688","R3694K",$mobile1,$email_body);
sendWay2SMS ( "8197508688","R3694K",$mobile2,$email_body);
?>
<script language="javascript" type="text/javascript">
alert('Registered successfully.Your ID is <?php echo $event_id;?>');
window.location = "http://jainbgm.in/odyssey18";
</script>
<?php
} else {
?>
<script language="javascript" type="text/javascript">
alert('You have already registered to this event.');
window.location = "http://jainbgm.in/odyssey18";
</script>
<?php
}
} else {
echo "Connection Time Out, please try again.";
}
$conn->close();
}
?>