Exemple #1
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     // Менеджеры.
     $mUsers = M_Users::Instance();
     $mTeg = M_Teg::Instance();
     //проверяем поступившие даные AJAX запроса
     if ($_REQUEST['teg'] == null or $_REQUEST['teg'] == 'undefined') {
         $this->result = false;
     } else {
         //если данные пришли, присваиваем их переменным класса
         $this->teg = $_REQUEST['teg'];
         $tegname = $mTeg->getteg_id($this->teg);
         $this->tegname = $tegname[0]['name'];
         //добавить ли кнопку удаления
         $doc = $mTeg->getdoc($_REQUEST['teg']);
         $n = count($doc);
         $this->doc = $doc;
         if ($n != 0) {
             $this->del = false;
         } else {
             $this->del = true;
         }
         $this->result = true;
     }
 }
Exemple #2
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     // Менеджеры.
     $mUsers = M_Users::Instance();
     $mDocument = M_Document::Instance();
     $mType = M_Type::Instance();
     if ($this->IsGet()) {
         if (@$_GET['id'] != NULL) {
             $id = (int) $_GET['id'];
             if ($mDocument->getiddocument($id) != NULL) {
                 // в переменную класса для дальнейшей работы сохраняем то что считаем нужным
                 $this->id = $id;
                 $this->result = 'yes';
             } else {
                 $this->result = null;
             }
             //в случае неправильного параметра, или получении левых данных учтём это в следующих методах
         } else {
             $this->result = null;
         }
     } else {
         $this->result = null;
     }
 }
Exemple #3
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->costs_id = $_GET['id'];
     $this->cost_name = getCostNameById($this->costs_id);
     $this->incomings = CIncomings($this->costs_id);
 }
Exemple #4
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     if ($this->IsGet()) {
         if ($_REQUEST['code']) {
             // получаем access_token
             $resp = file_get_contents('https://oauth.vk.com/access_token?client_id=' . CLIENT_ID . '&code=' . $_REQUEST['code'] . '&client_secret=' . SECRET . '&redirect_uri=' . PATH . "index.php?c=setting");
             $data = json_decode($resp, true);
             echo $resp;
             if ($data['access_token']) {
                 $this->mSet->getProfileVk($data['user_id'], $data['access_token'], $this->user[id_user]);
                 header('Location: index.php?c=setting');
                 die;
             }
         }
     }
     // Обработка отправки формы.
     if ($this->IsPost()) {
         $type = $_POST['type'];
         if ($_POST['type'] == 'grup') {
             $person = $_POST['grup'];
             $firstName = $_POST['firstName'];
             $lastName = $_POST['lastName'];
         } elseif ($_POST['type'] == 'lecturer') {
             $person = $_POST['lecturer'];
             $firstName = $_POST['lecturer'];
             $lastName = '';
         }
         $var = array('type' => $type, 'person' => $person, 'first_name' => $firstName, 'last_name' => $lastName);
         $this->mSet->edit_person($var, $this->user[id_user]);
         $this->user = $this->mUsers->Get();
     }
 }
Exemple #5
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->med_id = $_GET['id'];
     $this->medicine_name = getMedicineNameById($this->med_id);
     $this->incomings = Incomings($this->med_id);
 }
Exemple #6
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Редактировать профиль';
     $this->userinfo = getUserInfo($_SESSION['uid']);
     $id_user = $_SESSION['uid'];
 }
Exemple #7
0
 /**
  * Передача работы Механику, для подготовки выходных данных.
  * сохранение данных array[Article] в $_articles
  */
 protected function OnInput()
 {
     parent::OnInput();
     // работаем с одной статьёй
     $this->_title .= '::Просмотр статьи';
     $this->_article = $this->_model->getArticle((int) $_GET['id']);
     $this->_error = $this->_model->getError();
 }
Exemple #8
0
 /**
  * Анализ входных данных, передача работы Механику, для подготовки выходных данных.@deprecated
  * сохранение данных array[Article] в $_articles
  */
 protected function OnInput()
 {
     parent::OnInput();
     // работаем со списком статей
     $this->_title .= '::Просмотр списка статей';
     $this->_articles = $this->_model->getArticles();
     $this->_error = $this->_model->getError();
 }
Exemple #9
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->med_id = $_GET['id'];
     $this->medicine_name = getMedicineNameById($this->med_id);
     $this->expences = Expences($this->med_id);
     $this->patients = getAllpatients();
 }
Exemple #10
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->cost_id = $_GET['id'];
     $this->cost_name = getCostNameById($this->cost_id);
     $this->expences = CExpences($this->cost_id);
     $this->patients = getAllpatients();
 }
Exemple #11
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     // Менеджеры.
     $mUsers = M_Users::Instance();
     $mDocument = M_Document::Instance();
     $mSv = M_Sv::Instance();
     // Обработка отправки формы.
     if ($this->IsPost()) {
         if ($mDocument->ifdate($_POST['date'])) {
             if ($_POST['type'] == NULL) {
                 $this->type = 1;
             } else {
                 $this->type = (int) $_POST['type'];
             }
             $this->date = $_POST['date'];
             //$this->id  = $mDocument->scan_save($this->type, $this->date);
             $docinfo = $mDocument->save_document_uploaded($this->type);
             //сохраняем загруженный файл на сервер
             if ($docinfo != null) {
                 //$this->svar ='всё сохранилось'.$docinfo['falename'].'___'.$docinfo['name'].'___'.$docinfo['rsh'].'___'.$docinfo['sizefile'];
                 //сохраняем в базу
                 $docfalename = $docinfo['falename'];
                 $docname = $docinfo['name'];
                 $docsizefile = $docinfo['sizefile'];
                 $docrsh = $docinfo['rsh'];
                 $result = $mDocument->addnewdoc("{$docname}", "{$docfalename}", "{$this->type}", "{$this->date}", "{$docsizefile}", "{$docrsh}");
                 if ($result > 0) {
                     $this->result = 'ok';
                     //кодовое слово для перехода на другую страницу
                     $this->id = $result;
                     if ($_GET['idcopy'] != null) {
                         $this->result = 'okcopy';
                         $this->idcopy = (int) $_GET['idcopy'];
                         $mSv->copyteg($this->id, $this->idcopy);
                     }
                 }
             } else {
                 $this->error = $mDocument->geterror();
                 //получаем ошибки загрузки
             }
         } else {
             $this->error = 'неверная дата';
         }
     } else {
         $this->input = 'Пример';
         if ($_GET['idcopy'] != null) {
             $this->idcopy = (int) $_GET['idcopy'];
             $this->date = $mDocument->getdatadocument($this->idcopy);
             //присваиваем ему дату исходного документа
         } else {
             $this->date = 'YYYY-MM-DD';
             //просто новый документ
         }
         $this->result = null;
     }
 }
 protected function OnInput()
 {
     parent::OnInput();
     // Подключаем необходимые классы.
     $mUsers = M_Users::Instance();
     // Текущий пользователь.
     $this->user = $mUsers->Get();
     $this->title = 'Главная - Электронная библиотека';
 }
Exemple #13
0
 public function OnInput()
 {
     parent::OnInput();
     $this->id = $_GET['id_patient'];
     $this->month = $_GET['month'];
     $this->year = $_GET['year'];
     $this->expenced = getPatientExpences($this->id, $this->month, $this->year);
     $this->costExpenced = getPatientCostExpences($this->id, $this->month, $this->year);
 }
Exemple #14
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->id_cost = $_GET['id_med'];
     $this->cost = getCostNameById($this->id_cost);
     $this->month = $_GET['month'];
     $this->year = $_GET['year'];
     $this->incomings = getCostIncomingsFromDate($this->id_cost, $this->month, $this->year);
     $this->expences = getCostExpencesFromDate($this->id_cost, $this->month, $this->year);
 }
Exemple #15
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->med_id = $_GET['id_med'];
     $this->medicine = getMedicineNameById($this->med_id);
     $this->month = $_GET['month'];
     $this->year = $_GET['year'];
     $this->incomings = getIncomingsFromDate($this->med_id, $this->month, $this->year);
     $this->expences = getExpencesFromDate($this->med_id, $this->month, $this->year);
 }
Exemple #16
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Добавление папки';
     if (isset($_POST['submit'])) {
         $id_user = $_SESSION['uid'];
         $name = $_POST['name'];
         if (addcategory($id_user, $name)) {
             header('location: index.php?option=files');
         }
     }
 }
Exemple #17
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Информация о персонале';
     $this->personal = getPersonalInfoById($_GET['id']);
     $this->schedule = getScheduleOfDoctor($_GET['id']);
     //Getting patients
     $this->patients = getAllPatients();
     //Getting procedute and place
     $this->procedure = getAllProcedures();
     $this->place = getAllPlaces();
 }
Exemple #18
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Информация о персонале';
     $this->patient = getPatientInfoById($_GET['id']);
     $this->medicines = getAllMedicines();
     $this->costs = getAllCosts();
     $this->procedure = getAllProcedures();
     $this->place = getAllPlaces();
     $this->doctor = getAllPersonals();
     $this->schedule = getScheduleOfPatient($_GET['id']);
 }
Exemple #19
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Добавление заявки';
     $this->types = getTypes();
     $this->departments = getDepartments();
     if (isset($_POST['submit'])) {
         move_uploaded_file($_FILES["filename"]['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/dt/uploads/claim/" . $_FILES["filename"]["name"]);
         $file = $_FILES['filename']['name'];
         addClaim($_POST['in_num'], $_POST['in_date'], $_POST['out_num'], $_POST['out_date'], $_POST['type'], $_POST['description'], $_POST['sen_dep'], $_POST['sen_name'], $file, $_POST['rec']);
     }
 }
Exemple #20
0
 /**
  * Анализ входных данных, передача работы Механику, для подготовки выходных данных.
  * сохранение данных статьи в $_article
  */
 protected function OnInput()
 {
     parent::OnInput();
     $this->_title .= '::Редактирование статьи';
     $this->_model->deleteArticle((int) $_POST['id_article']);
     // при удаче на главную страницу
     if (!($this->_error = $this->_model->getError())) {
         header("Location: index.php");
     } else {
         // метод post- неудачное удаление - повторить форму
         $this->_article = new Article(array($_POST['id_article'], $_POST['title_article'], $_POST['content_article']));
     }
 }
 protected function OnInput()
 {
     parent::OnInput();
     // Подключаем необходимые классы.
     $mUsers = M_Users::Instance();
     $mLibrary = M_Library::Instance();
     // Текущий пользователь.
     $this->user = $mUsers->Get();
     $this->title = 'Поиск по сайту - Электронная библиотека';
     if (!empty($_POST)) {
         $this->result = $mLibrary->Search($_POST['search']);
     }
 }
Exemple #22
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Список контактов';
     if (isset($_POST['submit'])) {
         $name = $_FILES['file']['name'];
         $size = $_FILES['file']['size'];
         $id_cat = $_GET['id'];
         if (addfile($id_cat, $name, $size)) {
             move_uploaded_file($_FILES["file"]['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/social/uploads/files/" . $_FILES["file"]["name"]);
             header("location: index.php?option=viewcat&id={$id_cat}");
         }
     }
 }
Exemple #23
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     // Менеджеры.
     $mUsers = M_Users::Instance();
     $mSv = M_Sv::Instance();
     //проверяем поступившие даные AJAX запроса
     if ($_REQUEST['teg'] == null or $_REQUEST['teg'] == 'undefined') {
         $this->result = false;
     } else {
         $this->teg = $_REQUEST['teg'];
     }
 }
 protected function OnInput()
 {
     parent::OnInput();
     // Подключаем необходимые классы.
     $mUsers = M_Users::Instance();
     // Текущий пользователь.
     $this->user = $mUsers->Get();
     // Может ли пользователь просматривать данную страницу
     if (!$mUsers->Can('Editor_library')) {
         header("Location: index.php");
         die('Отказано в доступе');
     }
     $this->title = 'Панель управления - Электронная библиотека';
 }
Exemple #25
0
 protected function OnInput()
 {
     // Выход из системы пользователя.
     $mUsers = M_Users::Instance();
     $mUsers->Logout();
     // C_Base.
     parent::OnInput();
     // Обработка отправки формы.
     if ($this->IsPost()) {
         if ($mUsers->Login($_POST['login'], $_POST['password'], isset($_POST['remember']))) {
             header('Location: index.php');
             die;
         }
         $this->login = $_POST['login'];
     }
 }
Exemple #26
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Поиск';
     if (isset($_POST['txtSearch'])) {
         $txtSearch = $_POST['txtSearch'];
         $this->txt = $txtSearch;
         if ($this->txt != '') {
             $this->InNum = findByInNum($this->txt);
             $this->OutNum = findByOutNum($this->txt);
             $this->Date = findByDate($this->txt);
             $this->ContactName = findByContactName($this->txt);
             $this->CNumber = findByContactNumber($this->txt);
         }
     }
 }
Exemple #27
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     $expire = time() + 3600 * 24 * 100;
     // Обработка отправки формы.
     if ($this->IsGet()) {
         $expire = time() + 3600 * 24 * 100;
         //Обработка основных параметров формы
         //Группа...
         if (isset($_GET['g'])) {
             $this->sel_grup = $_GET['g'];
             $_COOKIE['sel_grup'] = $this->sel_grup;
             setcookie("sel_grup", $this->sel_grup, time() + $expire);
         } else {
             $this->sel_grup = $_COOKIE['sel_grup'];
         }
         //Преподаватель
         if (isset($_GET['l'])) {
             $this->sel_lecturer = $_GET['l'];
             $_COOKIE['sel_lecturer'] = $this->sel_lecturer;
             setcookie("sel_lecturer", $this->sel_lecturer, time() + $expire);
         } else {
             $this->sel_lecturer = $_COOKIE['sel_lecturer'];
         }
         //Неделя
         if (isset($_GET['w'])) {
             $this->sel_week = $_GET['w'];
             $_COOKIE['sel_week'] = $this->sel_week;
             setcookie("sel_week", $this->sel_week, time() + $expire);
         } else {
             //Ели кука пустая то устанавливаем выбранную неделю в селекте на текущую
             if ($_COOKIE['sel_week'] == NULL) {
                 $this->sel_week = $this->now_week;
             } else {
                 $this->sel_week = $_COOKIE['sel_week'];
             }
         }
         if (isset($_GET[p])) {
             $this->person = $_GET[p];
             $_COOKIE['person'] = $this->person;
             setcookie("person", $this->person, time() + $expire);
         } else {
             $this->person = $_COOKIE['person'];
         }
     }
 }
Exemple #28
0
 protected function OnInput()
 {
     // C_Base.
     parent::OnInput();
     // Менеджеры.
     $mUsers = M_Users::Instance();
     $mDocument = M_Document::Instance();
     $mTeg = M_Teg::Instance();
     $mSv = M_Sv::Instance();
     $mType = M_Type::Instance();
     // Обработка отправки формы.
     // получение id документа из GET
     if (@$_GET['id'] != NULL) {
         $id = (int) $_GET['id'];
         if ($mDocument->getiddocument($id) != NULL) {
             // в переменную класса для дальнейшей работы сохраняем то что считаем нужным
             $this->docid = $id;
             // Обработка отправки формы.
             if ($this->IsPost()) {
                 if (@$_POST['save']) {
                     if ($_POST['type'] != NULL) {
                         $mDocument->updatetype($this->docid, $_POST['type']);
                         //перемещает файл и изменяет в базе, если что-то не так возвращает ошибку
                     }
                     if ($_POST['date'] != NULL) {
                         $mDocument->updatedate($this->docid, $_POST['date']);
                         //меняем дату в базе
                     }
                 } elseif (@$_POST['del']) {
                     $mDocument->delitedocument($this->docid);
                     header("Location:index.php?c=listdoc");
                     //нет больше того документа которого мы редактировали - ибо удалил ты его только что
                 } elseif (@$_POST['change']) {
                     $mDocument->changefile($this->docid);
                 }
             }
             $this->resultget = 'yes';
         } else {
             $this->resultget = null;
         }
         //в случае неправильного параметра, или получении левых данных учтём это в следующих методах
     } else {
         $this->resultget = null;
     }
 }
Exemple #29
0
 protected function OnInput()
 {
     parent::OnInput();
     $this->title = 'Заявка';
     $this->id = $_GET['id'];
     $this->user = $_SESSION['uid'];
     makeopen($this->user, $this->id);
     $this->claiminfo = getClaimInfo($this->id);
     if (isset($_POST['submit']) && isClosed($this->id)) {
         closeThisClaim($this->id);
     }
     if (isset($_POST['submit']) && ($_SESSION['role'] == '2' || $_SESSION['role'] == '5')) {
         $comment = $_POST['comment'];
         $str = $_POST['manager'];
         $n = strlen($str);
         if ($n >= 4) {
             $manager = substr($str, 3, $n - 1);
         } else {
             $m = getManagerFromSection($_POST['manager']);
             $manager = $m->id;
         }
         if ($comment != '') {
             addcomment($this->user, $this->id, $manager, $comment);
         }
         makestate($_SESSION['uid'], $this->id);
         sendtouser($manager, $this->id, $this->user);
     }
     if (isset($_POST['submit']) && $_SESSION['role'] == '3') {
         $comment = $_POST['comment'];
         $user = $_POST['user'];
         if ($comment != '') {
             addcomment($this->user, $this->id, $user, $comment);
         }
         makestate($_SESSION['uid'], $this->id);
         sendtouser($user, $this->id, $this->user);
     }
     if (isset($_POST['submit']) && $_SESSION['role'] == '4') {
         move_uploaded_file($_FILES["filename"]['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . "/dt/uploads/act/" . $_FILES["filename"]["name"]);
         makestate($_SESSION['uid'], $this->id);
         closeClaim($this->id, $_SESSION['uid'], $_FILES['filename']['name']);
         if ($comment != '') {
             addcomment($this->user, $this->id, $user, $comment);
         }
     }
 }
 protected function OnInput()
 {
     parent::OnInput();
     // Подключаем необходимый класс.
     $mUsers = M_Users::Instance();
     $this->title = 'Авторизация - Электронная библиотека';
     // Очистка старых сессий.
     $mUsers->ClearSessions();
     // Выход.
     $mUsers->Logout();
     // Обработка отправки формы.
     if (!empty($_POST)) {
         if ($mUsers->Login($_POST['login'], $_POST['password'])) {
             header('Location: index.php?act=editor_library');
             die;
         }
     }
 }