-
Notifications
You must be signed in to change notification settings - Fork 1
/
changes.php
114 lines (106 loc) · 3.82 KB
/
changes.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
<?php
include 'config.php';
date_default_timezone_set("$timezone");
$area_asc = $_GET['asc'];
$area_num = $_GET['areanum'];
$how_many_days = $_REQUEST['hdays'];
$today = date("Y-m-d");
$dateminus = date('Y-m-d', strtotime("-$how_many_days days"));
//Changes printed on date and time
echo "
<!DOCTYPE html>
<html>
<head>
<link rel=\"stylesheet\" type=\"text/css\" href=\"changes.css\">
</head>
<body>
<H2>" .$area_asc. " CHANGES</H2>
Changes for last " .$how_many_days. " days from today: " .date("l jS \of F Y h:i A") . "<br>
<hr>";
$url = $bmlt_server. "/client_interface/json/?switcher=GetChanges&start_date=" .$dateminus. "&end_date=" .$today. "&service_body_id=" .$area_num;
// get xml file contents
$json = json_decode(file_get_contents($url));
// loop begins
foreach ($json as $row) {
if (strpos($row->meeting_name, 'YAP') !== false) {
// dont show YAP data
} else {
// begin new paragraph
echo "<p>";
// show Date
echo "<strong>Date:</strong> ".$row->date_string." - ";
// show Change Type
$change_type=$row->change_type;
if ($change_type == "comdef_change_type_change") {
$change_type = "Change";
}
if ($change_type == "comdef_change_type_new") {
$change_type = "New";
}
if ($change_type == "comdef_change_type_delete") {
$change_type = "DELETE";
}
echo "<strong>Change Type:</strong> ".$change_type."<br/>";
// show Meeting ID
echo "<strong>Meeting (ID) Name:</strong> (".$row->meeting_id.") " .$row->meeting_name."<br/>";
// show User Name
echo "<strong>User Name:</strong> ".$row->user_name."<br/>";
// show Service Body
echo "<strong>Service Body:</strong> ".$row->service_body_name."</br><OL>";
// show details
$details=$row->details;
// remove root_server_uri info
$details = str_replace(". root_server_uri was added as \"https:\" ", " ", $details);
// Remove last . at end of details
$details = preg_replace('/.$/', "", $details);
// Remove the weird #@-@# from the format codes
$details = str_replace("#@-@#", " ", $details);
// protect email . from being replacedwith </br> tag
$details = preg_replace_callback(
'/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})/',
function ($email) {
return str_replace(".", "~DOT~", $email[0]);
},
$details
);
// Look for Latittude and Longitude, change . to ~DOT~
$details = preg_replace_callback(
'/from \"[0-9]+\./',
function ($matches) {
return str_replace(".", "~DOT~", $matches[0]);
},
$details
);
$details = preg_replace_callback(
'/to \"[0-9]+\./',
function ($matches) {
return str_replace(".", "~DOT~", $matches[0]);
},
$details
);
$details = preg_replace_callback(
'/from \"-+[0-9]+\./',
function ($matches) {
return str_replace(".", "~DOT~", $matches[0]);
},
$details
);
$details = preg_replace_callback(
'/to \"-+[0-9]+\./',
function ($matches) {
return str_replace(".", "~DOT~", $matches[0]);
},
$details
);
//Change all the . to <LI>
$details = str_replace(".", "<LI>", $details);
//Change all the ~DOT~ back to .
$details = str_replace("~DOT~", ".", $details);
// $details = str_replace("from \"-75</br>"," from \"-75.",$details);
echo "<strong>Details:</strong><LI> ".$details."</OL>";
echo "</p> <hr>";
// end paragraph
}
}
// loop ends
echo "END of File<br>BMLT Changes</body></html>";