<?php
include_once(_DIR_TO_CLASS."/c_page.php");
include_once(_DIR_EXT."/esmo_magnit_pmo/i_event_pmo.php");
class c_page_cab_events_event_pass extends c_page
{
  public $h1='Карточка участника мероприятия' ;

	var $rec_pass ;
	var $rec_personal ;
	var $obj_event ;
	var $rec_event ;

	function select_obj_info()
	{ if (_CUR_ID)
	  { $this->rec_pass=EVENTS()->get_event_pass_by_pass_id(_CUR_ID)  ;
	    if ($this->rec_pass['personal_id']) $this->rec_personal=PERSONAL()->get_personal_by_id($this->rec_pass['personal_id'],array('get_ext_info'=>1)) ;
	    if (!$this->rec_personal['pkey']) $this->result=404 ;
	    if ($this->rec_pass['event_id']) 
        { $this->rec_event=EVENTS()->get_event_by_id($this->rec_pass['event_id']) ;
          $this->obj_event=EVENTS()->get_event_obj_by_ext($this->rec_event['ext']) ;
        }
	    
	  }
	}

	function menu_config()
	{ // вкладки для сотрудника
	  if ($this->rec_pass['pkey'])
	     { $this->menu['/window/events/event_pass/'.$this->rec_pass['pkey'].'/']='Карточка участника' ;
	       $this->menu['/window/events/event_pass/'.$this->rec_pass['pkey'].'/log/']='Журнал событий' ;
	       $this->menu['/window/events/event_pass/'.$this->rec_pass['pkey'].'/log_json/']='Журнал' ;
	       $this->menu['/window/events/event_pass/'.$this->rec_pass['pkey'].'/db/']='Исходные данные' ;
	       $this->page_type='window' ;
	     }
	  else parent::menu_config() ;
	}

  function block_main()
  { $this->page_title() ;
    
      include_once(_DIR_EXT.'/events/doc_event_personal_history.php') ;
      $report_obj=new doc_event_personal_history() ;
      $report_obj->event_pass_id=_CUR_ID;
      $report_obj->init();
      $report_obj->setting();
      $report_obj->view() ;

  }


}



?>