Ergaenze Markt-Durchfuehrungstabelle im Portal
This commit is contained in:
1 parent
c147624d71
commit
bbec87abfa
4 files changed
+164
-5
No files matched your search
+25
-1
@@ -8,6 +8,7 @@ require_once __DIR__ . '/../modules/erp/bestellungen/service.php';
|
||||
require_once __DIR__ . '/../modules/erp/lager/service.php';
|
||||
require_once __DIR__ . '/../modules/erp/kontakte/service.php';
|
||||
require_once __DIR__ . '/../modules/erp/artikel-mapping/service.php';
|
||||
require_once __DIR__ . '/../modules/market_management/service.php';
|
||||
|
||||
$env = expand_env_values(parse_env_file(__DIR__ . '/../.env'));
|
||||
$pdo = connect_database($env);
|
||||
@@ -58,11 +59,34 @@ if ($currentUser !== null) {
|
||||
'limit' => (int) ($_GET['bestellungen_limit'] ?? 20),
|
||||
'page_size' => 20,
|
||||
]);
|
||||
$marketSearch = (string) ($_GET['market_search'] ?? '');
|
||||
$marketSort = (string) ($_GET['market_sort'] ?? 'earliest_date');
|
||||
$marketDirection = strtoupper((string) ($_GET['market_dir'] ?? 'ASC'));
|
||||
$marketLimit = min(100, max(1, (int) ($_GET['market_limit'] ?? 20)));
|
||||
$marketOccurrencesTable = [
|
||||
'rows' => market_management_search_occurrences($pdo, [
|
||||
'search' => $marketSearch,
|
||||
'sort' => $marketSort,
|
||||
'sort_direction' => $marketDirection,
|
||||
'limit' => $marketLimit,
|
||||
'offset' => 0,
|
||||
]),
|
||||
'search' => $marketSearch,
|
||||
'sort_column' => $marketSort,
|
||||
'sort_direction' => $marketDirection,
|
||||
'limit' => $marketLimit,
|
||||
'page_size' => 20,
|
||||
];
|
||||
$marketOccurrencesTable['has_more'] = count($marketOccurrencesTable['rows']) >= $marketLimit;
|
||||
if ((string) ($_GET['bestellungen_fragment'] ?? '') === '1') {
|
||||
echo auth_render_bestellungen_content($bestellungenTable);
|
||||
exit;
|
||||
}
|
||||
render_auth_home_page($currentUser, $otcProducts, $bestellungenTable, $lagerProducts, $lagerArtikel, $lagerManufacturers);
|
||||
if ((string) ($_GET['market_fragment'] ?? '') === '1') {
|
||||
echo auth_render_markets_content($marketOccurrencesTable);
|
||||
exit;
|
||||
}
|
||||
render_auth_home_page($currentUser, $otcProducts, $bestellungenTable, $marketOccurrencesTable, $lagerProducts, $lagerArtikel, $lagerManufacturers);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user