<?php
include_once('c_rmt_check_s.php') ;
class c_page_cab_rmt_check_s4 extends c_page_cab_rmt_check_s
{
  var $step=3 ;
  public $h1='4 из 4: Подпись техника' ;

  function menu_config()
  { $this->menu[$this->rec_to['__href'].'s1/']='Подтверждение личности водителя' ;
    $this->menu[$this->rec_to['__href'].'s3/']='Проверка технического состояния' ;
    $this->menu[$this->rec_to['__href'].'s4/']='Подпись техника' ;
    $this->menu['/cab/rmt/']=array('title'=>'Закрыть') ;
  }

  function block_main()
  { ?><script src="/AddOns/jSignature/jSignature.min.noconflict.js"></script>
      <h1>Подпись техника <?echo MEMBER()->name?></h1>
      <div id="panel_filter">
        <table id="table_person_sign" class="sky-form">
            <tr><td><div id="signature" style="width:500px;height:200px;"></div></td></tr>
            <tr><td><button id="apply_sign" class="button">Подпись подтверждаю</button><td>
        </table>
      </div>
      <script type="text/javascript">
           $j(document).ready(function() { $j("#signature").jSignature({color:"#00f",'decor-color':'#ffffff',showLine:0,width: '500px', height: '200px'}) ; }) ;
      </script>
      <script type="text/javascript">
 	         $j('button#apply_sign').on('click',function()
 	         {  var sigdiv = $j("#signature")
 		        var datapair = sigdiv.jSignature("getData", "image")  ;
 		        send_ajax_request({cmd:'rmt/tech_sign',to_id:<?echo $this->rec_to['pkey']?>,personal_id:<?echo MEMBER()->id?>,image:datapair}) ;
 	         }) ;
      </script>
      <style type="text/css">
            #table_person_sign{width:auto;table-layout:auto;}
            #table_person_sign td{text-align:center;vertical-align:middle;}
            #table_person_sign button{width:300px;height:70px;float:none;margin:20px auto;}
            #table_person_sign div#signature{width:500px;height:200px;background:url("<?echo _PATH_TO_EXT?>/esmo_magnit_instruction/img/kletka.png") repeat;}
      </style>
 	  <?
  }

}

?>