Exemplo n.º 1
0
function Actualizar()
{
    $conceptogasto = new ConceptoGasto();
    if (isset($_POST['cg_id']) && $_POST['cg_id'] != "" && isset($_POST['nombre']) && $_POST['nombre'] != "" && isset($_POST['sociedad_id']) && $_POST['sociedad_id'] != "" && isset($_POST['tipo']) && $_POST['tipo'] != "" && isset($_POST['pais_id']) && $_POST['pais_id'] != "" && isset($_POST['cuenta']) && $_POST['cuenta'] != "") {
        $conceptogasto_id = $_POST['cg_id'];
        $nombre = $_POST['nombre'];
        $estatus = $_POST['estatus'];
        $anticipo = $_POST['anticipo'];
        $ceco = $_POST['ceco_id'];
        $tipo = $_POST['tipo'];
        $pais = $_POST['pais_id'];
        $cuenta = $_POST['cuenta'];
        $gasto = $_POST['gasto_id'];
        $id_concepto = $_POST['id_concepto'];
        if ($anticipo == "on") {
            $anticipofinal = '1';
        } else {
            $anticipofinal = '0';
        }
        if ($estatus == "on") {
            $conceptogasto->Edita_ConceptoGasto($nombre, $gasto, $ceco, $anticipofinal, $tipo, $cuenta, "1", $conceptogasto_id, $id_concepto);
        } else {
            $conceptogasto->Edita_ConceptoGasto($nombre, $gasto, $ceco, $anticipofinal, $tipo, $cuenta, "0", $conceptogasto_id, $id_concepto);
        }
        header("Location: index.php?okupdate");
    } else {
        header("Location: index.php?error");
    }
}