-
Notifications
You must be signed in to change notification settings - Fork 0
/
Modify_hsc_generator_show.php
executable file
·83 lines (57 loc) · 3.48 KB
/
Modify_hsc_generator_show.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php require_once("includes/session.php"); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php require_once("includes/validation_functions.php"); ?>
<?php confirm_logged_in(); ?>
<?php include("includes/header.php"); ?>
<div class="row2">
<div class = "col1"></div>
<div class = "col2">
<br>
<div Class="sidebar">
<a class="heading1" href="Modify_data.php">BACK</a>
</div>
<button class="btn btn-success" onClick ="printDiv('printableArea')">PDF Export</button>
<button class="btn btn-success" onClick ="$('#table1').tableExport({type: 'excel', escape: 'false'});">Excel Export</button>
<button class="btn btn-success" onClick ="$('#table1').tableExport({type: 'png', escape: 'false'});">PNG Export</button>
<br><br>
<div id="printableArea">
<?php
$query = "SELECT * FROM view_generators_hsc ORDER BY Bldg ASC";
$result = mysqli_query($connection,$query);
echo 'HSC - Generators';
echo '<br><br>';
if($result){
$data = mysqli_fetch_assoc($result);
$nullVar = NULL;
if($data){
echo '<table id="table1" style="width:200%" CLASS="sortable">';
echo'<th>Bldg</th><th>Building</th><th>Equipment</th><th>Nomenclature</th><th>Floor</th><th>kW</th><th>kVA</th><th>Output_Voltage</th><th>Manufacturer</th><th>Mfrd_Year</th><th>Engine_Type</th><th>Fuel_In_Gallons</th><th>Fuel_Type</th><th>Location</th><th>Keyword</th>';
while($data = mysqli_fetch_assoc($result))
{
echo'<tr style="text-align:center">';
if (substr($data['Manufacturer'],0,4)=="With" || substr($data['Manufacturer'],0,4)=="WITH" || substr($data['Manufacturer'],0,4)=="with")
{
echo '<td><a style="text-decoration: none" href="data/'.(substr($data['Bldg'],0,3)).'.php">'.$data['Bldg'].'</a></td><td>'.$data['Building'].'</td><td>'.$data['Equipment'].'</td><td>'.$data['Nomenclature'].'</td><td>'.$data['Floor'].'</td><td>'.$data['kW'].'</td><td>'.$data['kVA'].'</td><td>'.$data['Output_Voltage'].'</td><td><a style="text-decoration: none" href="data/'.(substr($data['Manufacturer'],5,3)).'.php">'.$data['Manufacturer'].'</a></td><td>'.$data['Mfrd_Year'].'</td><td>'.$data['Engine_Type'].'</td><td>'.$data['Fuel_In_Gallons'].'</td><td>'.$data['Fuel_Type'].'</td><td>'.$data['Location'].'</td><td>'.$data['Keyword'].'</td>';
}
else
{
echo '<td><a style="text-decoration: none" href="data/'.(substr($data['Bldg'],0,3)).'.php">'.$data['Bldg'].'</a></td><td>'.$data['Building'].'</td><td>'.$data['Equipment'].'</td><td>'.$data['Nomenclature'].'</td><td>'.$data['Floor'].'</td><td>'.$data['kW'].'</td><td>'.$data['kVA'].'</td><td>'.$data['Output_Voltage'].'</td><td>'.$data['Manufacturer'].'</td><td>'.$data['Mfrd_Year'].'</td><td>'.$data['Engine_Type'].'</td><td>'.$data['Fuel_In_Gallons'].'</td><td>'.$data['Fuel_Type'].'</td><td>'.$data['Location'].'</td><td>'.$data['Keyword'].'</td>';
}
echo'</tr>';
}
echo '</table>';
}
else{
echo "<p style='text-align:center'><b>No HSC Generator Information Found</b></p>";
}
}
else{
"Error is: " . mysqli_error($connection);
}
?>
</div>
<br>
</div>
</div>
<?php include("includes/footer.php"); ?>