-
Notifications
You must be signed in to change notification settings - Fork 0
/
Modify_vlg_servicebybuilding_booklet1.php
executable file
·82 lines (59 loc) · 3.14 KB
/
Modify_vlg_servicebybuilding_booklet1.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
<?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('printableArea1')">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="printableArea1">
<?php
$counter = 0;
$nullVar = "-";
$query = "SELECT T1.Building_Code AS Building, T1.Primary_Feed AS Pri, T1.Secondary_Feed AS Sec, T2.Vault_Name AS Vault, T2.Vault_Section AS Service FROM elec_VLG_TXDEMAND T1 LEFT JOIN elec_VLG_SERVICES T2 ON T1.Primary_Feed = T2.Feeder_Name WHERE T1.Building_Code REGEXP '^[a-z]' ORDER BY 1 ";
$result = mysqli_query($connection,$query);
?>
<table id="table1" border="1px solid black;" class="booklet_is">
<tr style="background-color:orange;">
<th colspan="5">Building</th>
<th colspan="1">Pri.</th>
<th colspan="1">Sec.</th>
<th colspan="2">Vault</th>
<th colspan="1">Service</th>
</tr>
<?php
while($counter < 36){
$data = mysqli_fetch_assoc($result);
$var1=empty($data['Building'])? $nullVar : $data['Building'];
$var2=empty($data['Pri'])? $nullVar : $data['Pri'];
$var3=empty($data['Sec'])? $nullVar : $data['Sec'];
$var4=empty($data['Vault'])? $nullVar : $data['Vault'];
$var5=empty($data['Service'])? $nullVar : $data['Service'];
echo'<tr>';
echo '<td colspan="5" width = 50%><a style="text-decoration: none" href="data/'.(substr($var1,0,3)).'.php">'.$var1.'</a></td>';
if($var3==NULL)
echo '<td colspan="1" width = 10%>'.$var2.'</td>';
else
echo '<td colspan="1" width = 10% BGCOLOR="#7e7e7e">'.$var2.'</td>';
echo '<td colspan="1" width = 10%>'.$var3.'</td>';
echo '<td colspan="2" width = 20%>'.$var4.'</td>';
echo '<td colspan="1" width = 10%>'.$var5.'</td>';
echo'</tr>';
$counter = $counter + 1;
}
echo "</table>";
?>
</div>
<br>
</div>
</div>
<?php include("includes/footer.php"); ?>