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.133.153.224
Current Path : /var/www/html/nehu/src/ |
| Current File : /var/www/html/nehu/src/entryexitevents.php |
<?php
function leaveEntryExitNoOfDays($aobj_context)
{
require("excludeweekdays.php");
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$from_date = $aobj_context->mobj_data["from_date"];
$to_date = $aobj_context->mobj_data["to_date"];
$days= date_difference($aobj_context,$from_date,$to_date);
$get_ids="select (suse.internal_code) as ids from s_user_schema_elements suse
inner join s_user_schema s on s.internal_code=ref_s_user_schema_code
where module_name='Leave Entry' and suse.name='No Of Days'";
$lobj_get_ids = $aobj_context->mobj_db->GetRow($get_ids);
if($from_date !='undefined-undefined-')
{
$arr[days]=$days;
$arr[ids]=$lobj_get_ids[ids];
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr[days]=0;
$arr[ids]=$lobj_get_ids[ids];
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
}
function leaveEntryExitBalanceLeaves($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$emp_code = $aobj_context->mobj_data["emp_code"];
$leave_type = $aobj_context->mobj_data["leave_type"];
if($emp_code>0 && $leave_type>0)
{
$get_ids="select concat('module_',ref_s_user_schema_code) as table_name,(suse.internal_code) as ids,
name,db_field from s_user_schema_elements suse
inner join s_user_schema s on s.internal_code=ref_s_user_schema_code
where module_name='Employee Leave Balance' ";
$lobj_get_ids = $aobj_context->mobj_db->GetAll($get_ids);
foreach($lobj_get_ids as $key=>$val)
{
if($val[name]=='Employee Code')
$ref_emp_code=$val[db_field];
else if($val[name]=='Leave Type')
$ref_leave_type=$val[db_field];
else if($val[name]=='Opening Balance')
$opeing_balance=$val[db_field];
else if($val[name]=='Closing Balance')
$closing_balance=$val[db_field];
else if($val[name]=='Financial Year')
$fin_year=$val[db_field];
$table_name=$val[table_name];
}
$get_balance_leaves="select
{$ref_emp_code} as ref_emp_code,
{$ref_leave_type} as ref_leave_type,
{$opeing_balance} as opeing_balance,
{$closing_balance} as closing_balance,
SUBSTRING({$fin_year} ,7,4) as st_year,
SUBSTRING({$fin_year} ,18,4) as end_year FROM
{$table_name} where
{$ref_leave_type}={$leave_type} and
{$ref_emp_code}={$emp_code} and YEAR(CURRENT_DATE) BETWEEN SUBSTRING({$fin_year} ,7,4) AND SUBSTRING({$fin_year} ,18,4)";
$obj_get_balance_leaves = $aobj_context->mobj_db->GetRow($get_balance_leaves);
$get_html_field_id="select (suse.internal_code) as ids from s_user_schema_elements suse
inner join s_user_schema s on s.internal_code=ref_s_user_schema_code
where module_name='Leave Entry' and suse.name='Balance Leaves'";
$get_html_field_id = $aobj_context->mobj_db->GetRow($get_html_field_id);
if(!empty($obj_get_balance_leaves))
{
$arr[days]=$obj_get_balance_leaves[closing_balance];
$arr[ids]=$get_html_field_id[ids];
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr[days]=0;
$arr[ids]= $get_html_field_id[ids];
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
}
}
?>
|