Exemplo n.º 1
0
 if (version_compare(JVERSION, '2.5.0', 'ge')) {
     // Joomla! 2.5 code here
     $plugin_short_path = 'plugins/system/bit_vm_check_vatid/bitvatidchecker/';
 } elseif (version_compare(JVERSION, '1.7.0', 'ge')) {
     // Joomla! 1.7 code here
     $plugin_short_path = 'plugins/system/bit_vm_check_vatid/bitvatidchecker/';
 } elseif (version_compare(JVERSION, '1.6.0', 'ge')) {
     // Joomla! 1.6 code here
     $plugin_short_path = 'plugins/system/bit_vm_check_vatid/bitvatidchecker/';
 } else {
     // Joomla! 1.5 code here
     $plugin_short_path = 'plugins/system/bitvatidchecker/';
 }
 require_once JPATH_SITE . DS . $plugin_short_path . 'classes/euvatcheck.class.php';
 $error_msg = OPCLang::setGet('COM_ONEPAGE_VAT_CHECKER_INVALID', $error_msg);
 $vies_down_error_msg = OPCLang::setGet('COM_ONEPAGE_VAT_CHECKER_DOWN', $vies_down_error_msg);
 $session = JFactory::getSession();
 $vatids = $session->get('opc_vat', array());
 if (!is_array($vatids)) {
     $vatids = unserialize($vatids);
 }
 $vatids['field'] = $fname;
 $vatid = strtoupper($vatid);
 $vatid = preg_replace("/[^a-zA-Z0-9]/", "", $vatid);
 $country = JRequest::getVar('virtuemart_country_id');
 $vathash = $country . '_' . $vatid;
 // vatid must start with country:
 $invalid = false;
 $str = substr($vatid, 0, 2);
 $test = preg_replace("/[a-zA-Z]/", "", $str);
 if (!empty($test)) {