-
Notifications
You must be signed in to change notification settings - Fork 1
/
califica_.php
64 lines (41 loc) · 1.47 KB
/
califica_.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
<?php
include 'conex_.php';
$IdCentro = $_GET['IdC'];
$Estado = $_GET['Es'];
$Box = $_GET['Bo'];
$GenteEsp = $_GET['Ge'];
$TiempoEs = $_GET['Te'];
$IdPaciente = 1;
$query = "";
if($Estado != Null && $Estado=="1")
{
$query = "INSERT INTO `ocl_hopper`.`Atencion_Paciente` (`IdUsuario`, `IdCentro`, `Estado`, `Registro`) VALUES ('$IdPaciente', '$IdCentro', '$Estado', NOW());";
$result=mysql_db_query($dbname, $query, $link);
// $row = mysql_fetch_array ($result)
//mysql_free_result($result);
echo($query);
}
if($Estado != Null && $Estado=="2")
{
$query += "INSERT INTO `ocl_hopper`.`Atencion_Prestador` ( ";
$query += "`IdUsuario` , ";
$query += "`IdCentro` , ";
$query += "`Estado` , ";
$query += "`Registro` , ";
$query += "`Box` , ";
$query += "`GenteEspera` , ";
$query += "`TiempoEspera` ";
$query += ") ";
$query += "VALUES ( ";
$query += "'$IdPaciente', '$IdCentro','$Estado', 'now()', '$Box', '$GenteEsp', '$TiempoEs'); ";
$result=mysql_db_query($dbname, $query, $link);
$query = " SELECT sum( box ) , sum( GenteEspera ) , tiempoEspera "
$query += " FROM `Atencion_Prestador` "
$query += " WHERE DATE_SUB( CURDATE( ) , INTERVAL 3 "
$query += " DAY ) <= registro "
$query += " AND idcentro =1 "
$result=mysql_db_query($dbname, $query, $link);
echo($query);
}
?>
?>