Viewing file: actualizar_articulos.php (1.27 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? session_start(); $pagina_actual="actualizar-articulos"; $categoria_actual="articulos"; require_once("includes/config.php"); require_once("includes/funciones.php");?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> </head>
<body> <? $query = $mysqli->query("TRUNCATE TABLE banking_articulos"); $lines = file('extraer/articulos.txt'); foreach ($lines as $line_num => $line) { $datos = explode(" ", $line); $ww=0; while ($ww<=5) {$datos[$ww]=trim($datos[$ww]); $datos[$ww]=addslashes($datos[$ww]); $datos[$ww] = str_replace("\n", "", $datos[$ww]); $ww=$ww+1; $rubro=$datos[3].".".$datos[4]; } $insertSQL = $mysqli->query("INSERT INTO banking_articulos (id_articulo, codigo, nombre, stock, cod_rubro_aux, cod_rubro, cod_subrubro, alicuota) VALUES ('$datos[0]','$datos[0]','".utf8_decode($datos[1])."','$datos[2]','$datos[3]','$rubro','$datos[4]','$datos[5]')");
} //fin foreach ?><script language="javascript">location.href = "actualizar_ven_listas_precio.php";</script>
</body> </html>
|