Example #1
0
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
function RefreshParent() { 
    parent.location.reload(); 
} 
</script>

<?php 
include "../conexion_db.php";
conectame_db("scrap_gdl");
switch ($op) {
    case "insert_txt":
        insert_txt($alias, $tipo);
        break;
}
function insert_txt($alias, $tipo)
{
    $s_ = "delete from tmp_partes";
    $r_ = mysql_query($s_);
    $s_ = "select * from configuracion where variable='ruta_cargas'";
    $r_ = mysql_query($s_);
    $d_ = mysql_fetch_array($r_);
    $r_server = $d_['valor'];
    $cont = 0;
    $fd = fopen($r_server . "{$alias}", "r");
    while (!feof($fd)) {
        $buffer = fgets($fd);
        if (substr($buffer, 0, 3) != '---') {
            $campo['0'] = trim(substr($buffer, 0, 15));
            //Parte Padre
            $campo['0'] = ltrim($campo['0'], "0");
Example #2
0
function scripts_mantto_2($archivo, $archivo_name)
{
    $s_ = "select * from configuracion where variable='ruta_cargas'";
    $r_ = mysql_query($s_);
    $d_ = mysql_fetch_array($r_);
    $r_server = $d_['valor'];
    $pext = getFileExtension($archivo_name);
    $nombre = "temporal_." . $pext;
    $nom_final = $r_server . $nombre;
    if (is_uploaded_file($archivo)) {
        if (!copy($archivo, "{$nom_final}")) {
            echo "<script>alert('Error al subir el archivo: {$nom_final}');</script>";
            scripts_mantto_1();
            exit;
        } else {
            insert_txt($nombre);
        }
    }
}