upBox ;: TLabel ;: TLabel ;: TDateTimePicker ;: TDateTimePicker ;: TButton ;: TGroupBox ;: TLabel ;: TLabel ;: TDateTimePicker ;: TDateTimePicker ;: TButton ;: TfrxReport ;: TfrxReport ;: TfrxDBDataset; Yfpfl1Click (Sender: TObject); FormClose (Sender: TObject; var Action: TCloseAction); DBLookupComboBox1CloseUp (Sender: TObject); DBLookupComboBox2CloseUp (Sender: TObject); FormShow (Sender: TObject); Button1Click (Sender: TObject) ; Button2Click (Sender: TObject); Button3Click (Sender: TObject); Button4Click (Sender: TObject);
{Private declarations}
{Public declarations} ;: TForm10; Main, Data;
{$ R * .dfm} TForm10.Yfpfl1Click (Sender: TObject) ;. Close; .Show ;; TForm10.FormClose (Sender: TObject; var Action: TCloseAction) ;. Show ;; TForm10.DBLookupComboBox1CloseUp (Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya, Student.Imya, Predmet.Nazvanie, AVG (Ocenka.Ocenka) AS itog ) ;. SQL. Add ( FROM Student LEFT JOIN (Predmet FULL JOIN Ocenka ON Ocenka.id_predmeta=Predmet.id_predmeta) ) ;. SQL.Add ( ON Student.id_student=Ocenka.id_student ) ;. SQL.Add ( laquo ; WHERE Student.Id_gruppi= + IntToStr (DBLookupComboBox1.KeyValue) + AND Predmet.Nazvanie= + # 39 + DBLookupComboBox2.Text + # 39) ;. SQL.Add ( Group by Student.Famailiya,Student.Imya,Predmet.Nazvanieraquo;);.Open;;TForm10.DBLookupComboBox2CloseUp(Sender: TObject) ;. Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya, Student.Imya, Predmet.Nazvanie, AVG (Ocenka.Ocenka) AS itog ) ;. SQL.Add ( FROM Student LEFT JOIN (Predmet FULL JOIN Ocenka ON Ocenka.id_predmeta=Predmet.id_predmeta) ) ;. SQL.Add ( ON Student.id_student=Ocenka.id_student ) ;. SQL.Add ( WHERE Student.Id_gruppi = + IntToStr (DBLookupComboBox1.KeyValue) + AND Predmet.Nazvanie= + # 39 + DBLookupComboBox2.Text + # 39) ;. SQL.Add ( Group by Student.Famailiya, Student.Imya, Predmet. Nazvanie ) ;. Open ;; TForm10.FormShow (Sender: TObject) ;. KeyValue:=1; .KeyValue:=1; .Close; .SQL.Clear; .SQL.Add ( Select Student.Famailiya, Student.Imya, Predmet.Nazvanie, AVG (Ocenka.Ocenka) AS itog ) ;. SQL.Add ( FROM Student LEFT JOIN (Predmet FULL JOIN Ocenka ON Ocenka.id_predmeta=Predmet.id_predmeta) ) ;. SQL. Add ( ON Student.id_student=Ocenka.id_student ) ;. SQL.Add ( WHERE Student.Id_gruppi= + IntToStr (DBLookupComboBox1.KeyValue) + AND Predmet.Nazvanie= + # 39 + DBLookupComboBox2.Text + # 39) ;. SQL.Add ( Group by Student.Famailiya, Student.Imya, Predmet.Nazvanie ) ;. Open ;; TForm10.Button1Click (Sender:TObject);.Variables[laquo;predraquo;]:=QuotedStr(DBLookupComboBox1.Text);.PrepareReport;.ShowPreparedReport;;TForm10.Button2Click(Sender: TObject) ;, ch, tr, dva, vsego: integer;, xo, ud, pl: real; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL.Add ( WHERE ((id_predmeta= + IntToStr (DBLookupComboBox2.KeyValue) + ) AND (Data BETWEEN: ff AND: ll)) );.SQL.Add ( GROUP BY id_student ) ;. SQL.Add ( HAVING AVG (Ocenka)=2 ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker1.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker2.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL. Add ( WHERE ((id_predmeta= + IntToStr (DBLookupComboBox2.KeyValue) + ) AND (Data BETWEEN: ff AND: ll)) ) ;. SQL.Add ( GROUP BY id_student );.SQL.Add ( HAVING AVG (Ocenka)=3 OR AVG (Ocenka)=4 OR AVG (Ocenka)=5 ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker1.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker2.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL. Add ( WHERE ((id_predmeta= + IntToStr (DBLookupComboBox2.KeyValue) + ) AND (Data BETWEEN: ff AND: ll)) ) ;. SQL.Add ( GROUP BY id_student );.SQL.Add ( HAVING (AVG (Ocenka)=4 OR AVG (Ocenka) =5)raquo;);.Parameters.ParamByName(laquo;ffraquo;).Value:=DateToStr(DateTimePicker1.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker2.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL. Add ( WHERE ((id_predmeta= + IntToStr (DBLookupComboBox2.KeyValue) + ) AND (Data BETWEEN: ff AND: ll)) ) ;. SQL.Add ( GROUP BY id_student );.SQL.Add ( HAVING AVG (Ocenka)=5 ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker1.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker2.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL. Add ( WHERE ((id_predmeta= + IntToStr (DBLookupComboBox2.KeyValue) + ) AND (Data BETWE...