<?php
    Getsecurity('operator');

    if($_REQUEST['ajax']) {
        switch($_REQUEST['code']) {
            case "transno":
              if(RetRstField("SELECT fnid FROM tlemployee WHERE ftoperator_code='{$_REQUEST['fttrans_no']}'")) {
                  ?>
                  alert('Kode Operator sudah dipakai...\n System akan mengenerate Kode Pegawai kembali ...\n Silahkan ulangi proses penyimpanan...  ');

                  OnChangeDate_fdstart_date()
            <?php
              }
              else {
                    ?> 
                  submitbutton('Simpan','','','','');                   
            <?php
              }
            die("");
            break;
			
        }       
      
    }

    $objAxpDB->ViewName("Daftar Nama Operator");
    $objAxpDB->ViewSQL("SELECT 	a.fnid,  a.ftoperator_code, a.ftemployee_name, b.fttrans_status_name
                        from tlemployee  a
                                left join tstransaction_status b on a.fnstatus=b.fntrans_status_code and b.fntrans_group_code = 29
                        order by a.fnstatus,a.ftoperator_code");
    $objAxpDB->ViewCaption("ID, Kode Operator, Nama Operator, Status");
   
    $objAxpDB->FormName("Operator");
    $objAxpDB->FormSQL("select ftoperator_code, ftemployee_name, fnstatus from tlemployee");
    $objAxpDB->FormCaption(" Kode Operator, Nama Operator, Status");
    $objAxpDB->FormPosition("TL, TL, TL");
        
    $objAxpDB->SetStatus("id");
    
    $objAxpDB->Lookup("fnstatus", "select fntrans_status_code, fttrans_status_name from tstransaction_status where fntrans_group_code = 29 and fnactive_status = 1 ", "fntrans_status_code", "fttrans_status_name", 0, True);
    
    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");
            $objAxpDB->ButtonShow("update, hapus, tutup");
    }

    $objAxpDB->Process();
    $objAxpDB->WriteHtmlTable();
       
?>