_item.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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."_norm.jpg";
  12. if( !file_exists( Yii::getAlias('@webroot').$photo ) ){
  13. $photo = $assetDir."/img/user1-128x128.jpg";
  14. }
  15. ?>
  16. <div class="col-md-3">
  17. <div class="card card-primary card-outline">
  18. <div class="card-body box-profile">
  19. <div class="text-center">
  20. <img class="profile-user-img img-fluid img-circle" src="<?=$photo?>" alt="User profile picture">
  21. </div>
  22. <h3 class="profile-username text-center"><?=$data['name']?></h3>
  23. <p class="text-muted text-center"><?=$data['name']?></p>
  24. <ul class="list-group list-group-unbordered mb-3">
  25. <li class="list-group-item">
  26. <b>Неактивен: </b> <i class="far fa-clock mr-1"></i> <?=date("i:s", time()-$data['time'])?><span class="float-right text-sm <?=$markd?>"><i class="<?=$mark?>"></i></span>
  27. </li>
  28. <li class="list-group-item">
  29. <b>Following</b> <a class="float-right">543</a>
  30. </li>
  31. <li class="list-group-item">
  32. <b>Friends</b> <a class="float-right">13,287</a>
  33. </li>
  34. </ul>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="dropdown-divider"></div>
  39. <?
  40. }
  41. }