<?php 
include '../koneksi.php';
$nama       = $_POST['nama'];
$alamat     = $_POST['alamat'];
$jabatan    = $_POST['jabatan'];
$oleh     = $_POST['oleh'];
//$oleh       = $_SESSION['id'];
$kdc        = $_POST['kdc'];
$grup       = '0';
$jam= date('d-m-Y  H:i:s'); //kombinasi jam dan tanggal
$cek='';

    $query = mysqli_query($mysqli, "INSERT INTO karyawan (nama,alamat,jabatan,kdc,jam_input,oleh) 
                                    VALUES('$nama','$alamat','$jabatan','$kdc',(now()),'$oleh')")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
    $query = mysqli_query($mysqli, "INSERT INTO karyawan_iden (kdc,jam,oleh) 
                                    VALUES('$kdc',(now()),'$oleh')")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
    $query = mysqli_query($mysqli, "INSERT INTO karyawan_gapok (kdc,jam,oleh) 
                                    VALUES('$kdc',(now()),'$oleh')")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));                                    
//mysqli_query($koneksi, "insert into karyawan values (NULL,'$nama','$alamat','$jabatan','$grup','$jam','$cek','$cek','$cek','$cek','$cek','$cek','$cek')");
//mysqli_query($koneksi, "insert into karyawan_gapok values (NULL,'$cek','$cek','$cek','$cek','$cek','$cek','$cek')");
//mysqli_query($koneksi, "insert into karyawan_iden values (NULL,'$cek','$cek','$cek','$cek','$cek','$cek','$cek')");

header("location:b_karyawan_top.php");