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 : 18.221.240.14
<?php
class monthYear
{
function __construct($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->user_id = $_SESSION['user_id'];
include_once($aobj_context->main_src."/schema/t_financial_year.php");
$this->fin_obj=new t_financial_year();
}
function getMonthYear()
{
$get_months="select month_id as internal_code,month_name from months order by 1";
$lobj_get_months = $this->aobj_context->mobj_db->GetAll($get_months);
$get_month_year="select month(current_date) as month,year(current_date) as year ";
$lobj_get_month_year = $this->aobj_context->mobj_db->GetRow($get_month_year);
$year=$lobj_get_month_year[year];
$month=$lobj_get_month_year[month];
$days_in_a_month=cal_days_in_month(CAL_GREGORIAN, $month, $year);
$start_year=$year-2;
$end_year=$year+3;
$k=0;
for($i=$start_year;$i<=$end_year;$i++)
{
$lobj_get_years[$k][internal_code].=$i;
$lobj_get_years[$k][year].=$i;
$k++;
}
$arr[month_period]=$lobj_get_period_data;
$arr[year]=$lobj_get_years;
$arr[month]=$lobj_get_months;
$arr[current_month]=$month;
$arr[current_year]=$year;
$arr[days_in_a_month]=$days_in_a_month;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
return;
}
function getDaysInaMonth($aobj_context)
{
$this->aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$days_in_a_month=cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);
$arr[days_in_a_month]=$days_in_a_month;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
return;
}
function getFinancialYear()
{
$get_data="select internal_code,
{$this->fin_obj->year_code} as year_code,
{$this->fin_obj->start_date} as start_date,
{$this->fin_obj->end_date} as end_date from
{$this->fin_obj->financial_year_table} order by year_code desc";
$lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
echo $this->aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"Success");
return;
}
}
function getMonthYear($aobj_context)
{
$obj=new monthYear($aobj_context);
$obj->getMonthYear();
}
function getFinancialYear($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$obj=new monthYear($aobj_context);
$obj->getFinancialYear();
}
function getDaysInaMonth($aobj_context)
{
$obj=new monthYear($aobj_context);
$obj->year=$aobj_context->mobj_data["year"];
$obj->month=$aobj_context->mobj_data["month"];
$obj->getDaysInaMonth();
}
?>
|