Ayudame

pepe
12 de Diciembre del 2003
include(\\\\\\\"conexpg.php\\\\\\\");

$qu = pg_exec (\\\\\\\"SELECT hopridia,hosegdia,hoterdia from horxcic where hocodcic=\\\\\\\\'2308\\\\\\\\' order by hopridia\\\\\\\");

function fechas ($ls_array)
{

$row = 0;
echo \\\\\\\"<pre>\\\\\\\";

while ($data = pg_fetch_object($qu))
{
$p1=substr($data->hopridia,0,1);
$p2=substr($data->hopridia,1,2);
$p3=substr($data->hopridia,3,2);

$s1=substr($data->hosegdia,0,1);
$s2=substr($data->hosegdia,1,2);
$s3=substr($data->hosegdia,3,2);

$t1=substr($data->hoterdia,0,1);
$t2=substr($data->hoterdia,1,2);
$t3=substr($data->hoterdia,3,2);

switch ($p1)
{
case \\\\\\\\'L\\\\\\\\':$ls_rpta= \\\\\\\"Lunes $p2-$p3 \\\\\\\";break;
case \\\\\\\\'M\\\\\\\\':$ls_rpta= \\\\\\\"Martes $p2-$p3 \\\\\\\";break;
case \\\\\\\\'R\\\\\\\\':$ls_rpta= \\\\\\\"Miercoles $p2-$p3 \\\\\\\";break;
case \\\\\\\\'J\\\\\\\\':$ls_rpta= \\\\\\\"Jueves $p2-$p3 \\\\\\\";break;
case \\\\\\\\'V\\\\\\\\':$ls_rpta= \\\\\\\"Viernes $p2-$p3 \\\\\\\";break;
case \\\\\\\\'S\\\\\\\\':$ls_rpta= \\\\\\\"Sabado $p2-$p3 \\\\\\\";break;
case \\\\\\\\'D\\\\\\\\':$ls_rpta= \\\\\\\"Domingo $p2-$p3 \\\\\\\";break;
}
switch ($s1)
{
case \\\\\\\\'L\\\\\\\\':$ls_rpta2= \\\\\\\"Lunes $s2-$s3 \\\\\\\";break;
case \\\\\\\\'M\\\\\\\\':$ls_rpta2= \\\\\\\"Martes $s2-$s3 \\\\\\\";break;
case \\\\\\\\'R\\\\\\\\':$ls_rpta2= \\\\\\\"Miercoles $s2-$s3 \\\\\\\";break;
case \\\\\\\\'J\\\\\\\\':$ls_rpta2= \\\\\\\"Jueves $s2-$s3 \\\\\\\";break;
case \\\\\\\\'V\\\\\\\\':$ls_rpta2= \\\\\\\"Viernes $s2-$s3 \\\\\\\";break;
case \\\\\\\\'S\\\\\\\\':$ls_rpta2= \\\\\\\"Sabado $s2-$s3 \\\\\\\";break;
case \\\\\\\\'D\\\\\\\\':$ls_rpta2= \\\\\\\"Domingo $s2-$s3 \\\\\\\";break;
}
switch ($t1)
{
case \\\\\\\\'L\\\\\\\\':$ls_rpta3= \\\\\\\"Lunes $t2-$t3 \\\\\\\";break;
case \\\\\\\\'M\\\\\\\\':$ls_rpta3= \\\\\\\"Martes $t2-$t3 \\\\\\\";break;
case \\\\\\\\'R\\\\\\\\':$ls_rpta3= \\\\\\\"Miercoles $t2-$t3 \\\\\\\";break;
case \\\\\\\\'J\\\\\\\\':$ls_rpta3= \\\\\\\"Jueves $t2-$t3 \\\\\\\";break;
case \\\\\\\\'V\\\\\\\\':$ls_rpta3= \\\\\\\"Viernes $t2-$t3 \\\\\\\";break;
case \\\\\\\\'S\\\\\\\\':$ls_rpta3= \\\\\\\"Sabado $t2-$t3 \\\\\\\";break;
case \\\\\\\\'D\\\\\\\\':$ls_rpta3= \\\\\\\"Domingo $t2-$t3 \\\\\\\";break;
}

// $pantalla .= $ls_rpta;
//$pantalla .= $ls_rpta2;
//$pantalla .= $ls_rpta3.\\\\\\\"<br>\\\\\\\";


//echo $ls_rpta;
//echo $ls_rpta2;
//echo $ls_rpta3.\\\\\\\"<br>\\\\\\\";

$row++;

$ls_rpta2=\\\\\\\"\\\\\\\";
$ls_rpta3=\\\\\\\"\\\\\\\";
}
echo \\\\\\\"</PRE>\\\\\\\";
//pg_freeResult ($qu);
$ls_array=array($ls_rpta,$ls_rpta2,$ls_rpta3);
return $ls_array;
}
print( fechas($ls_array));

como me podria devolver el listado ... son 3 filas ejm
M0813 -R0813 - J0913
MARTES 08 - 13 - MIERCOLES 08 - 13 JUEVES 09 -13
ESPERO QU ME ENTIENDAN