-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.inc.php
92 lines (78 loc) · 2.94 KB
/
shared.inc.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
<?php
// The following four lines should be updated before deploying
define('IMAGEPATH', 'https://xray.ddosecrets.com/images/');
define('FILEPATH', 'install_path/images/');
define('TOOLSPATH', 'install_path/bin/');
$link = mysqli_connect('localhost', 'root', '', '', 32077, '');
session_name('grids');
session_start();
function ownershipTable($row, $gridrow)
{
global $link;
if ($gridrow['confirmed'] < 3) {
echo "<p>\n";
echo "This data has not yet been validated.\n";
echo "</p>\n\n";
}
echo "<table style=\"width: 100%; border: 1px solid black;\">\n\n";
echo "<tr>\n";
echo "<td></td>\n";
echo "<td><b>Name / Company</b></td>\n";
echo "<td><b>Address</b></td>\n";
echo "<td><b>Start Date</b></td>\n";
echo "<td><b>End Date</b></td>\n";
echo "<td><b>Position</b></td>\n";
echo "<td><b>Type (Officer/Director)</b></td>\n";
echo "</tr>\n\n";
$subresult = mysqli_query($link, "SELECT * FROM `gridrows` WHERE `gridid`='" . $gridrow['gridid'] . "'");
while ($subrow = mysqli_fetch_assoc($subresult)) {
if (! empty($subrow['companyname'])) {
$name = $subrow['companyname'];
} else {
$name = $subrow['firstname'] . ' ' . $subrow['middlename'] . ' ' . $subrow['lastname'];
}
if (! empty($subrow['idnumber'])) {
$name .= "<br>\n";
$name .= "(ID " . $subrow['idnumber'] . ")";
}
$address = '';
if (! empty($subrow['address1']))
$address .= $subrow['address1'];
if (! empty($subrow['address2'])) {
$address .= "<br>\n";
$address .= $subrow['address2'];
}
if (! empty($subrow['address3'])) {
$address .= "<br>\n";
$address .= $subrow['address3'];
}
if (! empty($subrow['city']) || ! empty($subrow['stateprovince']) || ! empty($subrow['postalcode'])) {
if (! empty($subrow['address1']) || ! empty($subrow['address2']) || ! empty($subrow['address3']))
$address .= "<br>\n";
$address .= $subrow['city'] . ($subrow['stateprovince'] || $subrow['postalcode'] ? ', ' : '') . $subrow['stateprovince'] . ' ' . $subrow['postalcode'];
}
if (! empty($subrow['country'])) {
$address .= "<br>\n";
$address .= strtoupper($subrow['country']);
}
$startDate = $subrow['startdate'] != '0000-00-00' ? $subrow['startdate'] : '';
$endDate = $subrow['enddate'] != '0000-00-00' ? $subrow['enddate'] : '';
$position = $subrow['position'];
$type = $subrow['type'];
echo "<tr>\n";
echo "<td><a href=\"go.php?gridid=" . $subrow['gridid'] . "\">View</a></td>\n";
echo "<td>$name</td>\n";
echo "<td>$address</td>\n";
echo "<td>$startDate</td>\n";
echo "<td>$endDate</td>\n";
echo "<td>$position</td>\n";
echo "<td>$type</td>\n";
echo "</tr>\n\n";
}
echo "<tr>\n";
echo "<td colspan=7>Recorded by the " . $row['jurisdiction'] . " registry on " . $gridrow['date'] . "<br>\n";
echo "Digitally crowdsourced on " . $gridrow['createstamp'] . "</td>\n";
echo "</tr>\n\n";
echo "</table>";
}
?>