Viewing file: actualizar_vendedores.php (1.2 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? session_start(); $pagina_actual="actualizar-rubros"; $categoria_actual="rubros"; 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_vendedores"); $lines = file('extraer/vendedores.txt'); foreach ($lines as $line_num => $line) { $datos = explode(" ", $line); $ww=0; while ($ww<=3) { //$datos[$ww]=$mysqli->real_escape_string($datos[$ww]); $datos[$ww] = str_replace("\n", "", $datos[$ww]); $datos[$ww]=trim($datos[$ww]); $datos[$ww] = str_replace( "'", "_", $datos[$ww]); $ww=$ww+1; } $insertSQL = $mysqli->query("INSERT INTO banking_vendedores (id, nombre, usuario, clave) VALUES ('$datos[0]','".utf8_decode($datos[1])."','$datos[2]','$datos[3]')");
} //fin foreach ?><script language="javascript">location.href = "actualizar_cta_cte.php";</script>
</body> </html>
|