<?php 
session_start();
include '../koneksi.php';
$kdc=$_SESSION['kdc'];

$kasir = $_POST['kasir'];
$keuangan = $_POST['keuangan'];
$xttd_1 = $_POST['ttd_1'];
$xttd_2 = $_POST['ttd_2'];
$xttd_3 = $_POST['ttd_3'];

$kary = mysqli_query($koneksi,"select nama AS tnama1 from karyawan where jab='$xttd_1'");
                $k = mysqli_fetch_assoc($kary);
$kary2 = mysqli_query($koneksi,"select nama AS tnama2 from karyawan where jab='$xttd_2'");
                $k2 = mysqli_fetch_assoc($kary2);
$kary3 = mysqli_query($koneksi,"select nama AS tnama3 from karyawan where jab='$xttd_3'");
                $k3 = mysqli_fetch_assoc($kary3);                
                
mysqli_query($koneksi, "UPDATE kdkanca SET ttd_1='$xttd_1',nama_ttd_1='$k[tnama1]',ttd_2='$xttd_2',nama_ttd_2='$k2[tnama2]',ttd_3='$xttd_3',nama_ttd_3='$k3[tnama3]',kasir='$kasir' WHERE kd='$kdc' ")or die(mysqli_errno());

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