'), trim($object->{$field.'_'.((int)($_GET['language'])+1)})); if (ToolsCore::property_exists($object, $field.'_1')) return str_replace(array('!|', '|!'), array('<', '>'), trim($object->{$field.'_1'})); return ''; } if ($_GET['request'] == 'form') { $p = addslashes(strtolower($_GET['partner'])); $c = addslashes(strtolower($_GET['country_iso_code'])); $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); $content = @file_get_contents('http://www.prestashop.com/partner/preactivation/fields.php?version=1.0&partner='.$p.'&country_iso_code='.$c, false, $context); if ($content && $content[0] == '<') { $result = simplexml_load_string($content); if ($result) { $varList = ""; echo '


'; foreach ($result->field as $field) { echo '
'; if ($field->type == 'text' || $field->type == 'password') echo 'size) ? 'size="'.$field->size.'"' : '').' value="'.(isset($_GET[trim($field->key)]) ? $_GET[trim($field->key)] : $field->default).'" />'; elseif ($field->type == 'radio') { foreach ($field->values as $key => $value) echo getPreinstallXmlLang($value, 'label').' value == $field->default ? 'checked="checked"' : '').' />'; } elseif ($field->type == 'select') { echo ''; } elseif ($field->type == 'date') { echo ''; echo ''; echo ''; } if (getPreinstallXmlLang($field, 'help')) echo ' '.getPreinstallXmlLang($field, 'help'); echo '

'; if ($field->type == 'date') $varList .= "'&".$field->key."='+$('#".$p."_".$c."_form_".$field->key."_year').val()+'-'+$('#".$p."_".$c."_form_".$field->key."_month').val()+'-'+$('#".$p."_".$c."_form_".$field->key."_day').val()+\n"; else $varList .= "'&".$field->key."='+ encodeURIComponent($('#".$p."_".$c."_form_".$field->key."').val())+\n"; } echo ' '; } } } if ($_GET['request'] == 'send') { $context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5))); $url = 'http://www.prestashop.com/partner/preactivation/actions.php?version=1.0&partner='.addslashes($_GET['partner']); // Protect fields foreach ($_GET as $key => $value) $_GET[$key] = strip_tags(str_replace(array('\'', '"'), '', trim($value))); // Encore Get, Send It and Get Answers @require_once('../config/settings.inc.php'); foreach ($_GET as $key => $val) $url .= '&'.$key.'='.urlencode($val); $url .= '&security='.md5($_GET['email']._COOKIE_IV_); $content = @file_get_contents($url, false, $context); if ($content) echo $content; else echo 'KO|Could not connect with Prestashop.com'; } ?>