<?php
class report_shift extends c_report
{
    var $title='Журнал предсменных/послесменных медицинских осмотров' ;
    public $PDF_page_orientation='L' ; // L P
    public $PDF_page_format='A4' ;
    public $PDF_page_keepmargins=false ;
    public $PDF_page_tocpage=false ;
    public $PDF_show_header=true ;
    var $footer_right='' ;
    var $db_report_code='' ;

    var $rec_event=array() ;
    var $rec_personal=array() ;

    public $show_on_page_peports=0 ;
    var $mo_id=0 ;
    var $personal_id=0 ;
    var $arr_html_docs=array() ;
    var $reports = ['report_mo_before_shift','report_mo_after_shift'];

    function view_as_HTML($options=array())
    {
        foreach ($this->reports as $report_name) {
            $report_html = $this->create_HTML($report_name);
            $this->arr_html_docs[]=$report_html;
        }
    }

    function create_HTML($report_name)
    {
        include_once(_DIR_EXT.'/aspmo_reports/'.$report_name.'.php');
        ob_start();
        $report = new $report_name();
        $report->filter=$this->filter;
        $report->report_paginator=0 ;
        $report->view_as_HTML(['no_any_panels'=>1]);
        $html1=ob_get_clean() ;
        $report_html=_TEMP_DIR.'report_'.md5(rand(1,100000)).'.html' ;
        $this->prepare_HTML_to_PDF_convert($html1,$this->title,$report_html,array()) ;
        return $report_html;
    }


}

?>