ABLE_PREF. study );
/* СЕКЦІЇ */( CLUB raquo ;, TABLE_PREF. ); ( CLUB_ID raquo ;, TABLE_PREF. ); ( CLUB_YEAR raquo ;, TABLE_PREF. laquo ; ); ( CLUB_ID_PUPIL raquo ;, TABLE_PREF. ); ( CLUB_ID_SECTION raquo ;, TABLE_PREF. ); ( SECTION raquo ;, TABLE_PREF. ); ( SECTION_ID raquo ;, TABLE_PREF. ); ( SECTION_NAME raquo ;, TABLE_PREF. );
Додаток Б
(Модель)
Папка: models
Файли: _model.php_model.php_model.php_model.php
Файл: admin_model.php
lt;? phpadmin_model extends model
{__ construct ()
{:: __ construct ();
} _ select_subjects ()
{
$ subjects=$ this- gt; db- gt; select ( SELECT * FROM raquo ;. SUBJECTS); (count ($ subjects) === 0)? array (): $ subjects;
} _ select_teachers ()
{
$ subjects=$ this- gt; db- gt; select ( SELECT * FROM raquo ;. TEACHERS); (count ($ subjects) === 0)? array (): $ subjects;
} _ select_pupils ()
{
$ subjects=$ this- gt; db- gt; select ( SELECT * FROM raquo ;. PUPILS); (count ($ subjects) === 0)? array (): $ subjects;
}
}
Файл: form_model.php
lt;? phpform_model extends model
{__ construct ()
{:: __ construct ();
} _ update_subject ($ id, $ name)
{
$ this- gt; db- gt; update (SUBJECTS, array (_NAME= gt; $ name), SUBJECT_ID. = raquo ;. $ id);
} _ add_subject ($ name)
{$ this- gt; db- gt; insert (SUBJECTS, array (_NAME= gt; $ name));
} _ update_teacher ($ id, $ name, $ surname, $ lastname, $ experience, $ category, $ subject)
{
$ this- gt; db- gt; update (TEACHERS, array (_NAME= gt; $ name, _SURNAME= gt; $ surname, _LASTNAME= gt; $ lastname, _EXPERIENCE= gt; $ experience , _CATEGORY= gt; $ category, _SUBJECT= gt; $ subject
), TEACHER_ID. = raquo ;. $ id);
} _ add_teacher ($ name, $ surname, $ lastname, $ experience, $ category, $ subject)
{$ this- gt; db- gt; insert (TEACHERS, array (_NAME= gt; $ name, _SURNAME= gt; $ surname, _LASTNAME= gt; $ lastname, _EXPERIENCE= gt; $ experience, _CATEGORY= gt; $ category, _SUBJECT= gt; $ subject
));
} _ delete_teacher ($ id)
{$ this- gt; db- gt; delete (TEACHERS, TEACHER_ID. = raquo ;. $ id);
} _ update_pupil ($ id, $ name, $ surname, $ lastname, $ birthday, $ adress, $ mather, $ father)
{
$ this- gt; db- gt; update (PUPILS, array (_NAME= gt; $ name, _SURNAME= gt; $ surname, _LASTNAME= gt; $ lastname, _BIRTHDAY= gt; $ birthday , _ADRESS= gt; $ adress, _PARENT_MATHER= gt; $ mather, _PARENT_FATHER= gt; $ father
), PUPIL_ID. = raquo ;. $ id);
} _ add_pupil ($ name, $ surname, $ lastname, $ birthday, $ adress, $ mather, $ father)
{$ this- gt; db- gt; insert (PUPILS, array (_NAME= gt; $ name, _SURNAME= gt; $ surname, _LASTNAME= gt; $ lastname, _BIRTHDAY= gt; $ birthday, _ADRESS= gt; $ adress, _PARENT_MATHER= gt; $ mather, _PARENT_FATHER= gt; $ father
));
} _ delete_pupil ($ id)
{$ this- gt; db- gt; delete (PUPILS, PUPIL_ID. = raquo ;. $ id);
}
}
Файл: index_model.php
lt;? phpindex_model extends model
{__ construct ()
{:: __ construct ();
}
}
Файл: login_model.php
lt;? phplogin_model extends model
{function __construct ()
parent :: __ construct (); function run ()
$ sth=$ this- gt; db- gt; select ( SELECT * FROM raquo ;. USERS. WHERE raquo ;. USER_LOGIN. =: raquo ;. USER_LOGIN. laquo ; AND raquo ;. USER_PASS_H. =: raquo ;. USER_PASS_H. raquo ;, array (_LOGIN= gt; $ _POST [ login ], _ PASS_H= gt; $ _POST [ password ])) ; (count ($ sth) gt; 0)
{( auth raquo ;, admin raquo ;, (time () + 7770000), / raquo ;, DOMAIN, FALSE, TRUE); _ s...