| Helper | Signature | Description |
CustomQuery() | CustomQuery(string $sql, array $params = []): PDOStatement | Execute raw SQL with a prepared statement. Returns PDOStatement. |
db_fetch_array() | db_fetch_array(PDOStatement $stmt): array|false | Fetch a single row from a query result. Equivalent to fetch(PDO::FETCH_ASSOC). |
db_fetch_all() | db_fetch_all(PDOStatement $stmt): array | Fetch all rows. Equivalent to fetchAll(PDO::FETCH_ASSOC). |
db_num_rows() | db_num_rows(PDOStatement $stmt): int | Count rows from a statement. Wraps rowCount(). |
db_insert_id() | db_insert_id(): string | Get the last insert ID after an INSERT. |
db_escape() | db_escape(string $value): string | Escape a string. Use prepared statements whenever possible. |
| Helper | Signature | Description |
page_set_var() | page_set_var(string $key, mixed $value): void | Set a page-level variable (stored in $_SESSION). Useful for passing data between events/pages. |
page_get_var() | page_get_var(string $key, mixed $default = null): mixed | Retrieve a page-level variable previously set with page_set_var(). |
flash() | flash(string $message, string $type = 'success'): void | Set a flash message displayed once on the next page. Types: success, error, warning. |
| Helper | Signature | Description & Suitable Event |
set_default_value() | set_default_value(string $field, mixed $value): void | Set a default field value in the Add form. Event: Add Page — Before Display |
hide_field() | hide_field(string ...$fields): void | Hide fields from the view. Supports multiple fields. Event: Before Display (Add/Edit/View/List) |
show_field() | show_field(string ...$fields): void | Show fields that were previously hidden. Event: Before Display |
set_readonly_field() | set_readonly_field(string ...$fields): void | Make fields read-only (visible but not editable). Event: Edit Page — Before Display |
| Helper | Signature | Description |
send_email() | send_email(string $to, string $subject, string $body, string $from = ''): bool | Send an HTML email. For full features (CC/BCC/attachment) use aurum_mail(). |
format_currency() | format_currency(float $amount, string $symbol = 'Rp', int $decimals = 0): string | Format a number as currency. Example: format_currency(1500000) → "Rp 1.500.000" |
format_date() | format_date(string $date, string $format = 'd/m/Y'): string | Format a date. Returns - if empty/0000-00-00. Example: format_date('2024-01-15') → "15/01/2024" |
| Helper | Signature | Description |
PrepareSQL() | PrepareSQL(string $sql, array $params = []): array | Wrap SQL + params into an array. For passing to Exec() or Query(). |
Exec() | Exec(string|array $sql, array $params = []): int|false | Execute a query, returns rowCount. On error → LastError(). |
Query() | Query(string|array $sql, array $params = []): PDOStatement|false | Execute a query, returns PDOStatement. On error → returns false. |
LastId() | LastId(): string|false | Get the last insert ID after Exec() or Query(). |
LastError() | LastError(): string | Get the last error message from Exec() or Query(). |
| Helper | Signature | Description |
evt_number() | evt_number(array $values, string $field, float $default = 0): float | Get a field value as a number. Ideal for currency inputs (e.g. "Rp 1,500,000" → 1500000). |
evt_set_value() | evt_set_value(array &$values, string $field, mixed $value): void | Modify a field value before saving. Used in Process Record Values. |
evt_now() | evt_now(string $format = 'Y-m-d H:i:s'): string | Get the current datetime. Example: evt_now('Y-m-d') → "2024-01-15" |
evt_insert() | evt_insert(?PDO $pdo, string $table, array $data): string | Insert a record into another table. Returns last insert ID. $pdo can be null. |
evt_update() | evt_update(?PDO $pdo, string $table, array $data, array $where): int | Update records by condition. $where is required (cannot be empty). |
evt_delete() | evt_delete(?PDO $pdo, string $table, array $where): int | Delete records by condition. $where is required (cannot be empty). |
evt_first() | evt_first(?PDO $pdo, string $table, array $where = [], array $columns = ['*']): ?array | Get a single record. Returns null if not found. |
evt_all() | evt_all(?PDO $pdo, string $table, array $where = [], array $columns = ['*'], string $orderBy = '', int $limit = 0): array | Get multiple records. Supports filters, column selection, ordering, and limit. |
evt_sum() | evt_sum(?PDO $pdo, string $table, string $field, array $where = []): float | Sum a field's values. Example: total sales per employee. |
evt_count() | evt_count(?PDO $pdo, string $table, array $where = []): int | Count records matching the given conditions. |
evt_raw() | evt_raw(string $sql, array $params = []): array | Safe SQL expression for evt_insert()/evt_update(). Example: evt_raw('qty - ?', [1]) |
evt_only() | evt_only(array $values, array $fields): array | Pick only specific fields from $values. |
evt_except() | evt_except(array $values, array $fields): array | Remove specific fields from $values. |
| Category | Helper | Source File |
| URL & Navigation | base_url() redirect() | core/helpers.php |
| Database Legacy | CustomQuery() db_fetch_array() db_fetch_all() db_num_rows() db_insert_id() db_escape() | core/helpers.php |
| Session & Flash | page_set_var() page_get_var() flash() | core/helpers.php |
| Event Error & State | event_error() event_set() event_get() | core/helpers.php |
| HTML Injection | add_html_top() add_html_bottom() | core/helpers.php |
| Field Control | set_default_value() hide_field() show_field() set_readonly_field() | core/helpers.php |
| Email & Formatting | send_email() format_currency() format_date() | core/helpers.php |
| Auth & User | current_user() current_group_id() is_admin() | core/helpers.php |
| Utility | auto_number() value_exists() | core/helpers.php |
| Event DB Connection | evt_db() SetConnection() | core/event_helpers.php |
| Event Query | PrepareSQL() Exec() Query() LastId() LastError() | core/event_helpers.php |
| Event Lookup | DBLookup() DBLookupRow() DBQueryRows() | core/event_helpers.php |
| Event Utility | evt_identifier() evt_value() | core/event_helpers.php |
| Event CRUD (evt_*) | evt_number() evt_set_value() evt_now() evt_insert() evt_update() evt_delete() evt_first() evt_all() evt_sum() evt_count() evt_raw() evt_only() evt_except() | core/event_helpers.php |