-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patharticle.php
More file actions
41 lines (29 loc) · 1.62 KB
/
article.php
File metadata and controls
41 lines (29 loc) · 1.62 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
34
35
36
37
38
39
40
41
<?php
include'vendor/autoload.php';
$app = new Warehouse();
$article = new Article($app->db);
$article->load($app->stickyGET('article_id'));
$c = $app->layout->add('Columns');
$c->addColumn()->add(['Header', 'Article info '.$article['name'], 'icon'=>'stack overflow', 'subHeader'=>$article['category']. ' / '.$article['brand']]);
$statistic = $c->addColumn(['', 'center aligned'])->add(['ui'=>'tiny violet statistic']);
$statistic->add(['View', $article['stock'], 'value']);
$statistic->add(['View', 'in stock','label']);
$button_bar = $c->addColumn(['', 'right aligned'])->add(['ui'=>'buttons', 'right aligned'=>true]);
$app->layout->add(['Message', 'This screen is for debug purposes only', 'warning'])->add(['Text', 'To be removed in the final version of the app']);
$c = $app->layout->add(['ui'=>'segment'])->add(new \atk4\ui\Columns('divided'));
$c1 = $c->addColumn();
$c2 = $c->addColumn();
$c1->add(['Header', 'Recent Additions']);
$c2->add(['Header', 'Recent Subtractions']);
$button_bar->add(new ui\EditButton(['Adjust Stock', 'action'=>[
new \atk4\ui\jsReload($c),
new \atk4\ui\jsReload($statistic),
]]))->setModel($article->ref('Stock')->addCondition('type', 'inventory'));
$c1->add(['Table', 'very compact very basic small'])
->setModel($article->ref('Stock')->addCondition('qty_increase','>=',0), ['date', 'type', 'description', 'qty_increase'])
->setLimit(5)
->setOrder('date desc');
$c2->add(['Table', 'very compact very basic small'])
->setModel($article->ref('Stock')->addCondition('qty_increase','<',0), ['date', 'type', 'description', 'qty_increase'])
->setLimit(5)
->setOrder('date desc');