Subversion Repositories web_pages

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 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
    <?php foreach ($config['software'] as $software): ?>
59
      <input type="checkbox" name="software[]" value="<?= htmlspecialchars($software) ?>">
60
      <?= htmlspecialchars($software) ?><br>
61
    <?php endforeach; ?>
62
 
63
    <label for="notes">Notes</label>
64
    <textarea name="notes"></textarea>
65
 
66
    <button type="submit">Submit</button>
67
  </form>
68
</body>
69
</html>