error = NO funciona
Publicado por sergio (7 intervenciones) el 08/08/2016 20:22:32
Hola tengo el siguiente codigo y el unico error que arroja es QUE NO FUNCIONA, y la verdad que la logica creo que esta bien, pero no encuentro el error, a ver si alguien me puede decir donde esta el error, Gracias
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
<div id="grilla1">
<?php
//Conectamos con mysql
$mysql = new mysql;
$mysql->connect();
//----------------
$fecha = ($mensaje_anio.'-'.$mensaje_mes.'-'.$mensaje_dia);
$nuevafecha0 = strtotime ( '+0 day' , strtotime ( $fecha ) ) ;
$nuevafecha0 = date( 'd-m-Y' , $nuevafecha0 );
$nuevafecha1 = strtotime ( '+1 day' , strtotime ( $fecha ) ) ;
$nuevafecha1 = date ('d-m-Y' , $nuevafecha1 );
$nuevafecha2 = strtotime ( '+2 day' , strtotime ( $fecha ) ) ;
$nuevafecha2 = date ( 'd-m-Y' , $nuevafecha2 );
//----------------
echo "<TABLE>";
echo "<TR>";
echo "<Th class='col'>Hora</Th>";
echo "<Th class='col'>$nuevafecha0</Th>";
echo "<Th class='col'>$nuevafecha1</Th>";
echo "<Th class='col'>$nuevafecha2</Th>";
echo "</TR>";
$cSql1 = $mysql->query("DELETE FROM temporalturnos");
$cSql2 = $mysql->query("select turnos.usuarios as usuarios,turnos.hora as hora,turnos.fecha as fecha,miagenda.nombre as nombre from turnos left join miagenda on turnos.codigoagenda=miagenda.codigo where usuarios='$usuario' and DATE_FORMAT(turnos.fecha, '%d-%m-%Y')>='$nuevafecha0' and DATE_FORMAT(turnos.fecha, '%d-%m-%Y')<='$nuevafecha2' order by turnos.usuarios,turnos.hora,turnos.fecha");
while ($idRec = mysql_fetch_array( $cSql2 ))
{
$horatemp = $idRec['hora'];
$nombretemp = $idRec['nombre'];
$fechatemp = date( 'd-m-Y' , strtotime($idRec['fecha']));
switch ($fechatemp)
{
case $nuevafecha0:
$cSql3 = $mysql->query("select * from temporalturnos where hora='$horatemp'");
$nfilas = $mysql->f_num($cSql3);
if ($nfilas==0)
{
$a =$mysql->query("INSERT INTO temporalturnos (hora,mfecha1) values ('$horatemp','$nombretemp')");
}
else
{
$b = $mysql->query("update temporalturnos set mfecha1='$nombretemp' where hora='$horatemp'");
}
break;
case $nuevafecha1:
$cSql4 = $mysql->query("select * from temporalturnos where hora='$horatemp'");
$nfilas = $mysql->f_num($cSql4);
if ($nfilas==0)
{
$c = $mysql->query("INSERT INTO temporalturnos (hora,mfecha2) values ('$horatemp','$nombretemp')");
}
else
{
$d = $mysql->query("update temporalturnos set mfecha2='$nombretemp' where hora='$horatemp'");
}
break;
case $nuevafecha2:
$cSql5 = $mysql->query("select * from temporalturnos where hora='$horatemp'");
$nfilas = $mysql->f_num($cSql5);
if ($nfilas==0)
{
$e $mysql->query("INSERT INTO temporalturnos (hora,mfecha3) values ('$horatemp','$nombretemp')");
}
else
{
$f = $mysql->query("update temporalturnos set mfecha3='$nombretemp' where hora='$horatemp'");
}
break;
}
}
$cSql6 = $mysql->query("select hora,mfecha1,mfecha2,mfecha3 from temporalturnos order by hora");
while ($idRec1 = mysql_fetch_array( $cSql6 ))
{
echo "<TR class='col' >";
echo "<TD class='col'>".$idRec1['hora']."</TD>";
echo "<Td class='col'>".$idRec1['mfecha1']."</Td>";
echo "<Td class='col'>".$idRec1['mfecha2']."</Td>";
echo "<Td class='col'>".$idRec1['mfecha3']."</Td>";
echo "</TR>";
}
echo "</table>";
mysql_close($conexion);if(isset($mysql))$mysql->close();
?>
</div>
Valora esta pregunta


0