Importa farmacie
RAGIONE SOCIALE [1] => INDIRIZZO [2] => CAP [3] => LOCALITA [4] => PROVINCIA [5] => CODICE [6] => TELEFONO [7] => E-MAIL pharmacy city address phone web email email_cert type */ if(is_uploaded_file($_FILES['file']['tmp_name'])){ $dest="tmpfiles/tmppharmacy"; if(move_uploaded_file($_FILES['file']['tmp_name'],$dest)){ $myfile = fopen($dest, "r") or die("Unable to open file!"); while(!feof($myfile)) { $r = explode("|",fgets($myfile)); if($r[0]!='N_Albo' && $r[0]!=''){ $q="INSERT INTO pharmacy VALUES( '".addslashes(trim(anyToUTF8($r[0])))."','','','".addslashes(trim(anyToUTF8($r[3])))."', '".addslashes(trim(anyToUTF8($r[1])))."','".addslashes(trim(anyToUTF8($r[6])))."','', '".addslashes(trim(anyToUTF8($r[7])))."','') ON DUPLICATE KEY UPDATE pharmacy='".addslashes(trim(anyToUTF8($r[0])))."', city='".addslashes(trim(anyToUTF8($r[3])))."', address='".addslashes(trim(anyToUTF8($r[1])))."', phone='".addslashes(trim(anyToUTF8($r[6])))."', email='".addslashes(trim(anyToUTF8($r[7])))."'"; } mysqli_query($conn, $q); } fclose($myfile); echo '

File importato correttamente!

'; }else{ echo '

ATENZIONE: Errore nell\'importazione del file!

'; } } }else{ ?>
File *.CSV

ATTENZIONE: assicurarsi che il file sia del formato corretto.