我正在为学校/我自己做一个项目。这是项目描述...
“我正在考虑开办吉他教学业务,并想创建一个网络应用程序,让我能够跟踪学生、他们的课程安排、音乐兴趣、付款历史、年龄、电子邮件地址和电话号码。我还希望能够创建我们在课程中学习的信息的记录,以及学生当前拥有或随着时间推移而发展的技能列表。当学生每月付款时,我希望能够单击处理付款并将发票副本通过电子邮件发送给学生和我自己。为了维护学生记录,我将使用编辑按钮在每节课后更新信息。
我们必须使用 EXTjs 作为我们的表示层,PHP 作为逻辑层,mySQL 作为我们的数据库。
我对能够填充我的网格和页面布局感到非常有信心。然而,我担心能够确保我可以生成一个学生应该有下一节课的日期(例如,今天是 4 月 8 日,这个学生的下一节课是 4 月 15 日,然后是 22 日等)
我还没有开始我的 PHP 代码,我想知道是否有人能指出我正确的方向,因为我真的不知道根据学生开始的日期我将如何做我想做的事情。
我的数据库代码如下。
use mydatabase;
drop table teacher;
drop table student;
drop table payment;
drop table skills;
drop table TeacherTrainingLog;
drop table StudentTrainingLog;
CREATE TABLE teacher
(TeacherID int,
TeacherLast varchar(30),
TeacherFirst varchar(30),
TeacherEmail varchar(254),
TeacherDOB date,
TeacherAddress varchar(50),
TeacherCity varchar(30),
TeacherState char(2),
TeacherZip varchar(10),
TeacherPhone varchar(12),
TeacherUserId varchar(50),
TeacherPassword varchar(15));
alter table teacher add constraint TeacherPK primary key (TeacherID);
CREATE TABLE student
(StudentID int,
StudentLast varchar(30),
StudentFirst varchar(30),
StudentEmail varchar(254),
DateStarted date,
StudentDOB date,
MusicInterest text,
StudentAddress varchar(50),
StudentCity varchar(30),
StudentState char(2),
StudentZip varchar(10),
StudentPhone varchar(12),
StudentUserId varchar(50),
StudentPassword varchar(15),
TeacherID int);
alter table student add constraint StudentPK primary key (StudentID);
alter table student add constraint TeacherFK foreign key (TeacherID) references teacher(TeacherID);
CREATE TABLE payment
(PaymentID int,
PaymentDueDate date,
PaymentAmount int,
TeacherID int,
StudentID int);
alter table payment add constraint PaymentPK primary key (PaymentID);
alter table payment add constraint TeacherFK foreign key (TeacherID) references teacher(TeacherID);
alter table payment add constraint StudentFK foreign key (StudentID) references student(StudentID);
CREATE TABLE skills
(SkillID int,
SkillName varchar(30));
alter table skills add constraint SkillPK primary key (SkillID);
CREATE TABLE TeacherTrainingLog
(TeacherID int,
SkillID int,
TeacherDateStarted date,
Teacherlevel int,
TeacherTrainingNotes text);
alter table TeacherTrainingLog add constraint TeachIDfk foreign key (TeacherID) references teacher (TeacherID);
alter table TeacherTrainingLog add constraint SkillIDfk foreign key (SkillID) references skills (SkillID);
alter table TeacherTrainingLog add constraint TeacherTraingingLogPK primary key (TeacherID, SkillID);
CREATE TABLE StudentTrainingLog
(StudentID int,
SkillID int,
StudentDateStarted date,
Studentlevel int,
StudentTrainingNotes text);
alter table StudentTrainingLog add constraint StudentIDfk foreign key (StudentID) references student (StudentID);
alter table StudentTrainingLog add constraint SkillIDfk foreign key (SkillID) references skills (SkillID);
alter table StudentTrainingLog add constraint StudentTraingingLogPK primary key (StudentID, SkillID);
insert into teacher values (1, 'Bob', 'Joe','teacher.troxy@gmail.com','1988/5/4', '1120 Sweet St.', 'Boulder', 'CO', '55555', '555-555-5555','capn', 'crunch');
insert into student values (1, 'Joey', 'Bobby','student.troxy@gmail.com','2013/4/8', '1988/9/12', 'Led Zepplin, Taylor Swift', '2120 Garbage Can Ln', 'Boulder', 'CO', '55555', '333-333-333','student1',
'first', 1);
insert into skills values (1, 'Chord');
insert into skills values (2, 'Strumming');
insert into skills values (3, 'Alternate Picking');
insert into skills values (4, 'Bend');
insert into skills values (5, 'Bend/Release');
insert into skills values (6, 'Hammer-on');
insert into skills values (7, 'Pull-off');
insert into skills values (8, 'Slide');
insert into skills values (9, 'Vibrato');
insert into skills values (10, 'Tapping');
insert into skills values (11, 'Natural Harmonic');
insert into skills values (12, 'Pinch Harmonic');
insert into skills values (13, 'Sweep Picking');
insert into skills values (14, 'Finger Picking');
谢谢你能给我的任何帮助。我希望这不是含糊的。我试图解释它以及我知道如何。