10 |
randell |
1 |
<?php
|
|
|
2 |
$config = json_decode(file_get_contents('config.json'), true);
|
|
|
3 |
// if we have success in the query string, display a success message
|
|
|
4 |
if (isset($_GET['success']) && $_GET['success'] == 1) {
|
|
|
5 |
// Create a variable to hold the success message
|
|
|
6 |
$success_message = "Your workstation request has been submitted successfully.";
|
|
|
7 |
}
|
|
|
8 |
else {
|
|
|
9 |
// If no success, set the message to an empty string
|
|
|
10 |
$success_message = "";
|
|
|
11 |
}
|
|
|
12 |
// if there is an error in the query string, display an error message
|
|
|
13 |
if (isset($_GET['error'])) {
|
|
|
14 |
$error_message = "There was an error submitting your request. Please try again.";
|
|
|
15 |
} else {
|
|
|
16 |
$error_message = "";
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
?>
|
|
|
20 |
<!DOCTYPE html>
|
|
|
21 |
<html>
|
|
|
22 |
<head>
|
|
|
23 |
<meta charset="UTF-8">
|
|
|
24 |
<title>MedCAD Workstation Build Out</title>
|
|
|
25 |
<link rel="stylesheet" href="style.css">
|
|
|
26 |
</head>
|
|
|
27 |
<body>
|
|
|
28 |
<form method="POST" action="send.php">
|
|
|
29 |
<?php if (isset($success_message)): ?>
|
|
|
30 |
<div class="success-message"><?= htmlspecialchars($success_message) ?></div>
|
|
|
31 |
<?php endif; ?>
|
|
|
32 |
<?php if (isset($_GET['error'])): ?>
|
|
|
33 |
<div class="error-message">There was an error submitting your request. Please try again.</div>
|
|
|
34 |
<?php endif; ?>
|
|
|
35 |
|
|
|
36 |
<h2>MedCAD Workstation Build Out</h2>
|
|
|
37 |
|
|
|
38 |
<label for="requestor">Requestor Name</label>
|
|
|
39 |
<input type="text" name="requestor" required>
|
|
|
40 |
|
|
|
41 |
<label for="requestor_email">Requestor Email</label>
|
|
|
42 |
<input type="email" name="requestor_email" required>
|
|
|
43 |
|
|
|
44 |
<label for="workstation">Workstation Name</label>
|
|
|
45 |
<input type="text" name="workstation">
|
|
|
46 |
|
|
|
47 |
<label for="username">User Name</label>
|
|
|
48 |
<input type="text" name="username">
|
|
|
49 |
|
|
|
50 |
<label for="remote_access">Remote Access</label>
|
|
|
51 |
<select name="remote_access">
|
|
|
52 |
<?php foreach ($config['remote_access'] as $option): ?>
|
|
|
53 |
<option value="<?= htmlspecialchars($option) ?>"><?= htmlspecialchars($option) ?></option>
|
|
|
54 |
<?php endforeach; ?>
|
|
|
55 |
</select>
|
|
|
56 |
|
|
|
57 |
<label>Software List</label>
|
|
|
58 |
<div style="display: flex; flex-wrap: wrap;">
|
|
|
59 |
<?php
|
|
|
60 |
$software = $config['software'];
|
|
|
61 |
$half = ceil(count($software) / 2);
|
|
|
62 |
?>
|
|
|
63 |
<div style="flex: 1; min-width: 200px;">
|
|
|
64 |
<?php for ($i = 0; $i < $half; $i++): ?>
|
|
|
65 |
<input type="checkbox" name="software[]" value="<?= htmlspecialchars($software[$i]) ?>">
|
|
|
66 |
<?= htmlspecialchars($software[$i]) ?><br>
|
|
|
67 |
<?php endfor; ?>
|
|
|
68 |
</div>
|
|
|
69 |
<div style="flex: 1; min-width: 200px;">
|
|
|
70 |
<?php for ($i = $half; $i < count($software); $i++): ?>
|
|
|
71 |
<input type="checkbox" name="software[]" value="<?= htmlspecialchars($software[$i]) ?>">
|
|
|
72 |
<?= htmlspecialchars($software[$i]) ?><br>
|
|
|
73 |
<?php endfor; ?>
|
|
|
74 |
</div>
|
|
|
75 |
</div>
|
|
|
76 |
|
|
|
77 |
<label for="notes">Notes</label>
|
|
|
78 |
<textarea name="notes"></textarea>
|
|
|
79 |
|
|
|
80 |
<button type="submit">Submit</button>
|
|
|
81 |
</form>
|
|
|
82 |
</body>
|
|
|
83 |
</html>
|