2009-05-04 14:26:54 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
//Chargement des prix
|
|
|
|
|
$tabPaysPrix = array();
|
2009-07-20 16:17:33 +00:00
|
|
|
|
if (is_file('graydon/price.txt')) {
|
|
|
|
|
$tabPaysPrix = parse_ini_file('graydon/price.txt', true);
|
2009-05-04 14:26:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Chargement de la liste compl<70>te des pays
|
|
|
|
|
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
|
|
|
|
|
mysql_select_db('extranet', $link);
|
|
|
|
|
$tabPays_result = mysql_query('SELECT * FROM tabpays');
|
|
|
|
|
$tabPays = array();
|
|
|
|
|
while ($row = mysql_fetch_array($tabPays_result, MYSQL_ASSOC)) {
|
|
|
|
|
$tabPays[$row['libPaysEN']] = $row['codPays'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
|
|
|
|
|
mysql_select_db('graydon', $link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$listPays = array_keys($tabPaysPrix['Normal']);
|
|
|
|
|
|
|
|
|
|
//Immediate - Normal - Superflash
|
|
|
|
|
foreach($listPays as $pays){
|
|
|
|
|
|
|
|
|
|
//Enregistrement du pays en mode actif
|
2009-07-20 16:17:33 +00:00
|
|
|
|
if($tabPays[$pays]){
|
|
|
|
|
$code = $tabPays[$pays];
|
|
|
|
|
}else{
|
2009-05-04 14:26:54 +00:00
|
|
|
|
//Code non trouv<75>
|
|
|
|
|
$code = '';
|
|
|
|
|
print '<br/>Code non trouv<75> pour le pays : '.$pays.'<br/>';
|
|
|
|
|
};
|
2009-07-20 16:17:33 +00:00
|
|
|
|
|
2009-05-04 14:26:54 +00:00
|
|
|
|
echo $sql = 'INSERT INTO country (code, country, status) VALUES ( "'.$code.'" , "'.$pays.'", "actif")';
|
|
|
|
|
mysql_query($sql,$link);
|
|
|
|
|
$country_id = mysql_insert_id();
|
2009-07-20 16:17:33 +00:00
|
|
|
|
|
2009-05-04 14:26:54 +00:00
|
|
|
|
//Enregitrement des prix
|
|
|
|
|
echo $sql = 'INSERT INTO price (immediate, normal, superflash, country_id) VALUES ( "'.$tabPaysPrix['Immediate'][$pays].'" , "'.$tabPaysPrix['Normal'][$pays].'", "'.$tabPaysPrix['Superflash'][$pays].'", "'.$country_id.'")';
|
|
|
|
|
mysql_query($sql,$link);
|
2009-07-20 16:17:33 +00:00
|
|
|
|
|
2009-05-04 14:26:54 +00:00
|
|
|
|
echo '<br/>';
|
2009-07-20 16:17:33 +00:00
|
|
|
|
|
2009-05-04 14:26:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|