Example #1
0
function guardar($area, $estacion, $nombre)
{
    $area = trim($area);
    $estacion = trim($estacion);
    $nombre = trim($nombre);
    $existe = ver_si_existe($estacion, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into lineas values('','{$area}','{$estacion}','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #2
0
function guardar($codigo, $reason_code, $descripcion, $orden_interna, $info_ad, $financiero, $vendor, $depto1, $depto2, $txs_sap, $mov_sap)
{
    $codigo = trim($codigo);
    $reason_code = trim($reason_code);
    $descripcion = trim($descripcion);
    $txs_sap = trim($txs_sap);
    $mov_sap = trim($mov_sap);
    $existe = ver_si_existe($codigo);
    if ($existe == 'NO') {
        $s_1 = "insert into codigo_scrap values('', '{$codigo}', '{$reason_code}', '{$descripcion}', '{$orden_interna}', '{$info_ad}', '{$txs_sap}',";
        $s_1 .= "'{$mov_sap}','{$financiero}','{$vendor}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #3
0
function guardar($planta, $division, $nombre)
{
    $planta = trim($planta);
    $division = trim($division);
    $nombre = trim($nombre);
    $existe = ver_si_existe($division, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into segmentos values('','{$planta}','{$division}','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #4
0
function guardar($padre, $apd_, $tipo, $nivel, $material)
{
    $padre = trim($padre);
    $apd_ = trim($apd_);
    $tipo = trim($tipo);
    $nivel = trim($nivel);
    $material = trim($material);
    $archivo = date("YmdHis");
    $existe = ver_si_existe($padre, $apd_, $material, $tipo, $nivel);
    if ($existe == 'NO') {
        $s_1 = "insert into partes_padre values('{$padre}','{$material}','{$apd_}','{$tipo}','{$nivel}','1','{$archivo}')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #5
0
function guardar($division, $segmento, $nombre)
{
    $existe = ver_si_existe($division, $segmento, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into apd values('','{$division}','{$segmento}','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #6
0
function guardar($nombre, $apellidos, $usuario, $password1, $email, $ac_di)
{
    $nombre = fix_data(utf8_decode($nombre));
    $apellidos = fix_data(utf8_decode($apellidos));
    $usuario = trim(strtolower($usuario));
    $password1 = trim($password1);
    $email = fix_data(utf8_decode($email));
    $existe = ver_si_existe($usuario);
    if ($existe == 'NO') {
        if ($ac_di == 'NO') {
            $s_1 = "insert into empleados values('','{$nombre}','{$apellidos}','{$usuario}','{$password1}','{$email}','{$ac_di}','0','0','','0','0','0','0','1')";
        }
        if ($ac_di == 'SI') {
            $s_1 = "insert into empleados values('','','','{$usuario}','','','{$ac_di}','0','0','','0','0','0','0','1')";
        }
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #7
0
function guardar($nombre, $codigos)
{
    $nombre = trim($nombre);
    $existe = ver_si_existe($nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into causas values('','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        $s_1 = "select * from causas where nombre='{$nombre}' and activo='1'";
        $r_1 = mysql_query($s_1);
        $d_1 = mysql_fetch_array($r_1);
        $id_causa = $d_1['id'];
        for ($i = 0; $i < count($codigos); $i++) {
            $s_1 = "insert into causa_codigo values('','{$id_causa}','{$codigos[$i]}')";
            $r_1 = mysql_query($s_1);
        }
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #8
0
function guardar($nombre, $ubicacion, $jefe)
{
    $nombre = trim($nombre);
    $ubicacion = trim($ubicacion);
    $jefe = trim($jefe);
    $existe = ver_si_existe($nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into plantas values('','{$nombre}','{$ubicacion}','{$jefe}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #9
0
function guardar($planta, $division, $prce, $segmento, $nombre, $lsr, $apr_especial)
{
    $planta = trim($planta);
    $division = trim($division);
    $prce = trim($prce);
    $segmento = trim($segmento);
    $nombre = trim($nombre);
    $lsr = trim($lsr);
    $limite = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m") + 6, date("d"), date("Y")));
    $existe = ver_si_existe($prce, $segmento, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into proyectos values('','{$planta}','{$division}','{$prce}','{$segmento}','{$nombre}','{$lsr}','{$apr_especial}','{$limite}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #10
0
function guardar($vendor, $nombre)
{
    $nombre = trim($nombre);
    $existe = ver_si_existe($vendor, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into vendors values('','{$vendor}','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #11
0
function guardar($area, $estacion, $nombre, $causas)
{
    $area = trim($area);
    $estacion = trim($estacion);
    $nombre = trim($nombre);
    $existe = ver_si_existe($estacion, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into defectos values('','{$area}','{$estacion}','{$nombre}','1')";
        $r_1 = mysql_query($s_1);
        $s_1 = "select * from defectos where id_area='{$area}' and id_estacion='{$estacion}' and nombre='{$nombre}' and activo='1'";
        $r_1 = mysql_query($s_1);
        $d_1 = mysql_fetch_array($r_1);
        $id_defecto = $d_1['id'];
        for ($i = 0; $i < count($causas); $i++) {
            $s_1 = "insert into defecto_causa values('','{$id_defecto}','{$causas[$i]}')";
            $r_1 = mysql_query($s_1);
        }
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #12
0
function guardar($motivo)
{
    $motivo = trim($motivo);
    $existe = ver_si_existe($motivo);
    if ($existe == 'NO') {
        $s_1 = "insert into motivos_sap values('','{$motivo}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #13
0
function guardar($division, $segmento, $prce, $proyecto, $codigo, $orden_interna)
{
    $orden_interna = trim($orden_interna);
    $existe = ver_si_existe($division, $segmento, $prce, $proyecto, $codigo);
    if ($existe == 'NO') {
        $s_1 = "insert into oi_especial values('','{$division}','{$segmento}','{$prce}','{$proyecto}','{$codigo}','{$orden_interna}','1')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}
Example #14
0
function guardar($tabla, $tipo, $nombre, $costo, $unidad, $descripcion)
{
    $tabla = trim($tabla);
    $tipo = trim($tipo);
    $nombre = trim($nombre);
    $costo = trim($costo);
    $descripcion = htmlentities(trim($descripcion), ENT_QUOTES, "UTF-8");
    $existe = ver_si_existe($tipo, $tabla, $nombre);
    if ($existe == 'NO') {
        $s_1 = "insert into numeros_parte values('','{$nombre}','{$descripcion}','{$tabla}','{$tipo}','{$costo}','{$unidad}','1','NA')";
        $r_1 = mysql_query($s_1);
        echo "<script>alert('Registro almacenado');</script>";
    } else {
        echo "<script>alert('Ese registro ya existe');</script>";
    }
}