-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdapanesb13.php
More file actions
33 lines (30 loc) · 1.52 KB
/
Copy pathdapanesb13.php
File metadata and controls
33 lines (30 loc) · 1.52 KB
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
<?php
require_once 'opendata.php';
// ΕΚΤΥΠΩΣΗ ΠΛΗΡΟΦΟΡΙΩΝ ΦΟΡΕΑ (UID, ΕΠΩΝΥΜΙΑ, ΜΟΝΑΔΕΣ, ΥΠΟΓΡΑΦΟΝΤΕΣ)
$client = new OpendataClient();
$client->setAuth('apiuser_1', 'ApiUser@1');
$response = $client->getResource('/search?org=5006&type=Β.1.3&size=500&from_date=2014-01-01');
if ($response->code === 200) {
$unitData = $response->data;
$sum = 0.0;
$counter = 1;
foreach ($unitData['decisions'] as $unit) {
print $counter . ") ". $unit['subject'] . ": " . $unit['ada'] . " TYPE : " . $unit['decisionTypeId'] . ": ΠΟΣΟ : ". $unit['extraFieldValues']['amountWithVAT']['amount'] . " <a href=\"". $unit['documentUrl'] . "\">Link</a> <br> \n";
$kaeData = $unit['extraFieldValues']['amountWithKae'];
//print_r($kaeData);
foreach ($kaeData as $kae) {
print "   KAE ". $kae['kae'] . " : ΠΟΣΟ " . $kae['amountWithVAT'] . " ΠΡΟΜΗΘΕΥΤΗΣ : ". $kae['sponsorAFMName']['afm'] . " - " . $kae['sponsorAFMName']['name'] . "<br> \n";
$sum += $kae['amountWithVAT'];
}
$counter++;
}
print "<h2> ΣΥΝΟΛΙΚΟ ΠΟΣΟ : " . $sum . "€ </h2>";
/*
print " Υπογράφοντες:<br>\n";
foreach ($orgData['signers'] as $signer) {
print " ". $signer['uid'] . ": " . $signer['lastName'] . " " . $signer['firstName'] . "<br>\n";
}
*/
} else {
echo "Error " . $response->code;
}