MEMBUAT MENU PEGAWAI DENGAN CLIPPER

// Nama : Rizal

Do while .t.
   set colo to
   clea
   set colo to w/b
   @5,5 clea to 17,60
   @5,5 to 17,60
   @6,20 say "MENU UTAMA"
   @08,10 SAY "1] ENTRY DATA"
   @10,10 SAY "2] HAPUS DATA"
   @12,10 SAY "3] LAPORAN"
   @14,10 SAY "4] SELESAI"
   P=0
   @16,15 SAY "PILIHAN : " GET P PICT "9"
   READ
   DO CASE
      CASE P=1
         MASUK()
      CASE P=2
         HAPUS()
      CASE P=3
         LAPOR()
      CASE P=4
         EXIT
    ENDCASE
ENDDO

func formulir()
   set colo to
   clea
   set colo to w/b
   @5,5 clea to 17,60
   @5,5 to 17,60
   @06,20 say "ENTRY DATA PEGAWAI"
   @08,10 SAY "No. Induk Pegawai:           [F2]-Lihat NIP"
   @10,10 say "Nama Pegawai     :"
   @12,10 say "Kode             :    (A/B/C)"
   set colo to gr+*/b
   @08,40 say "F2"
   set colo to w/b
retu



FUNC LIHAT()
  Local Layar:=savescreen()
  set colo to w+/br,gr*+/r*
  @7,27 clea to 17,71
  @7,27 to 17,71
  go top
  dbedit(8,28,16,70,{"NIP","NAMA"},,,{"NIP","NAMA PEGAWAI"})
  mNIP=Fieldget(1)
  keyboard chr(13)
  set color to
  restscreen(,,,,layar)
retu


FUNC CT_LAYAR()
    SETCURSOR(2)
    SET COLO TO W+/B
    @1,0 to 23,79
    @24,1 clea to 24,78
    @24,14 say "Pres    Atas   Bawah      Batal       ScUp      ScDn"
    set colo to GR+/b
    @24,19 say chr(24)
    @24,27 say chr(25)
    @24,35 SAY 'ESC'
    @24,47 say 'PgUp'
    @24,57 say 'PgDn'
    SET PRINT OFF
    SET CONS ON
    SET ALTER TO
    SET COLO TO W+/B
    geser:=memoedit(memoread("LAPOR.TXT"),2,1,22,78,.F.,,350,10)
return

Func Masuk()
Close Data
set menu off
set score off
set date ital
set cent on

If ! file("pegawai.dbf")
   dbcreate("pegawai.dbf",{{"NIP","C",5,0},;
                         {"NAMA","C",20,0},;
                         {"KODE","C",1,0}})
                        
endif

If ! file("pegawai.ntx")
   use pegawai
   index on nip to pegawai
endif

    Use pegawai index pegawai

Do while .t.
   Formulir()
   mNIP=spac(5)
   set key -1 to lihat
   set colo to w/b
   @8,28 get mNIP
   read

   if empty(mNIP)
      exit
   endif

   
   Seek mNIP
   if ! found()
      appe blank
      repl nip with mNIP
   endif
   set colo to
   @10,28  get nama

   @12,28 get kode pict "@!" valid kode$"ABC"
   read
  
   Tanya=spac(1)
   set colo to w/b
   @15,20 say "Masih ada Data [Y/T] " get tanya pict "@!" valid Tanya$"YT"
   read
   if Tanya="T"
      exit
   endif
enddo
retu

Func Hapus()
Close Data
set menu off
set score off
set date ital
set cent on

If ! file("pegawai.dbf")
   alert("Perhatian File pegawai.dbf Belum ada")
   retu
endif

    Use pegawai index pegawai

Do while .t.
   formulir()
   mNIP=spac(5)
   set key -1 to lihat
   set colo to w/b
   @8,28 get mNIP
   read

   if empty(mNIP)
      alert("NIP tidak boleh kosong")
      loop
   endif

   set colo to w/b
   Seek mNIP
   if ! found()
      alert("NIP tersebut belum ada, cari yang lain")
   else
      @10,28  say nama
      @12,28 say kode
     

     Tanya=spac(1)
     set colo to w/b
     @15,15 clea to 15,58
     @15,20 say "Yakin dihapus [Y/T] " get tanya pict "@!" valid Tanya$"YT"
     read
     if Tanya="Y"
       dele
       pack
     endif
   endif

   Tanya=spac(1)
   set colo to w/b
   @15,15 clea to 15,58
   @15,20 say "Ingin hapus lagi[Y/T] " get tanya pict "@!" valid Tanya$"YT"
   read
   if Tanya="T"
      exit
   endif
enddo
retu

Func Lapor()
Close Data

If ! file("pegawai.dbf")
   alert("Perhatian File pegawai.dbf Belum ada")
   retu
endif


Use pegawai index pegawai

pilih=0
pilih:=alert("Media cetakan",{"Layar","Printer","Batal"})
Do case
   case pilih=1
        set printer off
        set cons off
        set alter to lapor.txt
        set alter on
   case pilih=2
        if ! isprinter()
           alert("Printer Belum Siap")
           return
        endif
        set cons off
        set printer on
    case pilih=3 .or. pilih=0
        return
endcase
clea
NO=0
? "                                DAFTAR GAJI PEGAWAI"
? "                             PT. MAJU MUNDUR SURABAYA"
?
? "=============================================================================="
? "|NO |  NIP  | NAMA PEGAWAI       | KODE | GAJI POKOK | TUNJANGAN | GAJI TOTAL|"
? "------------------------------------------------------------------------------"
DO WHILE .NOT. EOF()
   NO=NO+1

   IF KODE="A"
      GP=450000
     
   ELSEIF KODE="B"
      GP=350000

   ELSE
      GP=300000
   ENDIF
TJ=(10/100)*GP
GT=GP+TJ

   A="|"+TRAN(NO,"99")+" | "+NIP+" | "+NAMA+" |  "+KODE
   B="  |  "+TRAN(GP,"999,999")+"  |  "+TRAN(TJ,"999,999")+"  |   "+TRAN(GT,"999,999")+" |"
   ? A+B
   SKIP
ENDDO
?  "=============================================================================="
IF PILIH=1
   CT_LAYAR()
ENDIF
RETU

//Download Filenya disini

0 Response to "MEMBUAT MENU PEGAWAI DENGAN CLIPPER"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel