Exemplo n.º 1
0
      </tr>
   </thead>
   <tbody>
<?php 
$i = 0;
foreach ($users as $obj) {
    $row = $obj->as_array();
    // reformat dates
    // Note: fields that do not exist in the default configuration are commented out. See /modules/user/classes/model/user.php for details.
    //      <th scope="col">Last login</th>
    //      <th scope="col">Failed logins</th>
    //      <th scope="col">Last failed login</th>
    // $row['created'] = Helper_Format::friendly_datetime($row['created']);
    // $row['modified'] = Helper_Format::friendly_datetime($row['modified']);
    if ($row['last_login'] != '') {
        $row['last_login'] = Helper_Format::relative_time($row['last_login']);
    }
    //   if($row['last_failed_login'] != '0000-00-00 00:00:00') {
    //      $row['last_failed_login'] = Helper_Format::relative_time(strtotime($row['last_failed_login']));
    //   } else {
    //      $row['last_failed_login'] = '******';
    //   }
    // add actions
    $row['actions'] = Html::anchor('admin_user/edit/' . $row['id'], 'Edit') . ' ' . Html::anchor('admin_user/delete/' . $row['id'], 'Delete');
    // set roles
    $row['role'] = '';
    foreach ($obj->roles->find_all() as $role) {
        $row['role'] .= $role->name . ', ';
    }
    // remove last comma
    $row['role'] = substr($row['role'], 0, -2);