/
record_DO.php
99 lines (88 loc) · 2.88 KB
/
record_DO.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
<?php include "utils/config.php";
//File: record_DO.php
//Authors: Gordon Doore, Parth Parth
//Last modified: 07/24/2023
//Purpose: Record DairyOne PDF file to operational drive
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
$_SESSION['session_name'] = session_name();
$error = "";
$metaSubmitted = false;
$user_id = $_SESSION['user_id'];
$U_Id = substr($user_id, 2);
$sql = "SELECT * FROM C3SignUp WHERE U_Id = ?";
$stmt = $conn->prepare($sql);
$stmt->execute([$U_Id]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
if ($user) {
$email = $user['Email'];
$_SESSION['email'] = $email;
$last_name = $user['LastName'];
$first_name = $user['FirstName'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cross-Origin-Opener-Policy" content="unsafe-none">
<meta http-equiv="Cross-Origin-Embedder-Policy" content="unsafe-none">
<title>C3 | Submit</title>
<link rel="stylesheet" href="utils/css/dashboard-common.css">
<link rel="stylesheet" href="utils/css/record_DO.css">
</head>
<body>
<?php if (!empty($error)): ?>
<div class="error-div">
<p id="error-message">
<?php echo $error; ?>
</p>
</div>
<?php endif; ?>
<div class="wrapper-background">
<p> </p>
</div>
<div class="wrapper">
<?php include "navbar.php"; ?>
<?php include "loader.php"; ?>
<div class="content-wrapper">
<div class="content">
<h1>Record DairyOne PDF</h1>
<div class="dataset-submission">
<div class="enter-data">
<div class="dataset-submission">
<div class="upload-file">
<p>Please attach your DairyOne PDF here to submit it to the database. The metadata will be recorded from
the file.</p>
<form id="upload_form" enctype="multipart/form-data">
<input type="file" id="file_input" name="file_input">
<div>
<label>
<input type="radio" name="folder_selection" value="analysis" checked> Analysis
</label>
</div>
<div>
<label>
<input type="radio" name="folder_selection" value="macro"> Macro
</label>
</div>
<div>
<label>
<input type="radio" name="folder_selection" value="fatty_acids"> Fatty Acids
</label>
</div>
<input type="button" name = 'file_attach' value="Upload" onclick="handleFileUpload()">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="utils/js/submit.js"></script>
</body>
</html>