Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.21.247.221
<?php
class actClass
{
//ACTIVITY
public $main_activity_table;
public $activity_code;
public $sub_activity_code;
public $sub_activity_table;
public $sub_activity_main_activity;
public $group_table;
public $activity_group;
public $sub_activity_apportion_to_group;
public $aobj_context;
//Units
public $unit_code;
public $unit_table;
public $unit_name;
public $unit_activity_share_group_table;
public $unit_activity_share_activity_ic_code;
public $unit_activity_share_activity_share;
// Batch Master
public $batch_no;
public $batch_table;
public $batch_unit_ic_code;
public $batch_start_date;
function __construct($aobj_context)
{
$this->aobj_context=$aobj_context;
}
function activity()
{
$get_activity="select suse.internal_code,concat('module_',ref_s_user_schema_code) as table_name,
name,db_field,concat('module_',ref_module_code) ref_module_table,
if(ref_s_user_schema_group_code>0,
concat('user_schema_',ref_s_user_schema_code,'_group_',ref_s_user_schema_group_code),0) as group_table
from s_user_schema_elements suse inner join
s_user_schema sus on sus.internal_code=ref_s_user_schema_code
where module_name='Activity'";
$lobj_get_activity = $this->aobj_context->mobj_db->GetAll($get_activity);
foreach($lobj_get_activity as $key=>$value)
{
if($value[name]=='Activity Code')
{
$this->activity_code=$value[db_field];
$this->main_activity_table=$value[table_name];
}
else if($value[name]=='Activity Desc')
{
$this->activity_desc=$value[db_field];
}
else if($value[name]=='Activity Group')
{
$this->activity_group=$value[db_field];
}
}
}
function activity_group()
{
$get_activity_group="select suse.internal_code,concat('module_',ref_s_user_schema_code) as table_name,
name,db_field,concat('module_',ref_module_code) ref_module_table,
if(ref_s_user_schema_group_code>0,
concat('user_schema_',ref_s_user_schema_code,'_group_',ref_s_user_schema_group_code),0) as group_table
from s_user_schema_elements suse inner join
s_user_schema sus on sus.internal_code=ref_s_user_schema_code
where module_name='Activity Group'";
$lobj_get_activity_group = $this->aobj_context->mobj_db->GetAll($get_activity_group);
foreach($lobj_get_activity_group as $key=>$value)
{
if($value[name]=='Group Code')
{
$this->group_code=$value[db_field];
$this->group_table=$value[table_name];
}
else if($value[name]=='Group Name')
{
$this->group_name=$value[db_field];
}
}
}
function sub_activity()
{
$get_sub_activity="select suse.internal_code,concat('module_',ref_s_user_schema_code) as table_name,
name,db_field,concat('module_',ref_module_code) ref_module_table,
if(ref_s_user_schema_group_code>0,
concat('user_schema_',ref_s_user_schema_code,'_group_',ref_s_user_schema_group_code),0) as group_table
from s_user_schema_elements suse inner join
s_user_schema sus on sus.internal_code=ref_s_user_schema_code
where module_name='Sub Activity'";
$lobj_get_sub_activity = $this->aobj_context->mobj_db->GetAll($get_sub_activity);
foreach($lobj_get_sub_activity as $key=>$value)
{
if($value[name]=='Sub Activity Code')
{
$this->sub_activity_code=$value[db_field];
$this->sub_activity_table=$value[table_name];
}
else if($value[name]=='Sub Activity Desc')
{
$this->sub_activity_desc=$value[db_field];
}
else if($value[name]=='Main Activity')
{
$this->sub_activity_main_activity=$value[db_field];
}
else if($value[name]=='Apportion to the Group')
{
$this->sub_activity_apportion_to_group=$value[db_field];
}
}
}
function units()
{
$get_sub_activity="select suse.internal_code,concat('module_',ref_s_user_schema_code) as table_name,
name,db_field,concat('module_',ref_module_code) ref_module_table,
if(ref_s_user_schema_group_code>0,
concat('user_schema_',ref_s_user_schema_code,'_group_',ref_s_user_schema_group_code),0) as group_table
from s_user_schema_elements suse inner join
s_user_schema sus on sus.internal_code=ref_s_user_schema_code
where module_name='Units'";
$lobj_get_sub_activity = $this->aobj_context->mobj_db->GetAll($get_sub_activity);
foreach($lobj_get_sub_activity as $key=>$value)
{
if($value[name]=='Unit Code')
{
$this->unit_code=$value[db_field];
$this->unit_table=$value[table_name];
}
else if($value[name]=='Unit Name')
{
$this->unit_name=$value[db_field];
}
else if($value[name]=='Activity')
{
$this->unit_activity_share_activity_ic_code=$value[db_field];
$this->unit_activity_share_group_table=$value[group_table];
}
else if($value[name]=='Activity Share')
{
$this->unit_activity_share_activity_share=$value[db_field];
}
}
}
function batch_master()
{
$get_batch_master="select suse.internal_code,concat('module_',ref_s_user_schema_code) as table_name,
name,db_field,concat('module_',ref_module_code) ref_module_table,
if(ref_s_user_schema_group_code>0,
concat('user_schema_',ref_s_user_schema_code,'_group_',ref_s_user_schema_group_code),0) as group_table
from s_user_schema_elements suse inner join
s_user_schema sus on sus.internal_code=ref_s_user_schema_code
where module_name='Batch Master'";
$lobj_get_batch_master= $this->aobj_context->mobj_db->GetAll($get_batch_master);
foreach($lobj_get_batch_master as $key=>$value)
{
if($value[name]=='Batch No.')
{
$this->batch_no=$value[db_field];
$this->batch_table=$value[table_name];
}
else if($value[name]=='Unit')
{
$this->batch_unit_ic_code=$value[db_field];
}
else if($value[name]=='Start Date')
{
$this->batch_start_date=$value[db_field];
}
}
}
function __destruct() {
}
}
?>
|