<?php
include_once("c_esmo_magnit_instruction_card.php");
class c_page_cab_esmo_magnit_instruction_card_report extends c_page_cab_esmo_magnit_instruction_card
{

  function second_menu_config()
  { if (_sizeof($this->obj_event->arr_reports)) foreach($this->obj_event->arr_reports as $i=>$rec_report)
      $this->second_menu[$this->rec_event['__href'].'report/'.$i.'/']=array('title'=>$rec_report['title']) ;
  }

  public $h1='Журнал инструктажа' ;
  function block_main()
  { $this->page_title() ;
    $arr=explode('/',_CUR_PAGE_DIR) ;
	$report_id=0 ;
    if ((int)$arr[6]) $report_id=(int)$arr[6] ;
    if ($report_id)
    {   $rec_report=$this->obj_event->arr_reports[$report_id] ;
        list($report_ext,$report_script)=explode('/',$rec_report['code']) ;
	    $report_class=$report_script ;
	    //echo '$report_ext='.$report_ext.'<br>' ; echo '$report_script='.$report_script.'<br>' ; echo '$report_script='.$report_script.'<br>' ; echo '$report_class='.$report_class.'<br>' ;
	    include_once(_DIR_EXT.'/'.$report_ext.'/'.$report_script.'.php') ;
        $report_obj=new $report_class() ;
        //damp_array($report_obj) ;
        $report_obj->no_view_title=0;
        $report_obj->event_id=$this->rec_event['pkey'];
        $report_obj->init();
        $report_obj->setting(array('no_view_event_select'=>1,
                                    'hidden_params'=>array('url_page_doc_view'=>'/window/esmo_magnit_instruction/card/'.$this->rec_event['pkey'].'/doc/',
                                                           'append_doc_to_to_doc_url'=>1,
                                                           'filter[event_id]'=>$this->rec_event['pkey']
                                                           )
                                  )) ;
        $report_obj->view() ;

    }

  }


}



?>
