Fixed "Create-system" form

This commit is contained in:
2022-01-19 12:55:42 +01:00
parent 0481dc380e
commit a6059d5831

View File

@@ -7,7 +7,7 @@ if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
exit;
}
require_once "../assets/php/config.php";
if(isset( $_POST ['sysID'], $_POST ['ServiceTag'], $_POST ['location'], $_POST ['WinKey'], $_POST ['EthMac'])){
if(isset( $_POST ['sysID'],$_POST['sysType'], $_POST ['ServiceTag'], $_POST ['location'], $_POST ['WinKey'], $_POST ['EthMac'])){
// Escape user inputs for security
$sysID = mysqli_real_escape_string($link, $_POST['sysTypeID'].$_POST['sysID']);
$sysType = mysqli_real_escape_string($link, $_POST['sysType']);
@@ -180,90 +180,80 @@ mysqli_close($link);
</div>
<div class="form-wrapper md-elevation-8 p-4">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<!-- Prepended text-->
<div class='control-group'>
<label class="col-md-8 control-label" >System ID <span style="color:red">*</span></label>
<div class='controls'>
<div class="col-md-4">
<div class='input-prepend dropdown' id="sysType" name="sysType" data-select='true'>
<!-- there must not be a space between the prepend toggle and the input field -->
<a class='add-on dropdown-toggle' data-toggle='dropdown' href='#'>
<!-- span.dropdown-display will be updated with the text from the selected option -->
<span class='dropdown-display'>DT</span>
<i class='caret'></i>
</a>
<input type='text' placeholder='000' id="sysID" required="" minlength="3" maxlength="3" name="sysID" class='col-md-4 control-label' />
<!-- this hidden field is used to contain the selected option from the dropdown -->
<input type='hidden' id="sysTypeID" name="sysTypeID" value='DT' class='dropdown-field' />
<!-- unordered list of options -->
<ul class='dropdown-menu'>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="DT">DT</a>
</li>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="LT">LT</a>
</li>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="TC">TC</a>
</li>
</ul>
</div>
</div>
</div>
<!-- /PREPEND EXAMPLE -->
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="sysType">System type <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="ServiceTag" name="ServiceTag" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="location">Location <span style="color:red">*</span></label>
<div class="col-md-4">
<select id="location" name="location" class="form-control">
<option value="Arnhem">Arnhem</option>
<option value="Doetinchem">Doetinchem</option>
<option value="Nijmegen">Nijmegen</option>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="EthMac">Mac addres <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="EthMac" name="EthMac" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<div class="form-group col-md-4">
<input type="submit" class="btn btn-secondary" value="Add">
</div>
</form>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="WinKey">Windows key <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="WinKey" name="WinKey" type="WinKey" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="ServiceTag">Service Tag/Serial nr<span style="color:red">*</span></label>
<div class="col-md-4">
<input id="ServiceTag" name="ServiceTag" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Prepended text-->
<div class='control-group'>
<label class="col-md-8 control-label" >System ID <span style="color:red">*</span></label>
<div class='controls'>
<div class="col-md-4">
<div class='input-prepend dropdown' id="sysType" name="sysType" data-select='true'>
<!-- there must not be a space between the prepend toggle and the input field -->
<a class='add-on dropdown-toggle' data-toggle='dropdown' href='#'>
<!-- span.dropdown-display will be updated with the text from the selected option -->
<span class='dropdown-display'>DT</span>
<i class='caret'></i>
</a>
<input type='text' placeholder='000' id="sysID" required="" minlength="3" maxlength="3" name="sysID" class='col-md-4 control-label' />
<!-- this hidden field is used to contain the selected option from the dropdown -->
<input type='hidden' id="sysTypeID" name="sysTypeID" value='DT' class='dropdown-field' />
<!-- unordered list of options -->
<ul class='dropdown-menu'>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="DT">DT</a>
</li>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="LT">LT</a>
</li>
<li>
<a href="#" class="idlist" id="sysType" name="sysTypeID" data-value="TC">TC</a>
</li>
</ul>
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="sysType">System type <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="ServiceTag" name="ServiceTag" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="location">Location <span style="color:red">*</span></label>
<div class="col-md-4">
<select id="location" name="location" class="form-control">
<option value="Arnhem">Arnhem</option>
<option value="Doetinchem">Doetinchem</option>
<option value="Nijmegen">Nijmegen</option>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="EthMac">Mac addres <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="EthMac" name="EthMac" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="WinKey">Windows key <span style="color:red">*</span></label>
<div class="col-md-4">
<input id="WinKey" name="WinKey" type="WinKey" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="ServiceTag">Service Tag/Serial nr<span style="color:red">*</span></label>
<div class="col-md-4">
<input id="ServiceTag" name="ServiceTag" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<div class="form-group col-md-4">
<input type="submit" class="btn btn-secondary" value="Add">
</div>
</div>
</form>
<!-- / CONTENT -->