forked from JituR101/consortium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayazure.php
More file actions
191 lines (159 loc) · 7.84 KB
/
Copy pathpayazure.php
File metadata and controls
191 lines (159 loc) · 7.84 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
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
<?php
session_start();
$db_host = "localhost:3306";
$db_username = "conso19";
$db_pass = "Conso@123";
$db_name = "conso19";
$con = mysqli_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
mysqli_select_db($con,$db_name) or die ("no database");
if($_SERVER['REQUEST_METHOD'] === 'POST'){
$email = $con->real_escape_string($_POST['email']);
$txnid = $con->real_escape_string($_POST['txnid']);
if($email=="" || $txnid==""){
$msg = "Something went wrong. <a href='expo.php' style='color:#eee;'>Try Again</a>";
}
else{
$query = "UPDATE Azure SET paid = 1 WHERE email='$email'";
$result = mysqli_query($con,$query);
$num = mysqli_affected_rows($con);
if($num > 0){
$donemsg = "Congratulations! You are now a part of Central India’s Biggest Entrepreneurship Summit.<br>Your transaction ID: <b>".$txnid ."</b>";
$to = $email;
$subject = "Welcome To The Azure Space | Consortium'20";
$html = '
<!DOCTYPE html>
<html>
<head>
<style>
li{
padding:10px;
}
p{
font-size:16px;
}
*{
font-family:Helvetica,Arial,sans-serif;
}
h2{
text-align: center;
margin-top: 150px;
}
html, body{
background-color:#f7f9fb;
margin: 0;
}
.context {
font-size: 12px;
padding: 40px 60px;
margin-left:10%;
margin-right: 10%;
}
.context p{
font-size: 12px;
}
p{
margin: 15px 0px;
}
</style>
</head>
<body>
<div style="background: #0b0b0b; padding:10px 30px;"><img src="https://www.ecellvnit.org/img/logo-ecell.png"></div>
<h2 style="font-size:22px;">Welcome to Azure Space</h2><br>
<div class="context">
<h3><b>Hello,</b></h3>
<p>Congratulations! You are now a part of Central India’s Biggest Entrepreneurship Summit.</p>
<div>
<p>We hope this mail finds you in the best of your health and cheerful spirits. We are well pleased to have you on board for this event.</p>
<p> Your Transaction ID: <b>'.$txnid.'</b><br>
Registration Fee: 500 INR
</p>
<p>
To keep you updated, all the relevant details will be emailed to you.<br>
<br>
</p>
<p>For queries and in case of any difficulty, feel free to contact us.</p>
<p>
With warm regards,<br>
Anushree Rungta<br>
Core-Coordinator, Ecell VNIT
</p>
</div>
</div>
</body>
</html>
';
$url = 'https://startupconclave.ecellvnit.org/send';
$data = array('subject' => $subject, 'email' => $to, 'html' => $html, 'pass' => 'intheend');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
}
else{
$msg = "You're not registered with us. Kindly first register <a href='expo.php'> here</a>. Or your have entered wrong email address while payment. Kindly Contact Us";
}
}
}
?>
<!DOCTYPE html>
<html>
<?php $pagetitle = 'Azure Zone | Consortium'; ?>
<?php include('includes/head.php'); ?>
<body class="back">
<?php include('includes/header.php'); ?>
<div id="register">
<div class="g-container--sm g-padding-y-80--xs g-padding-y-125--sm">
<div class="g-text-center--xs g-margin-b-60--xs">
<p class="text-uppercase g-font-size-14--xs g-font-weight--700 g-color--white-opacity g-letter-spacing--2 g-margin-b-25--xs">Sign Up</p>
<h2 class="g-font-size-32--xs g-font-size-36--md g-color--white">
Pay Now
</h2>
<p id="message" class="text-uppercase g-font-size-14--xs g-font-weight--700 g-color--red g-letter-spacing--2 g-margin-b-25--xs"><?php echo $msg; ?></p>
<p class="text-uppercase g-font-size-16--xs g-font-weight--700 g-letter-spacing--2 g-margin-b-25--xs"><?php echo $donemsg; ?></p>
<div class="col-md-8 col-md-offset-2" style="text-align: center;">
<p class="g-color--white-opacity g-font-size-16--sm">
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST'){
$query = "SELECT * FROM Azure WHERE Email = '$_SESSION[email]' ";
$result = mysqli_query($con,$query);
$data = mysqli_fetch_assoc($result);
$flag = 0;
if($data['paid'] == 1){
$flag = 1;
echo 'Your are already registered.';
}
else{
echo 'Grab this golden opportunity to know how the tech game has changed!';
}
}
?>
<br><br>Registration Fee: <b>500 INR</b>
</p>
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST' && $flag ==0){
echo '<p class="g-color--white-opacity g-font-size-12--sm">
*Note: Kindly only use your consoID i.e. your registered email address while payment.
</p>
<div class="wow fadeInLeft" data-wow-duration=".3" data-wow-delay=".5s">
<a id="reg_button" href="https://www.payumoney.com/paybypayumoney/#/39EF7CBDB91213090ABBB7DCFAE46DAE" title="Register">
<!--<i class="s-icon s-icon--lg s-icon--white-bg g-radius--circle ti-arrow-down"></i>-->
<span class="text-uppercase s-btn s-btn--xs s-btn--white-brd g-radius--50">Pay Now!</span>
</a>
</div>';
}
?>
</div>
</div>
</div>
</div>
<?php include("includes/footer_landing.php");?>
<?php include("includes/script.php");?>
</body>
</html>