<?php
include_once("c_personal_person_events.php");
class c_page_cab_personal_person_events_instruktions 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 t2.pkey,t2.c_data,t2.ext,t2.obj_name,t2.type,
                  t1.pkey as event_personal_pkey, 
                  t1.status as event_personal_status, 
                  t1.fname as event_personal_fname, 
                  t1.mess_id as event_personal_mess_id, 
                  t1.result as event_personal_result 
                  from obj_site_events_pass t1
                  left join obj_site_events_schedule t2 on t2.pkey=t1.event_id 
                  where t2.ext like "esmo_magnit_instruction%" and t1.personal_id='.$this->rec_personal['pkey'].'
                  order by t2.c_data desc
                  ') ;
   ?><table class="basic fz_small auto">
      <tr>
        <th>Дата создания инструктажа</th>
        <th>Тип инструктажа</th>
        <th>Наименование инструктажа</th>
        <th>Статус сотрудника</th>
        <th></th>
      </tr>

   <?
   if (_sizeof($recs)) foreach($recs as $rec)
   {  $obj_event=EVENTS()->get_event_obj_by_ext($rec['ext']) ;
      ?><tr>
            <td><?echo date('d.m.Y',$rec['c_data'])?></td>
            <td class="left"><?echo $obj_event->name?></td>
            <td class="left"><?echo $rec['obj_name']?></td>
            <td class="left"><?echo $obj_event->arr_status[$rec['event_personal_status']]?></td>
            <td><a href="/window/events/status/<?echo $rec['event_personal_pkey']?>/" class="new_window">Подробнее</a></td>
        </tr>
      <?
   }
     ?></table><?
 }

}



?>
