<?php
include_once("c_personal_person_events.php");
class c_page_cab_personal_person_events_pmo extends c_page_cab_personal_person_events
{
  public $h1='Карточка сотрудника - ПМО' ;

 function get_cur_page_meta_tags()
 {
   if ($this->rec_personal['pkey']) $this->h1=$this->rec_personal['obj_name'].' - ПМО' ;
 }

 function block_main()
 { $this->page_title() ;
/*
    $recs=execSQL('select * from view_event_personals where event_type=1 and personal_id='.$this->rec_personal['pkey'].' order by pkey desc',2,1) ;
    if (_sizeof($recs)) foreach($recs as $rec)
    { $timeline=array() ;
      $rec_event=EVENTS()->get_event_by_id($rec['event_id']) ;
      ?><h2><?echo EVENT_PMO()->name.' '.$rec_event['obj_name']?></h2><?
      $rec_levels=execSQL('select * from obj_site_events_pass_status where event_id='.$rec['event_id'].' and personal_id='.$this->rec_personal['pkey'].' order by c_data',2,1) ;
      if (_sizeof($rec_levels)) foreach($rec_levels as $rec_level) $timeline[$rec_level['c_data']]=$rec_level ;
      $rec_messages=execSQL_line('select * from obj_site_personal_mess where source_obj="esmo_magnit_pmo/i_event_pmo" and source_pkey='.$rec['event_person_id'],2,1) ;
      $arr=array() ;
      if (_sizeof($rec_messages)) foreach($rec_messages as $mess_id) $arr[]='reffer1="'.$mess_id.'.293"' ;
      if (_sizeof($arr))
      { $usl='('.implode(' or ',$arr).')' ;
        $rec_message_events=execSQL('select c_data,obj_name,comment from obj_site_mo_log where '.$usl.' and reffer2="'.$this->rec_personal['_reffer'].'" order by pkey limit 0,50',2,1) ;
        if (_sizeof($rec_message_events)) foreach($rec_message_events as $rec_message_event) $timeline[$rec_message_event['c_data']+2]=$rec_message_event ;
      }

      print_2x_arr($timeline) ;
    }

    ?><?
  */
    include_once(_DIR_EXT.'/esmo_magnit_pmo/report_personals_in_event_pmo.php') ;
    $report_obj=new report_personals_in_event_pmo() ;
    $report_obj->filter['order']='c_data desc';
    $report_obj->event_id=$GLOBALS['LS_esmo_PMO_event'] ;
    $report_obj->personal_id=$this->rec_personal['pkey'] ;
    $report_obj->init();
    $report_obj->no_view_title=1;
    //$report_obj->setting();
    $report_obj->view() ;

    ?><br><br><?

     $pass_id=execSQL_value('select pkey from obj_site_events_pass where event_id='.$GLOBALS['LS_esmo_PMO_event'].' and personal_id='.$this->rec_personal['pkey']) ;

     include_once(_DIR_EXT.'/events/doc_event_personal_history.php') ;
     $report_obj=new doc_event_personal_history() ;
     $report_obj->event_pass_id=$pass_id;
     $report_obj->init();
     //$report_obj->setting();
     $report_obj->view() ;

 }

}



?>
