Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

S.T. CENTER
//=========================================================
//โปรแกรมหลักเรียกใช้งานในเมนูย่อย
# include "inkey.ch"
SET CURSOR off
SET ESCAPE ON
set procedure to empl0701
set procedure to empl0702
set procedure to empl0703
set procedure to empl0704
set procedure to empl0705
SET BELL ON

RESTORE FROM CC

ARMAIN=5; ARCM=ARRAY(ARMAIN)
ARCM[1]=[ งานหลัก ]
ARCM[2]=[ ปรับปรุง ]
ARCM[3]=[ รายงาน ]
ARCM[4]=[ สรุป   ]
ARCM[5]=[ ระบบ   ]

ARS1=7; ARC1=ARRAY(ARS1)
ARC1[1]=[ - ขายสินค้า       F3 ]
ARC1[2]=[ - สั่งซื้อสินค้า  F4 ]
ARC1[3]=[ - รับสินค้า       F5 ]
ARC1[4]=[ - รับชำระหนี้     F6 ]
ARC1[5]=[ - ยกเลิก             ]
ARC1[6]=[ - QUIT               ]
ARC1[7]=[ - RETURN             ]

ARS2=4; ARC2=ARRAY(ARS2)
ARC2[1]=[ - DATA            ]
ARC2[2]=[ - BROWSE          ]
ARC2[3]=[ - SORT            ]
ARC2[4]=[ - RETURN          ]

ARS3=8; ARC3=ARRAY(ARS3)
ARC3[1]=[ - สินค้า          ]
ARC3[2]=[ - พนักงาน         ]
ARC3[3]=[ - สมาชิก          ]
ARC3[4]=[ - ขายสินค้า       ]
ARC3[5]=[ - สั่งซื้อ        ]
ARC3[6]=[ - รับสินค้า       ]
ARC3[7]=[ - รับชำระหนี้     ]
ARC3[8]=[ - RETURN          ]

ARS4=7; ARC4=ARRAY(ARS4)
ARC4[1]=[ - ขายสินค้า       ]
ARC4[2]=[ - สั่งซื้อ        ]
ARC4[3]=[ - รับสินค้า       ]
ARC4[4]=[ - รับชำระหนี้     ]
ARC4[5]=[ - สมาชิก          ]
ARC4[6]=[ - สินค้า          ]
ARC4[7]=[ - RETURN          ]

ARS5=9; ARC5=ARRAY(ARS5)
ARC5[1]=[ - HELP            ]
ARC5[2]=[ - SCREEN SAVER    ]
ARC5[3]=[ - USER PASSWORD   ]
ARC5[4]=[ - LOG FILE        ]
ARC5[5]=[ - SET COLOR       ]
ARC5[6]=[ - BACK UP         ]
ARC5[7]=[ - DOS SHELL       ]
ARC5[8]=[ - SOURE           ]
ARC5[9]=[ - RETURN          ]

OPT = 1
TOPLMT = OPT
BOTTOMLMT = ARMAIN
ALLSUB = ARMAIN
DO WRITEMENU
DO WHILE LASTKEY() !=27
   @ 0,64  SAY "TIME:"
   @ 0,69  say TIME()
   SET DATE FORMAT TO "DD-MM-YYYY"
   @ 0,1  SAY "DATE:"
   @ 0,6  SAY DTOC(DATE())
   INKEY(0.02)
   IF LASTKEY() !=0
      DO CASE
         CASE LASTKEY()=27
              DO END
         CASE LASTKEY()=4
              IF OPT < 10
                 DO PRESSDOWN
              ELSE
                 IF(OPT-MOD(OPT,10))/10=ALLSUB
                     OPT=11
                 ELSE
                     OPT=(OPT-MOD(OPT,10))+11
                 ENDIF
             ENDIF
         CASE LASTKEY()=19
              IF OPT<10
                 DO PRESSUP
              ELSE
                 IF(OPT-MOD(OPT,10))/10=1
                    OPT =ALLSUB*10+1
                 ELSE
                    OPT=(OPT-MOD(OPT,10))-9
                 ENDIF
              ENDIF
         CASE LASTKEY()=24 ;DO PRESSDOWN
         CASE LASTKEY()=27 ;DO END
         CASE LASTKEY()=-1 ;DO HELP
         CASE LASTKEY()=-2 ;DO s5
         CASE LASTKEY()=-3 ;DO o5
         CASE LASTKEY()=-4 ;DO r5
         CASE LASTKEY()=-5 ;DO INCOME
         CASE LASTKEY()= 5 ;DO PRESSUP
         CASE LASTKEY()=13
               DO CASE
                    CASE OPT=1;OPT=11
                    CASE OPT=2;OPT=21
                    CASE OPT=3;OPT=31
                    CASE OPT=4;OPT=41
                    CASE OPT=5;OPT=51
                    CASE OPT=10+ARS1;OPT=1
                    CASE OPT=20+ARS2;OPT=2
                    CASE OPT=30+ARS3;OPT=3
                    CASE OPT=40+ARS4;OPT=4
                    CASE OPT=50+ARS5;OPT=5
                    CASE OPT>=11.AND.OPT<=10+ARS1
                         do case
                            case opt=11;do s5    ;opt=11
                            case opt=12;do o5    ;opt=12
                            case opt=13;do R5    ;opt=13
                            case opt=14;do income;opt=14
                            case opt=15;do cancel;opt=15
                            case opt=16;do end   ;opt=16
                         endcase
                    CASE OPT>=21.AND.OPT<=20+ARS2
                         do case
                            case opt=21 ;do ad ;opt=21
                            case opt=22 ;do bd ;opt=22
                            case opt=23 ;do sd ;opt=23
                         endcase
                    CASE OPT>=31.AND.OPT<=30+ARS3
                         DO CASE
                            case opt=31 ;do GA ;opt=31
                            CASE OPT=32 ;DO EA ;OPT=32
                            CASE OPT=33 ;DO MA ;OPT=33
                            CASE OPT=34 ;DO SA ;OPT=34
                            CASE OPT=35 ;DO OA ;OPT=35
                            CASE OPT=36 ;DO RA ;OPT=36
                            CASE OPT=37 ;DO IA ;OPT=37
                         ENDCASE
                    CASE OPT>=41.AND.OPT<=40+ARS4
                         DO CASE
                            CASE OPT=41 ;DO SSALE ;OPT=41
                            CASE OPT=42 ;DO SORDER ;OPT=42
                            CASE OPT=43 ;DO SRECEIV ;OPT=43
                            CASE OPT=44 ;DO SINCOME ;OPT=44
                            CASE OPT=45 ;DO SMEMBER ;OPT=45
                            CASE OPT=46 ;DO SGOODS ;OPT=46
                         ENDCASE
                    CASE OPT>=51.AND.OPT<=50+ARS5
                         do case
                            CASE OPT=51 ;DO HELP_HELP  ;OPT=51
                            CASE OPT=52 ;DO DISPLAY1   ;OPT=54
                            CASE OPT=53 ;DO MENU_PASS  ;OPT=55
                            CASE OPT=54 ;DO t_log      ;OPT=54
                            CASE OPT=55 ;DO cho_col    ;OPT=55
                            CASE OPT=56 ;DO BACKUP     ;OPT=56
                            CASE OPT=57 ;RUN COMMAMD   ;OPT=57
                            CASE OPT=58 ;DO soure      ;OPT=58
                         endcase
                    ENDCASE
            ENDCASE
            DO CASE
               CASE OPT<10
                    TOPLMT=1  ;BOTTOMLMT=ARMAIN
               CASE OPT>=11.AND.OPT<=10+ARS1
                    TOPLMT=11 ;BOTTOMLMT=10+ARS1
               CASE OPT>=21.AND.OPT<=20+ARS2
                    TOPLMT=21 ;BOTTOMLMT=20+ARS2
               CASE OPT>=31.AND.OPT<=30+ARS3
                    TOPLMT=31 ;BOTTOMLMT=30+ARS3
               CASE OPT>=41.AND.OPT<=40+ARS4
                    TOPLMT=41 ;BOTTOMLMT=40+ARS4
               CASE OPT>=51.AND.OPT<=50+ARS5
                    TOPLMT=51 ;BOTTOMLMT=50+ARS5
            ENDCASE
         DO WRITEMENU
         KEYBOARD CHR(0)
         INKEY()
   ENDIF
ENDDO
//===================================================================
PROCEDURE PRESSDOWN
   IF OPT=BOTTOMLMT
      OPT=TOPLMT
   ELSE
      OPT=OPT+1
   ENDIF
RETURN
//===================================================================
PROCEDURE PRESSUP
   IF OPT=TOPLMT
      OPT=BOTTOMLMT
   ELSE
      OPT=OPT-1
   ENDIF
RETURN
//====================================================================
PROCEDURE WRITEMENU
SET COLOR TO (CC1)
          CLS
          SET COLOR TO (CC3)
          @ 0,0 CLEAR TO 0,80
          SET COLOR TO (CC3)
          @ 0,34 SAY "[S.T CENTER]"
          SET COLOR TO (CC2)
          @ 7,7 CLEAR TO 19,74
          SET COLOR TO (CC3)
          @ 6,5 CLEAR TO 18,72
          SET COLOR TO (CC3)
          @ 8,5  TO 8,72 double
          SET COLOR TO R/W
          @ 1,0 CLEAR TO 1,80
          @ 1,37 SAY "SYSTEM"
          @ 23,0 CLEAR TO 23,80
          @ 23,1 SAY "   [PROGROM BY NARIN KRIKUG SEND BURIN] [ENTER การทำงาน] [ESC ออกโปรแกรม]"
          SET COLOR TO (CC3)
          @ 24,0 CLEAR TO 24,80
          @ 24,1 SAY "   [F1 ช่วยเหลือ] [F2 แนะนำลักษณะ] [F3 ขายสินค้า] [F4 สั่งซื้อ] [F5 รับสินค้า]"
          FOR J=1 TO ARMAIN
              @ 6+1,j*10 SAY ARCM[J]
          NEXT
          I=9
          DO CASE
             CASE OPT>=11.AND.OPT<=ARS1+10
                  FOR J=I TO I+ARS1-1
                      @ J,10 SAY ARC1[J-I+1]
                  NEXT
                      TEMPAR = ARC1
             CASE OPT>=21.AND.OPT<=ARS2+20
                  FOR J=I TO I+ARS2-1
                      @ J,20 SAY ARC2[J-I+1]
                  NEXT
                      TEMPAR = ARC2
             CASE OPT>=31.AND.OPT<=ARS3+30
                  FOR J= I TO I+ARS3-1
                      @ J,30 SAY ARC3[J-I+1]
                  NEXT
                      TEMPAR = ARC3
             CASE OPT>=41.AND.OPT<=ARS4+40
                  FOR J= I TO I+ARS4-1
                      @ J,40 SAY ARC4[J-I+1]
                  NEXT
                      TEMPAR = ARC4
             CASE OPT>=51.AND.OPT<=ARS5+50
                  FOR J= I TO I+ARS5-1
                      @ J,50 SAY ARC5[J-I+1]
                  NEXT
                      TEMPAR = ARC5
               CASE OPT>=61 .AND. OPT<=ARS6+60
                  FOR J= I TO I+ARS6-1
                      @ J,60 SAY ARC5[J-I+1]
                  NEXT
                      TEMPAR = ARC6
          ENDCASE
          SET COLOR TO B/W
          IF OPT>10
             @ I+MOD(OPT,10)-1,OPT-MOD(OPT,10);
             SAY TEMPAR[MOD(OPT,10)]
             @ 6+1,(OPT-MOD(OPT,10));
             SAY ARCM[(OPT-MOD(OPT,10))/10]
          ELSE
             @ 6+1,MOD(OPT,10)*10 SAY ARCM[MOD(OPT,10)]
          ENDIF
          SET COLOR TO W/B
RETURN
//===================================================================
//เช็ค PASSWORD ก่อนที่จะเข้าโปรแกรม
PROCEDURE PASSWORD
  cls
  USE PASS
  TS = 1
  PS = .F.
  WHILE TS <= 2 .AND. PS = .F.
    _USERNAME = SPACE(3)
    CHR = 0
    CHKPASSWORD = ARRAY(5)
    //@ 8,16 CLEAR TO 13,57
    @ 9,20 SAY'Please login your username & password'
    @ 10,18 TO 10,57 DOUBLE
    @ 11,27 SAY'ระบุ Username  :' GET _USERNAME
    READ
    @ 12,27 SAY'ระบุ Password  :'
    FOR I = 1 TO 3
      INKEY(0)
      CHKPASSWORD[I] = LASTKEY()
      @ 12,I+41 SAY'*'
    NEXT
    LOCATE FOR USERNAME = _USERNAME  .AND. PASSWORD = (CHR(CHKPASSWORD[1])+CHR(CHKPASSWORD[2])+CHR(CHKPASSWORD[3]))
    IF FOUND()
      INKEY(0)
      _PIORITY = PIORITY
      PS = .T.
      CHK = ALERT(' Pass word is correct.',{'Ok'})
    ELSE
      INKEY(0)
      PS = .F.
      CHK = ALERT('Password is incorrect!.',{'Ok'})
      IF TS = 2
        SET COLOR TO
        USE
        QUIT
      ENDIF
    ENDIF
    TS++
  END
  use log_file
  append blank
         replace start_time with time(),user with _username,;
                 password with 999 ,date with date(),stop_time with time()
RETURN
//===================================================================
//โปรแกรมการสอบถามว่าจะออกจากโปรแกรมหรือไม่
PROCEDURE END
  go bott
  use log_file
      replace stop_time with time()
  opt = 0
  set color to B/W+
  @ 22,0 clear to 22,80
  @ 22,1 say '   DO YOU WANT TO QUIT PROGRAM SURE !'
  @ 22,39 prom [ ENTER ]
  @ 22,46 prom [ CANCEL ]
  menu to opt
  do case
  case opt = 1
          SET COLOR TO N/W
          @ 6,5 CLEAR TO 18,72
          save screen to scr1
          @ 12,30 SAY'THE END OF PROGRAM'
          TONE(146.80,36)
          INKEY(0.9)
          INKEY(0.9)
          restore screen from scr1
          SET COLOR TO N/w
          @ 0,0 CLEAR TO 24,80
          @  2,10 say " ....   ......    .....  ..... ..  .. ......  ..... ....."
          @  3,10 say "..        ..     ..     ..     ..  ..   ..   ..     ..  .."
          @  4,10 say "..        ..     ..     ..     ... ..   ..   ..     ..  .."
          @  5,10 say " ...      ..     ..      ....  ... ..   ..    ..... ....."
          @  6,10 SAY "   ..     ..     ..     ..     .. ...   ..   ..     ..  .."
          @  7,10 say "   ..     ..     ..     ..     ..  ..   ..   ..     ..  .."
          @  8,10 SAY "....  []  ..  []  .....  ..... ..  ..   ..    ..... ..  .."
          @ 10,10 TO 10,67
          @ 11,28 Say " FINAL PROJECT BCOM413"
          @ 12,10 Say "เขียนโปรแกรมโดย นายนรินทร์ ไกรกรุง"
          @ 13,10 Say "รหัสนักศึกษา 4111044"
          @ 14,10 Say "วันที่ compiled 20 มีนาคม 2543"
          @ 15,10 Say "เสนอ อ.บุรินทร์ รุจจนพันธุ์ "
          @ 16,10 Say "อาจารย์ที่ปรึกษา อ.ทรรศนีย์ ไชยชนะ"
          @ 17,10 Say "เพื่อใช้ประกอบการเรียนวิชา BCOM 413"
          @ 18,10 Say "(สัมมนาคอมพิวเตอร์ธุรกิจ)"
          @ 19,10 Say "ประจำภาคเรียนที่ 2 ปีการศึกษา 2542"
          @ 20,10 TO 20,67
          INKEY(2.5)
          QUIT
  endcase
RETURN
//====================================================================
//แสดงการแนะนำลักษณะโปรแกรม
PROCEDURE HELP
  SET COLOR TO B/W
  @ 1,0 CLEAR TO 1,80
  @ 1,34  SAY'[แนะโปรแกรม]'
  SET COLOR TO B/W
  @ 6,5 CLEAR TO 18,72
  @ 7,9  SAY'DATE :'+DTOC(DATE())
  @ 7,40  SAY'TIME :'+TIME()
  @ 8,9 SAY'OS :'+ OS()
  @ 8,40 SAY'MEMORY :'+ltrim(STR(MEMORY()))
  @ 9,9 SAY'VESION :'+VERSION()
  @ 9,40 SAY'F1 : ช่วยเหลือ'
  @ 10,9 SAY '- หากต้องการออกจากการทำงานหรือยกเลิก สามารถกด Esc ได้ทันที'
  @ 11,9 SAY '- วันที่ในระบบนี้ จะใช้แบบ วัน/เดือน/ปี แบบ อังกฤษ เช่น 01/01/99'
  @ 12,9 SAY '- โปรแกรมนี้ Version 1.0'
  @ 13,9 SAY '- ระบบนี้ถูกพัฒนาโดย นายนรินทร์ ไกรกรุง'
  @ 14,9 SAY '- คณะบริหารธุรกิจ วิทยาลัยโยนก'
  @ 15,9 SAY '- ถ้าหากมีความสนใจ ติดต่อขอรับฟรีได้ที่'
  @ 16,9 SAY '- บ้านเลขที่ 260/176 ตลาดอัศวิน ถ.ท่าคราวน้อย ต.สบตุ๋ย อ.เมือง'
  @ 17,9 SAY '- จ.ลำปาง 52000 โทรศัพท์ 054-225514,054-310074'
  INKEY(0)
RETURN
//===================================================================
//ฟังช์ชั่นที่ใช้ในการช่วยเหลือ
//====================================================================
function callmem()
save screen to scr1
parameter id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_mem
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _id = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callmem1()
save screen to scr1
parameter id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_mem
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _id1 = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callmem2()
save screen to scr1
parameter id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_mem
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _id2 = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callemp()
save screen to scr1
parameter e_id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_emp
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(e_id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _e_id = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callemp1()
save screen to scr1
parameter e_id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_emp
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(e_id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _e_id1 = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callemp2()
save screen to scr1
parameter e_id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_emp
   go top
   r1=10;c1=37;r2=15;c2=67
   mshow = {}
   do while !eof()
      aadd(mshow,str(e_id,5)+" |"+name)
      skip
   enddo
   mdata=achoice(r1,c1,r2,c2,mshow)
   if mdata > 0
      _e_id2 = val(substr(mshow[mdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
FUNCTION CALLg()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_goo
   go top
   r1=10;c1=37;r2=15;c2=67
   gshow = {}
   SET FILTER TO G_QUAN <= G_PORDER
   do while !eof()
      aadd(gshow,str(goodsid,5)+" |"+g_name)
      skip
   enddo
   gdata=achoice(r1,c1,r2,c2,gshow)
   if gdata > 0
      _goodsid = val(substr(gshow[gdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callgoo()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_goo
   go top
   r1=10;c1=37;r2=15;c2=67
   gshow = {}
   do while !eof()
      aadd(gshow,str(goodsid,5)+" |"+g_name)
      skip
   enddo
   gdata=achoice(r1,c1,r2,c2,gshow)
   if gdata > 0
      _goodsid = val(substr(gshow[gdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callgoo1()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_goo
   go top
   r1=10;c1=37;r2=15;c2=67
   gshow = {}
   do while !eof()
      aadd(gshow,str(goodsid,5)+" |"+g_name)
      skip
   enddo
   gdata=achoice(r1,c1,r2,c2,gshow)
   if gdata > 0
      _goodsid1 = val(substr(gshow[gdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callgoo2()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_goo
   go top
   r1=10;c1=37;r2=15;c2=67
   gshow = {}
   do while !eof()
      aadd(gshow,str(goodsid,5)+" |"+g_name)
      skip
   enddo
   gdata=achoice(r1,c1,r2,c2,gshow)
   if gdata > 0
      _goodsid2 = val(substr(gshow[gdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callGUA()
save screen to scr1
parameter GUARid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_GUA
   go top
   r1=10;c1=37;r2=15;c2=67
   Gshow = {}
   do while !eof()
      aadd(gshow,str(GUARid,3)+" |"+name)
      skip
   enddo
   Gdata=achoice(r1,c1,r2,c2,Gshow)
   if Gdata > 0
      _GUARid = val(substr(Gshow[Gdata],1,3))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//==================================================================
function callord()
save screen to scr1
parameter orderid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_ord
   go top
   r1=10;c1=37;r2=15;c2=67
   oshow = {}
   do while !eof()
      aadd(oshow,str(ordERid,5)+" |"+dtoc(Odate))
      skip
   enddo
   odata=achoice(r1,c1,r2,c2,oshow)
   if odata > 0
      _orderid = val(substr(oshow[odata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//==================================================================
function callrec()
save screen to scr1
parameter receivid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_rec
   go top
   r1=10;c1=37;r2=15;c2=67
   rshow = {}
   do while !eof()
      aadd(rshow,str(receivid,5)+" |"+dtoc(rec_date))
      skip
   enddo
   Rdata=achoice(r1,c1,r2,c2,rshow)
   if rdata > 0
      _receivid = val(substr(rshow[rdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//==================================================================
function callsal()
save screen to scr1
parameter billon
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_sal
   go top
   r1=10;c1=37;r2=15;c2=67
   bshow = {}
   do while !eof()
      aadd(bshow,str(billon,5)+" |"+str(id))
      skip
   enddo
   bdata=achoice(r1,c1,r2,c2,bshow)
   if bdata > 0
      _billon = val(substr(bshow[bdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//===================================================================
function callpro()
save screen to scr1
parameter proid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_pro
   go top
   r1=10;c1=37;r2=15;c2=67
   pshow = {}
   do while !eof()
      aadd(pshow,str(proid,3)+" |"+P_name)
      skip
   enddo
   pdata=achoice(r1,c1,r2,c2,pshow)
   if pdata > 0
      _proid = val(substr(pshow[pdata],1,3))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callkin()
save screen to scr1
parameter kind_id
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_kin
   go top
   r1=10;c1=37;r2=15;c2=67
   kshow = {}
   do while !eof()
      aadd(kshow,str(kind_id,4)+" |"+name)
      skip
   enddo
   kdata=achoice(r1,c1,r2,c2,kshow)
   if kdata > 0
      _kind_id = val(substr(kshow[kdata],1,4))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callinc()
save screen to scr1
parameter incomeid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_inc
   go top
   r1=10;c1=37;r2=15;c2=67
   ishow = {}
   do while !eof()
      aadd(ishow,str(incomeid,5)+" |"+dtoc(i_date))
      skip
   enddo
   idata=achoice(r1,c1,r2,c2,ishow)
   if idata > 0
      _incomeid = val(substr(ishow[idata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
proc box3
 parameters r1,c1,r2,c2,col1,col2
 set color to &col1
 @r1,c1 Clea to r2,c2
 @r1,c1+1 To r2,c2-1
 @r1,c1+2 say repl(chr(196),c2-c1-10)
 set color to &col2
 @r2,c1+2 TO r2,c2-1
 @r1,c2-1 TO r2,c2-1
 @r1,c2-1 say chr(191)
 @r2,c2-1 say chr(217)
return
//====================================================================
function callsgoo()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_sal_d
   go top
   r1=10;c1=37;r2=15;c2=67
   sshow = {}
   set filter to billon = _billon
   do while !eof() .and. goodsid = goodsid
      aadd(sshow,str(goodsid,5))
      //+str(billon))
      skip
   enddo
   sdata=achoice(r1,c1,r2,c2,sshow)
   if sdata > 0
      _goodsid = val(substr(sshow[sdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callogoo()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_ord_d
   go top
   r1=10;c1=37;r2=15;c2=67
   oshow = {}
   set filter to orderid = _orderid
   do while !eof() .and. goodsid = goodsid
      aadd(oshow,str(goodsid,5))
      //+str(billon))
      skip
   enddo
   odata=achoice(r1,c1,r2,c2,oshow)
   if odata > 0
      _goodsid = val(substr(oshow[Odata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callrgoo()
save screen to scr1
parameter goodsid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_rec_d
   go top
   r1=10;c1=37;r2=15;c2=67
   rshow = {}
   Set filter to receivid = _receivid
   do while !eof() .and. goodsid = goodsid
       aadd(rshow,str(goodsid,5))
      skip
   enddo
   rdata=achoice(r1,c1,r2,c2,rshow)
   if rdata > 0
      _goodsid = val(substr(rshow[rdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callgpro()
save screen to scr1
parameter proid
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_goo
   go bottom
   r1=10;c1=37;r2=15;c2=67
   pshow = {}
   Set filter to goodsid = _goodsid
   do while !eof()
      aadd(pshow,str(proid,3)+" |"+str(goodsid))
      skip
   enddo
   pdata=achoice(r1,c1,r2,c2,pshow)
   if pdata > 0
      _proid = val(substr(pshow[pdata],1,3))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
function callgkin()
save screen to scr1
parameter kind_id
do box3 with 09,35,16,69,'w+/w,n/bg+','n/w'
   use t_goo
   go bott
   r1=10;c1=37;r2=15;c2=67
   kshow = {}
   Set filter to goodsid = _goodsid
   do while !eof()
      aadd(kshow,str(kind_id,4)+" |"+str(goodsid))
      skip
   enddo
   kdata=achoice(r1,c1,r2,c2,kshow)
   if kdata > 0
      _kind_id = val(substr(kshow[kdata],1,4))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//====================================================================
procedure listgood
save screen to scr1
use t_mem
      LOCATE FOR ID = _ID
             set color to n/n
             @ 14,11 clear to 18,68
             set color to n/bg
             @ 13,9 clear to 17,66
             @ 14,13 say "รายละเอียด"
             @ 14,24 say REPLICATE('---',13)
             IF FOUND()
                @ 15,13 say "รหัสสมาชิก ["+ltrim(str(id))+"] ชื่อ ["+ltrim(name)+"]"
                @ 16,13 say "อายุ ["+ltrim(age)+"] อาชีพ ["+ltrim(profess)+"] ส่วนลด ["+ltrim(str(discount))+"]"
             else
                @ 15,13 say "รหัสสมาชิกไม่ถูกต้อง"
             endif
             inkey(0.9)
             inkey(0.9)
restore screen from scr1
set color to b/w
return(nil)
//====================================================================
function callisal()
save screen to scr1
parameter billon
do box3 with 09,35,16,69,'w+/w,n/gb','n/w'
   use t_sal
   go top
   r1=10;c1=37;r2=15;c2=67
   isshow = {}
   Set filter to id = _id
   do while !eof()
      aadd(isshow,str(billon,5))
      skip
   enddo
   isdata=achoice(r1,c1,r2,c2,isshow)
   if isdata > 0
      _billon = val(substr(isshow[isdata],1,5))
   endif
restore screen from scr1
set color to b/w+
return(nil)
//===================================================================
หลักปรับปรุงรายงาน สรุประบบ
BACK