<?php
     if($_REQUEST['ajax']) {
        switch($_REQUEST['code']) {
            case "transno":
              if(RetRstField("SELECT fnid FROM tlovertime WHERE ftovertime_code='{$_REQUEST['fttrans_no']}'")) {
                  ?>

                  alert('Kode Pendidikan sudah dipakai... ');
            <?php
              }
              else {
                    ?>


                  submitbutton('Simpan','','','','');

            <?php
              }
            break;
        }
        die("");
    }

	 if($_REQUEST['id']=='0') {
            $strAutoNumber0="document.getElementById('fdovertime_from').value='00:00:00';
							document.getElementById('fdovertime_to').value='00:00:00';
							document.getElementById('fnovertime_formula').value='0';

								 ";
            $objAxpDB->FormJS($strAutoNumber0);
     }

   $objAxpDB->ViewName("Daftar Lembur");
   $objAxpDB->ViewTable("vHRLembur");
    $objAxpDB->ViewSQL("select 	a.fnid, a.ftovertime_code, b.fttrans_status_name,a.fdovertime_from, a.fdovertime_to, a.fnovertime_formula
                            from tlovertime a
                             LEFT JOIN tstransaction_status b ON b.fntrans_status_code=a.fntype AND b.fntrans_group_code = 32 ");
    $objAxpDB->ViewCaption("ID,  Kode Lembur,Type Lembur, Periode Lembur Awal, Periode Lembur Akhir, Formula");

    $objAxpDB->FormName("Lembur");
    $objAxpDB->FormSQL("select  ftovertime_code,fntype, fdovertime_from, fdovertime_to, fnovertime_formula from tlovertime");
    $objAxpDB->FormCaption(" Kode Lembur,Type Lembur, Periode Lembur Awal, Periode Lembur Akhir, Formula");
     $objAxpDB->Lookup("fntype", "SELECT fntrans_status_code, fttrans_status_name FROM tstransaction_status WHERE fntrans_group_code = 32", "fntrans_status_code", "fttrans_status_name",1, True);

    $objAxpDB->FormPosition(" TL, TL,TL, TL, TL");
//    $objAxpDB->FormScript(1, "onKeyUp=\"FormatNPWP(this)\"");

    $objAxpDB->Lookup("fnStatus", "select fntrans_status_code, fttrans_status_name from tstransaction_status where fntrans_group_code = 9", "fntrans_status_code", "fttrans_status_name", 1, True);

    $objAxpDB->SetStatus("id, fnStatus");
    if ($objAxpDB->GetStatus("id") == "")
            $objAxpDB->ButtonShow("baru, cetak_daftar, export_excel ,  tutup");
    elseif ($objAxpDB->GetStatus("id") == 0) {
            $objAxpDB->FormLocked(" 0, 0");
            $objAxpDB->ButtonShow("reset, simpan, tutup");
    } elseif ($objAxpDB->GetStatus("id") != 0) {
            $objAxpDB->FormLocked(" 1, 0");
            $objAxpDB->ButtonShow("update, hapus, tutup");
    }
    $objAxpDB->Process();
        $objAxpDB->WriteHtmlTable();


?>
