-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathnewsponsor.php
85 lines (72 loc) · 3.12 KB
/
newsponsor.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
<?php
require_once "classControllers/init.php";
$sponsor = new sponsors;
if (isset($_POST["sponsor-btn"])) {
$err = '';
$sponsor->sponsor_name = $_POST["sponsor_name"];
$sponsor->sponsor_email = $_POST["sponsor_email"];
$sponsor->business_address = $_POST["business_address"];
$sponsor->about_you = $_POST["about_you"];
$image = $_FILES['file']['name'];
$target_file = '../uploads/sponsor-img/' . $image;
$count = $sponsor->emailExists();
if($count === 0){
if (empty($error)) {
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
$resp = $sponsor->addSponsors($target_file);
$sponsor_mess = '<p style="text-align:center;">Registration Succesful. You will here from us soon thank you!</a>';
}
} else {
$err = "Upload not successful";
}
}else{
$err = "Email already exist";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>New Sponsor</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<link rel="stylesheet" href="css/newsponsor.css">
<link rel="stylesheet" type="text/css" href="css/header-footer.css">
<link rel="icon" type="img/png" href="images/hng-favicon.png">
</head>
<body>
<?php include('fragments/site_header.php'); ?>
<section class="container-fluid">
<div class="wrap">
<div class="header">
<h1>Sponsor Registration</h1>
<p> Fill the form below to become a sponsor</p>
</div>
<form class="inputs-wrap" method="post" enctype="multipart/form-data">
<div id="contact-message">
<?php
if (!empty($sponsor_mess)) {
echo "<center><h6 class='text-success text-center success' style='background: #D3ECDB; color: #2B5036; padding: 10px;'>" . $sponsor_mess . "</h6></center>";
}
if (!empty($err)) {
echo "<h6 class='text-danger text-center'>" . $err . "</h6>";
}
?>
</div>
<label for="sponsor_logo">Upload Your logo</label>
<input type="file" placeholder="Sponsor Logo" name="file" required>
<input type="text" placeholder="Name" name="sponsor_name" required>
<input type="email" placeholder="Email" name="sponsor_email" required>
<input type="text" placeholder="Business Address" name="business_address" required>
<textarea id="" placeholder="Tell us about youself" cols="" rows="10" name="about_you" required></textarea>
<input type="submit" id="submit" value="REGISTER" name="sponsor-btn">
</form>
</div>
</section>
<?php include "fragments/site_footer.php"; ?>
</body>
</html>