<?php
include_once('c_rmt.php') ;
include_once('i_mrt.php') ;
class c_page_cab_rmt_check extends c_page_cab_rmt
{
 public $h1='Проверка транспортного средства' ;
 public $page_type='window' ;
 public $rec_car=array() ;
 public $rec_to=array() ;
 public $use_highslide=1;

 function select_obj_info()
 {
   if (_CUR_ID)
    { $this->rec_to=CAR_TO()->get_TO_by_id(_CUR_ID) ;

      $this->rec_personal=PERSONAL()->get_personal_by_id($this->rec_to['personal_id']) ;
      $this->rec_car=PERSONAL()->get_car_by_id($this->rec_to['car_id']) ;
      $access=($this->rec_to['access_type'])? 'ВЫЕЗД':'ВЪЕЗД' ;
      $this->h1='Проверка транспортного средства  '.$this->rec_to['car_number'].' - '.$access ;
      $this->title='Проверка транспортного средства  '.$this->rec_to['car_number'].' - '.$access ;
    }
   else $this->result=404 ;
 }

 function _menu_config() {}

 function block_main()
 {
   $this->page_title() ;
   $this->panel_TO() ;
 }

 function panel_nomer()
 { ?><div id="panel_nomer">
      <?echo $this->rec_personal['_ext_info']['CarDetails']['Marka'].' '.$this->rec_personal['_ext_info']['CarDetails']['Model'].' '.$this->rec_personal['_ext_info']['CarDetails']['CarNumber']?>
     </div>
   <?
 }

 function panel_TO()
 { include_once('panel_driver_info.php');
   include_once('panel_car_info.php');
   include_once('panel_check_car.php');
   include_once('panel_MO_info.php');


   //$time_mo=getdate(time()) ;
   //$time_from=mktime($time_mo['hours']-8,$time_mo['minutes'],$time_mo['seconds'],$time_mo['mon'],$time_mo['mday'],$time_mo['year']);
   //$rec_mo=ESMO()->get_last_mo_rec_to_personal($this->rec_personal['pkey'],array('only_model'=>'all','time_from'=>$time_from)) ;
   $rec_mo=ESMO()->get_mo_by_id($this->rec_to['mo_id']) ;
   //  echo $_SERVER['REMOTE_ADDR'] ;
   //damp_array($rec_mo) ;
   ?><div id="panel_TO"><form><div id="panel_image_preview"></div>
<!--           --><?//$this->panel_img_mo_view();?>
           <table class="col2x">
             <tr class="info"><td class="info"><? if ($this->rec_to['access_type']) panel_MO_info($rec_mo) ;
                                     panel_driver_info($this->rec_personal);
                                     panel_car_info($this->rec_car);
                                 ?></td>
                 <td class="krit"><? panel_check_car($this->rec_personal,$this->rec_car,$rec_mo,$this->rec_to) ; ?></td>
             </tr>
           </table>
     </form></div>

     <style>
         @media (max-width: 1050px) {
             table.col2x tr.info {
                 display: grid;
             }
         }
         @media (max-width: 825px) {
            #panel_main_menu {
                display: none;
            }
            body.body_work > div.body {
                margin-left: 9px;
            }
         }
     </style>

   <?
     
 }

    function panel_img_mo_view()
    {
       if (!$this->rec_TO['pkey']) return ;
        $list_images=get_all_img_info_to_reffer($this->rec_TO['_reffer']) ;
        print_template($list_images,'list_images_highslide',array('clone_small'=>150)) ;
    }






}

?>