browse.phtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <?php
  2. /**
  3. * @version 7.9 [rev.7.9.03]
  4. */
  5. ?>
  6. <nav class="navbar navbar-filter">
  7. <div class="navbar-left">
  8. <?php if ($section != 'admin' || $this->loggedInUser['role'] == \Ppb\Service\Users::ADMIN_ROLE_PRIMARY) { ?>
  9. <a class="btn btn-default"
  10. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'add', 'view' => $this->section)); ?>">
  11. <?php echo $this->_('Create Account'); ?>
  12. </a>
  13. <?php } ?>
  14. <?php if ($this->section != 'admin') { ?>
  15. <?php
  16. $container = $this->navigation()->getContainer();
  17. echo $this->navigation()
  18. ->setContainer($container->findOneBy('label', $this->_('Filter Site Users')))
  19. ->setPartial('navigation/browse-filter.phtml')
  20. ->menu();
  21. // reset navigation container (workaround for the navigation on the layout page)
  22. $this->navigation()->setContainer($container);
  23. ?>
  24. <?php } ?>
  25. </div>
  26. <form class="navbar-form navbar-right"
  27. action="<?php echo $this->url(null, null, true, array('username', 'email', 'page', 'submit')); ?>"
  28. method="get">
  29. <div class="form-group">
  30. <?php echo $this->formElement('text', 'id', $this->id)
  31. ->setAttributes(array('placeholder' => $this->_('User ID'), 'class' => 'form-control input-small'))
  32. ->render();
  33. ?>
  34. <?php echo $this->formElement('text', 'username', $this->username)
  35. ->setAttributes(array('placeholder' => $this->_('Username'), 'class' => 'form-control input-default'))
  36. ->render();
  37. ?>
  38. <?php echo $this->formElement('text', 'email', $this->email)
  39. ->setAttributes(array('placeholder' => $this->_('Email Address'), 'class' => 'form-control input-default'))
  40. ->render();
  41. ?>
  42. </div>
  43. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  44. ->setAttributes(array('class' => 'btn btn-default'))
  45. ->render();
  46. ?>
  47. </form>
  48. </nav>
  49. <div class="table-responsive">
  50. <table class="table table-striped table-hover">
  51. <caption>
  52. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('users found.'); ?>
  53. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  54. <?php echo $this->_('Showing results'); ?>
  55. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  56. <?php echo $this->_('to'); ?>
  57. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  58. <?php } ?>
  59. </caption>
  60. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  61. <thead>
  62. <tr>
  63. <th class="size-small"><?php echo $this->_('Username'); ?></th>
  64. <th><?php echo $this->_('User Details / Settings'); ?></th>
  65. <th class="size-large"><?php echo $this->_('Status'); ?></th>
  66. <th class="size-tiny"></th>
  67. </tr>
  68. </thead>
  69. <?php } ?>
  70. <tbody>
  71. <?php
  72. /** @var \Ppb\Db\Table\Row\User $user */
  73. foreach ($this->paginator as $user) {
  74. ?>
  75. <tr>
  76. <td>
  77. <?php echo $user['username']; ?>
  78. </td>
  79. <td>
  80. <div>
  81. <strong><?php echo $this->_('Name'); ?></strong>: <?php echo $this->userDetails($user)->displayFullName(); ?>
  82. </div>
  83. <div>
  84. <strong><?php echo $this->_('Email'); ?></strong>: <?php echo $user['email']; ?>
  85. </div>
  86. <div class="pdb-10">
  87. <strong><?php echo $this->_('Reg. Date'); ?></strong>: <?php echo $this->date($user['created_at']); ?>
  88. </div>
  89. <?php if (!in_array($user['role'], $adminRoles)) { ?>
  90. <div class="btn-group">
  91. <a class="btn btn-default"
  92. title="<?php echo $this->_('user details'); ?>"
  93. data-toggle="collapse"
  94. data-target="#info<?php echo $user['id']; ?>">
  95. <i class="fa fa-male"></i>
  96. </a>
  97. <?php if ($this->settings['private_site']) { ?>
  98. <a class="btn confirm-box <?php echo ($user['is_seller']) ? 'btn-success' : 'btn-danger'; ?>"
  99. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'is_seller', 'id' => $user['id'], 'flag' => !$user['is_seller']),
  100. null, true); ?>"
  101. title="<?php echo $this->_('Change selling privileges'); ?>"
  102. data-message="<?php echo sprintf($this->_("%s selling privileges for user '%s'?"),
  103. ($user['is_seller']) ? $this->_('Disable') : $this->_('Activate'),
  104. $user['username']); ?>">
  105. <i class="fa fa-gavel"></i>
  106. </a>
  107. <?php } ?>
  108. <a class="btn btn-default jq-popup-form"
  109. href="<?php echo $this->url(array('action' => 'user-options', 'id' => $user['id'])); ?>"
  110. data-close-redirect="<?php echo $this->url(array(
  111. 'action' => 'browse', 'view' => 'site', 'username' => $user['username'])); ?>"
  112. title="<?php echo $this->_('Edit User Options'); ?>">
  113. <i class="fa fa-cogs"></i>
  114. </a>
  115. <a class="btn btn-default"
  116. href="<?php echo $this->url(array('controller' => 'tools', 'action' => 'accounting', 'id' => $user['id'])); ?>"
  117. title="<?php echo $this->_('View Account History'); ?>">
  118. <i class="fa fa-table"></i>
  119. </a>
  120. <a class="btn btn-default"
  121. href="<?php echo $this->url(array('controller' => 'listings', 'action' => 'browse', 'show' => 'by-user', 'user_id' => $user['id'])); ?>"
  122. title="<?php echo $this->_('View Listings'); ?>">
  123. <i class="fa fa-files-o"></i>
  124. </a>
  125. <a class="btn btn-default confirm-box"
  126. href="<?php echo $this->url(array('action' => 'login-as', 'id' => $user['id'])); ?>"
  127. data-message="<?php echo sprintf($this->_("You will be logged in as '%s'. Proceed?"),
  128. $user['username']); ?>"
  129. title="<?php echo $this->_('Login as User'); ?>">
  130. <i class="fa fa-unlock-alt"></i>
  131. </a>
  132. <?php if ($user->userPaymentMode() == 'account' && $user['balance'] > 0) { ?>
  133. <a class="btn btn-default confirm-box"
  134. href="<?php echo $this->url(array('action' => 'payment-reminder', 'id' => $user['id'])); ?>"
  135. data-message="<?php echo sprintf($this->_("Send payment reminder to user '%s'?"),
  136. $user['username']); ?>"
  137. title="<?php echo $this->_('Send Payment Reminder'); ?>">
  138. <i class="fa fa-money"></i>
  139. </a>
  140. <?php } ?>
  141. <a class="btn btn-default jq-popup-form"
  142. href="<?php echo $this->url(array('action' => 'send-message', 'receiver_id' => $user['id'])); ?>"
  143. title="<?php echo $this->_('Send Message To User'); ?>">
  144. <i class="fa fa-envelope-o"></i>
  145. </a>
  146. </div>
  147. <?php } ?>
  148. <div id="info<?php echo $user['id']; ?>" class="collapse">
  149. <hr>
  150. <div>
  151. <b><?php echo $this->_('Address'); ?></b>: <?php echo $this->fieldDisplay($this->userDetails()->displayAddress(', ')); ?>
  152. </div>
  153. <div>
  154. <b><?php echo $this->_('Phone'); ?></b>: <?php echo $this->fieldDisplay($user['phone']); ?>
  155. </div>
  156. <?php if ($user['birthdate'] > 0) { ?>
  157. <div>
  158. <b><?php echo $this->_('Birthdate'); ?></b>: <?php echo $this->date($user['birthdate'], true); ?>
  159. </div>
  160. <?php } ?>
  161. <?php if ($user['last_login'] > 0) { ?>
  162. <div>
  163. <b><?php echo $this->_('Last Login'); ?></b>: <?php echo $this->date($user['last_login']); ?>
  164. </div>
  165. <?php } ?>
  166. <div>
  167. <b><?php echo $this->_('IP Address'); ?></b>:
  168. <em>
  169. <?php echo $this->fieldDisplay($user['ip_address'],
  170. '<a href="http://db-ip.com/' . $user['ip_address'] . '" target="_blank">' . $user['ip_address'] . '</a>'); ?>
  171. </em>
  172. </div>
  173. </div>
  174. </td>
  175. <td>
  176. <?php echo $this->userDetails()->status(); ?>
  177. </td>
  178. <td>
  179. <?php if (!in_array($user['role'],
  180. $adminRoles) || $this->loggedInUser['role'] == \Ppb\Service\Users::ADMIN_ROLE_PRIMARY
  181. ) {
  182. ?>
  183. <div class="btn-group-vertical">
  184. <?php if (!$user['approved']) { ?>
  185. <a class="btn btn-success btn-sm confirm-box"
  186. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'approve', 'id' => $user['id']),
  187. null, true); ?>"
  188. title="<?php echo $this->_('Approve Account'); ?>"
  189. data-message="<?php echo $this->_('Are you sure you want to approve this account?'); ?>">
  190. <i class="fa fa-check-square-o"></i>
  191. </a>
  192. <?php } ?>
  193. <?php if (!$user['mail_activated']) { ?>
  194. <a class="btn btn-info btn-sm confirm-box"
  195. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'verify-email', 'id' => $user['id']),
  196. null, true); ?>"
  197. title="<?php echo $this->_('Verify Email Address'); ?>"
  198. data-message="<?php echo $this->_("Are you sure you want to verify this user's email address?"); ?>">
  199. <i class="fa fa-envelope-o"></i>
  200. </a>
  201. <?php } ?>
  202. <a class="btn btn-default btn-sm"
  203. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'manage', 'view' => $this->section, 'id' => $user['id'])); ?>"
  204. title="<?php echo $this->_('Edit User'); ?>">
  205. <i class="fa fa-folder-open"></i>
  206. </a>
  207. <?php
  208. if (!$user['active']) {
  209. $flag = 1;
  210. $msg = $this->_('activate');
  211. $title = $this->_('Activate Account');
  212. $cls = 'btn-success';
  213. $btn = '<i class="fa fa-check-circle"></i>';
  214. }
  215. else {
  216. $flag = 0;
  217. $msg = $this->_('suspend');
  218. $cls = 'btn-default';
  219. $title = $this->_('Suspend Account');
  220. $btn = '<i class="fa fa-ban"></i>';
  221. }
  222. ?>
  223. <a class="btn <?php echo $cls; ?> btn-sm confirm-box"
  224. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'change-status', 'option' => 'activate', 'flag' => $flag, 'id' => $user['id']),
  225. null, true); ?>"
  226. title="<?php echo $title; ?>"
  227. data-message="<?php echo sprintf($this->_('Are you sure you want to %s this account?'),
  228. $msg); ?>">
  229. <?php echo $btn; ?>
  230. </a>
  231. <a class="btn btn-danger btn-sm confirm-box"
  232. href="<?php echo $this->url(array('controller' => 'users', 'action' => 'delete', 'id' => $user['id']),
  233. null, true); ?>"
  234. title="<?php echo $this->_('Delete User'); ?>"
  235. data-message="<?php echo $this->_('Are you sure you want to delete this account?'); ?>">
  236. <i class="fa fa-times"></i>
  237. </a>
  238. </div>
  239. <?php } ?>
  240. </td>
  241. </tr>
  242. <?php } ?>
  243. </tbody>
  244. </table>
  245. </div>
  246. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>