<?php 
include '../koneksi.php';
session_start();

$kdc=$_SESSION['kdc'];

    $id    = $_GET['id'];
    $warna = $_GET['warna'];

mysqli_query($koneksi, "UPDATE kdkanca SET warna_b='$warna',id_warna='$id' WHERE kd='$kdc' ")or die(mysqli_errno());

    $kdkanca = mysqli_query($koneksi,"select * from kdkanca where kd='$kdc'");
        $k = mysqli_fetch_assoc($kdkanca);    
        $id_warna=$k['id_warna'];
    $kdwarna = mysqli_query($koneksi,"select * from kdwarna where id='$id_warna'");
        $w = mysqli_fetch_assoc($kdwarna);            
    session_start();
    $_SESSION['warna_bag']= $w['warna'] ;    

header("location:00_warna_background.php?alert=berhasil");