if ($device_customer != 0) { echo "<div class='alert alert-info' role='alert'>A customer has been already assigned to this machine"; echo "<p>Customer Name: " . get_customer_name_from_id($device_customer) . "</p>"; echo "</div>"; } ?> <label>Assign/Reassign Customer</label> <?php include 'config/db.php'; $sql = "SELECT * FROM `customers`"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<select class='form-control' name='device_customer'>"; // output data of each row if (!empty(get_customer_name_from_id($device_customer))) { echo "<option value='{$device_customer}'>" . get_customer_name_from_id($device_customer) . "</option>"; } while ($row = $result->fetch_assoc()) { $customer_id = $row["id"]; if ($customer_id != $device_customer) { echo "<option value='{$customer_id}'>" . $row["customer_name"] . "</option>"; } } echo "</select>"; } else { echo "0 results"; } ?> <br> <center><input type="submit" form="customer_form" class="btn btn-primary"></center> </form>
echo "<th>Vendor</th>"; echo "<th>Physical Label</th>"; echo "<th>Customer</th>"; echo "<th>IP Address</th>"; echo "<th>MAC Address</th>"; echo "<th>Serial #</th>"; echo "<th><center>Manage</center></th>"; echo "</tr>"; echo "</thead>"; while ($row = $result->fetch_assoc()) { $device_id = $row["device_id"]; echo "<tr>"; echo "<td>" . get_rack_name($row['rackid']) . "</td>"; echo "<td>" . $row["device_brand"] . "</td>"; echo "<td>" . $row["device_label"] . "</td>"; echo "<td>" . get_customer_name_from_id($row["device_customer"]) . "</td>"; echo "<td>" . $row["device_ipaddress"] . "</td>"; echo "<td>" . $row["device_mac"] . "</td>"; echo "<td>" . $row["device_serial"] . "</td>"; echo "<td><center><a href='manage_server.php?device_id={$device_id}'>Manage</a></center></td>"; echo "</tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?> </div> <!-- Add HDD Modal --> <div id="add_hdd" class="modal fade" role="dialog">
echo $device_ram_total; ?> </p> </div> </div> </div> <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Server Customer</h3> </div> <div class="panel-body"> <?php if (!empty(get_customer_name_from_id($device_customer))) { echo get_customer_name_from_id($device_customer); } else { echo "None Assigned"; } ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Server Notes</h3> </div> <div class="panel-body"> <?php echo $device_notes; ?> </div>