Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/07/2008, 04:17
Avatar de midpunto
midpunto
 
Fecha de Ingreso: enero-2004
Ubicación: España Palma de mallorca
Mensajes: 118
Antigüedad: 20 años, 3 meses
Puntos: 0
Desacuerdo bueno, viendo que nadie dice nada.. jeje

Hola, alguna idea?, alguien?...

bueno por el momento y ya se que es medio desastre he solucionado de la siguiente forma aquí pongo el código por si a alguien le sirve:

Código PHP:
<?php require_once('../../../Connections/conect.php'); ?>
<?php  
if (!isset($_GET['fecha'])){
             
$fecha_aux date('Y-m-d');
             }else{
             
// Fecha en Nuestro Formato
             
$dtm_fechainicial=$_GET['fecha'];
             
// Creamos una lista de variables a la cual le asignamos los valores parciales de $dtm_fechainicial, divididos por el signo "/"
             
list( $dia$mes$anio) = split'[-__]'$dtm_fechainicial );
             
// reasignamos la fecha a $dtm_fechainicial con su nuevo formato
             
$dtm_fechainicial "$anio-$mes-$dia";
             
$fecha_aux $dtm_fechainicial;
                  }
?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

if (!
function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$colname_eventos "-1";
if (isset(
$_GET['usuario'])) {
  
$colname_eventos $_GET['usuario'];
}
mysql_select_db($database_conect$conect);
$query_eventos sprintf("SELECT * FROM cal_eventos WHERE user_ev = %s AND fe_ini_ev ='$fecha_aux' AND hor_in_ev >='00:00:00' AND hor_in_ev <'01:00:00' ORDER BY hor_in_ev ASC"GetSQLValueString($colname_eventos"int"));
$eventos mysql_query($query_eventos$conect) or die(mysql_error());
$row_eventos mysql_fetch_assoc($eventos);
$totalRows_eventos mysql_num_rows($eventos);

$colname_eventos11 "-1";
if (isset(
$_GET['usuario'])) {
  
$colname_eventos11 $_GET['usuario'];
}
mysql_select_db($database_conect$conect);
$query_eventos11 sprintf("SELECT * FROM cal_eventos WHERE user_ev = %s AND fe_ini_ev ='$fecha_aux' AND hor_in_ev >='11:00:00' AND hor_in_ev <'12:00:00' ORDER BY fe_ini_ev ASC"GetSQLValueString($colname_eventos11"int"));
$eventos11 mysql_query($query_eventos11$conect) or die(mysql_error());
$row_eventos11 mysql_fetch_assoc($eventos11);
$totalRows_eventos11 mysql_num_rows($eventos11);

$colname_eventos2 "-1";
if (isset(
$_GET['usuario'])) {
  
$colname_eventos2 $_GET['usuario'];
}
// hasta 24 consultas para poer rellenar cada celda con su intervalo de tiempo en horas (cosa que he intentado hacerlo mucho más simple y se que se pude pero no se como hacerlo...

//contenido html
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#709FCF">
  <tr>
    <td colspan="2" align="center" bgcolor="#EAEAEA"><span class="Estilo5">El día seleccionado  es
      <?php  if (!isset($_GET['fecha'])){
             
$Hoy date('d-m-Y'); echo $Hoy ;
             }else{ 
             echo 
$_GET['fecha'];
                  }
?>
    </span></td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#ACC8E3"><span class="Estilo1"><span class="Estilo3">0</span>.<span class="Estilo2">00</span></span></td>
    <td width="94%" bgcolor="#ACC8E3"><table width="100%" border="0" cellpadding="1">
      <tr>
        <?php
  
do { // horizontal looper version 3
?>
        <td width="103" bgcolor="#89B0D8"><span class="Estilo2"><?php echo $row_eventos['asunto_ev'];?></span> <span class="Estilo3">+</span></td>
        <?php
    $row_eventos 
mysql_fetch_assoc($eventos);
    if (!isset(
$nested_eventos)) {
      
$nested_eventos1;
    }
    if (isset(
$row_eventos) && is_array($row_eventos) && $nested_eventos++ % 3==0) {
      echo 
"</tr><tr>";
    }
  } while (
$row_eventos); //end horizontal looper version 3
?>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#ACC8E3"><span class="Estilo1"><span class="Estilo3">1</span>.<span class="Estilo2">00</span></span></td>
    <td width="94%" bgcolor="#ACC8E3" class="Estilo2"><table width="100%" border="0" cellpadding="1">
      <tr>
        <?php
  
do { // horizontal looper version 3
?>
          <td bgcolor="#89B0D8"><?php echo $row_even1['coment_ev']; ?> <span class="Estilo3">+</span></td>
          <?php
    $row_even1 
mysql_fetch_assoc($even1);
    if (!isset(
$nested_even1)) {
      
$nested_even11;
    }
    if (isset(
$row_even1) && is_array($row_even1) && $nested_even1++ % 3==0) {
      echo 
"</tr><tr>";
    }
  } while (
$row_even1); //end horizontal looper version 3
?>
      </tr>
    </table></td>
  </tr>
  
  <tr>
    
//no he podido poner el jemplo entero ya que son muchos carateres, pero bueno creo que la idea esta clara.

      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
un saludo y si alguien me quiere echar una mano se lo agradezco.