//---------------------------------------------------------------------------

#ifndef IST0020MFH
#define IST0020MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <Buttons.hpp>
#include <ImgList.hpp>
#include <Graphics.hpp>
#include <DB.hpp>
#include <DBClient.hpp>
#include <Provider.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include <ADODB.hpp>
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
#include "FRAME_ChartF.h"
#include "cxButtons.hpp"
#include "cxCalc.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDBData.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridBandedTableView.hpp"
#include "cxGridChartView.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridDBChartView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinMcSkin.hpp"
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TIST0020M : public TForm
{
__published:	// IDE-managed Components
	TShape *ShpList;
    TcxPageControl *PgQuery;
    TcxTabSheet *TsDay;
    TcxTabSheet *TsMon;
    TcxTabSheet *TsYear;
    TcxButton *BtnSearch;
    TcxButton *BtnPrint;
    TcxButton *BtnExlSave;
    TcxPageControl *PgList;
    TcxTabSheet *TsListDay;
    TcxTabSheet *TsListMon;
    TcxTabSheet *TsListYear;
    TBevel *Bevel1;
    TDateTimePicker *DtDay;
    TDateTimePicker *DtMon;
    TDateTimePicker *DtYear;
    TcxLabel *Lbl2;
    TcxLabel *cxLabel1;
    TcxLabel *cxLabel2;
    TcxGrid *CxDay;
    TcxGridDBChartView *TcDay;
    TcxGridDBChartSeries *cDaySeries1;
    TcxGridDBChartSeries *cDaySeries2;
    TcxGridDBChartSeries *cDaySeries3;
    TcxGridDBChartSeries *cDaySeries4;
    TcxGridDBChartSeries *cDaySeries5;
    TcxGridDBChartSeries *cDaySeries6;
    TcxGridDBChartSeries *cDaySeries7;
    TcxGridLevel *GlDay;
    TPanel *PnlDayGraph;
    TPanel *PnlMonGraph;
    TPanel *PnlYearGraph;
    TcxSplitter *SplDay;
    TcxSplitter *SplMon;
    TcxSplitter *SplYear;
    TLabel *LblRptTitle;
    TLabel *LblQryTm;
    TLabel *LblQryDay;
    TLabel *LblQryYear;
    TcxTabSheet *TsTermYear;
    TcxTabSheet *TsListTermYear;
    TcxSplitter *SplTermYear;
    TPanel *PnlTermYear;
    TDateTimePicker *DtEdYear;
    TcxLabel *cxLabel3;
    TDateTimePicker *DtStYear;
    TcxLabel *cxLabel4;
    TLabel *LblQryTermYear;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TImageList *LimgTmp;
    TADOQuery *ADOD;
    TADOQuery *ADOM;
    TADOQuery *ADOY;
    TADOQuery *ADOT;
    TcxGridBandedTableView *TvDay;
    TcxGridBandedColumn *ColDayNo;
    TcxGridBandedColumn *ColDayNm;
    TcxGridBandedColumn *ColDayTt;
    TcxGridBandedColumn *ColDay00;
    TcxGridBandedColumn *ColDay01;
    TcxGridBandedColumn *ColDay02;
    TcxGridBandedColumn *ColDay03;
    TcxGridBandedColumn *ColDay04;
    TcxGridBandedColumn *ColDay05;
    TcxGridBandedColumn *ColDay06;
    TcxGridBandedColumn *ColDay07;
    TcxGridBandedColumn *ColDay08;
    TcxGridBandedColumn *ColDay09;
    TcxGridBandedColumn *ColDay10;
    TcxGridBandedColumn *ColDay11;
    TcxGridBandedColumn *ColDay12;
    TcxGridBandedColumn *ColDay13;
    TcxGridBandedColumn *ColDay14;
    TcxGridBandedColumn *ColDay15;
    TcxGridBandedColumn *ColDay16;
    TcxGridBandedColumn *ColDay17;
    TcxGridBandedColumn *ColDay18;
    TcxGridBandedColumn *ColDay19;
    TcxGridBandedColumn *ColDay20;
    TcxGridBandedColumn *ColDay21;
    TcxGridBandedColumn *ColDay22;
    TcxGridBandedColumn *ColDay23;
    TFRAMEChart *FRAMEChart1;
    TcxGrid *CxYear;
    TcxGridDBChartView *cxGridDBChartView2;
    TcxGridDBChartSeries *cxGridDBChartSeries8;
    TcxGridDBChartSeries *cxGridDBChartSeries9;
    TcxGridDBChartSeries *cxGridDBChartSeries10;
    TcxGridDBChartSeries *cxGridDBChartSeries11;
    TcxGridDBChartSeries *cxGridDBChartSeries12;
    TcxGridDBChartSeries *cxGridDBChartSeries13;
    TcxGridDBChartSeries *cxGridDBChartSeries14;
    TcxGridBandedTableView *TvYear;
    TcxGridBandedColumn *ColYearNo;
    TcxGridBandedColumn *ColYearNm;
    TcxGridBandedColumn *ColYearTt;
    TcxGridBandedColumn *ColYear01;
    TcxGridBandedColumn *ColYear02;
    TcxGridBandedColumn *ColYear03;
    TcxGridBandedColumn *ColYear04;
    TcxGridBandedColumn *ColYear05;
    TcxGridBandedColumn *ColYear06;
    TcxGridBandedColumn *ColYear07;
    TcxGridBandedColumn *ColYear08;
    TcxGridBandedColumn *ColYear09;
    TcxGridBandedColumn *ColYear10;
    TcxGridBandedColumn *ColYear11;
    TcxGridBandedColumn *ColYear12;
    TcxGridLevel *GlYear;
    TcxGrid *CxTermYear;
    TcxGridDBChartView *cxGridDBChartView1;
    TcxGridDBChartSeries *cxGridDBChartSeries1;
    TcxGridDBChartSeries *cxGridDBChartSeries2;
    TcxGridDBChartSeries *cxGridDBChartSeries3;
    TcxGridDBChartSeries *cxGridDBChartSeries4;
    TcxGridDBChartSeries *cxGridDBChartSeries5;
    TcxGridDBChartSeries *cxGridDBChartSeries6;
    TcxGridDBChartSeries *cxGridDBChartSeries7;
    TcxGridBandedTableView *TvTermYear;
    TcxGridBandedColumn *ColTYearNo;
    TcxGridBandedColumn *ColTYearNm;
    TcxGridBandedColumn *ColTYearTt;
    TcxGridBandedColumn *ColTYear00;
    TcxGridBandedColumn *ColTYear01;
    TcxGridBandedColumn *ColTYear02;
    TcxGridBandedColumn *ColTYear03;
    TcxGridBandedColumn *ColTYear04;
    TcxGridBandedColumn *ColTYear05;
    TcxGridBandedColumn *ColTYear06;
    TcxGridBandedColumn *ColTYear07;
    TcxGridBandedColumn *ColTYear08;
    TcxGridBandedColumn *ColTYear09;
    TcxGridBandedColumn *ColTYear10;
    TcxGridBandedColumn *ColTYear11;
    TcxGridBandedColumn *ColTYear12;
    TcxGridBandedColumn *ColTYear13;
    TcxGridBandedColumn *ColTYear14;
    TcxGridBandedColumn *ColTYear15;
    TcxGridBandedColumn *ColTYear16;
    TcxGridBandedColumn *ColTYear17;
    TcxGridBandedColumn *ColTYear18;
    TcxGridBandedColumn *ColTYear19;
    TcxGridBandedColumn *ColTYear20;
    TcxGridBandedColumn *ColTYear21;
    TcxGridBandedColumn *ColTYear22;
    TcxGridBandedColumn *ColTYear23;
    TcxGridLevel *GlTermYear;
    TcxGrid *CxMon;
    TcxGridDBChartView *cxGridDBChartView3;
    TcxGridDBChartSeries *cxGridDBChartSeries15;
    TcxGridDBChartSeries *cxGridDBChartSeries16;
    TcxGridDBChartSeries *cxGridDBChartSeries17;
    TcxGridDBChartSeries *cxGridDBChartSeries18;
    TcxGridDBChartSeries *cxGridDBChartSeries19;
    TcxGridDBChartSeries *cxGridDBChartSeries20;
    TcxGridDBChartSeries *cxGridDBChartSeries21;
    TcxGridBandedTableView *TvMon;
    TcxGridBandedColumn *ColMonNo;
    TcxGridBandedColumn *ColMonNm;
    TcxGridBandedColumn *ColMonTt;
    TcxGridBandedColumn *ColMon01;
    TcxGridBandedColumn *ColMon02;
    TcxGridBandedColumn *ColMon03;
    TcxGridBandedColumn *ColMon04;
    TcxGridBandedColumn *ColMon05;
    TcxGridBandedColumn *ColMon06;
    TcxGridBandedColumn *ColMon07;
    TcxGridBandedColumn *ColMon08;
    TcxGridBandedColumn *ColMon09;
    TcxGridBandedColumn *ColMon10;
    TcxGridBandedColumn *ColMon11;
    TcxGridBandedColumn *ColMon12;
    TcxGridBandedColumn *ColMon13;
    TcxGridBandedColumn *ColMon14;
    TcxGridBandedColumn *ColMon15;
    TcxGridBandedColumn *ColMon16;
    TcxGridBandedColumn *ColMon17;
    TcxGridBandedColumn *ColMon18;
    TcxGridBandedColumn *ColMon19;
    TcxGridBandedColumn *ColMon20;
    TcxGridBandedColumn *ColMon21;
    TcxGridBandedColumn *ColMon22;
    TcxGridBandedColumn *ColMon23;
    TcxGridLevel *GlMon;
    TFRAMEChart *FRAMEChart2;
    TFRAMEChart *FRAMEChart3;
    TFRAMEChart *FRAMEChart4;
    TcxGridBandedColumn *ColMon24;
    TcxGridBandedColumn *ColMon25;
    TcxGridBandedColumn *ColMon26;
    TcxGridBandedColumn *ColMon27;
    TcxGridBandedColumn *ColMon28;
    TcxGridBandedColumn *ColMon29;
    TcxGridBandedColumn *ColMon30;
    TcxGridBandedColumn *ColMon31;
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall BtnPrintClick(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall PgQueryChange(TObject *Sender);
    void __fastcall TvListDataControllerSummaryFooterSummaryItemsSummary(TcxDataSummaryItems *ASender, TcxSummaryEventArguments &Arguments,
          TcxSummaryEventOutArguments &OutArguments);
    void __fastcall TvListDataControllerSummaryDefaultGroupSummaryItemsSummary(TcxDataSummaryItems *ASender, TcxSummaryEventArguments &Arguments,
          TcxSummaryEventOutArguments &OutArguments);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private:	// User declarations
    String          FTitle;

public:		// User declarations
	__fastcall TIST0020M(TComponent* Owner);

	void __fastcall CommClose();
    void __fastcall FormInit();

	void __fastcall RefreshData();

    void __fastcall SelDayStatistics(int ADispCols);
    void __fastcall DspDayStatistics(int ADispCols);

    void __fastcall SelMonthStatistics(int ADispCols);
    void __fastcall DspMonthStatistics(int ADispCols);

    void __fastcall SelYearStatistics(int ADispCols);
    void __fastcall DspYearStatistics(int ADispCols);

    void __fastcall SelTermYearStatistics(int ADispCols);
    void __fastcall DspTermYearStatistics(int ADispCols, int AStYear);

    void __fastcall DrawChart(String sTitle);
};
//---------------------------------------------------------------------------
extern PACKAGE TIST0020M *IST0020M;
//---------------------------------------------------------------------------
#endif
