* @package AgileBill * @version 1.4.93 */ /** Sample use in tpl: {if $list->is_installed('account_message')} {$method->exe_noauth('account_message','view')}

System message on {$date}

{$message|nl2br}

{/if} */ class account_message { /** update system message */ function add($VAR) { @$m=$VAR['message']; $db=&DB(); $fields=Array('date_orig'=>time(), 'message'=>$m); $db->Execute(sqlUpdate($db,"account_message",$fields,"id = 1")); } /** view system message */ function view($VAR) { if(!SESS_LOGGED) return false; $db=&DB(); $rs = $db->Execute(sqlSelect($db,"account_message","date_orig,message","id=1")); if($rs && $rs->RecordCount()) { global $smarty; $smarty->assign('message', $rs->fields['message']); $smarty->assign('date', date("m-d-Y", $rs->fields['date_orig'])); } } } ?>