Skip to content

Instantly share code, notes, and snippets.

View CharlesSellers's full-sized avatar

Charles Sellers CharlesSellers

View GitHub Profile
@CharlesSellers
CharlesSellers / WHMCS Client Ref Hook
Last active December 18, 2015 23:19
This is a WHMCS Hook to create a unique account number. This is in a similar way to Sage or KashFlow and is used on our invoices as a customer reference for Bank Transfers. The result is a unique six place account reference which is generated automatically from either the company name or surname. e.g. if we have a client called "Facebook" and an…
<?php
// The function defines a new hook (and hook name) for WHMCS
function hook_client_ref($vars) {
//Pull data from Database, these are the three variables we require.
$id = $vars['userid'];
$companyname = $vars['companyname'];
$surname = $vars['lastname'];