<?

function panel_check_car($rec_personal,$rec_car,$rec_mo,$rec_to)
{   $now=getdate(time()) ;
    $from_time=mktime($now['hours'],$now['minutes'],0,$now['mon'],$now['mday'],$now['year']);
    $to_time=mktime($now['hours'],$now['minutes'],0,$now['mon'],$now['mday']+1,$now['year']);
    $access_type=($rec_to['access_type'])? 1:0;
    $params=execSQL('select * from obj_site_to_params where access='.$access_type.' order by indx') ;
    $check_params=json_decode($rec_to['result']) ;
    //damp_array($check_params,1,-1) ;


    ?>  <h1>Результаты проверки автомобиля</h1>
        <table class="basic fz_small full auto" id="check_result">
        <? if (sizeof($check_params)) foreach($check_params as $param_id=>$res)
        { $rec_param=$params[$param_id] ;
          ?><tr><td><?echo $rec_param['obj_name']?></td><?
          switch($rec_param['type'])
          { case 1: ?><td class="yes <?if ($res->yes) echo 'active'?>"><?if ($res->yes) echo 'ДА'?></td><td class="no <?if ($res->no) echo 'active'?>"><?if ($res->no) echo 'НЕТ'?></td><? break ;
            case 2: ?><td colspan=2><?echo $res?></td><? break ;
            case 3: ?><td colspan=2><?echo $res?></td><? break ;
          }
          ?></tr><?
        }
        ?></table>
        <?
        if ($rec_to['status']) {
        ?>
        <h2>Подпись техника</h2>
        <img class=sign src="/public/to_sign/<?echo $rec_to['sign_tech']?>">
        <h2>Подпись водителя</h2>
        <img class=sign src="/public/to_sign/<?echo $rec_to['sign_driver']?>">
        <?
        }
        ?>


        <style type="text/css">
            table#check_result{}
            table#check_result td{width:100px;}
            table#check_result td.yes.active{background:green;opacity:0.6;color:white;}
            table#check_result td.no.active{background:red;opacity:0.6;color:white;}
            table#check_result td:first-child{width:auto;text-align:left;}

            div.list_images_highslide div.item{width:150px;float:left;}
            img.sign{border:1px solid #eeeeee;width:400px;}
        </style>
     <?

    $TOParamResults = json_decode($rec_to['result'],true);

    ?>
    <div class="list_images_highslide">
        <?
        if (is_array($TOParamResults)) foreach ($TOParamResults as $param => $TOParamResult) {
            if (is_array($TOParamResult) and $TOParamResult['no']) {
                if (file_exists(_DIR_TO_ROOT.'/public/to_photo/to_'.$rec_to['pkey'].'_'.$param.'.jpg')) {
                    ?>
                    <div class="item">
                        <a href="/public/to_photo/<?echo 'to_'.$rec_to['pkey'].'_'.$param.'.jpg'?>" onclick="return hs.expand(this)">
                            <img src="/public/to_photo/<?echo 'to_'.$rec_to['pkey'].'_'.$param.'.jpg'?>" style="max-width: 400px">
                        </a>
                    </div>
                    <?
                }
            }
        }
        ?>
        <div class=clear></div>
    </div>
    <?

}





?>