MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/allyindian_com/sbltt/application/helpers/report_helper.php
<?php

function show_report_if_allowed($report_prefix, $report_name, $person_id, $permission_id = '')
{
	$CI =& get_instance();

	$permission_id = empty($permission_id) ? 'reports_' . $report_name : $permission_id;
	if($CI->Employee->has_grant($permission_id, $person_id))
	{
		show_report($report_prefix, $report_name, $permission_id);
	}
}

function show_report($report_prefix, $report_name, $lang_key='')
{
	$CI =& get_instance();

	$lang_key = empty($lang_key) ? $report_name : $lang_key;
	$report_label = $CI->lang->line($lang_key);
	$report_prefix = empty($report_prefix) ? '' : $report_prefix . '_';
	// no summary nor detailed reports for receivings
	if(!empty($report_label) && $report_label != $lang_key . ' (TBD)')
	{
		if($report_label === "Items"){
			$report_label = "Products";
		}
		if($report_label === "Sale"){
			$report_label = "Sales";
		}
		if($report_label === "Receivings"){
			$report_label = "Receiving";
		}
		?>
			<a class="list-group-item" href="<?php echo site_url('reports/' . $report_prefix . preg_replace('/reports_(.*)/', '$1', $report_name));?>"><?php echo $report_label; ?></a>
		<?php
	}
}

?>