34         if (is_array($sHomeCountry)) {
 
   35             $this->_sHomeCountry = 
current($sHomeCountry);
 
   37             $this->_sHomeCountry = $sHomeCountry;
 
   53         $sBoni = ($oUser && $oUser->oxuser__oxboni->value) ? $oUser->oxuser__oxboni->value : 0;
 
   55         $sTable = getViewName(
'oxpayments');
 
   56         $sQ = 
"select {$sTable}.* from ( select distinct {$sTable}.* from {$sTable} ";
 
   57         $sQ .= 
"left join oxobject2group ON oxobject2group.oxobjectid = {$sTable}.oxid ";
 
   58         $sQ .= 
"inner join oxobject2payment ON oxobject2payment.oxobjectid = " . $oDb->quote($sShipSetId) . 
" and oxobject2payment.oxpaymentid = {$sTable}.oxid ";
 
   59         $sQ .= 
"where {$sTable}.oxactive='1' ";
 
   60         $sQ .= 
" and {$sTable}.oxfromboni <= " . $oDb->quote($sBoni) . 
" and {$sTable}.oxfromamount <= " . $oDb->quote($dPrice) . 
" and {$sTable}.oxtoamount >= " . $oDb->quote($dPrice);
 
   69             foreach ($oUser->getUserGroups() as $oGroup) {
 
   73                 $sGroupIds .= 
"'" . $oGroup->getId() . 
"'";
 
   77         $sGroupTable = getViewName(
'oxgroups');
 
   78         $sCountryTable = getViewName(
'oxcountry');
 
   80         $sCountrySql = $sCountryId ? 
"exists( select 1 from oxobject2payment as s1 where s1.oxpaymentid={$sTable}.OXID and s1.oxtype='oxcountry' and s1.OXOBJECTID=" . $oDb->quote($sCountryId) . 
" limit 1 )" : 
'0';
 
   81         $sGroupSql = $sGroupIds ? 
"exists( select 1 from oxobject2group as s3 where s3.OXOBJECTID={$sTable}.OXID and s3.OXGROUPSID in ( {$sGroupIds} ) limit 1 )" : 
'0';
 
   83         $sQ .= 
" ) as $sTable where ( 
   85                 if( exists( select 1 from oxobject2payment as ss1, $sCountryTable where $sCountryTable.oxid=ss1.oxobjectid and ss1.oxpaymentid={$sTable}.OXID and ss1.oxtype='oxcountry' limit 1 ), 
   88                 if( exists( select 1 from oxobject2group as ss3, $sGroupTable where $sGroupTable.oxid=ss3.oxgroupsid and ss3.OXOBJECTID={$sTable}.OXID limit 1 ), 
   91                 )  order by {$sTable}.oxsort asc ";
 
  107             $sCountryId = $oUser->getActiveCountry();
 
  139         $sTable = getViewName(
'oxpayments');
 
  140         $sSubSql = 
"SELECT * FROM oxobject2payment WHERE oxobject2payment.OXPAYMENTID = $sTable.OXID AND oxobject2payment.OXTYPE = 'rdfapayment'";
 
  141         $this->
selectString(
"SELECT $sTable.* FROM $sTable WHERE NOT EXISTS($sSubSql) AND $sTable.OXACTIVE = 1");
 
  153         $sTable = getViewName(
'oxpayments');
 
  154         $sQ = 
"select $sTable.*, oxobject2payment.oxobjectid from $sTable left join (select oxobject2payment.* from oxobject2payment where oxobject2payment.oxtype = 'rdfapayment') as oxobject2payment on oxobject2payment.oxpaymentid=$sTable.oxid ";
 
  155         $sQ .= 
"where $sTable.oxactive = 1 ";
 
  156         if ($dPrice !== null) {
 
  157             $sQ .= 
"and $sTable.oxfromamount <= " . $oDb->quote($dPrice) . 
" and $sTable.oxtoamount >= " . $oDb->quote($dPrice);
 
  159         $rs = $oDb->select($sQ);
 
  160         if ($rs != 
false && $rs->recordCount() > 0) {
 
  163                 $oListObject = clone $oSaved;
 
  165                 $this->_aArray[] = $oListObject;