Add Interface at bill create screen

This commit is contained in:
Richard Lawley
2016-03-14 19:18:53 +00:00
parent 2bbbd13f2c
commit b2c015b58c
4 changed files with 49 additions and 33 deletions

View File

@@ -1,3 +1,4 @@
<h4>Bill Information</h4>
<div class="form-group">
<label for="bill_name" class="col-sm-4 control-label">Description</label>
<div class="col-sm-8">

View File

@@ -150,16 +150,7 @@
<?php
$devices = dbFetchRows('SELECT * FROM `devices` ORDER BY hostname');
foreach ($devices as $device) {
unset($done);
foreach ($access_list as $ac) {
if ($ac == $device['device_id']) {
$done = 1;
}
}
if (!$done) {
echo " <option value='".$device['device_id']."'>".$device['hostname']."</option>\n";
}
echo "<option value='${device['device_id']}'>${device['hostname']}</option>\n";
}
?>

View File

@@ -75,8 +75,8 @@ if ($_POST['addbill'] == 'yes') {
$bill_id = dbInsert($insert, 'bills');
if (is_numeric($bill_id) && is_numeric($_POST['port'])) {
dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port']), 'bill_ports');
if (is_numeric($bill_id) && is_numeric($_POST['port_id'])) {
dbInsert(array('bill_id' => $bill_id, 'port_id' => $_POST['port_id']), 'bill_ports');
}
header('Location: /' . generate_url(array('page' => 'bill', 'bill_id' => $bill_id, 'view' => 'edit')));