PageRenderTime 983ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/current-commissions.php

https://github.com/intelliants/elitius
PHP | 131 lines | 97 code | 15 blank | 19 comment | 4 complexity | 3db2c2c4ef9ffdccbd43ae1c3f14e7df MD5 | raw file
  1. <?php
  2. /***************************************************************************
  3. *
  4. * PROJECT: eLitius Open Source Affiliate Software
  5. * VERSION: 1.0
  6. * LISENSE: GNU GPL (http://www.opensource.org/licenses/gpl-license.html)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation.
  11. *
  12. * Link to eLitius.com can not be removed from the software pages without
  13. * permission of the eLitius respective owners. It is the only requirement
  14. * for using this software.
  15. *
  16. * Copyright 2009 Intelliants LLC
  17. * http://www.intelliants.com/
  18. *
  19. ***************************************************************************/
  20. require_once('./init.php');
  21. $gDesc = $gXpLang['current_commissions'];
  22. $gPage = $gXpLang['current_commissions'];
  23. $gPath = 'current-commissions';
  24. require_once('header.php');
  25. $items = (int)$_GET['items'];
  26. $items = $items ? $items : 5 ;
  27. define(ITEMS_PER_PAGE, $items);
  28. $page = (int)$_GET['page'];
  29. $page = ($page < 1) ? 1 : $page;
  30. $start = ($page - 1) * ITEMS_PER_PAGE;
  31. $suser = addslashes(htmlentities(strip_tags($_GET['su'])));
  32. $accounts =& $gXpAdmin->getApprovedAccounts($start, ITEMS_PER_PAGE, 0, $suser);
  33. $accounts_num = count($gXpAdmin->getApprovedAccounts(0, 0, 0));
  34. ?>
  35. <br />
  36. <form action="manage-commissions.php" method="post" name="adminForm">
  37. <table class="adminlist">
  38. <tr>
  39. <th style="border-bottom: 1px solid #fff;"></th>
  40. <th style="border-bottom: 1px solid #fff;" colspan="5">
  41. Filter Username:
  42. <input id="search_user" type="text" name="user" value="<?php echo $suser;?>" style="margin:0" />
  43. <input type="button" value="Search" onclick="setAction();" />
  44. </th>
  45. </tr>
  46. <tr>
  47. <th width="20">ID</th>
  48. <th align="left" nowrap><?php echo $gXpLang['username']; ?></th>
  49. <th width="10%" nowrap><?php echo $gXpLang['approved']; ?></th>
  50. <th width="11%" nowrap><?php echo $gXpLang['non_approved']; ?></th>
  51. <th width="11%" nowrap><?php echo $gXpLang['total']; ?></th>
  52. <th width="11%" nowrap></th>
  53. </tr>
  54. <?php
  55. for($i=0; $i<count($accounts); $i++)
  56. {
  57. $approved = $gXpAdmin->getApprovedCommissionSum($accounts[$i]['id'])*$gXpConfig['payout_percent']/100;
  58. $approval = $gXpAdmin->getApprovalCommissionSum($accounts[$i]['id'])*$gXpConfig['payout_percent']/100;
  59. ?>
  60. <tr class="row<?php echo ($i%2) ? '0' : '1' ;?>">
  61. <td><?php echo $accounts[$i]['id'];?></td>
  62. <td><a href="manage-account.php?id=<?php echo $accounts[$i]['id'];?>" title="<?php echo $gXpLang['view_details']; ?>"><?php echo $accounts[$i]['username'];?></a></td>
  63. <td><?php echo $approved;?></td>
  64. <td><?php echo $approval;?></td>
  65. <td><?php echo $approved + $approval;?></td>
  66. <td><a href="commissions.php?user=<?php echo $accounts[$i]['id']; ?>&mg=3"><?php echo $gXpLang['small_view_details']; ?></a></td>
  67. </tr>
  68. <?php
  69. }
  70. if(count($accounts)==0)
  71. { ?>
  72. <tr class="row0">
  73. <td colspan="6" align="center">No Items</td>
  74. </tr>
  75. <?php
  76. }
  77. ?>
  78. </table>
  79. <input type="hidden" name="task" value="" />
  80. </form>
  81. <div style="height: 30px;"></div>
  82. <?php
  83. $url = "current-commissions.php?items=".ITEMS_PER_PAGE;
  84. navigation($accounts_num, $start, count($accounts), $url, ITEMS_PER_PAGE);
  85. ?>
  86. <script type="text/javascript">
  87. function setAction()
  88. {
  89. var suser = $("#search_user").val();
  90. var link = 'current-commissions.php';
  91. link += suser? "?su="+suser :"";
  92. document.location.href = link;
  93. }
  94. $(document).ready(function(){
  95. jQuery.fn.enterEscape = function()
  96. {
  97. this.keypress(
  98. function(e)
  99. {
  100. // get key pressed (charCode from Mozilla/Firefox and Opera / keyCode in IE)
  101. var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
  102. if(key == 13)
  103. {
  104. setAction();
  105. return false;
  106. }
  107. });
  108. return this;
  109. }
  110. $(document).enterEscape();
  111. });
  112. </script>
  113. <!--main part ends-->
  114. <?php
  115. require_once('footer.php');
  116. ?>