Информационная система распределения учебной нагрузки
Автоматизация системы формирования часов учебной нагрузки на кафедре и учебных поручений преподавателей. Обзор программных продуктов. Перечень требований к системе, разработка ее архитектуры. Сценарии вариантов использования. Тест информационной системы.
Рубрика | Программирование, компьютеры и кибернетика |
Вид | дипломная работа |
Язык | русский |
Дата добавления | 05.02.2012 |
Размер файла | 1,6 M |
Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже
Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.
return;
}
$users = $this->User->findAll("login='".$this->data['User']['login']."'");
if (count($users) > 0) {
$this->set("error", "Пользователь с таким логином уже зарегистрирован");
return;
}
if ($this->data['User']['admin'] == 0) {
$status = 1;
}
else {
$status = 0;
}
$data = array('User'=>array('login'=>$this->data['User']['login'], 'psw'=>$this->data['User']['psw'], 'status'=>$status));
$this->User->save($data);
if ($status == 1) {
$this->Session->Write('login', $this->data['User']['login']);
$this->redirect(array('controller'=>'users','action' => 'add_teacher'));
}
else {
$this->set('error', "Администратор успешно добавлен");
$this->data['User']['login'] = "";
$this->data['User']['psw'] = "";
$this->data['User']['psw2'] = "";
}
}
}
}
//*************************************
// выбор преподавателя для удаления
//*************************************
function select_teacher_for_del() {
if (!$this->is_admin()) {
$this->redirect(array('controller'=>'users','action' => 'index'));
}
else {
$teachers = $this->Teacher->findAll('order by last_name, first_name, middle_name');
$this->set('teachers', $teachers);
$this->pageTitle = "Выбор преподавателя";
}
}
//*************************************
// удаление преподавателя
//*************************************
function del_user($id = null) {
if (!$this->is_admin()) {
$this->redirect(array('controller'=>'users','action' => 'index'));
}
else {
$this->Teacher->id = $id;
$teacher = $this->Teacher->read();
$this->Plan->query('delete from plans where teacher_id='.$id);
$this->User->id = $teacher['Teacher']['user_id'];
$this->User->del();
$this->Teacher->del();
$this->redirect(array('controller'=>'users','action' => 'select_teacher_for_del'));
}
}
//******************************
// выбор преподавателя для редактирования
//******************************
function select_teacher() {
if (!$this->is_admin()) {
$this->redirect(array('controller'=>'users','action' => 'index'));
}
else {
$teachers = $this->Teacher->findAll('order by last_name, first_name, middle_name');
$this->set('teachers', $teachers);
$this->pageTitle = "Выбор преподавателя";
}
}
//*********************************
// редактирование данных преподавателя
//*********************************
function edit_user($id = null) {
if (!$this->is_admin()) {
$this->redirect(array('controller'=>'users','action' => 'index'));
}
else {
if (!empty($this->data)) {
$ok = true;
if (empty($this->data["Teacher"]["last_name"])) {
$this->set('error', "Фамилия не заполнена");
$ok = false;
}
if (empty($this->data['Teacher']['first_name'])) {
$this->set("error", "Имя не заполнено");
$ok = false;
}
if (empty($this->data['Teacher']['middle_name'])) {
$this->set("error", "Отчество не заполнено");
$ok = false;
}
if (empty($this->data['Teacher']['stepen'])) {
$this->set("error", "Ученая степень не заполнена");
$ok = false;
}
if (empty($this->data['Teacher']['post'])) {
$this->set('error', "Должность не заполнена");
$ok = false;
}
if ($ok) {
$data = array("Teacher"=>array('first_name'=>$this->data['Teacher']['first_name'], 'last_name'=>$this->data['Teacher']['last_name'], 'middle_name'=>$this->data['Teacher']['middle_name'], 'stepen'=>$this->data['Teacher']['stepen'], 'post'=>$this->data['Teacher']['post'], 'chair_id'=>$this->data['Chair']['name']));
$this->Teacher->id = $id;
$this->Teacher->save($data);
$this->set("error", "Данные преподавателя успешно изменены");
}
}
$this->Teacher->id = $id;
$teacher = $this->Teacher->read();
$this->set('teacher', $teacher);
$chairs = $this->Chair->findAll();
$this->set("chairs", $chairs);
$this->Chair->id = $teacher['Teacher']['chair_id'];
$chair = $this->Chair->read();
$this->set('chair_name', $chair['Chair']['name']);
$this->pageTitle = "Редактирование данных преподавателя";
}
}
//***************************************
// добавление преподавателя администратором
//***************************************
function add_teacher() {
if (!$this->is_admin()) {
$this->redirect(array('controller'=>'users','action' => 'index'));
}
else {
$this->pageTitle = "Добавление нового преподавателя";
$login = $this->Session->Read('login');
if (!empty($login)) {
$user = $this->User->findAll("login='".$login."'");
if (count($user) > 0) {
$chairs = $this->Chair->findAll();
$this->set("chairs", $chairs);
if (!empty($this->data)) {
if (empty($this->data["Teacher"]["last_name"])) {
$this->set('error', "Фамилия не заполнена");
return;
}
if (empty($this->data['Teacher']['first_name'])) {
$this->set("error", "Имя не заполнено");
return;
}
if (empty($this->data['Teacher']['middle_name'])) {
$this->set("error", "Отчество не заполнено");
return;
}
if (empty($this->data['Teacher']['stepen'])) {
$this->set("error", "Ученая степень не заполнена");
return;
}
if (empty($this->data['Teacher']['post'])) {
$this->set('error', "Должность не заполнена");
return;
}
$data = array("Teacher"=>array('first_name'=>$this->data['Teacher']['first_name'], 'last_name'=>$this->data['Teacher']['last_name'], 'middle_name'=>$this->data['Teacher']['middle_name'], 'stepen'=>$this->data['Teacher']['stepen'], 'post'=>$this->data['Teacher']['post'], 'chair_id'=>$this->data['Chair']['name'], 'user_id'=>$user[0]["User"]["id"]));
$this->Teacher->save($data);
$this->set("error", "Преподаватель успешно добавлен");
$this->data['Teacher']['last_name'] = "";
$this->data['Teacher']['first_name'] = "";
$this->data['Teacher']['middle_name'] = "";
$this->data['Teacher']['stepen'] = "";
$this->data['Teacher']['post'] = "";
}
}
else {
$this->set('error', "Не найден пользователь");
}
}
else {
$this->set('error', "Не найден пользователь");
}
}
}
//****************************
// проверка прав доступа
//****************************
function is_admin() {
if ($this->Session->Read('user') == '') {
return false ;
}
else {
$login = $this->Session->Read('user');
$user = $this->User->findAll("login='".$login."'");
if ($user[0]['User']['status'] == 0) {
return true;
}
else {
return false;
}
}
}
//*****************************
// выход из системы
//*****************************
function logout() {
$this->Session->Write('user', '');
$this->Session->Write('admin', '');
$this->redirect(array('controller'=>'users','action' => 'index'));
}
}
?>
Core.php
<?php
/* SVN FILE: $Id$ */
/**
* This is core configuration file.
*
* Use it to configure core behavior of Cake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
* 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 0);
/**
* Application wide charset encoding
*/
Configure::write('App.encoding', 'UTF-8');
/**
* To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
*
* /.htaccess
* /app/.htaccess
* /app/webroot/.htaccess
*
* And uncomment the App.baseUrl below:
*/
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
* Uncomment the define below to use CakePHP admin routes.
*
* The value of the define determines the name of the route
* and its associated controller actions:
*
* 'admin' -> admin_index() and /admin/controller/index
* 'superuser' -> superuser_index() and /superuser/controller/index
*/
//Configure::write('Routing.admin', 'admin');
/**
* Turn off all caching application-wide.
*
*/
//Configure::write('Cache.disable', true);
/**
* Enable cache checking.
*
* If set to true, for view caching you must still use the controller
* var $cacheAction inside your controllers to define caching settings.
* You can either set it controller-wide by setting var $cacheAction = true,
* or in each action using $this->cacheAction = true.
*
*/
//Configure::write('Cache.check', true);
/**
* Defines the default error type when using the log() function. Used for
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
*/
define('LOG_ERROR', 2);
/**
* The preferred session handling method. Valid values:
*
* 'php' Uses settings defined in your php.ini.
* 'cake' Saves session files in CakePHP's /tmp directory.
* 'database' Uses CakePHP's database sessions.
*
* To define a custom session handler, save it at /app/config/<name>.php.
* Set the value of 'Session.save' to <name> to utilize it in CakePHP.
*
* To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql.
*
*/
Configure::write('Session.save', 'php');
/**
* The name of the table used to store CakePHP database sessions.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*
* The table name set here should *not* include any table prefix defined elsewhere.
*/
//Configure::write('Session.table', 'cake_sessions');
/**
* The DATABASE_CONFIG::$var to use for database session handling.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*/
//Configure::write('Session.database', 'default');
/**
* The name of CakePHP's session cookie.
*/
Configure::write('Session.cookie', 'CAKEPHP');
/**
* Session time out time (in seconds).
* Actual value depends on 'Security.level' setting.
*/
Configure::write('Session.timeout', '120');
/**
* If set to false, sessions are not automatically started.
*/
Configure::write('Session.start', true);
/**
* When set to false, HTTP_USER_AGENT will not be checked
* in the session
*/
Configure::write('Session.checkAgent', true);
/**
* The level of CakePHP security. The session timeout time defined
* in 'Session.timeout' is multiplied according to the settings here.
* Valid values:
*
* 'high' Session timeout in 'Session.timeout' x 10
* 'medium' Session timeout in 'Session.timeout' x 100
* 'low' Session timeout in 'Session.timeout' x 300
*
* CakePHP session IDs are also regenerated between requests if
* 'Security.level' is set to 'high'.
*/
Configure::write('Security.level', 'high');
/**
* A random string used in security hashing methods.
*/
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
/**
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
* This requires a/var/cache directory to be writable by the web server for caching.
* and /vendors/csspp/csspp.php
*
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
*/
//Configure::write('Asset.filter.css', 'css.php');
/**
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
*
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
* If you are on PHP 5.3 uncomment this line and correct your server timezone
* to fix the date & time related errors.
*/
//date_default_timezone_set('UTC');
/**
*
* Cache Engine Configuration
* Default settings provided below
*
* File storage engine.
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
* 'serialize' => true, [optional]
* ));
*
*
* APC (http://pecl.php.net/package/APC)
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
* ));
*
*
* Memcache (http://www.danga.com/memcached/)
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
* ), //[optional]
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
* ));
*
*/
Cache::config('default', array('engine' => 'File'));
?>
Database.php
<?php
/* SVN FILE: $Id$ */
/**
* This is core configuration file.
*
* Use it to configure core behaviour ofCake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* In this file you set up your database connection details.
*
* @package cake
* @subpackage cake.config
*/
/**
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
* mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
* db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
* oracle - Oracle 8 and higher
* firebird - Firebird/Interbase
* sybase - Sybase ASE
* adodb-[drivername] - ADOdb interface wrapper (see below),
* odbc - ODBC DBO driver
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
* where 'x' is the name of the database.
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
*
* connect =>
* ADOdb set the connect to one of these
* (http://phplens.com/adodb/supported.databases.html) and
* append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
* For all other databases, this setting is deprecated.
*
* host =>
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
* 'public', DB2 defaults to empty.
*
* encoding =>
* For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
* database. Uses database default.
*
*/
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'root',
'database' => 'diplom_plan',
'prefix' => '',
'encoding'=>'utf8'
);
var $test = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
);
}
?>
Routes.php
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different urls to chosen controllers and their actions (functions).
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, /app/views/pages/home.ctp)...
*/
Router::connect('/', array('controller' => 'users', 'action' => 'index', 'home'));
/**
* ...and connect the rest of 'Pages' controller's urls.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
?>
User.php
<?php
class User extends AppModel {
var $name = 'User';
}
?>
Teacher.php
<?php
class User extends AppModel {
var $name = 'teacher';
}
?>
Subject.php
<?php
class User extends AppModel {
var $name = 'subject';
}
?>
Spec.php
<?php
class User extends AppModel {
var $name = 'spec';
}
?>
Semester.php
<?php
class Semester extends AppModel {
var $name = 'Semester';
}
?>
Plan.php
<?php
class Plan extends AppModel {
var $name = 'Plan';
}
?>
Chair.php
<?php
class Chair extends AppModel {
var $name = 'Chair';
}
?>
Размещено на Allbest.ru
Подобные документы
Программные компоненты, необходимые для реального функционирования информационной системы. Разработка информационного ресурса, позволяющего организовать работу с информацией о часах учебной нагрузки и основанного на принципах гипертекстовой технологии.
дипломная работа [1,2 M], добавлен 19.01.2012Формирование функциональной и информационной модели, отображающей потоки данных в бизнес-процессе. Математические расчеты, производимые в подпрограмме. Разработка интерфейса пользователя, возможности дальнейшего развития проектируемой подсистемы.
дипломная работа [1,3 M], добавлен 26.01.2013Краткая характеристика предметной области. Актуальность разработки объектно-ориентированной модели информационной системы для учебной библиотеки. Создание диаграммы вариантов использования, последовательности, кооперативной диаграммы, диаграммы классов.
курсовая работа [381,8 K], добавлен 01.06.2009Разработка структуры реляционной базы данных для информационной системы "Распределение учебной нагрузки". Требования к информации, надежности, составу и параметрам технических средств. Нормализация информационных объектов, логическая модель данных.
курсовая работа [2,3 M], добавлен 03.05.2015Рассмотрение структуры предприятия, обзор современного программного обеспечения. Описание информационной системы учета кадров. Создание информационной системы для работы с персоналом на основе выполненного анализа программных продуктов этого направления.
дипломная работа [3,7 M], добавлен 03.07.2015Обзор программных продуктов для службы экспресс-доставки. Анализ бизнес-процессов в системе, формулировка функциональных и эксплуатационных требований. Декомпозиция системы и построение диаграммы иерархии функций. Построение инфологической модели данных.
курсовая работа [474,8 K], добавлен 20.07.2014Цель, основные критерии и ограничения разрабатываемой информационной подсистемы "Организация и контроль учебной деятельности студентов". Состав и содержание работ по созданию системы. Разработка методик испытаний генерации регламентного документа.
дипломная работа [1,6 M], добавлен 30.06.2015Разработка информационной системы для автоматизации логистики в управлении архивом документов компании "Айрон Маунтен". Обзор рынка аналогов программных продуктов. Тестирование разработанной программной системы. Даталогическая и физическая модели данных.
дипломная работа [7,3 M], добавлен 04.05.2014Разработка информационной системы для ведения каталога книг/читателей, поисковой системы, предварительных заказов на приобретение книг. Анализ затрат на разработку системы. Архитектура объектно-ориентированной системы. Диаграмма классов, модули системы.
курсовая работа [906,1 K], добавлен 24.06.2013Разработка информационной системы ВУЗа с использованием методики объектно-ориентированного моделирования UML. Анализ требований к системе. Концептуальная (содержательная) модель. Диаграмма компонентов и классов. Программная реализация приложения.
курсовая работа [797,7 K], добавлен 16.04.2014