-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalarm_details.php
165 lines (156 loc) · 10.1 KB
/
alarm_details.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php
session_start();
$object_name = '$_REQUEST[object_name]';
if (strlen($object_name) == 10) {
$x = (str_split($object_name, 3));
$object_name = $x[0] . "_" . $x[1] . substr(chunk_split($x[2], 3, '_'), 0, -2);
}
?>
<?php
include 'include/header.php';
?>
<div class="panel">
<h2>Health Check Dashboard for Alarms</h2>
<div class="panelcontent">
<div class="top-portion">
<div class="top_table">
<table border=1>
<h3> Alarm Summary of <font color=red><?php echo $_REQUEST['text']; ?></font></h3>
<tr>
<center>
<th style="background: #91C910">Object Name </th>
<th style="background: #91C910">No. of Occurrence</th>
</center>
</tr>
<?php
if ($_REQUEST['object_type'] == 'bsc') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE (text='$_REQUEST[text]' AND (dn NOT LIKE '%BCF%' AND object_name NOT LIKE '%_C' AND DN NOT LIKE '%RNC-%' AND dn NOT LIKE '%NETACT%')) GROUP BY object_name ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'omc') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE (text='$_REQUEST[text]' AND dn LIKE '%NETACT%') GROUP BY object_name ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'bts') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE (text LIKE '$_REQUEST[text]' AND (dn LIKE '%BCF%')) GROUP BY object_name ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'vvip') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE (text LIKE '$_REQUEST[text]%' AND vip_site='Y' AND (object_name LIKE 'DHK%' OR object_name LIKE 'KHU%' OR object_name LIKE 'RAJ%' OR object_name LIKE 'SYL%') ) GROUP BY object_name ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'rnc') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE ((DN like '%RNC%' OR DN like '%OMS%') AND text LIKE '$_REQUEST[text]%') GROUP BY object_name ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'juniper') {
$query = "SELECT object_name, COUNT(*) FROM net_diag WHERE (dn like '%JMBH%' AND text LIKE '$_REQUEST[text]%') GROUP BY object_name ORDER BY COUNT(*) DESC";
}
$result = mysql_query($query);
$row = mysql_num_rows($result);
while ($rowsql = mysql_fetch_assoc($result)) {
?>
<tr>
<td class=td1 align="center"><a href="alarm_details_bts.php?object_type=bts&object_name=<?php echo $rowsql['object_name']; ?>" target="_blank"><font color="blue"><?php echo $rowsql['object_name']; ?></font></a></td>
<td class=td2 align="center"><?php echo $rowsql['COUNT(*)']; ?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="top_table">
<table border=1>
<tr>
<center>
<th style="background: #91C910">Object Name </th>
<th style="background: #91C910">DN </th>
<th style="background: #91C910">No. of Occurence</th>
</center>
</tr>
<?php
if ($_REQUEST['object_type'] == 'vvip') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where (text LIKE '%$_REQUEST[text]%' AND vip_site='Y') GROUP BY dn ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'bsc') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where (text LIKE '%$_REQUEST[text]%' AND (dn NOT LIKE '%BCF%' AND object_name NOT LIKE '%_C' AND DN NOT LIKE '%RNC-%' AND dn NOT LIKE '%NETACT%')) GROUP BY dn ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'bts') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where (text LIKE '%$_REQUEST[text]%' AND dn LIKE '%BCF%') GROUP BY dn ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'rnc') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where ((DN like '%RNC%' OR DN like '%OMS%') AND text LIKE '%$_REQUEST[text]%') GROUP BY dn ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'juniper') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where (dn like '%JMBH%' AND text LIKE '%$_REQUEST[text]%') GROUP BY dn ORDER BY COUNT(*) DESC";
} else if ($_REQUEST['object_type'] == 'omc') {
$query_vip = "SELECT object_name, dn, count(*) AS 'cnt' from net_diag where (text LIKE '%$_REQUEST[text]%') GROUP BY dn ORDER BY COUNT(*) DESC";
}
$result_vip = mysql_query($query_vip);
while ($rowsql = mysql_fetch_assoc($result_vip)) {
?>
<tr>
<td align="center"><?php echo $rowsql['object_name'] ?></td>
<td align="center"><?php echo $rowsql['dn']; ?></td>
<td align="center"><font color="red"><?php echo $rowsql['cnt']; ?></font></td>
</tr>
<?php
}
?>
</table>
</div>
</div>
</div>
</div>
<table class="data_table1" width='100%' id="table1">
<tr>
<center>
<th>Alarm Text</th>
<th>Alarm ID</th>
<th>Object Name</th>
<th>DN</th>
<th>Alarm Time</th>
<th>Cancel Time</th>
<th>Supply Info</th>
</center>
</tr>
<?php
$text = $_REQUEST['text'];
if ($_REQUEST['object_type'] == 'vvip') {
$query1 = "SELECT text, alarm_number, object_name, dn, alarm_time, cancel_time, sup_info, ack_status FROM net_diag WHERE text LIKE '$text%' AND vip_site='Y' ORDER BY alarm_time";
} else if ($_REQUEST['object_type'] == 'rnc') {
$query1 = "SELECT text, alarm_number, object_name, dn, alarm_time, cancel_time, sup_info, ack_status FROM net_diag WHERE ((DN like '%RNC%' OR DN like '%OMS%') AND text LIKE '$text%') ORDER BY alarm_time";
} else if ($_REQUEST['object_type'] == 'juniper') {
$query1 = "SELECT text, alarm_number, object_name, dn, alarm_time, cancel_time, sup_info, ack_status FROM net_diag WHERE (dn like '%JMBH%' AND text LIKE '$text%') ORDER BY alarm_time";
} else if ($_REQUEST['object_type'] == 'omc') {
$query1 = "SELECT text, alarm_number, object_name, dn, alarm_time, cancel_time, sup_info, ack_status FROM net_diag WHERE (text LIKE '$text%' AND dn LIKE '%NETACT%') ORDER BY alarm_time";
} else {
$query1 = "SELECT text, alarm_number, object_name, dn, alarm_time, cancel_time, sup_info, ack_status FROM net_diag WHERE text LIKE '$text%' AND (dn NOT LIKE '%BCF%' AND object_name NOT LIKE '%_C' AND DN NOT LIKE '%RNC-%' AND dn NOT LIKE '%NETACT%') ORDER BY alarm_time";
}
$_SESSION[query_data] = $query1;
$result1 = mysql_query($query1);
while ($rowsql1 = mysql_fetch_assoc($result1)) {
?>
<tr>
<td align="center"><?php echo $rowsql1['text']; ?></td>
<td align="center"><?php echo $rowsql1['alarm_number']; ?></td>
<td align="center"><?php echo $rowsql1['object_name']; ?></td>
<td align="center"><?php echo $rowsql1['dn']; ?></td>
<td align="center"><?php echo $rowsql1['alarm_time']; ?></td>
<td align="center"><?php
if (strlen(trim($rowsql1['cancel_time'])) != 0) {
echo $rowsql1['cancel_time'];
} else {
echo "Active";
}
?>
</td>
<td align="center"><?php echo $rowsql1['sup_info']; ?></td>
</tr>
<?php
}
?>
</table>
<script language="javascript" type="text/javascript">
var table1_Props = {
col_0: "select",
col_1: "select",
col_5: "select",
col_operation: "sum",
alternate_rows: true,
rows_counter: true,
rows_counter_text: "Total No. of Rows: ",
btn_reset: true,
bnt_reset_text: "Clear all "
};
setFilterGrid("table1", table1_Props);
</script>
</div>
</body>
</html>