Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/application/component/helper.php on line 162
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/components/com_cricket/cricket.php on line 21
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/application/component/model.php on line 118
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/components/com_cricket/models/appointments.php on line 18
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/application/component/controller.php on line 632
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/html/html.php on line 68
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/application/component/model.php on line 118
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/components/com_cricket/models/association.php on line 19
/**
* Convert date into the MYSQL compatible format (YYYY-MM-DD)
* @access public
* @param string $unformatted_date
* @return string
*/
function MYSQLDate($unformatted_date)
{
$mysql_date = str_replace("/", "-", $unformatted_date);
if ($mysql_date > 0)
{
$timestamp = strtotime($mysql_date);
$mysql_date = date("Y-m-d", $timestamp);
}
else
{
$mysql_date = '0000-00-00';
}
return $mysql_date;
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function HumanDate($mysql_date, $date_format = "d/m/Y")
{
$timestamp = strtotime(str_replace("/", "-", $mysql_date));
$human_date = date($date_format, $timestamp);
return $human_date;
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function Curry2Dec($currency)
{
$currency = str_replace(",","",$currency);
$currency = str_replace("$","",$currency);
return ($currency * 1);
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function FormatCurrency($numeric = 0, $dp = 2)
{
return "$".number_format(round($numeric,$dp),$dp);
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function Val($numeric = 0)
{
return ($numeric * 1);
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function image_toggle($id, $option, $controller, $view, $task, $value, $image = null, $yesimg = 'tick.png', $noimg = 'publish_x.png', $clickable = true, $onclick = 'default')
{
if ($onclick == 'default')
{
$onclick = 'onclick="return (confirm(\'Are you sure you want to set this record as not in myob?\') && listItemTask(\'cb'.$id.'\',\''.$task.'\'));"';
}
else
{
$onclick = 'onclick="return (true && listItemTask(\'cb'.$id.'\',\''.$task.'\'));"';
}
$imagename = $value ? $yesimg : $noimg;
$altText = $value ? 'Yes' : 'No';
if ($clickable)
{
$link = '
';
$endlink = '';
}
if ($image)
{
return $link.$image.$endlink;
}
else
{
return $link.'

'.$endlink;
}
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function getMonthName($month = 0)
{
if ($month > 0 && $month <= 12)
{
return date("F", mktime(0,0,0,$month));
}
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function ReIndex($selectString, $NewValue, $id = '')
{
$selectString = str_replace('SELECTED', '', $selectString);
$selectString = str_replace('value="'.$NewValue.'"', 'value="'.$NewValue.'" SELECTED', $selectString);
$selectString = str_replace('" class', $id.'" class', $selectString);
return $selectString;
}
/**
* Convert a into a formatted date (d/M/Y) from MYSQL;
* @access public
* @param string $MySQLDate, string $DateFormat
* @return string
*/
function getID()
{
//Get the selected id
$cid = JRequest::getVar( 'cid', array(), '', 'array' );
$id = JRequest::getVar( 'id', 0, '', 0);
if ($id == 0)
{
$id = JRequest::getVar( 'ID', 0, '', 0);
}
if (isset($cid) && $cid[0] > 0)
{
$id = $cid[0];
}
return $id;
}
?>
Warning: include(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/application/component/view.php on line 564
Warning: require_once(): Unable to allocate memory for pool. in /var/www/www.crcua.co.nz/libraries/joomla/html/html.php on line 68
|