<?php
     if($_REQUEST['ajax']) {
        switch($_REQUEST['code']) {
            case "transno":
              if(RetRstField("SELECT fnid FROM tlpph21 WHERE ftpph21_code='{$_REQUEST['fttrans_no']}'")) {
                  ?>
                  
                  alert('Kode Pendidikan sudah dipakai... ');
            <?php
              }
              else {
                    ?>
                   
                    
                  submitbutton('Simpan','','','','');
                   
            <?php
              }
            break;
        }       
        die("");
    }
    
        $objAxpDB->ViewName("Daftar PPH21");
        $objAxpDB->ViewTable("vHRPPH21");
        $objAxpDB->ViewSQL("select a.fnid,  a.ftpph21_code, a.ftpph21_name,  b.fttrans_status_name , a.fcamount from tlpph21   a left join tstransaction_status b on a.ftpph21_sex=b.fntrans_status_code and b.fntrans_group_code = 23");
        $objAxpDB->ViewCaption("ID,  Kode PPH21, Nama PPH21, Jenis Kelamin, Jumlah");

        $objAxpDB->FormName("PPH21");
        $objAxpDB->FormSQL("select  ftpph21_code, ftpph21_name, ftpph21_sex, fcamount from tlpph21");
        $objAxpDB->FormCaption(" Kode PPH21, Nama PPH21, Jenis Kelamin, Jumlah");
        $objAxpDB->FormPosition("TL, TL, TL, TL, TL, TL, TL, TL, TL, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR");
     
         $objAxpDB->Lookup("ftpph21_sex", "select fntrans_status_code, fttrans_status_name from tstransaction_status where fntrans_group_code = 23", "fntrans_status_code", "fttrans_status_name", 0, 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, 0");
                $objAxpDB->ButtonShow("reset, simpan, tutup");
        } elseif ($objAxpDB->GetStatus("id") != 0) {
                $objAxpDB->FormLocked("1, 0, 0");
                $objAxpDB->ButtonShow("update, hapus, tutup");
        }
        $objAxpDB->Process();
     
        $objAxpDB->WriteHtmlTable();
	   
       
?>
