Skip to content

Commit 9071b8f

Browse files
committed
Add files for mailing module; Change db; Add AWS Workshop files
1 parent 6d22573 commit 9071b8f

File tree

7 files changed

+90
-57
lines changed

7 files changed

+90
-57
lines changed

aws/css/index-css.css

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
body, html{
22
background-color: black;
33
font-family: "Share Tech Mono", monospace;
4-
color: #04bf00;
54
padding: 0;
65
margin: 0;
76
}
@@ -36,7 +35,7 @@ body{
3635
text-align: center;
3736
border: 1px dashed #29B6F6;
3837
padding: 1% 0%;
39-
font-size: 120%;
38+
font-size: 115%;
4039
font-family: "Share Tech Mono", monospace;
4140
cursor: pointer;
4241
}
@@ -50,29 +49,15 @@ body{
5049
width: 25%;
5150
}
5251

53-
.orange {
54-
color: #fa5c18;
55-
border: 1px dashed #fa5c18;
56-
}
57-
58-
.lilac {
59-
color: #edd5cd
60-
border: 1px dashed #edd5cd;
61-
}
62-
63-
.yellow {
64-
color: yellow !important;
65-
border: 1px dashed yellow !important;
66-
}
67-
68-
.light-red {
69-
color: #d97b7a;
70-
border: 1px dashed #d97b7a;
52+
.formText{
53+
font-size: 110%;
54+
width: 100%;
55+
text-align: center;
56+
color: yellow;
57+
margin-top: 5%;
7158
}
72-
73-
.cyan {
74-
color: #7189bf;
75-
border: 1px dashed #7189bf;
59+
.top1{
60+
margin-top: 1%;
7661
}
7762

7863
.below{

aws/index.php renamed to aws/index.html

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
<?php
2-
session_start();
3-
if(!isset($_SESSION['mobile'])) {
4-
header('Location: ../login/');
5-
}
6-
?>
71
<html>
82
<head>
9-
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
10-
<title>Interrupt '18 | AWS</title>
3+
<title>Interrupt '18 | AWS Workshop Registration</title>
114
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
125
<link href="css/index-css.css" rel="stylesheet">
136
<link rel="icon" href="../img/favicon.jpeg">
@@ -24,31 +17,24 @@
2417
<body>
2518

2619
<pre><span id="title">
27-
_____ _ _ _ _
28-
| __ \ (_) | | | | (_)
29-
| |__) |___ __ _ _ ___| |_ _ __ __ _| |_ _ ___ _ __
30-
| _ // _ \/ _` | / __| __| '__/ _` | __| |/ _ \| '_ \
31-
| | \ \ __/ (_| | \__ \ |_| | | (_| | |_| | (_) | | | |
32-
|_| \_\___|\__, |_|___/\__|_| \__,_|\__|_|\___/|_| |_|
33-
__/ |
34-
|___/
20+
__ _______
21+
/\ \ / / ____|
22+
/ \ \ /\ / / (___
23+
/ /\ \ \/ \/ / \___ \
24+
/ ____ \ /\ / ____) |
25+
/_/ \_\/ \/ |_____/
3526
</span></pre>
3627

37-
<span id="changeHere">
38-
28+
<span>
29+
3930
<form id='register-form' method="post" action="signup.php">
4031
<input type='text' name='nameInput' id="account-name" required class='home-links form-input' placeholder='Name'>
4132
<input type='tel' name='numberInput' required class='home-links form-input' id='account-number' placeholder='Number' maxlength="10" minlength="10">
4233
<input type='text' name='collegeInput' class='home-links form-input long' id="account-college" placeholder='College Name'><br>
4334
<input type='email' name='emailInput' required class='home-links form-input' id='account-email' placeholder='Email'><br>
4435

45-
<button type='button' class='home-links submit-butt' id='create-account'>Create Account!</button>
36+
<button type='submit' class='home-links submit-butt' id='create-account'>Register for Workshop!</button>
4637
<a href="http://www.interrupt2k18.in/cmd" class="home-links top-links">Go Back To Command Prompt &crarr;</span></a> <!-- The buttons on the home page. -->
47-
48-
<br>
49-
<p>RULES:</p>
50-
<P>* Only the first 50 registered participants are allowed to take part in the workshop.</p>
51-
<p>* A registration fee of Rs.100 should be paid while attending the workshop.</p>
5238
</form>
5339

5440
</span>

aws/signup.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// echo "<script>alert('Thank you for signing up!');</script>";
33

44
$dbservername="localhost";
5-
$dbusername= "root";
5+
$dbusername= "arjun1001";
66
$dbpassword="";
77
$dbname="INTERRUPT";
88

@@ -18,12 +18,11 @@
1818
$email=$_POST['emailInput'];
1919
$mobile=$_POST['numberInput'];
2020

21-
22-
$sql="INSERT INTO aws VALUES ('$mobile','$college','$name','$email');";
21+
$sql="INSERT INTO aws_workshop VALUES (SNO, '$mobile','$name','$college','$email', 0);";
2322

2423
if(mysqli_query($connect, $sql)){
25-
echo "<script>alert('Thank you for signing up!');</script>";
26-
echo "<script>window.location.href='../cmd';</script>";
24+
echo "<script>alert('Thank you for signing up for this workshop! An email regarding the details will be sent to you shortly!');</script>";
25+
echo "<script>window.location.href='../';</script>";
2726
}
2827

2928

aws/uniqueNumber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22
//This PHP file checks if a given number exists in the table or not
33
$dbservername="localhost";
4-
$dbusername= "root";
4+
$dbusername= "arjun1001";
55
$dbpassword="";
66
$dbname="INTERRUPT";
77

88
$number= $_REQUEST['number'];
9-
$sql_stmt="SELECT mobileNo FROM users WHERE mobileNo='$number';";
9+
$sql_stmt="SELECT mobileNo FROM aws_workshop WHERE mobileNo='$number';";
1010

1111
try{
1212
$conn=new PDO("mysql:host=$dbservername;dbname=$dbname",$dbusername,$dbpassword);

register/signup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$mobile=$_POST['numberInput'];
3535

3636

37-
$sql="INSERT INTO users VALUES ('$mobile', '$hashed_password','$college','$name','$email', 0, 0, 0);";
37+
$sql="INSERT INTO users VALUES ('$mobile', '$hashed_password','$college','$name','$email', 0, 0, 0, 0);";
3838
$sql2="INSERT INTO events VALUES ('$mobile',$event1,$event2,$event3,$event4,$event5,$event6,$event7,$event8,$event9,$event10,$event11,$event12); INSERT INTO challenge VALUES ('$mobile',0,'2000-01-01 12:00:00','2000-01-01 12:00:00',0);";
3939

4040
if(mysqli_multi_query($connect, $sql)){

utilities/mailing/eventMails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def doQuery( conn ) :
4848
msg['To'] = email_send
4949
msg['Subject'] = subject
5050

51-
body = "Hey "+nameArray[i]+",\nAs you might know, Interrupt 2k18 has two online events taking place this year! 'Pipe The Piper', which is an online coding event hosted on HackerRank, and 'Interrupt Challenge', an online puzzle-solving contest and our signature event! Also, to note, winners of these events MUST be present in college on the day of Interrupt to receive their prizes and must bring ID proof along with them. Students participating in these events must currently be in college.\n\nIf you'd like to participate in these events, click the links below.\n\nInterrupt Challenge - http://interrupt2k18.in/InterruptChallenge/\nPipe The Piper - http://www.hackerrank.com/pipe-the-piper-mock\n\nHope you have fun,\nTeam Interrupt '18."
51+
body = "Hey "+nameArray[i]+",\nAs you might know, Interrupt 2k18 has two online events taking place this year! 'Pipe The Piper', which is an online coding event hosted on HackerRank (On September 26th and 27th, 2018), and 'Interrupt Challenge', an online puzzle-solving contest and our signature event! Also, to note, winners of these events MUST be present in college on the day of Interrupt to receive their prizes and must bring ID proof along with them. Students participating in these events must currently be in college.\n\nIf you'd like to participate in these events, click the links below.\n\nInterrupt Challenge - http://interrupt2k18.in/InterruptChallenge/\nPipe The Piper - https://www.hackerearth.com/challenge/college/pipe-the-piper-day1/\n\nHope you have fun,\nTeam Interrupt '18."
5252
msg.attach(MIMEText(body,'plain'))
5353
text = msg.as_string()
5454
server = smtplib.SMTP('smtp.gmail.com',587)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/python
2+
3+
hostname = 'localhost'
4+
username = 'arjun1001'
5+
password = ''
6+
database = 'INTERRUPT'
7+
8+
# List variables for storing all the values retrieved from the database
9+
10+
nameArray=[]
11+
emailArray=[]
12+
13+
# Simple routine to run a query on a database and print the results:
14+
def doQuery( conn ) :
15+
cur = conn.cursor()
16+
17+
cur.execute( "SELECT name, email from users where sentWorkshopRegistration=0;" )
18+
19+
for name, email in cur.fetchall() :
20+
nameArray.append(name)
21+
emailArray.append(email)
22+
23+
24+
import MySQLdb
25+
myConnection = MySQLdb.connect( host=hostname, user=username, passwd=password, db=database )
26+
doQuery( myConnection )
27+
myConnection.close()
28+
29+
import smtplib
30+
31+
from email import encoders
32+
from email.mime.base import MIMEBase
33+
from email.mime.multipart import MIMEMultipart
34+
from email.mime.text import MIMEText
35+
36+
email_user = '[email protected]'
37+
email_password = ''
38+
39+
iterationLength=len(emailArray)
40+
41+
for i in range(0,iterationLength):
42+
43+
email_send = emailArray[i]
44+
subject = 'Pipe The Piper - Second Chance'
45+
46+
msg = MIMEMultipart()
47+
msg['From'] = email_user
48+
msg['To'] = email_send
49+
msg['Subject'] = subject
50+
51+
body = "Hey "+nameArray[i]+",\nWe are pleased to announce that the registrations for the AWS Workshop are now officially open! You can now register to include your name in the list for the workshop. However, we do have a few guidelines that are to be noted for this event.\n\n1. Only those who have registered for Interrupt 2k18 will be able to register for this workshop.\n2. Only the first 50 registrations will be entertained for the workshop, so hurry!\n3. Participants who have been selected for the workshop will need to pay a registration fee of Rs. 100/- for the workshop on the day of Interrupt (September 29th). Alternatively, they can pay the fees online through Google Pay (Tez) to 7708026256.\n4. Those who have been selected for the workshop will be intimated with an email in a few days time.\n5. The workshop will be conducted throughout the day on 29th, so participants will not be able to take part in other events.\n6. Participants must bring their own laptop and should have a pre-existing Amazon AWS account.\n\nLink: www.interrupt2k18.in/aws/\n\nThanks and Regards,\nTeam Interrupt '18."
52+
53+
msg.attach(MIMEText(body,'plain'))
54+
55+
text = msg.as_string()
56+
server = smtplib.SMTP('smtp.gmail.com',587)
57+
server.starttls()
58+
server.login(email_user,email_password)
59+
60+
server.sendmail(email_user,email_send,text)
61+
server.quit()
62+
63+
# The code ends here.

0 commit comments

Comments
 (0)