<?
function panel_proverka_result($args,$virt_status)
{   $systolic_min=$args['data']['tonometer_args']['systolic_min'] ;
    $systolic_max=$args['data']['tonometer_args']['systolic_max'] ;
    $diastolic_min=$args['data']['tonometer_args']['diastolic_min'] ;
    $diastolic_max=$args['data']['tonometer_args']['diastolic_max'] ;
    $min_temperature=$args['data']['thermometer_args']['min_temperature'] ;
    $max_temperature=$args['data']['thermometer_args']['max_temperature'] ;
    $min_pulse=$args['data']['pulse_args']['min_pulse'] ;
    $max_pulse=$args['data']['pulse_args']['max_pulse'] ;

    $_SESSION['ARR_pp_status']=array() ;
    $_SESSION['ARR_pp_status'][1]='Успешно (зеленый глаз)' ;
    $_SESSION['ARR_pp_status'][2]='Саботаж (черный глаз)' ;
    $_SESSION['ARR_pp_status'][3]='Не пройдено (красный глаз)' ;

    ?>
    <div id="panel_proverka_result"><div id="panel_filter">
           <form id="sky-form" class="sky-form">
        <?if ($args['comment']) echo '<div class="green" style="font-size:16px;">'.$args['comment'].'</div>'?>
      <table>
      <tr><td>Тип контроля</td><td><label><input type="radio" name="tk" value="1" checked> Предсменный </label> <label><input type="radio" name="tk" value="2"> Послесменный </label> </td></tr>
      <tr><td>У вас есть жалобы на самочувствие?:</td><td><label><input type="radio" name="q" value="0" checked> НЕТ </label> <label><input type="radio" name="q" value="1"> ДА </label> </td></tr>
      <tr><td colspan="2"><strong>Результаты проверки:</strong></td></tr>
      <?if ($args['data']['tonometer']){?><tr><td>Давление</td><td><input type=text name="d1" value="<?echo rand($systolic_min,$systolic_max)?>"> / <input type=text name="d2" value="<?echo rand($diastolic_min,$diastolic_max)?>"></td><td>Норма: <?echo $systolic_min.'...'.$systolic_max.' / '.$diastolic_min.'...'.$diastolic_max?></td></tr><?}?>
      <?if ($args['data']['pulse']){?><tr><td>Пульс</td><td><input type=text name="p" value="<?echo rand($min_pulse,$max_pulse)?>"></td><td>Норма: <?echo $min_pulse.'...'.$max_pulse?></tr><?}?>
      <?if ($args['data']['thermometer']){?><tr><td>Температура</td><td><input type=text name="t" value="<?echo rand($min_temperature,$max_temperature)?>"></td><td>Норма: <?echo $min_temperature.'...'.$max_temperature?></td></tr><?}?>
      <?if ($args['data']['alcotester']){?><tr><td>Тест на алкоголь</td><td><input type="radio" name="alko" value="0" checked> Нет <input type="radio" name="alko" value="1"> Есть <input type=text name="alko_value" value="<?echo 0?>"></td><td></td></tr><?}?>
      <?if ($args['data']['pupilometer']){?><tr><td>Путилометр</td><td><select name="pupilometer"><?if (_sizeof($_SESSION['ARR_pp_status'])) foreach($_SESSION['ARR_pp_status'] as $id=>$value) if ($id){?><option value="<?echo $id?>"><?echo $value?></option><?}?></select></td></tr><?}?>
      <tr><td>Ошибка при распозновании лица</td><td><input type="checkbox" name="intrusion" value="1"> Да</td><td></td></tr>
      <tr><td>args.data.reason</td><td><select name="reason"><option value="0"></option><?if (_sizeof($_SESSION['ARR_mo_failed_status'])) foreach($_SESSION['ARR_mo_failed_status'] as $id=>$value) if ($id){?><option value="<?echo $id?>"><?echo $value?></option><?}?></select></td></tr>
      <tr><td>args.data.equipment</td><td><select name="equipment"><option value="0"></option><?if (_sizeof($_SESSION['ARR_mo_failed_dev'])) foreach($_SESSION['ARR_mo_failed_dev'] as $id=>$value){?><option value="<?echo $id?>"><?echo $value?></option><?}?></select></td></tr>
      </table>
      <?
      // faceid
      if ($args['data']['faceid_photo']=='true')
      {  ?><strong>FACE ID фото</strong><br><?
         $img_name=_DIR_EXT.'/aspmo_term/source/faceid.jpg' ;
          ?><input type="hidden" name="faceid_photo" value="<?echo hide_server_dir($img_name)?>"><?
          ?><img src="<?echo hide_server_dir($img_name)?>" width="200"><?
      }

      // контроль уровня знаний - отдельный запрос
          if ($args['data']['quiz'])
          { include('panel_quiz.php') ;
            panel_quiz($args['data']['quiz'],$virt_status) ;
          }
          // доведение контента - отдельный запрос
          if ($args['data']['media_content'])
          { include('panel_media_content.php') ;
            panel_media_content($args['data']['media_content'],$virt_status) ;
          }
      ?>

       <div id="panel_buttons" style="">
           <input id=submit type="submit" class="button v2" cmd="aspmo_term/send_proverka_result" terminal_id="<?echo $args['id']['terminal']?>"  user="<?echo $args['id']['user']?>"  medexam="<?echo $args['id']['medexam']?>" value="Отправить результаты фельдшеру">            </div>
        </form>
       </div>



    </form></div><?

}

?>
