4 Commits

Author SHA1 Message Date
57f4b48e2e Fixed oopsie 2022-01-19 12:58:41 +01:00
a6059d5831 Fixed "Create-system" form 2022-01-19 12:55:42 +01:00
0481dc380e Fixed system creation form
Added serviceTag field
Fixed System type filed
2022-01-19 12:37:43 +01:00
bprieshof
506b49f11d Fixed Create user button 2019-09-26 00:57:41 +02:00
3 changed files with 78 additions and 79 deletions

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']);
@@ -181,7 +181,6 @@ mysqli_close($link);
<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'>
@@ -211,17 +210,13 @@ mysqli_close($link);
</div>
</div>
</div>
<!-- /PREPEND EXAMPLE -->
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="ServiceTag">System type <span style="color:red">*</span></label>
<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>
@@ -233,28 +228,32 @@ mysqli_close($link);
</select>
</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="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="sysType">Service Tag/Serial nr<span style="color:red">*</span></label>
<div class="col-md-4">
<input id="sysType" name="sysType" 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>
</form>
<!-- / CONTENT -->

View File

@@ -49,7 +49,7 @@ if(isset($_POST["id"]) && !empty($_POST["id"])){
$input_ServiceTag = trim($_POST["ServiceTag"]);
if(empty($input_ServiceTag)){
$ServiceTag_err = "Please enter a Windows Key";
$ServiceTag_err = "Please enter a Servicetag/Serial nr";
} else{
$ServiceTag = $input_ServiceTag;
}
@@ -367,7 +367,7 @@ $lines = explode("\n", $trimmedString);
</div>
<div class="form-group col-md-4 <?php echo (!empty($ServiceTag_err)) ? 'has-error' : ''; ?>">
<label>Service Tag</label>
<label>Service Tag/Serial nr</label>
<input type="text" name="ServiceTag" class="form-control" value="<?php echo $ServiceTag; ?>">
<span class="help-block"><?php echo $ServiceTag_err;?></span>
</div>

View File

@@ -149,7 +149,7 @@ require_once "../assets/php/cuttext.php";
<div class="clearfix" style="padding:20px;">
<h2 class="pull-right">Users</h2>
<div class="toolbar crud pull-left">
<a href="create-system.php" class="btn btn-secondary btn-fab"><i class="icon-plus"></i></a>
<a href="create-user.php" class="btn btn-secondary btn-fab"><i class="icon-plus"></i></a>
<button type="button" class="btn btn-secondary btn-fab" id="SearchButton"><i class="icon-magnify"></i></button>
<input type="search" id="SearchInput" style="display:none;" placeholder="Search">
</div>