<?php
include_once('report_mo3.php') ;
class report_mo_smena extends report_mo3
{
 var $title='Журнал проведения медицинских осмотров' ;
 var $filter=array() ;
    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 ;
    public $dont_use_member_personal_filter=1 ;


 function setting($options=array())
{ $arr_accounts=ACCOUNTS()->get_list_members(array('group_id'=>MEMBER()->cur_group_id,'rol'=>'2,3')) ;
  $arr_groups=ACCOUNTS()->get_arr_groups_to_cur_account() ;
  list($arr_orgs_ids,$arr_otdel_ids,$arr_works_ids)=PERSONAL()->get_org_otdels_works_to_cur_account($this->filter) ;
  ?><div id="panel_filter">
              <form id="sky-form" class="sky-form"><input type="hidden" name="filter_dir" value="<?echo _CUR_REPORT_DIR?>">
                   <fieldset>
                       <div class="row">
                       <?  $this->filter_section_select('group_id',$GLOBALS['LS_person_group_title'].':',2,$arr_groups) ;
                           $this->filter_section_select('doctor_id','Фельдшер:',2,$arr_accounts,array('space_element'=>1)) ;
                           $this->filter_section_select_multiple('org_ids','Организация:',2,$arr_orgs_ids) ;
                           $this->filter_section_select_multiple('otdel_ids','Подразделение:',2,$arr_otdel_ids) ;
                           $this->filter_section_input_text('name','ФИО:',2,array('auto_complete'=>"autocomplette_personal_name")) ;
                           $this->filter_section_select('tk','Тип контроля:',2,$_SESSION['ARR_mo_tk_type'],array('use_id_plus_1'=>1)) ;
                           $this->filter_section_input_text('data_from','От:',2,array('class'=>'datetimepicker')) ;
                           $this->filter_section_input_text('data_to','До:',2,array('class'=>'datetimepicker')) ;
                       ?>
                       </div>
                   </fieldset>
                   <?$this->panel_buttons();?>
               </form>
   </div>
  <?
}

function print_template_HTML($list_recs,$options=array())
{
    //damp_array($_POST) ;
    /*?><div id="reports_mo_smena">

      <div><table class="smena_info">
         <tr><td>Сотрудник:</td><td><?echo $member->working.' '.$member->name?></td></tr>
         <tr><td>Рабочая группа:</td><td><?echo $member->cur_group_name?></td></tr>
         <tr><td>Начало смены:</td><td><?echo $member->_smena_in?></td></tr>
         <tr><td>Окончание смены:</td><td><?echo date('d.m.Y H:i')?></td></tr>
    </table></div>
    <?*/

    parent::print_template_HTML($list_recs,$options) ;

    ?><table id="smena_podpis">
         <tr><td>Подпись:</td><td><div id=smena_podpis_name><? echo MEMBER()->working.' '.MEMBER()->name?></div></td></tr>
         <tr><td>Дата:</td><td><div id=smena_podpis_date><? echo date('d.m.Y H:i')?></div></td></tr>
         <tr><td>ЭЦП:</td><td><div id=smena_podpis_date>с/н <? echo strtoupper(MEMBER()->certificate['SerialNumber'])?></div></td></tr>

    </table><div class=clear></div><?
    // обязательно возвращем id записей отчета - они будут сохранены в базе
    return(array_keys($list_recs)) ;
}


}


?>
