<?
 function list_clients($recs,$options=array())
  {   ?><div id="list_clients"><form><?
         ?><table class="basic fz_small"><tr><th>Выбор</th><th>Состояние</th><th>Имя</th><th>Контактное лицо</th><th>Реквизиты</th><th>Печать</th><th>Авторизация</th><th>IP</th><th>Действие</th></tr><?
         if (_sizeof($recs)) foreach($recs as $rec)
         { $client_org_id=execSQL_value('select pkey from obj_site_personals where clss=207 and enabled=1 and client_id='.$rec['pkey'].' order by c_data limit 1') ;
           if (!$client_org_id) $client_org_id=adding_rec_to_table('obj_site_personals',array('clss'=>207,'parent'=>1,'client_id'=>$rec['pkey'],'obj_name'=>$rec['obj_name'])) ;
           $rec_org=PERSONAL()->get_org_by_id($client_org_id,array('get_ext_info'=>1)) ;

           ?><tr><td><input type=checkbox name="check[]" value="<?echo $rec['pkey']?>"></td>
              <td><?echo ($rec['enabled'])? 'включен':'заблокирован'?></td>
              <td><?echo htmlspecialchars($rec['obj_name'])?></td>
              <td><?echo htmlspecialchars($rec['contact_name'])?></td>
              <td><? if ($rec_org['full_name'] and $rec_org['email'] and $rec_org['phone'] and $rec_org['phone2'] and $rec_org['inn'] and $rec_org['kpp'] and $rec_org['bik'] and $rec_org['bank'] and $rec_org['ks'] and $rec_org['rs'] and $rec_org['adres1'] and $rec_org['adres2']) echo '<img src="/images/yes.png" title="Все поля заполнены">' ;
                     elseif ($rec_org['full_name'] or $rec_org['email'] or $rec_org['phone'] or $rec_org['phone2'] or $rec_org['inn'] or $rec_org['kpp'] or $rec_org['bik'] or $rec_org['bank'] or $rec_org['ks'] or $rec_org['rs'] or $rec_org['adres1'] or $rec_org['adres2']) echo '<img src="/images/question.png" title="Заполнены не все поля">' ;
                     //else


                  ?>
              </td>
              <td><?if (_sizeof($rec_org['stamp'])){?><img src="/images/yes.png"><?}?></td>
              <td class="left">
                  <?  if ($rec['time_login']) echo 'Вход:&nbsp;&nbsp; <strong>'.date('d.m.Y H:i:s',$rec['time_login']).'</strong><br>' ;
                      if ($rec['time_logout']) echo 'Выход: <strong>'.date('d.m.Y H:i:s',$rec['time_logout']).'</strong><br>' ;
                  ?>
              </td>
              <td><?echo $rec['ip']?></td>
              <td><button class="v1" href="/cab/manager/client/<?echo $rec['pkey']?>/">Редактировать</button></td>
           </tr>
       <?}?>
        </table><button class=v2 cmd=aspmo_manager/delete_check_client>Удалить выбранных клиентов</button><?
     ?></form></div><?
     //damp_array($rec) ;
  }


?>
