123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <?php
- /**
- * @version 7.9 [rev.7.9.03]
- */
- ?>
- <nav class="navbar navbar-filter">
- <div class="navbar-left">
- <?php if ($section != 'admin' || $this->loggedInUser['role'] == \Ppb\Service\Users::ADMIN_ROLE_PRIMARY) { ?>
- <a class="btn btn-default"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'add', 'view' => $this->section)); ?>">
- <?php echo $this->_('Create Account'); ?>
- </a>
- <?php } ?>
- <?php if ($this->section != 'admin') { ?>
- <?php
- $container = $this->navigation()->getContainer();
- echo $this->navigation()
- ->setContainer($container->findOneBy('label', $this->_('Filter Site Users')))
- ->setPartial('navigation/browse-filter.phtml')
- ->menu();
- // reset navigation container (workaround for the navigation on the layout page)
- $this->navigation()->setContainer($container);
- ?>
- <?php } ?>
- </div>
- <form class="navbar-form navbar-right"
- action="<?php echo $this->url(null, null, true, array('username', 'email', 'page', 'submit')); ?>"
- method="get">
- <div class="form-group">
- <?php echo $this->formElement('text', 'id', $this->id)
- ->setAttributes(array('placeholder' => $this->_('User ID'), 'class' => 'form-control input-small'))
- ->render();
- ?>
- <?php echo $this->formElement('text', 'username', $this->username)
- ->setAttributes(array('placeholder' => $this->_('Username'), 'class' => 'form-control input-default'))
- ->render();
- ?>
- <?php echo $this->formElement('text', 'email', $this->email)
- ->setAttributes(array('placeholder' => $this->_('Email Address'), 'class' => 'form-control input-default'))
- ->render();
- ?>
- </div>
- <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
- ->setAttributes(array('class' => 'btn btn-default'))
- ->render();
- ?>
- </form>
- </nav>
- <div class="table-responsive">
- <table class="table table-striped table-hover">
- <caption>
- <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('users found.'); ?>
- <?php if ($this->paginator->getPages()->totalItemCount) { ?>
- <?php echo $this->_('Showing results'); ?>
- <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
- <?php echo $this->_('to'); ?>
- <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
- <?php } ?>
- </caption>
- <?php if ($this->paginator->getPages()->totalItemCount) { ?>
- <thead>
- <tr>
- <th class="size-small"><?php echo $this->_('Username'); ?></th>
- <th><?php echo $this->_('User Details / Settings'); ?></th>
- <th class="size-large"><?php echo $this->_('Status'); ?></th>
- <th class="size-tiny"></th>
- </tr>
- </thead>
- <?php } ?>
- <tbody>
- <?php
- /** @var \Ppb\Db\Table\Row\User $user */
- foreach ($this->paginator as $user) {
- ?>
- <tr>
- <td>
- <?php echo $user['username']; ?>
- </td>
- <td>
- <div>
- <strong><?php echo $this->_('Name'); ?></strong>: <?php echo $this->userDetails($user)->displayFullName(); ?>
- </div>
- <div>
- <strong><?php echo $this->_('Email'); ?></strong>: <?php echo $user['email']; ?>
- </div>
- <div class="pdb-10">
- <strong><?php echo $this->_('Reg. Date'); ?></strong>: <?php echo $this->date($user['created_at']); ?>
- </div>
- <?php if (!in_array($user['role'], $adminRoles)) { ?>
- <div class="btn-group">
- <a class="btn btn-default"
- title="<?php echo $this->_('user details'); ?>"
- data-toggle="collapse"
- data-target="#info<?php echo $user['id']; ?>">
- <i class="fa fa-male"></i>
- </a>
- <?php if ($this->settings['private_site']) { ?>
- <a class="btn confirm-box <?php echo ($user['is_seller']) ? 'btn-success' : 'btn-danger'; ?>"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'is_seller', 'id' => $user['id'], 'flag' => !$user['is_seller']),
- null, true); ?>"
- title="<?php echo $this->_('Change selling privileges'); ?>"
- data-message="<?php echo sprintf($this->_("%s selling privileges for user '%s'?"),
- ($user['is_seller']) ? $this->_('Disable') : $this->_('Activate'),
- $user['username']); ?>">
- <i class="fa fa-gavel"></i>
- </a>
- <?php } ?>
- <a class="btn btn-default jq-popup-form"
- href="<?php echo $this->url(array('action' => 'user-options', 'id' => $user['id'])); ?>"
- data-close-redirect="<?php echo $this->url(array(
- 'action' => 'browse', 'view' => 'site', 'username' => $user['username'])); ?>"
- title="<?php echo $this->_('Edit User Options'); ?>">
- <i class="fa fa-cogs"></i>
- </a>
- <a class="btn btn-default"
- href="<?php echo $this->url(array('controller' => 'tools', 'action' => 'accounting', 'id' => $user['id'])); ?>"
- title="<?php echo $this->_('View Account History'); ?>">
- <i class="fa fa-table"></i>
- </a>
- <a class="btn btn-default"
- href="<?php echo $this->url(array('controller' => 'listings', 'action' => 'browse', 'show' => 'by-user', 'user_id' => $user['id'])); ?>"
- title="<?php echo $this->_('View Listings'); ?>">
- <i class="fa fa-files-o"></i>
- </a>
- <a class="btn btn-default confirm-box"
- href="<?php echo $this->url(array('action' => 'login-as', 'id' => $user['id'])); ?>"
- data-message="<?php echo sprintf($this->_("You will be logged in as '%s'. Proceed?"),
- $user['username']); ?>"
- title="<?php echo $this->_('Login as User'); ?>">
- <i class="fa fa-unlock-alt"></i>
- </a>
- <?php if ($user->userPaymentMode() == 'account' && $user['balance'] > 0) { ?>
- <a class="btn btn-default confirm-box"
- href="<?php echo $this->url(array('action' => 'payment-reminder', 'id' => $user['id'])); ?>"
- data-message="<?php echo sprintf($this->_("Send payment reminder to user '%s'?"),
- $user['username']); ?>"
- title="<?php echo $this->_('Send Payment Reminder'); ?>">
- <i class="fa fa-money"></i>
- </a>
- <?php } ?>
- <a class="btn btn-default jq-popup-form"
- href="<?php echo $this->url(array('action' => 'send-message', 'receiver_id' => $user['id'])); ?>"
- title="<?php echo $this->_('Send Message To User'); ?>">
- <i class="fa fa-envelope-o"></i>
- </a>
- </div>
- <?php } ?>
- <div id="info<?php echo $user['id']; ?>" class="collapse">
- <hr>
- <div>
- <b><?php echo $this->_('Address'); ?></b>: <?php echo $this->fieldDisplay($this->userDetails()->displayAddress(', ')); ?>
- </div>
- <div>
- <b><?php echo $this->_('Phone'); ?></b>: <?php echo $this->fieldDisplay($user['phone']); ?>
- </div>
- <?php if ($user['birthdate'] > 0) { ?>
- <div>
- <b><?php echo $this->_('Birthdate'); ?></b>: <?php echo $this->date($user['birthdate'], true); ?>
- </div>
- <?php } ?>
- <?php if ($user['last_login'] > 0) { ?>
- <div>
- <b><?php echo $this->_('Last Login'); ?></b>: <?php echo $this->date($user['last_login']); ?>
- </div>
- <?php } ?>
- <div>
- <b><?php echo $this->_('IP Address'); ?></b>:
- <em>
- <?php echo $this->fieldDisplay($user['ip_address'],
- '<a href="http://db-ip.com/' . $user['ip_address'] . '" target="_blank">' . $user['ip_address'] . '</a>'); ?>
- </em>
- </div>
- </div>
- </td>
- <td>
- <?php echo $this->userDetails()->status(); ?>
- </td>
- <td>
- <?php if (!in_array($user['role'],
- $adminRoles) || $this->loggedInUser['role'] == \Ppb\Service\Users::ADMIN_ROLE_PRIMARY
- ) {
- ?>
- <div class="btn-group-vertical">
- <?php if (!$user['approved']) { ?>
- <a class="btn btn-success btn-sm confirm-box"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'approve', 'id' => $user['id']),
- null, true); ?>"
- title="<?php echo $this->_('Approve Account'); ?>"
- data-message="<?php echo $this->_('Are you sure you want to approve this account?'); ?>">
- <i class="fa fa-check-square-o"></i>
- </a>
- <?php } ?>
- <?php if (!$user['mail_activated']) { ?>
- <a class="btn btn-info btn-sm confirm-box"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'verify-email', 'id' => $user['id']),
- null, true); ?>"
- title="<?php echo $this->_('Verify Email Address'); ?>"
- data-message="<?php echo $this->_("Are you sure you want to verify this user's email address?"); ?>">
- <i class="fa fa-envelope-o"></i>
- </a>
- <?php } ?>
- <a class="btn btn-default btn-sm"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'manage', 'view' => $this->section, 'id' => $user['id'])); ?>"
- title="<?php echo $this->_('Edit User'); ?>">
- <i class="fa fa-folder-open"></i>
- </a>
- <?php
- if (!$user['active']) {
- $flag = 1;
- $msg = $this->_('activate');
- $title = $this->_('Activate Account');
- $cls = 'btn-success';
- $btn = '<i class="fa fa-check-circle"></i>';
- }
- else {
- $flag = 0;
- $msg = $this->_('suspend');
- $cls = 'btn-default';
- $title = $this->_('Suspend Account');
- $btn = '<i class="fa fa-ban"></i>';
- }
- ?>
- <a class="btn <?php echo $cls; ?> btn-sm confirm-box"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'activate', 'flag' => $flag, 'id' => $user['id']),
- null, true); ?>"
- title="<?php echo $title; ?>"
- data-message="<?php echo sprintf($this->_('Are you sure you want to %s this account?'),
- $msg); ?>">
- <?php echo $btn; ?>
- </a>
- <a class="btn btn-danger btn-sm confirm-box"
- href="<?php echo $this->url(array('controller' => 'users', 'action' => 'delete', 'id' => $user['id']),
- null, true); ?>"
- title="<?php echo $this->_('Delete User'); ?>"
- data-message="<?php echo $this->_('Are you sure you want to delete this account?'); ?>">
- <i class="fa fa-times"></i>
- </a>
- </div>
- <?php } ?>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>
|