<?php
$ {
"GLOBALS"
}
["htyelnyuko"] = "limit";
$ {
"GLOBALS"
}
["kkrzvcixyd"] = "start";
$ {
"GLOBALS"
}
["lzuiemvx"] = "sql0";
$ {
"GLOBALS"
}
["uhrvyulw"] = "ret";
$ {
"GLOBALS"
}
["nzmcyefwa"] = "alt";
$ {
"GLOBALS"
}
["jhhpnpuuy"] = "currency";
$ {
"GLOBAL\x 53"
}
["sxexjilwbkn"] = "color";
$ {
"GLOBALS"
}
["pzoygsna"] = "balance";
$ {
"GLOBAL\x5 3"
}
["ihrknrqnbk"] = "sql";
$ {
"GLOBALS"
}
["uesdbscjuc"] = "payment_url";
$ {
"G\ x4cOBALS"
}
["hjgkldv"] = "notes";
$ {
"GLOBALS"
}
["uxjjeqvpevq"] = "paydata";
include_once (_PS_ROOT_DIR_ . "/modules/agilesellercommiss\x 69on/CommissionBalance.php");
include_once (_PS_ROOT_DIR_ . "/modules/agilesellercommissio n/SellerCommission. php");
include_once (_PS_ROOT_DIR_ . "/modules/agilesellercommissio\x6 e/agilesellercommissi\ x6fn.php");
class AgileCommissionBalances extends ModuleAdminController
{
public
function __construct()
{
global $cookie;
$this->bootstrap = true;
$this->table = "commission_balan\x 63e";
$this->className = "CommissionBal\ x61nce";
$this->identifier = "id_commission_ba\x6 cance";
parent::__construct();
$this->lang = false;
$this->list_no_link = true;
$this->fields_list = array(
"id_commissio n_balance" => array(
"title" = > $this->l('Seller ID') ,
"align" => "cente\x7 2",
"width" => 25
) ,
"seller" => array(
"ti tle" => $this->l('Seller Name') ,
"align" => "right",
"widt\x6 8" => 50
) ,
"balance" => array(
"title" => $this->l('Balance') ,
"width" => 150,
"align" => "r ight",
"type" => "price",
"cur rency" => true
) ,
"topay" => array(
"tit\x 6ce" => $this->l('Action') ,
"width" => 150,
"align " => "right",
"callback" => "d\ x69splayPayLink"
)
);
}
public
function initToolbar()
{
parent::initToolbar();
unset($this->toolbar_btn["new"]);
}
public
function renderList()
{
if (!$this->is_seller)
{
return parent::renderList() . $this->showBottomNotes();
}
return $this->showSelleBalanceInfo();
}
public
function displayPayLink($value, $data)
{
$
{
"GLOBA\ x4cS"
}
["vxwwvciyshj"] = "value";
$
{
"GLOBALS"
}
["dyndzhw"] = "value";
if ((float)$ {
$ {
"GLOBALS"
}
["dyndzhw"]
} <= 0) return "--";
$ {
"GLOBALS"
}
["obkdlrwn"] = "data";
$nhsfstnoe = "data";
$dprshahbclc = "p aydata";
$ {
$dprshahbclc } = array(
"reco rd_type" => SellerCommission::RECORD_TYPE_STORE_PAY_SELLER,
"id_seller " => $ {
$ {
"GLOBALS"
}
["obkdlrwn"]
}
["id_commission_balan ce"],
"amount_to_pay" => floatval($ {
$ {
"\x4 7LOBALS"
}
["vxwwvciyshj"]
}) ,
"retkey" => Tools::getValue("to\x6 ben") ,
"paykey" => Tools::encrypt($ {
$nhsfstnoe
}
["id_commission_balan\x6 3e"])
);
return "\n\t\t\t<a href=\"" . AgileSellerCommission::get_paycommission_url($ {
$ {
"GLOBALS"
}
["uxjjeqvpevq"]
}) . "" > nttt < imgsrc = "" . __PS_BASE_URI__ . "modules/agilesellercommissio n/img/pay.png\" alt=\"" . $this->l('Pay Commission') . ""title = "" . $this->l('Pay Commission') . "\" /></a>";
}
public
function showBottomNotes()
{
$suxaxwww = "notes";
$izumcvrowi = "notes";
$
{
$suxaxwww
} = "";
$
{
$
{
"GLO\x 42ALS"
}
["hjgkldv"]
}.= "<p>" . $this->l('Negative account: Seller owes store owner. Seller need to pay store owner.') . "</p>";
$
{
$
{
"GLOBALS"
}
["hjgkldv"]
}.= "<p>" . $this->l('Postive account: Store owner owes seller. Store owner needs to pay seller the sales of products.') . "</p>";
$
{
"GLOBALS"
}
["ydfxsahzckp"] = "payment_url";
$
{
"\x 47LOBALS"
}
["ndzifuteiwu"] = "notes";
$
{
$
{
"GLOBALS"
}
["uesdbscjuc"]
} = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . "modules/agilepaypalmas\x7 3pay/execute.php";
if (version_compare(_PS_VERSION_, "1.5", ">=")) {
$ {
$ {
"G LOBALS"
}
["uesdbscjuc"]
} = Context::getContext()->link->getModuleLink("agilepaypalmasspay", "execute", array() , true);
}
if (Module::isInstalled("agilepaypalmasspa y")) $ {
$ {
"GLOBALS"
}
["ndzifuteiwu"]
}.= "<p>" . $this->l('Click [Mass Pay All] button to pay all sellers together. ') . "<a href=\"" . $ {
$ {
"GLOB\ x41LS"
}
["ydfxsahzckp"]
} . "\" class=\"button\">" . $this->l('Mass Pay All') . "</a></p>";
else $ {
$ {
"GLOBALS"
}
["hjgkldv"]
}.= "<p>" . $this->l('If you install Agile Paypal Mass pay module, you can pay all sellers together in one transaction.') . "</p>";
return $ {
$izumcvrowi
};
}
public
function showSelleBalanceInfo()
{
$
{
"GLOBALS"
}
["fsyncnppjbil"] = "ret";
$ciicxr = "ret";
global $cookie;
$
{
$ciicxr
} = "";
$
{
$
{
"GLOBALS"
}
["ihrknrqnbk"]
} = "SELECT SUM(sc.r\x 65cord_balance) AS balance\n\t FROM `" . _DB_PREFIX_ . "seller_ commission` sc\n\t WHERE id_seller=" . $cookie->id_employee . " \n\t ";
$
{
"GLOBALS"
}
["oreafriyfb"] = "ret";
$
{
"GLOBALS"
}
["sigwjamu"] = "sql";
$
{
$
{
"GLOBALS"
}
["pzoygsna"]
} = Db::getInstance()->getValue($
{
$
{
"GLOBALS"
}
["sigwjamu"]
});
$hsvfnbjhgl = "alt";
$hrbbbfhqk = "col\x 6fr";
$
{
"GLOBALS"
}
["jjznelqwl"] = "color";
$
{
$hsvfnbjhgl
} = $this->l('Pay Now');
$
{
"GLOBALS"
}
["fjtwbjfqhihg"] = "balance";
$
{
$
{
"GLOB\x4 1LS"
}
["sxexjilwbkn"]
} = "black";
if ($ {
$ {
"GLOBALS"
}
["pzoygsna"]
} < 0) $ {
$hrbbbfhqk
} = "red";
$ {
$ {
"GLOBAL\x5 3"
}
["jhhpnpuuy"]
} = new Currency(Configuration::get("ASC_CO MMISSION_CURRENCY"));
$ {
$ {
"GLOBALS"
}
["fsyncnppjbil"]
}.= $this->l('Your account balance is') . ": <span style=\"font-size:xx-large;color:" . $ {
$ {
"GLO\ x42ALS"
}
["jjznelqwl"]
} . "" > ".Tools::displayPrice(floatval(${${"\x4 7LOBALS"}["pzoygsna"]}),${${"GLOBALS"}["jhhpnpuuy"]})." < / span > < br / > < br / > ";if(${${"GLOBALS"}["fjtwbjfqhihg"]}<0){${"GLOBALS"}["nbynizggjw"] = "balance";
$syffset = "ret";
${"GL\ x4fBALS"}["buygnsmvheuy"] = "alt";
${"GLOBALS"}["veawjc"] = "paydata";
${"GLOBAL S"}["rgwblmeq"] = "paydata";
${${"GLOBAL\ x53"}["rgwblmeq"]} = array(
"record_type" => SellerCommission::RECORD_TYPE_SELLER_PAY_STORE,
"id_se ller" => $cookie->id_employee,
"amount_to_pa y" => (-${${"GLOBALS"}["nbynizggjw"]}) ,
"retkey" => Tools::getValue("token") ,
"\x 70aykey" => Tools::encrypt($cookie->id_employee)
);
${$syffset}.= $this->l('Payment to store owner is owed for commissions on sales.') . "\n \t\t<br /><br /><a href=\"" . AgileSellerCommission::get_paycommission_url(${${"GLOBALS"}["veawjc"]}) . "\">\n\t\t\t " . $this->l('Click the icon to pay now') . "Â <img src=\"" . __PS_BASE_URI__ . "modules/agilesellercommis sion/img/pay.png\" alt="".${$ {
"GLOBALS"
}
["nzmcyefwa"]
}
"#@%+=FEFGT6R3987EFDF86347GR=+%@#"
" //@%+=FEFGT6R3987EFDF86347GR=+%@#" ."" title="" . $
{${"GLOBAL S"}["buygnsmvheuy"]} . "\" /></a>";
}else{${"GLOBALS"}["rtebaibjol"] = "ret";
${${"GLOBALS"}["rtebaibjol"]}.= $this->l('Store owes you the above amont.');
if (Module::isInstalled("agile\x7 0repaidcredit")) {${"GLOBAL\x5 3"}["kaeiwmjboyc"] = "customer";
$fmglopp = "cu\x 73tomer";
${${"GLOBAL S"}["uhrvyulw"]}.= "<br />" . $this->l('You can transfer this amount to your customer account and convert into tokens so that you can use it to purchase items in this store.');
${$fmglopp} = new Customer($cookie->id_employee);
if (Validate::isLoadedObject(${${"\x4 7LOBALS"}["kaeiwmjboyc"]})) {${"GLOBALS"}["rvacnbc"] = "ret";
${${"GLOBALS"}["rvacnbc"]}.= "<br />" . $customer->firstname . " " . $customer->lastname . "(" . $customer->email . ")";
}
else{$carrsoondm = "ret";
$oflkcbghozl = "ret";
${$carrsoondm}.= "<br />" . $this->l('Not linked to any account');
${$oflkcbghozl}.= "<br />" . $this->l('Link by email address:') . "Â <input type=\"linkto_email"value = "\" />";
${${"GLOBALS"}["uhrvyulw"]}.= "<br />" . $this->l('Link by customer ID:') . "Â <input type=\"linkto_id_custom er"value = "\" />";
}}}return${${"GLOBALS"}["oreafriyfb"]};}public function getList($id_lang,$orderBy=NULL,$orderWay=NULL,$sta rt=0,$limit=NULL,$id_lang_shop=false){$wtcklhqok = " limit";
global $cookie;
$ueqrrupy = "sql\x3 1";
${"GLOBALS"}["lknhvtk"] = "sql2";
${${"GLOBALS "}["lzuiemvx"]} = "SELECT SUM(sc.\x7 2ecord_balance) AS balance, SUM(sc.record\ x5fbalance) AS topay, sc.id_curr ency, sc.id_seller AS id_commission_bala\x 6ece, sl.company AS seller\n\t FROM `" . _DB_PREFIX_ . "seller_commissio\x6 e` sc\n\t LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo` s ON sc.id_seller=s.id_s\ x65ller\n\t LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo_la ng` sl ON (sl.id_sellerinfo =s.id_sellerinfo AND sl.id_lang=" . intval($cookie->id_lang) . ")\n\t WHERE 1 AND sc.id_seller>0 " . ($this->is_seller ? " AND sc.id_seller=" . $cookie->id_employee : "") . " \n\t GROUP \x4 2Y sc.id_seller, sl. company\n\t ";
$kknggsgz = "sql1";
$wikjjoquy = "sql\x3 2";
${$ueqrrupy} = ${${"GLOBALS"}["lzuiemvx"]} . " LIMIT " . ${${"GLOBALS "}["kkrzvcixyd"]} . "," . (intval(${${"GLOBALS"}["htyelnyuko"]}) > 0 ? intval(${$wtcklhqok}) : 50);
$this->_list = Db::getInstance()->ExecuteS(${$kknggsgz});
$tuiftwgcie = "sql0";
${$wikjjoquy} = "SELECT COUNT(*)\x2 0AS num FROM (" . ${$tuiftwgcie} . ") AS T";
$this->_listTotal = Db::getInstance()->getValue(${${"GLOBALS"}["lknhvtk"]});
}
}
?>