Form tính học bổng sinhviên

Một phần của tài liệu Phân tích ,thiết kế và xây dựng hệ thống quản lý sinh viên (Trang 43 - 59)

III. Một số giao diện chính của chương trình

5.Form tính học bổng sinhviên

Chưng IV : C i à đặt v hà ướng phát triển

ã Yêu cầu về hệ điều hành:

Hệ điều hành Windows 95 hoặc phiên bản mới hơn. ã Yêu cầu về máy

- Máy 486 với tốc độ của bộ xử lý 66Mhz hoặc lớn hơn.

- Chuột

- Bộ nhớ 16 MB RAM.

- Đĩa cứng có dung lượng còn lại 85 Mb(nếu cài đặt Typical), 90 MB nếu cài đầy đủ.

- Màn hình VGA hoặc cao hơn, có độ phân giải tốt. ã Tiến hành cài đặt

Cài đặt Visual Foxpro bằng đĩa CD, hay đĩa mềm. Trước khi cài đặt Visual Foxpro, phải tắt chế độ bảo vệ chống Virus. Các bước cài đặt như sau:

- Đưa đĩa CD vào ổ CD. - Chọn lệnh Run.

- Gõ lệnh X:\SETUP, trong đó X chỉ tên ổ đĩa Cd, sau đó nhấn phím Enter hoặc chọn Ok.

- Chọn những cách cài đặt sau:

- Cài tối thiểu (15MB): chỉ cài một số File thiết yếu của Visual Foxpro. - Cài đầy đủ : yêu cầu 192 MB đĩa trống.

2. Đánh giá kết qu thực hiện và phưng hướng phát triển.

Sau một thời gian thực hiện, chương trình được hoàn thành và đã đạt được những kết qủa nhất định. Có thể cập nhật hồ sơ sinh viên, nhập điểm cho sinh viên sau mỗi kì thi, in bảng điểm cho mỗi sinh viên sau khi tốt nghiệp và có thể tìm kiếm thông tin về sinh viên....Tuy nhiên do thời gian hạn chế nên chưng trình không thể tránh được những sai sót trong quá trình thực hiện.

Phương hướng trong tương lai tiếp tục phát triển để chương trình ngày càng phát triển hơn để có thể trở thành một phần mềm hoàn chỉnh

3. Cảm ơn

Trong quá trình thực hiện với sự giúp đỡ rất tận tình của thầy Thư. Chương trình được hoàn thành một cách tốt đẹp, nhờ trong quá trình thực hiện thầy rất tận tình chỉ bảo, kể cả những lúc bận rộn nhất thầy cũng luôn sẵn sàng bớt chút thời gian giải đáp thắc mắc. Vì vậy giúp cho em thấy được những lỗi mà mình không phát hiện ra và nhờ đó mà em rút ra được nhiều kinh nghiệm quý báu. Em rất cảm ơn sự hướng dẫn tận tình của thầy.

Một số Code của chưng trình: 1. Chưng trình chính: clear all

clear set talk off set date french SET STATUS OFF

SET COLOR TO b+/GB+ set cent on

set noti off set safe off

set exclusive off && De nhieu nguoi cung mo duoc du lieu(Chay tren mang)

set dele on

Public _Curpath, _Datapath, _Temppath,_AppTitle, _CurUser, _CurPass _Curpath = SYS(5)+CURD()

_Temppath = "C:\TEMP\"

_AppTitle = "Qun lý sinh viên Version 1.0" _Datapath = SYS(5)+CURD()+"DATA\" _CurUser = []

_CurPass = [] _CodeLogin= []

*DO GetDataPath && Bien doi gia tri dung cua _Datapath *If !File(_Datapath+ "QLSV.DBC")

* =MessageBox("Chưa có file c sở dữ liệu...",0,_AppTitle) * Return .f.

*Endif (adsbygoogle = window.adsbygoogle || []).push({});

Do form Manhinh\Login

Open database (_Datapath+ "QLSV") do HideWindow

_screen.picture="bitmap\qlsv.bmp" _screen.picture="bitmap\Bandoc.jpg" _Screen.Icon = "bitmap\Qlsv.ico"

_screen.Caption = "Chưng trình qun lý sinh viên -Lê Thanh tuấn- Tin 41B" _screen.Closable = .f. _screen.Maxbutton=.f. _screen.MinButton=.t. _Screen.Height=600 _screen.Width=800 do qlsvmenu.mpr

keyboard "{ALT+D}" read event clear all clear *---* Procedure Getdatapath If !File("Bitmap\QLSV.INI") DO Form Manhinh\DataPath Endif mHandle = FOPEN("Bitmap\QLSV.INI") S=FGets(mHandle) _Datapath = Allt(Substr(s,AT("=",S)+1)) =Fclose(mHandle) Return *--- Procedure HideWindow =HideWind("Color Palette") =HideWind("Database Designer") =HideWind("Form Controls") =HideWind("Form Designer") =HideWind("Layout") =HideWind("Print Preview") =HideWind("Query Designer") =HideWind("Report Constrols") =HideWind("Report Designer") =HideWind("Standard") =HideWind("View Designer") Return *---* Procedure HideWind para p_WinddowName If wexist(p_WinddowName)

Hide window (p_WinddowName) Endif Return *---* Procedure ShowWind para p_WinddowName If wexist(p_WinddowName)

Endif Return

*---* Function MoDBF

para p_file, p_alias, p_Co_mo_Exclusive Private p_para p_para = PARA() If used(p_alias) If p_para=3 =DongDBF(p_alias) select 0

use (p_file) alias (p_alias) Exclusive Else Select (p_alias) Endif Else select 0 If p_para=3

use (p_file) alias (p_alias) Exclusive Else

use (p_file) alias (p_alias) Endif Endif return *---* Function DongDBF para p_alias If used(p_alias) use in (p_alias) Endif return *---* Function GetLopSv

Para p_maso, p_namhoc

Private p_malop, p_FileLopsv, p_da_mo, p_Tag, p_curr, p_nam1, p_nam2 p_malop= ""

p_nam1 = Val(Left(p_namhoc,4)) p_nam2 = Val(Right(p_namhoc,4))

p_curr = SELE()

p_FileLopsv = _Datapath+"LOPSV" If Used('LOPSV')

Select LOPSV p_Tag = Tag()

Set order to i_LopSV p_da_mo = .T.

ELse

=MoDbf(p_FileLopsv,[LOPSV]) Set order to i_LopSV

p_da_mo = .F. Endif

*--- set near on seek p_maso set near off If Found()

scan while maso=p_maso

if year(tungay)<=p_nam1 if empty(denngay) p_malop = malop exit else if year(denngay)>=p_nam2 p_malop = malop exit endif endif endif ends Endif

IF p_da_mo And !Empty(p_Tag) Set order to (p_Tag)

Endif If !p_da_mo =Dongdbf('LOPSV') Endif Select (p_curr) Return p_malop

* CHUONG TRINH CHUAN HOA DU LIEU TRONG FOXPRO set talk off

set safe off clea

defi wind w from 0,0 to 21,106 font '.VnTime' defi wind w1 from 0,0 to 18,106 font '.VnTime' acti wind w (adsbygoogle = window.adsbygoogle || []).push({});

***

dgd=spac(30)

@1,5 say 'Tên đường dẫn tới tệp dữ liệu cần sắp xếp ' font '.VnTime',12 styl 'BI' get dgd font 'system'

read

dng=allt(dgd) set defa to &dng clea

@3,5 say ' Những tệp dữ liệu có ở trong thư mục hiện thời ' font '.vntime',12 colo w+/bg+

dir hh='C'

@1,5 say ' Tệp dữ liệu cần chuẩn hoá có ở đây kh"ng ? (C/K) ' font '.vntime',12 styl 'BI' colo w+/br+ get hh pict '!@'

read if hh<>'C'

deac wind all set defa to &dng retu

endi *** clea

@1,10 say ' Các tệp c sở dữ liệu có ở thư mục hiện thời ' font '.VnTime',12 style 'BI' colo w+/bg+

dir

wait ' Những tệp CH*.DBF là những tệp đã chuẩn hoá. Nhấn phím Enter để tiếp tục ... '

htc=space(8)

@20,10 say ' Muốn chuẩn hoá dữ liệu của tệp : ' font '.VnTime',12 style 'IB' get htc colo w+/br+

read

use &ttc ttt='ch'+ttc copy to &ttt

@20,5 say 'Xem dữ liệu trước khi chuẩn hoá ... Nhấn phím Esc để tiếp tục ... '+space(41) ;

font '.VnTime',11 style 'BI' colo w+/br+ acti wind w1 use &ttt brow deac wind w1 ***** do whil !eof()

repl hoten with strt(allt(hoten),' ',' ') repl hoten with strt(allt(hoten),' ',' ') repl hoten with strt(allt(hoten),' ',' ') repl hoten with strt(allt(hoten),' ',' ') repl hoten with strt(allt(hoten),' ',' ') repl hoten with strt(allt(hoten),' ',' ') skip endd *-- go top dt=fsize('hoten') dime c(dt) for j=1 to dt c(j)=' ' endf do whil !eof() dd=len(allt(hoten)) i=1 ct=' ' ****** do whil i<=dd ht=allt(hoten) if asc(ht)>=97.and.asc(ht)<=122 c(1)=chr(asc(subs(ht,1,1))-32) endi if ((asc(subs(hoten,i,1))>=65.and.asc(subs(hoten,i,1))<=90).or. (asc(subs(hoten,i,1))>=161; .and.asc(subs(hoten,i,1))<=167)).and.asc(subs(hoten,i-1,1))<>32

c(i)=' '+chr(asc(subs(hoten,i,1))) else c(i)=subs(hoten,i,1) endi i=i+1 endd i=1 do whil i<=dd ct=ct+c(i) i=i+1 endd

repl hoten with allt(ct) skip endd go top do whil !eof() dd=len(allt(hoten)) ht=allt(hoten) if asc(ht)>=97.and.asc(ht)<=122 c(1)=chr(asc(subs(ht,1,1))-32) else if asc(ht)=174 c(1)=chr(167) else c(1)=subs(ht,1,1) endi endi bt=' ' i=2 do whil i<=dd do case case asc(subs(ht,i,1))=32.and.asc(subs(ht,i+1,1))>=97.and.asc(subs(ht,i+1,1))<=1 22 c(i)=' ' c(i+1)=chr(asc(subs(ht,i+1,1))-32) i=i+1 case asc(subs(ht,i,1))=32.and.asc(subs(ht,i+1,1))>=167.and.asc(subs(ht,i+1,1))<= 174

c(i)=' ' c(i+1)=chr(asc(subs(ht,i+1,1))-7) i=i+1 othe c(i)=subs(ht,i,1) endc i=i+1 endd i=1 do whil i<=dd bt=bt+c(i) i=i+1 endd

repl hoten with allt(bt) skip

endd ***

@20,5 say 'Xem dữ liệu sau khi chuẩn hoá ... Nhấn phím Esc để tiếp tục ...' + space(41);

font '.VnTime',11 style 'BI' colo w+/br+ go top

acti wind w1 brow

deac wind w1 deac wind w set defa to &dng *retu (adsbygoogle = window.adsbygoogle || []).push({});

quit

** CHUONG TRINH SAP XEP TRUONG HOTEN TRONG FOXPRO set talk off

set safe off clea

defi wind w from 0,0 to 21,106 font '.VnTime',10

defi wind w1 from 0,0 to 18,106 font '.VnTime',10 colo w+/bg acti wind w

dgd=spac(30)

@1,5 say 'Tên đường dẫn tới tệp dữ liệu cần sắp xếp ' font '.VnTime',11 styl 'BI' get dgd font 'system'

read

set defa to &dng clea

@1,5 say ' Những tệp dữ liệu có ở trong thư mục hiện thời ' font '.vntime',11 colo w+/bg+

dir hh='C'

@18,5 say ' Tệp dữ liệu cần sắp xếp có ở đây kh"ng ? (C/K) ' font '.vntime',11 styl 'BI' colo w+/br+ get hh pict '!@'

read if hh<>'C'

deac wind all set defa to &dng retu

endi

tp=spac(20)

@18,5 say ' Tên tệp dữ liệu cần sắp xếp ' font '.VnTime',11 styl 'BI' get tp font 'system'

read tt=allt(tp) clea

@20,5 say ' Xin mời xem dữ liệu trước khi sắp xếp. Nhấn Esc để tiếp tục ... ' ;

font '.VnTime',11 styl 'BI' colo w+/rg+ acti wind w1

use &tt

copy to t1 fiel exce htnguoc,mhtnguoc use t1

brow

deacti wind w1 use &tt

clea

@18,10 say ' Nếu chưa có trường htnguoc,mhtnguoc thì thêm trường đó với htnguoc (C30), ;

mhtnguoc (C60) ' colo w+/br+

@19,10 say ' b"ng cách nhấn phím mũi tên xuống rồi thêm vào. Nếu có rồi thì nhấn Enter ;

để tiếp tục . . . '+spac(6) colo w+/br+

modi stru &&Thêm các trường htnguoc (C30) clea (adsbygoogle = window.adsbygoogle || []).push({});

go top dime m(10) do whil !eof()

* Chú ý: Trong các câu lệnh dưới đây, giữa hai dấu nháy đn là một ký tự trống for i=1 to 10 m(i)=' ' endf c=allt(hoten) sktt=occu(' ',c) xx=at(' ',c) yy=rat(' ',c) zz=at(' ',c,2) do case case sktt=1 m(1)=subs(c,1,xx) m(2)=subs(c,yy) case sktt=2 m(1)=subs(c,1,xx) m(2)=subs(c,xx,zz-xx) m(3)=subs(c,yy) othe m(1)=subs(c,1,xx) m(2)=subs(c,xx,zz-xx) m(sktt+1)=subs(c,yy) for i=3 to sktt

m(i)=subs(c,at(' ',c,i-1),at(' ',c,i)-at(' ',c,i-1)) endf

endc tht=' '

for i=sktt+1 to 1 step -1 tht=tht+' '+allt(m(i)) endf

repl htnguoc with allt(tht) skip

endd

** Chưng trình đo ngược kết thúc ở đây ch1='AaàãáạĂă"ẳẵắặÂâầẩẫấậBbCcDdĐđ' ch2='EeèẻẽéẹÊêềểễếệGgHhIiìỉĩíịKkLlMmNn' ch3='OoòỏõóọÔ"ồổỗốộƠờởỡớợPpQqRrSs'

ch4='TtUuùủũúụƯưừửữứựVvXxYyỳỷỹýỵ' Vs=allt(ch1)+allt(ch2)+allt(ch3)+allt(ch4) ASt=' ' for i=1 to 118 ASt=ASt+chr(i) endf AS=Allt(ASt)

Repl all mhtnguoc with chrt(htnguoc,VS,AS) kq='Sx'+tt

sort to &kq on mhtnguoc fiel exce htnguoc,mhtnguoc

@10,2 say 'Chú ý: Trong thư mục hiện thời những tệp bắt đầu b"ng Sx là những tệp đã sắp xếp';

font '.VnTime',11 styl 'BI'

@11,8 say 'ví dụ, tệp SxDsach.dbf là tệp sắp xếp của tệp Dsach.dbf' font '.VnTime',11 styl 'BI'

@13,10 say ' Nhấn Enter để tiếp tục...' styl 'BI' colo w+/br+ wait ' '

clea

@20,5 say ' Xin mời xem dữ liệu sau khi sắp xếp. Nhấn Esc để tiếp tục ... ' ; font '.VnTime',11 styl 'BI' colo w+/rb+

acti wind w1 use &kq brow

deac wind all set defa to &dng close all

*quit retu

Code của nút ghi:

Private m_makhoa, m_tenkhoa

m_makhoa = Thisform.txtMakhoa.Value m_tenkhoa = Thisform.txtTenkhoa.Value If Empty(m_Makhoa)

=messagebox("Mã khoa kh"ng được để trắng...",0,_AppTitle) Thisform.txtMakhoa.SetFocus && _CurObj=ObjNum(Bien) Return .f.

Endif

If Empty(m_Tenkhoa)

Thisform.txtTenkhoa.SetFocus && _CurObj=ObjNum(Bien) Return .f. Endif SELECT dskhoa Seek m_makhoa If Found()

=messagebox("Đã có mã khoa nay...",0,_AppTitle)

Thisform.txtMakhoa.SetFocus && _CurObj=ObjNum(Bien) Return .f.

Endif (adsbygoogle = window.adsbygoogle || []).push({});

Insert into Dskhoa(makhoa, tenkhoa) values(m_makhoa, m_tenkhoa) release thisform

Code của mật khẩu

Private p_makhoa, p_manv, p_password, p_Tenkhoa p_makhoa = DSKHOA.makhoa p_Tenkhoa = thisform.CboTenkhoa.value p_manv = thisform.txtmanv.value p_password=thisform.txtpassword.value sele user seek p_makhoa+p_manv if !found()

=messagebox("Kh"ng có nhân viên "+p_manv+" trong khoa "+p_tenkhoa+"...",64,_Apptitle) thisform.txtmanv.setfocus return .f. else if upper(allt(password))<>upper(allt(p_password)) =messagebox("Sai mật khẩu...",64,_Apptitle) thisform.txtpassword.setfocus return .f. else _CurUser = p_manv *Role = ROLE _CurPass = p_password _CodeLogin = p_makhoa *NameLogin = Allt(thisform.txttendv.value) * Close Data * =DongDBF("USER") * =DongDBF("DSKHOA") Release thisform

Endif

Code nút tìm kiếm set safe off

Masv=alltrim(upper(Thisform.text1.value)) Tensv=alltrim(upper(Thisform.text2.value)) Lop=alltrim(upper(Thisform.text3.value)) dk="" if len(masv)>0 dk=dk+"Alltrim(upper(masinhvien))='"+masv+"'" endif if len(tensv)>0 dk=dk+" and alltrim(upper(tensinhvien))='"+tensv+"'" endif if Len(lop)>0 dk=dk+" and alltrim(upper(lop))='"+lop+"'" endif if len(masv)=0 dk=substr(dk,5,len(dk)-4) endif

defi wind hien at 1,1 size 35,150 color rgb(,,125,125,125) font ".vntime" 14

sele sinhvien

Join with sinhvien for sinhvien.masv=lop.masv to Dssv sele 0

use dssv loca for &dk if found() acti wind Hien

brow Field Hovaten,diachi,masv,lop,ngaysinh for &dk wind hien noedit rele wind Hien

else

Wait wind "Khong thay" endif

use

Mục lục:

CHƯƠNG I: Phương pháp luận phân tích thiết kế hệ thống thông tin quản lý sinh viên

I.Khái quát về hệ thống qun lý sinh viên

II.Các giai đoạn phân tích thiết kế hệ thống thông tin Chưng iI : Giới thiệu về VisualFoxPro

CHƯƠNG III : Phân tích ,thiết kế và xây dựng hệ thống quản lý sinh viên I.Phân tích hệ thống quản lý sinh viên

II.Thiết kế hệ thống quản lý sinh viên

III.Thiết kế giao diện và xây dựng chưng trình Chương IV : Cài đặt đánh giá và hướng phát triển 1. Cài đặt

2. Đánh giá kết quả thực hiện 3. Phương hướng phát triển 4. Lời cảm ơn.

Tài liệu tham khảo

1. Giáo trình hệ thống thông tin quản lý.

TS Trương Văn Tú - TS Trần Thị Song Minh. 2. Sử dụng & khai thác Microsoft VISUAL FOXPRO.

Nguyễn Ngọc Minh. 3. Những bài thực hành VISUAL FOXPRO.

4. Bài giảng của thầy.

(adsbygoogle = window.adsbygoogle || []).push({});

Một phần của tài liệu Phân tích ,thiết kế và xây dựng hệ thống quản lý sinh viên (Trang 43 - 59)