-
Notifications
You must be signed in to change notification settings - Fork 0
/
Modify_usc_ladwp_meters_show_booklet.php
executable file
·147 lines (94 loc) · 5.47 KB
/
Modify_usc_ladwp_meters_show_booklet.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?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><br>
<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 * FROM elec_USC_LADWP_METERS ORDER BY Campus ASC, Name ASC, Service_Number ASC";
$result = mysqli_query($connection,$query);
?>
<?php
echo '<table id="table1" border="1px solid black;" class="booklet_is">';
echo'<th>Campus</th><th>Name</th><th>Address</th><th>Service_Number</th><th>Meter_Information</th>';
while($counter < 20){
$data = mysqli_fetch_assoc($result);
$var1=empty($data['Campus'])? $nullVar : $data['Campus'];
$var2=empty($data['Name'])? $nullVar : $data['Name'];
$var3=empty($data['Address'])? $nullVar : $data['Address'];
$var4=empty($data['Service_Number'])? $nullVar : $data['Service_Number'];
$var5=empty($data['Meter_Information'])? $nullVar : $data['Meter_Information'];
echo'<tr>';
echo '<td>'.$var1.'</td><td>'.$var2.'</td><td>'.$var3.'</td><td>'.$var4.'</td><td>'.$var5.'</td>';
echo'</tr>';
$counter = $counter + 1;
}
echo "</table>";
?>
</div>
<br><br>
<button class="btn btn-success" onClick ="printDiv('printableArea12')">PDF Export</button>
<button class="btn btn-success" onClick ="$('#table2').tableExport({type: 'excel', escape: 'false'});">Excel Export</button>
<button class="btn btn-success" onClick ="$('#table2').tableExport({type: 'png', escape: 'false'});">PNG Export</button>
<br><br>
<div id="printableArea12">
<?php
$counter = 20;
$nullVar = "-";
echo '<table id="table2" border="1px solid black;" class="booklet_is">';
echo'<th>Campus</th><th>Name</th><th>Address</th><th>Service_Number</th><th>Meter_Information</th>';
while($counter < 40){
$data = mysqli_fetch_assoc($result);
$var1=empty($data['Campus'])? $nullVar : $data['Campus'];
$var2=empty($data['Name'])? $nullVar : $data['Name'];
$var3=empty($data['Address'])? $nullVar : $data['Address'];
$var4=empty($data['Service_Number'])? $nullVar : $data['Service_Number'];
$var5=empty($data['Meter_Information'])? $nullVar : $data['Meter_Information'];
echo'<tr>';
echo '<td>'.$var1.'</td><td>'.$var2.'</td><td>'.$var3.'</td><td>'.$var4.'</td><td>'.$var5.'</td>';
echo'</tr>';
$counter = $counter + 1;
}
echo "</table>";
?>
</div>
<br><br>
<button class="btn btn-success" onClick ="printDiv('printableArea13')">PDF Export</button>
<button class="btn btn-success" onClick ="$('#table3').tableExport({type: 'excel', escape: 'false'});">Excel Export</button>
<button class="btn btn-success" onClick ="$('#table3').tableExport({type: 'png', escape: 'false'});">PNG Export</button>
<br><br>
<div id="printableArea13">
<?php
$counter = 40;
$nullVar = "-";
echo '<table id="table3" border="1px solid black;" class="booklet_is">';
echo'<th>Campus</th><th>Name</th><th>Address</th><th>Service_Number</th><th>Meter_Information</th>';
while($counter < 60){
$data = mysqli_fetch_assoc($result);
$var1=empty($data['Campus'])? $nullVar : $data['Campus'];
$var2=empty($data['Name'])? $nullVar : $data['Name'];
$var3=empty($data['Address'])? $nullVar : $data['Address'];
$var4=empty($data['Service_Number'])? $nullVar : $data['Service_Number'];
$var5=empty($data['Meter_Information'])? $nullVar : $data['Meter_Information'];
echo'<tr>';
echo '<td>'.$var1.'</td><td>'.$var2.'</td><td>'.$var3.'</td><td>'.$var4.'</td><td>'.$var5.'</td>';
echo'</tr>';
$counter = $counter + 1;
}
echo "</table>";
?>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>