-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.php
143 lines (128 loc) · 5.5 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
require_once("config/init.php");
include("security.php");
protegePagina();
$user_id = $_SESSION['id'];
$qryval = "SELECT * FROM `fila_procedimentos` WHERE (id = '$user_id') LIMIT 1";
$exe_usuariosval = $connection->query($qryval);
$rowval = mysqli_fetch_array($exe_usuariosval, MYSQL_ASSOC);
$tipo = $rowval['tipo'];
$nome = $rowval['nome'];
$data = $rowval['dt_entrada'];
if($data == "0000-00-00 00:00:00"){
$marcado = 0;
} else {
$marcado = 1;
}
if($tipo == 0){
$idtipo = $rowval['id_especialidade'];
$qrynew = "SELECT * FROM `especialidades` WHERE (id = '$idtipo') LIMIT 1";
if($marcado == 0){
$qrycount = "SELECT count(*) as total FROM `fila_procedimentos` WHERE id_especialidade = 1 and dt_entrada < '$data'";
$qry_table = "SELECT * FROM fila_procedimentos WHERE id_especialidade = 1 ORDER BY dt_entrada DESC LIMIT 10";
$result = $connection->query($qrycount);
$pos_fila = mysqli_fetch_assoc($result);
$pos_fila = $pos_fila['total']+1;
}
$nometipo = "consulta";
} else if($tipo == 1){
$idtipo = $rowval['id_exame'];
$qrynew = "SELECT * FROM `exames` WHERE (id = '$idtipo') LIMIT 1";
if($marcado == 0){
$qrycount = "SELECT count(*) as total FROM `fila_procedimentos` WHERE id_exame = 1 and dt_entrada < '$data'";
$qry_table = "SELECT * FROM fila_procedimentos WHERE id_exame = 1 ORDER BY dt_entrada DESC LIMIT 10";
$result = $connection->query($qrycount);
$pos_fila = mysqli_fetch_assoc($result);
$pos_fila = $pos_fila['total']+1;
}
$nometipo = "exame";
}
$exe_new = $connection->query($qrynew);
$rowfin = mysqli_fetch_array($exe_new, MYSQL_ASSOC);
if($marcado == 0){
$message = "Seu procedimento ainda não foi marcado, mas você é o <strong>".$pos_fila."º</strong> da fila.";
} else {
$data_atendimento = date_create($rowval['dt_atendimento']);
$data_atendimento = date_format($data_atendimento,'d/m/Y \à\s H:i:s');
$message = "Seu procedimento está marcado para o dia: ".$data_atendimento;
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<!--FONT-->
<link rel="stylesheet" type="text/css" href="css/font.css">
<!-- BASICS -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>SUS Transparente - Dados públicos sobre consultas e exames</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/isotope.css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/animate.css" />
<link rel="stylesheet" type="text/css" href="css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/material-design-iconic-font.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/style-info.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.jscrollpane.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css" />
<!-- Scripts -->
<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="js/typeahead.min.js"></script>
<script src="js/interact-1.2.4.min.js"></script>
<script src="js/scripts.js"></script>
</head>
<body>
<div id="main">
<div class="container">
<div class="col-md-12 column text-center">
<div class="ca-presentation">
<div class="animated fadeIn"><img src="img/logo.svg" width="300px" /></div>
<div class="ca-presentation-find type-one">Olá <strong><?php echo $nome; ?></strong>,<br /></span>
<span class="ca-presentation-find type-one"><?php echo $message; ?></span>
</div>
</div>
<?php if($marcado == 0){
$result_cat = $connection->query($qry_table);
?>
<div class="col-md-12 column">
<div class="animated fadeIn">
<table class="table table-bordered">
<tr>
<th width="10%">Posição</th>
<th width="45%">Paciente</th>
<th width="45%%">Data de entrada</th>
</tr>
<?php
$i = 1;
while ($row_table = mysqli_fetch_assoc($result_cat)){
$nome_pac = strtoupper(substr($row_table["id_sisreg"],3));
$data_entrada = date_create($row_table['dt_entrada']);
$data_entrada = date_format($data_entrada,'d/m/Y \à\s H:i:s');
echo "<tr><td>".$i."</td>";
echo "<td>XXX".$nome_pac."</td>";
echo "<td>".$data_entrada."</td>";
$i++;
}
?>
</tr>
</table>
</div>
</div>
<?php } ?>
<div id="fechar" class="text-center"><input type="button" name="close" class="btn btn-primary btnmod" id="fechar" value="Fechar" onclick="window.close()"></div>
</div>
</div>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/jquery.contentcarousel.js"></script>
</body>
</html>