model- gt; _select_subjects ();
$ this- gt; view- gt; render ( admin/admin_header );
$ this- gt; view- gt; render ( admin/admin_subjects );
$ this- gt; view- gt; render ( admin/admin_footer );
} teachers ()
{:: handleLogin ();
$ this- gt; view- gt; subjects=$ this- gt; model- gt; _select_subjects ();
$ this- gt; view- gt; teachers=$ this- gt; model- gt; _select_teachers ();
$ this- gt; view- gt; render ( admin/admin_header );
$ this- gt; view- gt; render ( admin/admin_teachers );
$ this- gt; view- gt; render ( admin/admin_footer );
} pupils ()
{:: handleLogin ();
$ this- gt; view- gt; pupils=$ this- gt; model- gt; _select_pupils ();
$ this- gt; view- gt; render ( admin/admin_header );
$ this- gt; view- gt; render ( admin/admin_pupils );
$ this- gt; view- gt; render ( admin/admin_footer );
} study ()
{:: handleLogin ();
$ this- gt; view- gt; render ( admin/admin_header );
$ this- gt; view- gt; render ( admin/admin_study );
$ this- gt; view- gt; render ( admin/admin_footer );
} search ()
{:: handleLogin ();
$ this- gt; view- gt; render ( admin/admin_header );
$ this- gt; view- gt; render ( admin/admin_search );
$ this- gt; view- gt; render ( admin/admin_footer );
}
}
Файл: form.php
lt;? phpform extends controller
{function __construct ()
{:: __ construct ();
} save_subject ()
{:: handleLogin (); (intval ($ _ POST [ id ]) gt; 0 amp; amp; (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ])))
{
$ this- gt; model- gt; _update_subject (intval ($ _ POST [ id ]), $ _POST [ name ]);
} else if (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ]))
{$ this- gt; model- gt; _add_subject ($ _ POST [ name ]);
} else
{ error raquo ;;
}
} save_teacher ()
{:: handleLogin (); (intval ($ _ POST [ id ]) gt; 0 amp; amp; (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ])))
{
$ this- gt; model- gt; _update_teacher (intval ($ _ POST [ id ]), $ _POST [ name ], $ _POST [ surname ], $ _POST [ lastname ], $ _POST [ experience ], $ _POST [ category ], $ _POST [ subject ]);
} else if (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ]))
{$ this- gt; model- gt; _add_teacher ($ _ POST [ name ], $ _POST [ surname ], $ _POST [ lastname ], $ _POST [ experience ], $ _POST [ category ], $ _POST [ subject ]);
} else
{ error raquo ;;
}
} delete_teacher ()
{:: handleLogin (); (intval ($ _ POST [ id ]) gt; 0)
{
$ this- gt; model- gt; _delete_teacher (intval ($ _ POST [ id ]));
} else
{ error raquo ;;
}
} save_pupil ()
{:: handleLogin (); (intval ($ _ POST [ id ]) gt; 0 amp; amp; (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ])))
{
$ this- gt; model- gt; _update_pupil (intval ($ _ POST [ id ]), $ _POST [ name ], $ _POST [ surname ], $ _POST [ lastname ], $ _POST [ birthday ], $ _POST [ adress ], $ _POST [ mather ], $ _POST [ father ]);
} else if (isset ($ _ POST [ name ]) amp; amp; count_chars ($ _ POST [ name ]))
{$ this- gt; model- gt; _add_pupil ($ _ POST [ name ], $ _POST [ surname ], $ _POST [ lastname ], $ _POST [ birthday ], $ _POST [ adress ], $ _POST [ mather ], $ _POST [ father ]);
} else
{ error raquo ;;
}
} delete_pupil ()
{:: handleLogin (); (intval ($ _...