<?php
function org_id()
{
    return $_SESSION['organization_id'] ?? 0;
}

function enforce_org_query($baseQuery)
{
    $org = org_id();
    if(!$org){
        die("Organization not selected.");
    }
    return $baseQuery . " AND organization_id=" . intval($org);
}
