"localhost",
"LOGIN" => "recambiosmarpe_tek_u",
"PASSW" => "mgKkw6I6agvK",
"DB_NAME" => "recambiosmarpe_tek"
);
//Administrator Password
$ADMIN_PASSW = "Marpe/2024/";
//CarMod License KEY
$CarModKey = "edfe67bde2cd4cac33283cf1298d3052";
$_SERVER['SERVER_NAME'] = 'buscaturecambio.com';
//Defines
$arCPDefines = Array(
'CM_DIR' => 'tienda', //Module REAL root folder
'CM_ADM' => 'admin24', //Admin REAL folder
'PROTOCOL' => 'https', // http / https
'FURL_MOD' => 'tienda', //CPMod root FURL section
'FURL_COMM' => '-com', //Commercial Vehicle Producers FURL appendix
'FURL_MOTO' => '-mc', //Motorcycles Producers FURL appendix
'FURL_TYPE' => 'n', //Same vehicle Type name - separating FURL symbol
'FURL_PRODUCT' => 'product', //Product Frendly URL
'FURL_SEARCH' => 'search', //Article search FURL
'CM_FILE_CHMOD' => "", // Files PERMISSIONS used by module Updates system when creating it
'CM_DF_RIGHTS' => "0755", // Folders PERMISSIONS used by module Updates system when creating it
);
foreach($arCPDefines as $k=>$v){if($k!=''){define($k,$v);}}
define('MEDIA_LINK', PROTOCOL.'://recambiazo.com/'.CM_DIR.'/img');
define('IMG_PRODUCT', PROTOCOL.'://recambiazo.com/'.CM_DIR.'/img/product');
//$_SERVER['DOCUMENT_ROOT'] .= '/shop';
define('CM_DEV_MODE',false);
//Is Cart have encoding Utf8 BUG for Ajax?
//define('CART_UTF8DEC',true);
//Session
if(!defined('CM_NO_SESSION')){
//@session_set_cookie_params(3600*24*3,"/");
//session_name('frontend'); //Magento
@session_start();
}
//PHP setup
ini_set("display_errors", 1);
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
//date_default_timezone_set('Europe/Kiev');
//Defines
if($_GET['ulng']!='' AND strlen($_GET['ulng'])==2){
define('URL_LANG',$_GET['ulng']);
$ULNG = '/'.$_GET['ulng'];
}else{$ULNG='';}
if(FURL_MOD==''){define('FURL_x',$ULNG);}else{define('FURL_x',$ULNG.'/'.FURL_MOD);}
define('PATH_x',$_SERVER['DOCUMENT_ROOT'].'/'.CM_DIR);
define('aPATH_x',$_SERVER['DOCUMENT_ROOT'].'/'.CM_DIR.'/'.CM_ADM.'/');
// My WebSite PROTOCOL & DOMAIN
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443){$cP='https';}else{$cP='http';}
define('PROTOCOL_DOMAIN_x', $cP.'://'.$_SERVER['HTTP_HOST']); //support www.
?>
$aCurList = Array("USD","EUR","RUB","BYR","BYN","UAH","AMD","GBP","LTL","MDL","ANG","PLN","RSD","KZT","BGN","CZK","DKK","GEL","HRK","HUF","COM","CHF","ILS","RON","TRY","CNY","BAM","JPY","SEK","KES");
function SimpleXmlUrl_x($Url){
if(extension_loaded('libxml')){
if(function_exists('simplexml_load_file')){
try{
return @simplexml_load_file($Url);
}catch(Exception $e){
ErAdd_x('Exception: '.$e);
return false;
}
}else{
ErAdd_x('Function simplexml_load_file() not loaded in your PHP');
return false;
}
}else{
ErAdd_x('Extension libxml not loaded in your PHP');
return false;
}
}
//RUB
class ExchangeRatesRUB{
var $rates;
var $Conn="N";
var $Name = 'ЦБРФ';
var $Site = 'cbr.ru';
var $Nominal = 1;
var $Round = 5;
function __construct($date = null){
if(extension_loaded('soap')){
try{
ini_set("default_socket_timeout", 3);
$client = new SoapClient("http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx?WSDL");
if (!isset($date)) $date = date("Y-m-d");
$curs = $client->GetCursOnDate(array("On_date" => $date));
$this->rates = new SimpleXMLElement($curs->GetCursOnDateResult->any);
$this->Conn="Y";
}catch(Exception $e){
$this->Conn="N"; //echo $e->getMessage();
}
}
}
function GetRate($code){
if($this->Conn=="Y"){
$code1 = (int)$code;
if ($code1!=0){
$result = $this->rates->xpath('ValuteData/ValuteCursOnDate/Vcode[.='.$code.']/parent::*');
}else{
$result = $this->rates->xpath('ValuteData/ValuteCursOnDate/VchCode[.="'.$code.'"]/parent::*');
}
if (!$result){return false;
}else {
$vc = (float)$result[0]->Vcurs;
$vn = (int)$result[0]->Vnom;
return ($vc/$vn);
}
}
}
}
//UAH
class ExchangeRatesUAH{
public $exchange_url = 'https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange';
public $xml;
var $Name = 'НБУ';
var $Site = 'bank.gov.ua';
var $Nominal = 1;
var $Round = 5;
function __construct(){
if($this->xml = SimpleXmlUrl_x($this->exchange_url)){
return $this->xml;
}else{
ErAdd_x('/core/exrates.php => '.get_class($this).'
');
return false;
}
}
function GetRate($NeedCode){
if($this->xml!==FALSE){
foreach($this->xml->children() as $obItem){
$CurCode = (string)$obItem->cc;
if($CurCode==$NeedCode){
$CurRate = (float)$obItem->rate;
$result = $CurRate;
}
}
}
return $result;
}
/* public $aCurRes;
var $Name = 'Минфин';
var $Site = 'minfin.com.ua';
var $Nominal = 1;
var $Round = 5;
function __construct(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.minfin.com.ua/mb/749edd231438bca930dd8ffb1d6a3b20c64d9678/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$jRes = curl_exec($ch); curl_close($ch);
$this->aCurRes = json_decode($jRes,true);
}
function GetRate($NeedCode){
if(is_array($this->aCurRes) AND count($this->aCurRes)>0){
foreach($this->aCurRes as $aItem){
$CurCode = strtoupper($aItem['currency']);
if($CurCode==$NeedCode){
$result = (float)$aItem['ask'];
}
}
}
return $result;
} */
}
//EUR
class ExchangeRatesEUR{
public $exchange_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml';
public $xml;
var $Name = 'ECB';
var $Site = 'ecb.europa.eu';
var $Nominal = 1;
var $Round = 5;
function __construct(){
if($this->xml = SimpleXmlUrl_x($this->exchange_url)){
return $this->xml;
}else{
ErAdd_x('/core/exrates.php => '.get_class($this).'
');
return false;
}
}
function GetRate($NeedCode){
if($this->xml!==FALSE){
foreach($this->xml->Cube->Cube->Cube as $obItem){ //echo '
';print_r($obItem);echo ''; $CurCode = (string)$obItem->attributes()['currency']; if($CurCode==$NeedCode){ $result = 1/(float)$obItem->attributes()['rate']; } } } return $result; } } //BYN class ExchangeRatesBYN{ public $exchange_url = 'http://www.nbrb.by/Services/XmlExRates.aspx'; public $xml; var $Name = 'НБРБ'; var $Site = 'nbrb.by'; var $Nominal = 1; var $Round = 3; function __construct(){ if($this->xml = SimpleXmlUrl_x($this->exchange_url)){ return $this->xml; }else{ ErAdd_x('/core/exrates.php => '.get_class($this).'
';print_r($obItem);echo ''; $CurCode = (string)$obItem->CharCode; if($CurCode==$NeedCode){ $CurRate = (float)$obItem->Rate; $CurSize = (float)$obItem->Scale; $CurRate = $CurRate/$CurSize; $result = $CurRate; } } } return $result; } } //AZN class ExchangeRatesAZN{ public $exchange_url = ''; public $xml; var $Name = 'Merkezi Banki'; var $Site = 'cbar.az'; var $Nominal = 1; var $Round = 5; function __construct(){ $this->exchange_url = 'https://www.cbar.az/currencies/'.date("m.d.Y").'.xml'; if($this->xml = SimpleXmlUrl_x($this->exchange_url)){ return $this->xml; }else{ ErAdd_x('/core/exrates.php => '.get_class($this).'
';print_r($obItem);echo ''; $CurCode = (string)$obItem->attributes()['Code']; if($CurCode==$NeedCode){ $result = (float)$obItem->Value; } } } return $result; } } //AMD class ExchangeRatesAMD{ var $url = "http://api.cba.am/exchangerates.asmx?op=ExchangeRatesByDate"; var $rates; var $Name = 'CBA'; var $Site = 'cba.am'; var $Nominal = 1; var $Round = 4; function __construct(){ $date = Date("Y-m-d"); $xml = ''. '