<?php
include_once("c_rmt.php");
class c_page_cab_rmt_report extends c_page_cab_rmt
{
  public $h1='Отчет техника' ;

    function block_main()
     {   return ;
         ?><script type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery.ui.core.js"></script>
                         <script type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery.ui.datepicker.min.js"></script>
                         <script type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery.ui.datepicker-ru.js"></script>
                         <script type="text/javascript" src="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery-ui-timepicker-addon.js"></script>
                         <link rel="stylesheet" type="text/css" href="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery-ui.css"/>
                         <link rel="stylesheet" type="text/css" href="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery.ui.datepicker.css"/>
                         <link rel="stylesheet" type="text/css" href="<?echo _PATH_TO_EXT?>/jquery-ui-1.9.2/jquery-ui-timepicker-addon.css"/>
                         <div class="report_setting"><form><?$this->report_mo_small_setting()?></form>

                         </div>
                       <?

     }

    function report_mo_small_setting()
    { $now=getdate() ;
      $from_time=mktime(0,0,0,$now['mon']-1,1,$now['year']);
      $members=ESMO()->get_list_members() ;
      ?><h2>Параметры отчета</h2>
        <table class="setting">
          <tr><td>Техник</td>
              <td><div><select id=doctor_id name="doctor_id" data-select><option value="0">Все</option>
                 <?if (_sizeof($members))foreach($members as $rec_member) if ($rec_member['rol']==2 or $rec_member['rol']==3) {?><option value="<?echo $rec_member['pkey']?>"><?echo $rec_member['_rol_name'].' '.$rec_member['obj_name']?></option><?}?>
                 </select></div>
              </td>
              <td>Тип контроля</td>
              <td>
                <label><input type="radio" name="tk" value="0" checked>Не важно</label><br>
                <?if (_sizeof($_SESSION['ARR_mo_tk_type'])) foreach($_SESSION['ARR_mo_tk_type'] as $id=>$value){?><label><input type="radio" name="tk" value="<?echo $id+1?>"><?echo $value?></label><br><?}?>
              </td>
          </tr>
          <tr><td>Интервал выборки</td>
              <td><input type="text" name="time_from" class="datepicker" data-required value="<?echo date('d.m.Y',$from_time)?>"> <input type="text" name="time_to" class="datepicker" data-required value="<?echo date('d.m.Y',time())?>"></td>
              <td>Результат МО</td>
              <td>
                  <label><input type="radio" name="status" value="0" checked>Не важно</label><br>
                  <label><input type="radio" name="status" value="1">Начат</label><br>
                  <label><input type="radio" name="status" value="2">Пройден</label><br>
                  <label><input type="radio" name="status" value="3">Не пройден</label>
              </td>
          </tr>
          <tr><td>ФИО</td>
              <td>
                  <input type="text" name="name" value=""><br>
              </td>
              <td>Допуск к смене</td>
              <td>
                  <label><input type="radio" name="dopusk" value="0" checked>Не важно</label><br>
                  <label><input type="radio" name="dopusk" value="1">Допущен</label><br>
                  <label><input type="radio" name="dopusk" value="2">Не допущен</label>
              </td>
          </tr>
          <tr><td>Пропуск</td>
              <td>
                  <input type="text" name="propusk" value=""><br>
              </td>
              <td>Причина отказа</td>
              <td>
                  <label><input type="checkbox" name="res_stat[a]" value="1">Алкоголь</label><br>
                  <label><input type="checkbox" name="res_stat[d]" value="1">Давление</label><br>
                  <label><input type="checkbox" name="res_stat[p]" value="1">Пульс</label><br>
                  <label><input type="checkbox" name="res_stat[q]" value="1">Жалобы</label>
              </td>
          </tr>
          <tr><td>Организация</td>
              <td><select name="org_id" id=org_id   data-select><option value="0">Все</option><?
                                  $recs=ESMO()->get_list_personal_section() ;
                                  if (_sizeof($recs)) foreach($recs as $rec_list) {?><option value="<?echo $rec_list['pkey']?>"><?echo $rec_list['obj_name']?></option><?}

                  ?></select><button class="v2" cmd="aspmo/get_panel_otdel_select">Показать подразделения</button>
                  <div id="otdel_select"></div>
              </td>
              <td></td>
              <td></td>
          </tr>
        </table>
        <div class="center"><button id=smena_podpis_button class="button_green v2" cmd="aspmo_docs/doc_create">Создать отчет</button></div>
        <script type="text/javascript">$j(document).ready(function ()
           {$j('input.datepicker').datepicker($j.datepicker.regional["ru"]);
             new mForm.Element.Select({original: 'doctor_id'});
             new mForm.Element.Select({original: 'org_id'});

           }) ;</script>
      <?
    }

}
?>
