<?php
include_once("c_esmo_magnit_instruction_lession.php");
class c_page_cab_esmo_magnit_instruction_lession_docs extends c_page_cab_esmo_magnit_instruction_lession
{
  public $h1='Занятие по инструктажу - методические материалы' ;

  function block_main()
  {	  //$this->page_title() ;
      //damp_array($this->recs_docs_by_themes) ;
      if (_sizeof($this->recs_themes)) foreach($this->recs_themes as $rec_theme)
      { if (_sizeof($this->recs_docs_by_themes[$rec_theme['theme_id']]))
        {   ?><h1><?echo $rec_theme['obj_name']?></h1><?
            foreach($this->recs_docs_by_themes[$rec_theme['theme_id']] as $rec_doc)
            {  //damp_array($rec_doc) ;
                ?><h2>Документ: "<?echo $rec_doc['obj_name']?>"</h2>
                  <p>Загрузил: <strong><?echo ACCOUNTS()->get_member_name_by_id($rec_doc['account_id'])?></strong></p>
                  <p>Дата загрузки: <strong><?echo date('d.m.Y H:i',$rec_doc['c_data'])?></strong></p>
                  <p>Размер файла: <strong><?echo show_size($rec_doc['size'])?></strong></p>
                  <p>Тип файла: <strong><?echo $rec_doc['type']?></strong></p>
                <?
                switch($rec_doc['type'])
                { case 'application/pdf':  ?><iframe src="<?echo _MAIN_PROTOCOL._MAIN_DOMAIN?>/public/instruktions_docs/<?echo $rec_doc['file_name']?>" style="width:100%; height:700px;" frameborder="0" /></iframe><br><br><? break ;
                  default: ?><img src="<?echo _MAIN_PROTOCOL._MAIN_DOMAIN?>/public/instruktions_docs/<?echo $rec_doc['file_name']?>" style="max-width:90%;margin:0 auto;display:block;"><?
                }
                ?><div id=panel_buttons class="sky-form no_box_shadow">
                            <button class=button id="print_doc_over_window" href="<?echo _MAIN_PROTOCOL._MAIN_DOMAIN?>/public/instruktions_docs/<?echo $rec_doc['file_name']?>">Печать</button>&nbsp;&nbsp;
                   </div><?
            }


        }

      }

  }
}



?>
