home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr2.zip / CSEVENT.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  6KB  |  208 lines

  1. * Program CSEVENT - Controls all Church Special Events Program Functions
  2. Set talk off
  3. Set bell off
  4. Clear
  5. Select primary
  6. Set deleted on
  7. Set intensity off
  8. Set exact off
  9. ? 'Now loading the CSEVENT program.'
  10. Select secondary
  11. Use EDIRFILE index EDIRFILE
  12. Store 'January  February March    April    May      June     ' to MONTHS
  13. Store MONTHS+'July     August   SeptemberOctober  November December ' to MONTHS
  14. If $(DATE(),7,2) = '00'
  15.   Set date to 01,01,00
  16. ENDIF
  17.   Store ' ' to curmonthx
  18.   Store ' ' to curyear
  19.   Store ' ' to curmonth
  20.   * Set today's date from current system-date
  21.   Store $(date(),1,2) to curmo
  22.   Store $(date(),7,2) to curmonthx
  23.   Store val(curmo) to nmonth
  24.   Store curmo+curmonthx to indate
  25.   Store VAL(curmonthx) to CURYEAR
  26.   If $(date(),4,1) = '0'
  27.     Store $(DATE(),5,1) to CURMONTHX
  28.   else
  29.     Store $(DATE(),4,2) to CURMONTHX
  30.   endif
  31.   Store trim($(months,NMONTH*9-8,9)) to curmonth
  32.   Store curmonth+' '+curmonthx to curmonthx
  33.   Store ', 19'+$(DATE(),7,2) to CURYEAR
  34.   Store curmonthx+curyear to curdate
  35. GOTO 2
  36. Store $(spact,21,1) to D
  37. SKIP
  38. Store trim($(SPACT,4,27)) to  ENAME
  39. SKIP
  40. Store $(SPACT,4,27) to eplace
  41. SKIP
  42. Store $(spact,4,27) to etime
  43. SKIP
  44. Store $(spact,9,8) to ecost
  45. release curmo,months,curyear,curmonthx
  46. Select primary
  47. Store T to LEVEL2
  48. Do while LEVEL2
  49.   Store d+':MEMBERSE' to MFILE
  50.   Save to FMEMVARS
  51.   Erase
  52.   @ 0,1 say  ename
  53.   @ 0,60 say curdate
  54.   @ 1,1  say 'DATA DISK = '+D
  55.   @ 2,21 say 'CHURCH SPECIAL EVENT MANAGER             5-/CSEVENT /'
  56.   @ 4,16 say  '1)  Event Attender Names                        /CSEUPDAT/'
  57.   @ 5,16 say  '2)  Financial'
  58.   @ 6,16 say  '3)  Lodging                                     /CSELODGE/'
  59.   @ 7,16 say  '4)  Sessions                                    /CSESSION/'
  60.   @ 8,16 say  '5)  Transportation                              /CSETRANS/'
  61.   @ 9,16 say  '6)  Equipment                                   '
  62.   @ 10,16 say '7)  Reports                                     /CSEREPTS/'
  63.   @ 11,16 say '8)  Set Up                                      /CSESETUP/'
  64. ?
  65. Accept '                Enter selection ' to MSEL
  66. ?
  67. If !(MSEL)='DISK='
  68.   Store !($(MSEL,6,1)) to D
  69.   ? 'Disk now being set to drive',D
  70.   Store d+':MEMBERSE' to MFILE
  71.   Store 'D' to MSEL
  72.   Save to FMEMVARS
  73. endif
  74. Select primary
  75. Store $(msel,1,1) to XX
  76. Do while @(XX,'12345678QqD')=0
  77.   Accept 'Invalid selection. Please enter again ' to MSEL
  78.   Store $(MSEL,1,1) to XX
  79. enddo
  80. If MSEL<>'8'.and.!(MSEL)<>'Q'
  81.  If file(MFILE)
  82.   Use &MFILE index &MFILE
  83.  else
  84. ? "File",MFILE," doesn't exist on the data disk.  Perform SET UP to create it."
  85. ?
  86.  endif
  87. endif
  88. Do CASE
  89.     CASE MSEL = '1'
  90.       Do CSEUPDAT.CMD
  91.     CASE MSEL = '2'
  92.      Select primary
  93.      GOTO TOP
  94.     ? '          Select -'
  95.     ? '              1)  All attenders '
  96.     ? '              2)  Attenders who still owe money'
  97.     ?
  98.     Accept '          Enter selection ' to fsel
  99.     ?
  100.     Do while @(!(fsel),'12Q')=0
  101.       Accept 'Invalid entry. Please enter again ' to fsel
  102.     enddo
  103.     If !(fsel)<>'Q'
  104.       ?
  105.       ? '        Career Church Fall Retreat  -  FINANCES     ',curdate
  106.       ?
  107.       Store '.not. LEVEL2' to bname
  108.       If fsel='2'
  109.         ? '             People who still owe money'
  110.         ?
  111.         Store 'AMOUNT - val($(PAID1,1,9))-val($(PAID2,1,9)) <= 0' to bname
  112.         Do while (.not. &bname) .and. .not EOF
  113.           SKIP
  114.         enddo
  115.       endif
  116.       Store 0.00 to OWEDT
  117.       Store 0.00 to PAIDT
  118. ? '  PAID1         PAID2          OWED          Name and Phone '
  119. ? '-------------  -------------  ------    -----------------------------------'
  120.       Do while .not. EOF
  121.         Store val($(paid1,3,7))+val($(paid2,3,7)) to paidd
  122.         Store amount-paidd to topay
  123.         ? $(paid1,3,13),$(paid2,3,13),str(topay,8,2),'  ',last:name
  124.         ?? $(first:name,1,13),$(home:phone,1,8)
  125.         Store OWEDT+AMOUNT to OWEDT
  126.         Store PAIDT+paidd to PAIDT
  127.         SKIP
  128.         Do while (&bname) .and. .not. EOF
  129.           SKIP
  130.         enddo
  131.       enddo
  132. ? '---------------------------------------------------------------------------'
  133. ?
  134.       If fsel='1'
  135.         ?? ' Total OWED:',str(OWEDT,8,2)
  136.         ?? '    Total PAID:',str(PAIDT,8,2)
  137.       endif
  138.       ?? '    Total still DUE:',str(OWEDT-PAIDT,8,2)
  139.       ?
  140.       Accept 'Report is complete.  Press <retn> ' to xx
  141.      endif
  142.     CASE MSEL='3'
  143.        Do CSELODGE.CMD
  144.     CASE MSEL='4'
  145.       Do CSESSION.CMD
  146.     CASE MSEL='5'
  147.       Do CSETRANS.CMD
  148.     CASE MSEL='6'
  149. Store d+':MEMEQUIP' to M1FILE
  150. Accept 'Does the MEMBERSE file need re-indexing, by Equipment name? ' to xx
  151. Select primary
  152. If !(xx)='Y'
  153.   Use &MFILE
  154.   ? 'Now indexing MEMBERSE by Equipment.'
  155.   Set talk on
  156.   Index on equipment to &M1FILE
  157.   Set talk off
  158. endif
  159. Use &MFILE index &M1FILE
  160. If !(xx)<>'Q'.and. xx<>' '
  161.   ? '  Now searching for the first name with some Equipment.'
  162.   Do while equipment='          '
  163.     SKIP
  164.   enddo
  165.   ?
  166.   Do while .not. EOF
  167.     Store 0 to I
  168.     Do while I<11 .and.  .not. EOF
  169.       Store I+1 to I
  170.       ? last:name,first:name,home:phone,address
  171.       ? '   ',equipment
  172.       SKIP
  173.     enddo
  174.     If .not. EOF
  175.       Accept 'Press <return> to continue ' to xx
  176.     endif
  177.   enddo
  178.   Accept  '  End-of-Equipment  Press <retn> ' to xx 
  179. endif
  180. Select primary
  181. Use &MFILE index &MFILE
  182.     CASE MSEL = '7'
  183.       Do CSEREPTS.CMD
  184.     CASE MSEL='8'
  185.       Do CSESETUP.CMD
  186.     CASE !(MSEL) = 'Q'
  187.       Store F to LEVEL2
  188.       Use
  189.       Clear
  190.       RETURN
  191.   ENDCASE
  192. endif
  193. Restore from FMEMVARS
  194. Select secondary
  195. Use edirfile index edirfile
  196. Select primary
  197. ENDDO
  198. RETURN
  199.  
  200.  
  201.             /CSEUPDAT/'
  202.   @ 5,16 say  '2)  Financial'
  203.   @ 6,16 say  '3)  Lodging                                     /CSELODGE/'
  204.   @ 7,16 say  '4)  Sessions                                    /CSESSION/'
  205.   @ 8,16 say  '5)  Transportation                              /CSETRANS/'
  206.   @ 9,16 say  '6)  Equipment                                   '
  207.   @ 10,16 say '7)  Reports                                     /CSEREPTS/'
  208.   @ 11,16 say '8)  Set Up