-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publicação dos arquivos e componentes iniciais do projeto
- Loading branch information
1 parent
87584fc
commit 5931484
Showing
566 changed files
with
211,560 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RewriteEngine on | ||
Options -Indexes | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^(.*)$ index.php?request_uri=$1 [NC,L,QSA,B] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
-- phpMyAdmin SQL Dump | ||
-- version 4.9.5 | ||
-- https://www.phpmyadmin.net/ | ||
-- | ||
-- Host: 127.0.0.1:3306 | ||
-- Tempo de geração: 10/08/2021 às 17:47 | ||
-- Versão do servidor: 10.3.24-MariaDB-cll-lve | ||
-- Versão do PHP: 7.2.34 | ||
|
||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
SET AUTOCOMMIT = 0; | ||
START TRANSACTION; | ||
SET time_zone = "+00:00"; | ||
|
||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8mb4 */; | ||
|
||
-- | ||
-- Banco de dados: `u226104869_covid` | ||
-- | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Estrutura para tabela `casos` | ||
-- | ||
|
||
CREATE TABLE `casos` ( | ||
`id` int(11) NOT NULL, | ||
`nome_paciente` varchar(255) DEFAULT NULL, | ||
`telefone` varchar(255) DEFAULT NULL, | ||
`status_exame` varchar(255) DEFAULT NULL, | ||
`origem` varchar(255) DEFAULT NULL, | ||
`inicio_sintomas` date DEFAULT NULL, | ||
`data_coleta_exame` date DEFAULT NULL, | ||
`local_coleta` varchar(255) DEFAULT NULL, | ||
`tipo_exame` varchar(255) DEFAULT NULL, | ||
`internado` varchar(255) DEFAULT NULL, | ||
`resultado` varchar(255) DEFAULT NULL, | ||
`caso_ativo` varchar(255) DEFAULT NULL, | ||
`data_descarte_caso` date DEFAULT NULL, | ||
`data_obito` date DEFAULT NULL, | ||
`data_encerramento_caso` date DEFAULT NULL, | ||
`obito` varchar(255) DEFAULT NULL, | ||
`inserido_por` varchar(255) DEFAULT NULL, | ||
`date_created` datetime DEFAULT NULL, | ||
`date_updated` datetime DEFAULT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
|
||
|
||
-- | ||
-- Estrutura para tabela `usuario` | ||
-- | ||
|
||
CREATE TABLE `usuario` ( | ||
`id` int(11) NOT NULL, | ||
`login` varchar(255) DEFAULT NULL, | ||
`senha` varchar(255) DEFAULT NULL, | ||
`email` varchar(255) DEFAULT NULL, | ||
`foto` varchar(255) DEFAULT NULL, | ||
`login_session_key` varchar(255) DEFAULT NULL, | ||
`email_status` varchar(20) DEFAULT NULL, | ||
`password_reset_key` varchar(255) DEFAULT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
|
||
-- | ||
-- Despejando dados para a tabela `usuario` | ||
-- | ||
|
||
INSERT INTO `usuario` (`id`, `login`, `senha`, `email`, `foto`, `login_session_key`, `email_status`, `password_reset_key`) VALUES | ||
(1, 'admin', '$2y$10$pET0DEVN6PR2a5Ri8cn62eHWBAXZYjxZVGxjAtPyqb/3XpHtgkDke', 'admin@admin.com', 'http://localhost/covid/uploads/files/mq4d3er1s0ylxb9.png', 'e4a51191a45619d8b2fb39461f3ebc6f', NULL, NULL) | ||
|
||
-- | ||
-- Índices de tabelas apagadas | ||
-- | ||
|
||
-- | ||
-- Índices de tabela `casos` | ||
-- | ||
ALTER TABLE `casos` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
-- | ||
-- Índices de tabela `usuario` | ||
-- | ||
ALTER TABLE `usuario` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
-- | ||
-- AUTO_INCREMENT de tabelas apagadas | ||
-- | ||
|
||
-- | ||
-- AUTO_INCREMENT de tabela `casos` | ||
-- | ||
ALTER TABLE `casos` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2419; | ||
|
||
-- | ||
-- AUTO_INCREMENT de tabela `usuario` | ||
-- | ||
ALTER TABLE `usuario` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; | ||
COMMIT; | ||
|
||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,55 @@ | ||
# controlecovid | ||
Sistema para controle e acompanhamento de casos de COVID-19 | ||
# Sistema de controle de casos de COVID-19 | ||
|
||
![](https://camo.githubusercontent.com/7a3a3da95ac1f0ace3082eb66233fcef6d176ebe9b34fe442614e9d134fa508d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e254333254137612d47504c76332d677265656e) | ||
|
||
Sistema para controle e monitoramento de casos de COVID-19 feito em PHP7. | ||
|
||
|
||
|
||
## Screenshots | ||
|
||
![Inicio do Painel](https://i.imgur.com/XUs42Mj.png) | ||
|
||
![Graficos e Menus](https://i.imgur.com/uSotRm3.png) | ||
|
||
![Filtros de dados](https://i.imgur.com/dZP6Cxl.png) | ||
|
||
![Gerador de prontuario](https://i.imgur.com/2AE6jXx.png) | ||
|
||
![Pagina de adição de dados](https://i.imgur.com/4I773V2.png) | ||
|
||
|
||
|
||
## Funcionalidades | ||
|
||
- Geração de prontuário individual | ||
- Geração de estatísticas automáticas e dinâmicas | ||
- Autopreenchimento de dados para informações já imputadas anteriormente | ||
- Barra de pesquisa dinâmica que pesquisa em todos os campos | ||
- Mais de 10 opções de filtros entre datas, tipo de exame, resultado, origem, etc | ||
- Cadastro e controle de usuários que terão acesso ao sistema | ||
- Menus intuitivos contendo os casos de maneira ordenada | ||
- Controle de alteração e adição (quem e quando imputou tais dados) | ||
- Layout responsivo, facilmente acessível pelo celular | ||
- Exportação de dados simplificada, possibilitando exportar para vários formatos | ||
|
||
## Instalando e customizando | ||
|
||
##### Instalação | ||
|
||
1. Copie todos os arquivos para sua pasta pública em seu servidor apache/nginx php. | ||
2. Crie um banco de dados com usuário e senha, vá ao phpmyadmin e importe o arquivo "**Banco-de-Dados.sql**" neste banco recém criado. | ||
3. Aceda ao arquivo "**config.php**" e altere as **linhas 82 a 85** com os dados do seu usuário e banco recém criados. | ||
4. Entre no sistema por sua URL Web com estas credenciais - **login:admin senha:123456789** | ||
|
||
##### Customização | ||
|
||
Por se tratar de um sistema que usa como base o codeigniter, toda a customização visual que precisar você irá encontrar na pasta app/views/partials, onde poderá editar o html/js de cada página, basta se orientar usando a URL que você vê no sistema. | ||
|
||
## Contribua com o projeto | ||
|
||
Este projeto é uma iniciativa totalmente opensource totalmente e gratuita, contribuidores e ideias são muito bem vindas! Entre em contato se deseja contribuir para que possamos fornecer o apoio e documentação necessários para que você possa contribuir com esse projeto. | ||
|
||
|
||
|
||
![](https://camo.githubusercontent.com/d7dfd46fa63366a44818b720366997dc6ffe536b9685130eb0de18758ff7ad06/68747470733a2f2f7777772e676e752e6f72672f67726170686963732f67706c76332d776974682d746578742d3133367836382e706e67) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?php | ||
/** | ||
* Account Page Controller | ||
* @category Controller | ||
*/ | ||
class AccountController extends SecureController{ | ||
function __construct(){ | ||
parent::__construct(); | ||
$this->tablename = "usuario"; | ||
} | ||
/** | ||
* Index Action | ||
* @return null | ||
*/ | ||
function index(){ | ||
$db = $this->GetModel(); | ||
$rec_id = $this->rec_id = USER_ID; //get current user id from session | ||
$db->where ("id", $rec_id); | ||
$tablename = $this->tablename; | ||
$fields = array("id", | ||
"login", | ||
"email"); | ||
$user = $db->getOne($tablename , $fields); | ||
if(!empty($user)){ | ||
$page_title = $this->view->page_title = "Minha conta"; | ||
$this->render_view("account/view.php", $user); | ||
} | ||
else{ | ||
$this->set_page_error(); | ||
$this->render_view("account/view.php"); | ||
} | ||
} | ||
/** | ||
* Update user account record with formdata | ||
* @param $formdata array() from $_POST | ||
* @return array | ||
*/ | ||
function edit($formdata = null){ | ||
$request = $this->request; | ||
$db = $this->GetModel(); | ||
$rec_id = $this->rec_id = USER_ID; | ||
$tablename = $this->tablename; | ||
//editable fields | ||
$fields = $this->fields = array("id","login","foto"); | ||
if($formdata){ | ||
$postdata = $this->format_request_data($formdata); | ||
$this->rules_array = array( | ||
'login' => 'required', | ||
); | ||
$this->sanitize_array = array( | ||
'login' => 'sanitize_string', | ||
'foto' => 'sanitize_string', | ||
); | ||
$modeldata = $this->modeldata = $this->validate_form($postdata); | ||
//Check if Duplicate Record Already Exit In The Database | ||
if(isset($modeldata['login'])){ | ||
$db->where("login", $modeldata['login'])->where("id", $rec_id, "!="); | ||
if($db->has($tablename)){ | ||
$this->view->page_error[] = $modeldata['login']." Já existe!"; | ||
} | ||
} | ||
if($this->validated()){ | ||
$db->where("usuario.id", $rec_id);; | ||
$bool = $db->update($tablename, $modeldata); | ||
$numRows = $db->getRowCount(); //number of affected rows. 0 = no record field updated | ||
if($bool && $numRows){ | ||
$this->set_flash_msg("Registro atualizado com sucesso", "success"); | ||
$db->where ("id", $rec_id); | ||
$user = $db->getOne($tablename , "*"); | ||
set_session("user_data", $user);// update session with new user data | ||
return $this->redirect("account"); | ||
} | ||
else{ | ||
if($db->getLastError()){ | ||
$this->set_page_error(); | ||
} | ||
elseif(!$numRows){ | ||
//not an error, but no record was updated | ||
$this->set_flash_msg("Nenhum registro atualizado", "warning"); | ||
return $this->redirect("account"); | ||
} | ||
} | ||
} | ||
} | ||
$db->where("usuario.id", $rec_id);; | ||
$data = $db->getOne($tablename, $fields); | ||
$page_title = $this->view->page_title = "Minha conta"; | ||
if(!$data){ | ||
$this->set_page_error(); | ||
} | ||
return $this->render_view("account/edit.php", $data); | ||
} | ||
/** | ||
* Change account email | ||
* @return BaseView | ||
*/ | ||
function change_email($formdata = null){ | ||
if($formdata){ | ||
$email = trim($formdata['email']); | ||
$db = $this->GetModel(); | ||
$rec_id = $this->rec_id = USER_ID; //get current user id from session | ||
$tablename = $this->tablename; | ||
$db->where ("id", $rec_id); | ||
$result = $db->update($tablename, array('email' => $email )); | ||
if($result){ | ||
$this->set_flash_msg("Endereço de email alterado com sucesso", "success"); | ||
$this->redirect("account"); | ||
} | ||
else{ | ||
$this->set_page_error("E-mail não alterado"); | ||
} | ||
} | ||
return $this->render_view("account/change_email.php"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Info Contoller Class | ||
* @category Controller | ||
*/ | ||
|
||
class ApiController extends BaseController | ||
{ | ||
|
||
/** | ||
* call model action to retrieve data | ||
* @return json data | ||
*/ | ||
|
||
function json($action, $arg1 = null, $arg2 = null) | ||
{ | ||
$model = new SharedController; | ||
$args = array($arg1, $arg2); | ||
$data = call_user_func_array(array($model, $action), $args); | ||
render_json($data); | ||
} | ||
} |
Oops, something went wrong.