mirror of
https://github.com/itflow-org/itflow
synced 2026-07-26 18:27:14 +00:00
25 lines
565 B
PHP
25 lines
565 B
PHP
<?php
|
|
|
|
require_once '../validate_api_key.php';
|
|
|
|
require_once '../require_get_method.php';
|
|
|
|
|
|
// Expenses aren't client-scoped; access is gated by module_financial in enforce_api_rbac.php
|
|
|
|
if (isset($_GET['expense_id'])) {
|
|
// Expense via ID (single)
|
|
|
|
$id = intval($_GET['expense_id']);
|
|
$sql = mysqli_query($mysqli, "SELECT * FROM expenses WHERE expense_id = '$id'");
|
|
|
|
} else {
|
|
// All expenses
|
|
|
|
$sql = mysqli_query($mysqli, "SELECT * FROM expenses ORDER BY expense_id LIMIT $limit OFFSET $offset");
|
|
}
|
|
|
|
// Output
|
|
require_once "../read_output.php";
|
|
|