list.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?
  2. use yii\web\View;
  3. $assetDir = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
  4. foreach($users as $userid => $data){
  5. $op = ( $userid == $id )?0.5:1;
  6. $mark = ( time()-$data['time'] < $obj::sleep )?'fas fa-user-check':'fas fa-mug-hot';
  7. $mark = ( time()-$data['time'] < $obj::dead )?'fas fa-user-check':'fas fa-bed';
  8. $markd = ( time()-$data['time'] < $obj::sleep )?'text-success':'text-warning';
  9. $markd = ( time()-$data['time'] < $obj::dead )?'text-success':'text-danger';
  10. if( time()-$data['time'] < $obj::kill ) {
  11. $photo = "/images/users/".$userid."_sm.jpg";
  12. if( !file_exists( Yii::getAlias('@webroot').$photo ) ){
  13. $photo = $assetDir."/img/user1-128x128.jpg";
  14. }
  15. ?>
  16. <a href="#" class="dropdown-item">
  17. <!-- Message Start -->
  18. <div class="media" style="opacity:<?=$op?>">
  19. <img src="<?=$photo?>" alt="User Avatar" class="img-size-50 mr-3 img-circle">
  20. <div class="media-body">
  21. <h3 class="dropdown-item-title">
  22. <?=$data['name']?>
  23. <span class="float-right text-sm <?=$markd?>"><i class="<?=$mark?>"></i></span>
  24. </h3>
  25. <p class="text-sm">Думает...</p>
  26. <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> <?=date("i:s", time()-$data['time'])?> м:сек</p>
  27. </div>
  28. </div>
  29. <!-- Message End -->
  30. </a>
  31. <div class="dropdown-divider"></div>
  32. <?
  33. }
  34. }