-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.php
128 lines (104 loc) · 3.86 KB
/
database.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Wall-Off::Official Site </title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/custom.css">
</head>
<body>
<div id="wrap">
<nav>
<ul id="dropdown-content">
<a href="index.html"><li> Home </li></a>
<a href="join.php"><li>Join</li></a>
<a href="map.php"><li>Map</li></a>
<a href="upload.php"><li>Upload</li></a>
<a href="gallery.php"><li>Gallery</li></a>
<a href="donate.php"><li> Donate</li></a>
<a href="signin.php"><li>Sign In</li></a>
</ul>
<table width="100%"><tr><td align="center">
<h1>WALL-OFF</h1>
<h3>"Discover Public Art"</h3></td>
<td valign="top" align="right"><img src="image/mobilemenu.png" id="dropbtn"></td></tr>
</table>
</nav>
<div>
<?php
try{
$db = new PDO("mysql:host=localhost;dbname=og_WO;port=8889","root","root");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("SET NAMES 'utf8'");
echo "<br/>";
echo "<br/>";
echo "<br/>";
echo "<h1>Thank you for your support!</h1>";
$userFN = $_POST['firstname'];
$userLN = $_POST['lastname'];
$userEM = $_POST['email'];
$userAdd = $_POST['street'];
$userCity = $_POST['city'];
$userState = $_POST['state'];
$userZip = $_POST['zip'];
$userAge = $_POST['age'];
$userJob = $_POST['occu1'];
$userSM = $_POST['SM'];
$donateAmt = $_POST['amount'];
$ccType = $_POST['cc1'];
$cc = $_POST['cc'];
$artist = $_POST['artistname'];
$mural = $_POST['muralname'];
$vmural = $_POST['visible'];
$land = $_POST['landmark'];
$muralAdd = $_POST['streetM'];
$muralCity = $_POST['cityM'];
$muralState = $_POST['stateM'];
$muralZip = $_POST['zipM'];
$country = $_POST['countryM'];
$imagePath = $_POST['filename'];
$muraldescript= implode( $_POST['script'] );
$dataSource = $_POST['dataSource'];
switch( $dataSource ){
case "join":
case "donate":
$ins1 = "INSERT INTO Donate (donateAmt, cc) VALUES ('$donateAmt', '$cc')";
$rec1 = $db->query($ins1);
$ins2 = "INSERT INTO Member (fname, lname, email, address, city, state, zip, occupation, socialMedia) VALUES ('$userFN','$userLN','$userEM','$userAdd','$userCity','$userState','$userZip','$userJob','$userSM')";
$rec2 = $db->query($ins2);
break;
case "upload":
//Step 1 save file in upload folder
//include_once("obj/fileup.php");
//echo ":)";
$ins3 = "INSERT INTO Mural (name, script, landmark, artist, address, city, state, zip, country, visible) VALUES ('$mural','$muraldescript','$land','$artist', '$muralAdd','$muralCity','$muralState', '$muralZip', '$country', '$vmural')";
//echo ($ins3);
$rec3 = $db->query($ins3);
case "pic":
//include_once("upload/testUpload.php");
// $ins4 = "INSERT INTO Mural (imagePath) VALUES ('$imagePath')";
// echo ($ins4);
break;
}
}catch (Exception $e){
echo ($e);
echo "BUSTED";
exit;
}
?>
</div>
<footer id="contact">
Contact us via email <a href="mailto:[email protected]">info@Wall_Off</a>
All rights reserved by Wall-Off NYC © Copyright
</footer>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/custom.js"></script>
<script src="js/val.js"></script>
</body>
</html>