Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- define("ADMINAREA", true);
- require "../init.php";
- $aInt = new WHMCS\Admin("Manage Affiliates");
- $aInt->title = $aInt->lang("affiliates", "title");
- $aInt->sidebar = "clients";
- $aInt->icon = "affiliates";
- $aInt->helplink = "Affiliates";
- $aInt->requiredFiles(array("invoicefunctions", "gatewayfunctions"));
- if ($action == "save")
- {
- check_token("WHMCS.admin.default");
- update_query("tblaffiliates", array("paytype" => $paymenttype, "payamount" => $payamount, "onetime" => $onetime, "visitors" => $visitors, "balance" => $balance, "withdrawn" => $withdrawn), array("id" => $id));
- logActivity("Affiliate ID " . $id . " Details Updated");
- redir("action=edit&id=" . $id);
- }
- if ($action == "deletecommission")
- {
- check_token("WHMCS.admin.default");
- delete_query("tblaffiliatespending", array("id" => $cid));
- redir("action=edit&id=" . $id);
- }
- if ($action == "deletehistory")
- {
- check_token("WHMCS.admin.default");
- delete_query("tblaffiliateshistory", array("id" => $hid));
- redir("action=edit&id=" . $id);
- }
- if ($action == "deletereferral")
- {
- check_token("WHMCS.admin.default");
- delete_query("tblaffiliatesaccounts", array("id" => $affaccid));
- redir("action=edit&id=" . $id);
- }
- if ($action == "deletewithdrawal")
- {
- check_token("WHMCS.admin.default");
- delete_query("tblaffiliateswithdrawals", array("id" => $wid));
- redir("action=edit&id=" . $id);
- }
- if ($action == "addcomm")
- {
- check_token("WHMCS.admin.default");
- $amount = format_as_currency($amount);
- insert_query("tblaffiliateshistory", array("affiliateid" => $id, "date" => toMySQLDate($date), "affaccid" => $refid, "description" => $description, "amount" => $amount));
- update_query("tblaffiliates", array("balance" => "+=" . $amount), array("id" => (int)$id));
- redir("action=edit&id=" . $id);
- }
- if ($action == "withdraw")
- {
- check_token("WHMCS.admin.default");
- insert_query("tblaffiliateswithdrawals", array("affiliateid" => $id, "date" => "now()", "amount" => $amount));
- update_query("tblaffiliates", array("balance" => "-=" . $amount, "withdrawn" => "+=" . $amount), array("id" => (int)$id));
- if ($payouttype == "1")
- {
- $result = select_query("tblaffiliates", "", array("id" => (int)$id));
- $data = mysql_fetch_array($result);
- $id = (int)$data["id"];
- $clientid = (int)$data["clientid"];
- addTransaction($clientid, "", "Affiliate Commissions Withdrawal Payout", "0", "0", $amount, $paymentmethod, $transid);
- }
- else
- {
- if ($payouttype == "2")
- {
- $result = select_query("tblaffiliates", "", array("id" => (int)$id));
- $data = mysql_fetch_array($result);
- $id = (int)$data["id"];
- $clientid = (int)$data["clientid"];
- insert_query("tblcredit", array("clientid" => $clientid, "date" => "now()", "description" => "Affiliate Commissions Withdrawal", "amount" => $amount));
- update_query("tblclients", array("credit" => "+=" . $amount), array("id" => $clientid));
- full_query($query);
- logActivity("Processed Affiliate Commissions Withdrawal to Credit Balance - User ID: " . $clientid . " - Amount: " . $amount);
- }
- }
- redir("action=edit&id=" . $id);
- }
- if ($sub == "delete")
- {
- check_token("WHMCS.admin.default");
- .................................................................
- ................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement