Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define("ADMINAREA", true);
  15. require "../init.php";
  16. $aInt = new WHMCS\Admin("Manage Affiliates");
  17. $aInt->title = $aInt->lang("affiliates", "title");
  18. $aInt->sidebar = "clients";
  19. $aInt->icon = "affiliates";
  20. $aInt->helplink = "Affiliates";
  21. $aInt->requiredFiles(array("invoicefunctions", "gatewayfunctions"));
  22. if ($action == "save")
  23. {
  24. check_token("WHMCS.admin.default");
  25. update_query("tblaffiliates", array("paytype" => $paymenttype, "payamount" => $payamount, "onetime" => $onetime, "visitors" => $visitors, "balance" => $balance, "withdrawn" => $withdrawn), array("id" => $id));
  26. logActivity("Affiliate ID " . $id . " Details Updated");
  27. redir("action=edit&id=" . $id);
  28. }
  29. if ($action == "deletecommission")
  30. {
  31. check_token("WHMCS.admin.default");
  32. delete_query("tblaffiliatespending", array("id" => $cid));
  33. redir("action=edit&id=" . $id);
  34. }
  35. if ($action == "deletehistory")
  36. {
  37. check_token("WHMCS.admin.default");
  38. delete_query("tblaffiliateshistory", array("id" => $hid));
  39. redir("action=edit&id=" . $id);
  40. }
  41. if ($action == "deletereferral")
  42. {
  43. check_token("WHMCS.admin.default");
  44. delete_query("tblaffiliatesaccounts", array("id" => $affaccid));
  45. redir("action=edit&id=" . $id);
  46. }
  47. if ($action == "deletewithdrawal")
  48. {
  49. check_token("WHMCS.admin.default");
  50. delete_query("tblaffiliateswithdrawals", array("id" => $wid));
  51. redir("action=edit&id=" . $id);
  52. }
  53. if ($action == "addcomm")
  54. {
  55. check_token("WHMCS.admin.default");
  56. $amount = format_as_currency($amount);
  57. insert_query("tblaffiliateshistory", array("affiliateid" => $id, "date" => toMySQLDate($date), "affaccid" => $refid, "description" => $description, "amount" => $amount));
  58. update_query("tblaffiliates", array("balance" => "+=" . $amount), array("id" => (int)$id));
  59. redir("action=edit&id=" . $id);
  60. }
  61. if ($action == "withdraw")
  62. {
  63. check_token("WHMCS.admin.default");
  64. insert_query("tblaffiliateswithdrawals", array("affiliateid" => $id, "date" => "now()", "amount" => $amount));
  65. update_query("tblaffiliates", array("balance" => "-=" . $amount, "withdrawn" => "+=" . $amount), array("id" => (int)$id));
  66. if ($payouttype == "1")
  67. {
  68. $result = select_query("tblaffiliates", "", array("id" => (int)$id));
  69. $data = mysql_fetch_array($result);
  70. $id = (int)$data["id"];
  71. $clientid = (int)$data["clientid"];
  72. addTransaction($clientid, "", "Affiliate Commissions Withdrawal Payout", "0", "0", $amount, $paymentmethod, $transid);
  73. }
  74. else
  75. {
  76. if ($payouttype == "2")
  77. {
  78. $result = select_query("tblaffiliates", "", array("id" => (int)$id));
  79. $data = mysql_fetch_array($result);
  80. $id = (int)$data["id"];
  81. $clientid = (int)$data["clientid"];
  82. insert_query("tblcredit", array("clientid" => $clientid, "date" => "now()", "description" => "Affiliate Commissions Withdrawal", "amount" => $amount));
  83. update_query("tblclients", array("credit" => "+=" . $amount), array("id" => $clientid));
  84. full_query($query);
  85. logActivity("Processed Affiliate Commissions Withdrawal to Credit Balance - User ID: " . $clientid . " - Amount: " . $amount);
  86. }
  87. }
  88. redir("action=edit&id=" . $id);
  89. }
  90. if ($sub == "delete")
  91. {
  92. check_token("WHMCS.admin.default");
  93. .................................................................
  94. ................................
  95. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement