<?
 function panel_stats_admin()
 { $list_group=execSQL('select t1.pkey,t1.obj_name,t2.obj_name as doctor_name,t2.smena_in 
                            from obj_site_account t1 
                            left join obj_site_account t2 on t2.group_id=t1.pkey and t2.smena=1 
                            where t1.clss=206 and t1.enabled=1 and t1.pkey!=1 
                            order by t1.obj_name') ;

   ?><div id="panel_rmv_stats"><table class="basic full auto" id="mo_stats_admin">
     <tr><th>Группа терминалов</th><th>Дежурный фельдшер</th><th>Время начала смены</th><th>Длительность смены</th><th>Проверено сотрудников</th><th>Ожидается на проверку</th><th>Пройдено МО</th><th>Допущено</th><th>Не допущено</th></tr>
     <?
     if (_sizeof($list_group)) foreach($list_group as $rec)
     {   $d=time()-$rec['smena_in'] ;
     ?><tr></tr>
       <tr><td><?echo $rec['obj_name']?></td>
           <td class="left"><?echo $rec['doctor_name']?></td>
           <td><?echo ($rec['smena_in'])? date('d.m.Y H:i',$rec['smena_in']):'-'?></td>
           <td><?echo ($rec['smena_in'])? gmstrftime('%H:%M',$d):'-'?></td>
               <td id="stats_count_personal_<?echo $rec['pkey']?>"><img src="/<?echo _CLASS_?>/assets/loader.white.tr.gif"></td>
               <td id="stats_count_to_check_<?echo $rec['pkey']?>"><img src="/<?echo _CLASS_?>/assets/loader.white.tr.gif"></td>
               <td id="stats_s1_<?echo $rec['pkey']?>"><img src="/<?echo _CLASS_?>/assets/loader.white.tr.gif"></td>
               <td id="stats_s2_<?echo $rec['pkey']?>"><img src="/<?echo _CLASS_?>/assets/loader.white.tr.gif"></td>
               <td id="stats_s3_<?echo $rec['pkey']?>"><img src="/<?echo _CLASS_?>/assets/loader.white.tr.gif"></td>
       </tr>
    <?}?>
     </table>
     <script type="text/javascript">send_ajax_request({cmd:'aspmo_rmv/rmv_admin_backgroup_upload_stats'})</script>
     <?
   ?></div><?
 }
?>
