-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathcertificate_upload.php
142 lines (114 loc) · 4.16 KB
/
certificate_upload.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
require_once "classControllers/init.php";
$admin = new Admins();
$sponsors = new Certificate;
$data = $sponsors->getAllProcessindRequest();
$status = $sponsors->processing();
if (!isset($_SESSION["role"])) {
header('Location:login.php');
}
if (isset($_GET['fileId'])) {
if (isset($_POST['uploadfile'])) {
$id = $_GET['fileId'];
$image = $_FILES['file']['name'];
$target_file = '../uploads/sponsor-img/' . $image;
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
$insert = $database->query("UPDATE certificate_request SET file = '$target_file' WHERE id = '$id' ");
$_SESSION['file'] = "<h6 style='color: green'>File was uploaded</h6>";
header('location: processing_request.php');
}
}
}
?>
<!DOCTYPE html>
<html>
<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 Admin</title>
<link rel="icon" type="img/png" href="images/hng-favicon.png">
<link rel="stylesheet" href="css/dashboard.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<style type="text/css">
.card {
height: 150px;
background: #ccc;
margin: 15px;
padding: 10px;
border-radius: 15px;
}
</style>
</head>
<body>
<main>
<section id="overview-section">
<!-- <h1>Dashboard</h1> -->
<br><br>
<h2>Upload Certificate </h2>
<!-- <section id="intern-section">
Populated by `js/dashboard.js`
</section> -->
<div class="container">
<div class="row">
<div class="col-md-6">
<form method="post" enctype="multipart/form-data">
<?php
if (isset($resp)) {
echo $resp;
}
if (!empty($errors)) {
foreach ($errors as $error) {
echo "<p class='text-danger'>$error</p>";
}
}
?>
<div class="form-group">
<input type="file" class="" name="file" id="lastname">
</div>
<button type="submit" class="btn btn-primary" name="uploadfile">Upload certificate</button>
<a href="processing_request" class="btn mb-4" style="background: gray; color:#fff;">cancel</a>
</form>
</div>
</div>
</div>
<!-- <button id="export">Export to Spreadsheet</button> -->
</section>
<!-- <section id="details-section">
<div id="details-back">
<div>
<a href="overview.html" id="newitem-go-back" title="Go back">
<div></div>
</a>
</div>
</div>
<h2>Intern application details</h2>
<em id="no-intern">No intern selected</em>
<br />
<p>Name: <span id="details-name"></span></p>
<p>Email: <span id="details-email"></span></p>
<p>Age: <span id="details-age"></span></p>
<p>Phone Number: <span id="details-number"></span></p>
<p>Track of interest: <span id="details-track"></span></p>
<p>CV link: <span id="details-CV-link"></span></p>
<p>State of residence: <span id="details-state-of-residence"></span></p>
<div href="" id="details-return">Back to Overview</div>
</section> -->
</main>
<input type="checkbox" id="mobile-bars-check" />
<label for="mobile-bars-check" id="mobile-bars">
<div class="stix" id="stik1"></div>
<div class="stix" id="stik2"></div>
<div class="stix" id="stik3"></div>
</label>
<?php include('fragments/sidebar.php'); ?>
</body>
</html>
<script type="text/javascript" src="js/dashboard.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script>