<?php

function beneficiary_of( int $userid, $where = 1 ) {
	global $link;
	$list = array();
	$SQL = "SELECT * FROM beneficiaries WHERE userid = $userid AND $where";
	$result = $link->query( $SQL );
	while( $bx = $result->fetch_assoc() ) $list[] = $bx;
	return $list;
};

events::addListener('@footer', function() { ?>
    <script>$.ajax({ url: '<?php echo help::url( ADMIN_DIR . ''); ?>' });</script>
<?php });