proc pri_ipl  (kaf)
#include "box.ch"
#define NULL 0
set cursor off
clear
@ 5,5 say "९⥫ "
@ 5,22 get prepod
read
sele 10
use &kaf+"npr"
go top
locate for Prep=prepod
*஢  eof
if eof()
   clear
   @ 5,5 say "訡 !!!"
endif
adr_p=recno()
sele 11
use &kaf+"np1"
locate for A_pr=adr_p
* 蠯 ⠡
@ 1,1 say "㠫  ९⥫"
@ 1,40 say prepod
@ 2,1 say "Ŀ"
@ 3,1 say " ।          㯯 .  1 ᥬ    2 ᥬ   ⮣       "
@ 4,1 say "                                 㳔ⳏ 㳔ⳏ 㳔"
@ 5,1 say "Ĵ"
i=6
flag=.t.
sum_s_1=0
sum_s_2=0
sum_all=0
do while flag
   n_sem=mod(Sem,2)
   if n_sem = 0
      n_sem = 2
   endif
   local zan[9]
   if Lek>0
      zan[1]=.t.
      tnum=1
   endif
   if Pz>0
      zan[2]=.t.
      tnum=2
   endif
   if Lba>0
      zan[3]=.t.
      tnum=3
   endif
   if Irs>0
      zan[4]=.t.
      tnum=4
   endif
   if Kur>0
      zan[5]=.t.
      tnum=5
   endif
   if Kon>0
      zan[6]=.t.
      tnum=6
   endif
   if Konsu>0
      zan[7]=.t.
      tnum=7
   endif
   if Zac>0
      zan[8]=.t.
      tnum=8
   endif
   if Exz>0
      zan[9]=.t.
      tnum=9
   endif
   @ i,1 say ""
   @ i,3 say pred
   @ i,20 say ""
   @ i,21 say gr
   @ i,27 say ""
   for count = 1 to tnum
       if zan[count]
          do case
             case count=1
                @ i,28 say "樨"
             case count=2
                @ i,28 say ".."
             case count=3
                @ i,28 say "."
             case count=4
                @ i,28 say ""
             case count=5
                @ i,28 say "ᮢ."
             case count=6
                @ i,28 say "."
             case count=7
                @ i,28 say "."
             case count=8
                @ i,28 say ""
             case count=9
                @ i,28 say ""
          endcase
          if n_sem=1
             @ i,36 say ""
             col=37
          else
             @ i,36 say "            "
             col=51
          endif
          do case
             case count=1
                @ i,col say Lek
             case count=2
                @ i,col say Pz
             case count=3
                @ i,col say Lba
             case count=4
                @ i,col say Irs
             case count=5
                @ i,col say Kur
             case count=6
                @ i,col say Kon
             case count=7
                @ i,col say Konsu
             case count=8
                @ i,col say Zac
             case count=9
                @ i,col say Exz
          endcase
          if n_sem=1
             @ i,45 say "                "
          else
             @ i,59 say "    "
          endif
          if count = tnum
             @ i,65 say sump
             @ i++,73 say "    "
             @ i++,1 say "Ĵ"
          else
             @ i++,64 say "            "
          endif
       endif
   next
   if n_sem=1
      sum_s_1+=Sump
      sum_all+=Sump
   else
      sum_s_2+=Sump
      sum_all+=Sump
   endif
   if A_next = NULL
      @ i,1 say "                                                        "
      @ i,65 say sum_all
      @ i++,73 say"    "
      @ i,1 say ""
      flag = .f.
   else
      go A_next
   endif
enddo
@ i+1,5 say "뢮   [y\n] "
@ i+1,40 get otw
read
if otw = "Y" .or. "y"
   tab_print(prepod)
endif
return
