<script type="text/javascript">
    var id_kar = 0;
    $(function(){
        $('.tab_detail_karyawan li').click(function(){
            $('.tab_detail_karyawan li').removeClass("active");
            $(this).addClass("active");
        });

        form_datadiri();

    });

    function form_datadiri(){
        $("#myTabContent").load("<?= route('master.karyawan.datadiri.detail').'/'.$id_karyawan ?>");
    }

    function edit_informasi_datadiri(id){
        $("#myTabContent").load("<?= route('master.karyawan.datadiri.form.edit') ?>"+"/"+id);
    }

    function tab_keluarga(){
        $("#myTabContent").load("<?= route('master.karyawan.keluarga.home').'/'.$id_karyawan ?>");
    }

    function tab_pendidikan(){
        $("#myTabContent").load("<?= route('master.karyawan.riwayatpendidikan.home').'/'.$id_karyawan ?>");
    }

    function tab_pengalamankerja(){
        $("#myTabContent").load("<?= route('master.karyawan.pengalamankerja.home').'/'.$id_karyawan ?>");
    }

    function tab_karirpekerjaan(){
        $("#myTabContent").load("<?= route('master.karyawan.karirpekerjaan.home').'/'.$id_karyawan ?>");
    }

    function tab_sertifikat(){
        $("#myTabContent").load("<?= route('master.karyawan.sertifikat.home').'/'.$id_karyawan ?>");
    }

    function tab_akun(){
        $("#myTabContent").load("<?= route('master.karyawan.akun.home').'/'.$id_karyawan ?>");
    }

    function tab_file(){
        $("#myTabContent").load("<?= route('master.karyawan.kelengkapanfile.home').'/'.$id_karyawan ?>");
    }
    <?php if($this->session->userdata('paket_payroll') == 1) { ?>
    function tab_payroll(){
        $("#myTabContent").load("<?= route('master.karyawan.payroll.home').'/'.$id_karyawan ?>");
    }
    <?php } ?>
</script>

<div class="content-header">
    <div class="row align-items-center">
        <div class="content-header-left col-md-6 col-12 mb-md-0">
            <h3 class="content-header-title"><?= $judul ?></h3>
            <div class="row breadcrumbs-top">
                <div class="breadcrumb-wrapper col-12">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">Master Data</a>
                        </li>
                        <li class="breadcrumb-item active"><?= $judul ?>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="content-header-right col-md-6 col-12">
            <div class="float-md-right">
                <a href="<?= site_url('master/karyawan') ?>" class="btn btn-secondary btn-min-width">
                    <i class="fa fa-arrow-left"></i> KEMBALI
                </a>
            </div>
        </div>
    </div>
</div>

<div class="row match-height">
    <div class="col-xl-12 col-lg-12">
        <div class="card card-rounded card-detail-karyawan">
            <div class="card-content">
                <div class="card-body p-custom">
                    <div class="nav-vertical row">
                        <div class="col-md-2 border-kanan">
                            <ul class="tab_detail_karyawan nav nav-tabs nav-left flex-column">
                                <li onclick="tab_datadiri();" class="nav-item active">
                                    <a class="nav-link active" data-toggle="tab" aria-expanded="true">
                                        Data Diri
                                    </a>
                                </li>
                                <?php
                                    if($this->level_user == "1"){
                                ?>
                                    <li onclick="tab_keluarga();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Data Keluarga
                                        </a>
                                    </li>
                                    <li onclick="tab_pendidikan();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Data Pendidikan
                                        </a>
                                    </li>
                                    <li onclick="tab_pengalamankerja();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Pengalaman Kerja
                                        </a>
                                    </li>
                                    <li onclick="tab_karirpekerjaan();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Karir Pekerjaan
                                        </a>
                                    </li>
                                    <li onclick="tab_sertifikat();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Sertifikat/Pelatihan
                                        </a>
                                    </li>
                                    <li onclick="tab_akun();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Akses Akun
                                        </a>
                                    </li>
                                    <li onclick="tab_file();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Kelengkapan File
                                        </a>
                                    </li>
                                    <?php if($this->session->userdata('paket_payroll') == 1) { ?>
                                    <li onclick="tab_payroll();" class="nav-item">
                                        <a class="nav-link" data-toggle="tab" aria-expanded="false">
                                            Payroll
                                        </a>
                                    </li>
                                <?php
                                    }
                                    }
                                ?>
                            </ul>
                        </div>
                        <div class="col-md-10">
                            <div id="myTabContent" class="tab-content">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


