-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonthlyMovementHistory.php
executable file
·37 lines (28 loc) · 1.1 KB
/
monthlyMovementHistory.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
<?php
include ("dbaccess.php");
require 'vendor/autoload.php';
$loader = new Twig_Loader_Filesystem('views');
$twig = new Twig_Environment($loader);
$template = $twig->load('monthlyMovementHistory.html.twig');
if (isset($_GET['id'])) {
$record = $fm->getRecordByID('web', $_GET['id']);
$related_records = $record->getRelatedSet('InventoryArchive');
$_symbol = $record->getField('publicationCode');
$monthlyMovements = array();
foreach($related_records as $related_record) {
$monthlyMovements[] = array(
'date' => $related_record->getField('InventoryArchive::date'),
'moved' => $related_record->getField('InventoryArchive::moved'),
'received' => $related_record->getField('InventoryArchive::received'),
'onHandStart' => $related_record->getField('InventoryArchive::onHandStart'),
'onHandEnd' => $related_record->getField('InventoryArchive::onHandEnd'),
);
}
}
echo $template->render(array(
'monthlyMovements' => $monthlyMovements,
'recID' => $_GET['recID'],
'symbol' => $_symbol,
)
);
?>