mirror of https://github.com/itflow-org/itflow
Added location to networks
This commit is contained in:
parent
4330254891
commit
98532b0c7d
|
|
@ -10,18 +10,18 @@
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="client_net_terms" value="<?php echo $client_net_terms; ?>">
|
<input type="hidden" name="client_net_terms" value="<?php echo $client_net_terms; ?>">
|
||||||
|
|
||||||
<?php if(isset($_GET['client_id'])){ ?>
|
|
||||||
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
<?php if(isset($_GET['client_id'])){ ?>
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||||
|
<?php }else{ ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client</label>
|
<label>Client</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="client" required <?php if(isset($_GET['client_id'])){ echo "disabled"; } ?>>
|
<select class="form-control selectpicker show-tick" data-live-search="true" name="client" required>
|
||||||
<option value="">- Client -</option>
|
<option value="">- Client -</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Invoice Date</label>
|
<label>Invoice Date</label>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,31 @@
|
||||||
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199">
|
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Location</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control selectpicker show-tick" data-live-search="true" name="location">
|
||||||
|
<option value="">- Location -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id");
|
||||||
|
while($row = mysqli_fetch_array($sql)){
|
||||||
|
$location_id = $row['location_id'];
|
||||||
|
$location_name = $row['location_name'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,16 @@
|
||||||
</div>
|
</div>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
<?php if(isset($_GET['client_id'])){ ?>
|
||||||
|
<input type="hidden" name="client" value="<?php echo $client_id; ?>">
|
||||||
|
<?php }else{ ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Client</label>
|
<label>Client</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="client" required <?php if(isset($_GET['client_id'])){ echo "disabled"; } ?>>
|
<select class="form-control selectpicker show-tick" data-live-search="true" name="client" required>
|
||||||
<option value="">- Client -</option>
|
<option value="">- Client -</option>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
@ -33,6 +35,7 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Subject</label>
|
<label>Subject</label>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
$network = $row['network'];
|
$network = $row['network'];
|
||||||
$network_gateway = $row['network_gateway'];
|
$network_gateway = $row['network_gateway'];
|
||||||
$network_dhcp_range = $row['network_dhcp_range'];
|
$network_dhcp_range = $row['network_dhcp_range'];
|
||||||
|
$network_dhcp_range = $row['network_dhcp_range'];
|
||||||
|
$location_id = $row['location_id'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,31 @@
|
||||||
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" value="<?php echo $network_dhcp_range; ?>">
|
<input type="text" class="form-control" name="dhcp_range" placeholder="ex 192.168.1.11-199" value="<?php echo $network_dhcp_range; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Location</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||||
|
</div>
|
||||||
|
<select class="form-control selectpicker show-tick" data-live-search="true" name="location">
|
||||||
|
<option value="">- Location -</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id");
|
||||||
|
while($row = mysqli_fetch_array($sql_locations)){
|
||||||
|
$location_id_select = $row['location_id'];
|
||||||
|
$location_name_select = $row['location_name'];
|
||||||
|
?>
|
||||||
|
<option <?php if($location_id == $location_id_select){ echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer bg-white">
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content bg-dark">
|
<div class="modal-content bg-dark">
|
||||||
<div class="modal-header text-white">
|
<div class="modal-header text-white">
|
||||||
<h5 class="modal-title"><i class="fa fa-fw fa-tag mr-2"></i>Ticket # <?php echo $ticket_id; ?></h5>
|
<h5 class="modal-title"><i class="fa fa-fw fa-tag mr-2"></i>Ticket # <?php echo $ticket_id; ?> for Client <?php echo $client_name; ?></h5>
|
||||||
<button type="button" class="close text-white" data-dismiss="modal">
|
<button type="button" class="close text-white" data-dismiss="modal">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -10,17 +10,7 @@
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
||||||
<div class="modal-body bg-white">
|
<div class="modal-body bg-white">
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Client</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
|
||||||
</div>
|
|
||||||
<input type="text" class="form-control" value="<?php echo $client_name; ?>" disabled>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Subject</label>
|
<label>Subject</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|
|
||||||
6
post.php
6
post.php
|
|
@ -2449,8 +2449,9 @@ if(isset($_POST['add_network'])){
|
||||||
$network = strip_tags(mysqli_real_escape_string($mysqli,$_POST['network']));
|
$network = strip_tags(mysqli_real_escape_string($mysqli,$_POST['network']));
|
||||||
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
||||||
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
||||||
|
$location_id = intval($_POST['location']);
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_created_at = NOW(), client_id = $client_id");
|
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_created_at = NOW(), location_id = $location_id, client_id = $client_id");
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Network added";
|
$_SESSION['alert_message'] = "Network added";
|
||||||
|
|
||||||
|
|
@ -2465,8 +2466,9 @@ if(isset($_POST['edit_network'])){
|
||||||
$network = strip_tags(mysqli_real_escape_string($mysqli,$_POST['network']));
|
$network = strip_tags(mysqli_real_escape_string($mysqli,$_POST['network']));
|
||||||
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
||||||
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
||||||
|
$location_id = intval($_POST['location']);
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_updated_at = NOW() WHERE network_id = $network_id");
|
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_updated_at = NOW(), location_id = $location_id WHERE network_id = $network_id");
|
||||||
|
|
||||||
$_SESSION['alert_message'] = "Network updated";
|
$_SESSION['alert_message'] = "Network updated";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue