Prueba

[insert_php]
global $id, $tipo, $query, $querya, $queryb, $queryc, $result, $resulta, $resultb, $resultc, $contenido, $contenidoa, $contenidob, $contenidoc, $idgrab, $reg, $prog, $reproductor, $nombre, $nombrea, $descprog, $descgrab, $idloc, $locutor, $idprod, $productor, $categoria, $temp, $tempa, $contador, $emision, $emisiona, $fecemision, $fecemisiona, $dbhost, $dbuser, $dbpass, $dbname, $conn, $textemp, $combo, $opcion, $contador;

$dbhost = ‘db545638665.db.1and1.com’;
$dbuser = ‘dbo545638665’;
$dbpass = ‘El_escritor1’;
$dbname = ‘db545638665’;
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error al conectarse a MySQL’);
mysql_select_db($dbname);

$id = $_GET[‘audio’];
$prog = $_GET[‘prog’];
$tipo = $_GET[‘tipo’];
$combo = “”;

if($tipo == 1){
$query = “SELECT P.Nombre as Programa, P.Descripcion as DescPrograma, GP.Descripcion as DescGrabacion, L.ID as IdLocutor, L.Nombre as Locutor, Prod.ID as IdProductor, Prod.Nombre as Productor, Cat.Nombre as Categoria, GP.Liga as Liga, GP.Temporada as Temporada, GP.Emision as Emision, GP.Fecha as FechaEmision FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma INNER JOIN Locutores L ON L.ID = GP.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GP.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GP.IdCategoria WHERE GP.ID = ‘” . $id . “‘ AND GP.EnServidor = 1 ORDER BY GP.Emision ASC”;
$querya = “SELECT COUNT(GP.ID) As Contador FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma WHERE GP.ID <> ‘” . $id . “‘ AND GP.IdPrograma = ” . $prog . ” AND GP.EnServidor = 1″;
$queryb = “SELECT DISTINCT GP.Temporada As Temporada, CONCAT(GP.Temporada, ‘ª Temporada ‘) As DescTemporada FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma INNER JOIN Locutores L ON L.ID = GP.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GP.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GP.IdCategoria WHERE GP.IdPrograma = ” . $prog . ” AND GP.EnServidor = 1 ORDER BY GP.Emision ASC”;
}if($tipo == 2){
$query = “SELECT C.Nombre as Programa, C.Descripcion as DescPrograma, GC.Descripcion as DescGrabacion, L.ID as IdLocutor, L.Nombre as Locutor, Prod.ID as IdProductor, Prod.Nombre as Productor, Cat.Nombre as Categoria, GC.Liga as Liga, GC.Temporada as Temporada, GC.Emision as Emision, GC.Fecha as FechaEmision FROM GrabacionesCapsulas GC INNER JOIN Capsulas C ON C.ID = GC.IdCapsula INNER JOIN Locutores L ON L.ID = GC.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GC.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GC.IdCategoria WHERE GC.ID = ‘” . $id . “‘ AND GC.EnServidor = 1 ORDER BY GC.Emision ASC”;
$querya = “SELECT COUNT(GC.ID) As Contador FROM GrabacionesCapsulas GC INNER JOIN Capsulas C ON C.ID = GC.IdCapsula WHERE GC.ID <> ‘” . $id . “‘ AND GC.IdCapsula = ” . $prog . ” AND GC.EnServidor = 1″;
$queryb = “SELECT DISTINCT GC.Temporada As Temporada, CONCAT(GC.Temporada, ‘ª Temporada ‘) AS DescTemporada FROM GrabacionesCapsulas GC INNER JOIN Capsulas C ON C.ID = GC.IdCapsula INNER JOIN Locutores L ON L.ID = GC.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GC.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GC.IdCategoria WHERE GC.IdCapsula = ” . $prog . ” AND GC.EnServidor = 1 ORDER BY GC.Emision ASC”;
}if($tipo == 3){
$query = “SELECT ‘Grabaciones Diversas’ as Programa, ‘Aquí se muestran grabaciones diversas’ as DescPrograma, GD.Descripcion as DescGrabacion, GD.VariosInterpretes as IdLocutor, GD.Interprete as Locutor, GD.VariosCompositores as IdProductor, GD.Compositor as Productor, ‘0’ as Categoria, GD.Liga as Liga, ‘0’ as Temporada, ‘0’ as Emision, GD.Fecha as FechaEmision FROM GrabacionesDiversas GD WHERE GD.ID = ‘” . $id . “‘ AND GD.EnServidor = 1 ORDER BY GD.ID ASC”;
$querya = “SELECT COUNT(GD.ID) As Contador FROM GrabacionesDiversas GD WHERE GD.ID <> ‘” . $id . “‘ AND GD.EnServidor = 1”;
$queryb = “SELECT DISTINCT Clave FROM GrabacionesDiversas GD WHERE Clave = ‘” . $prog . “‘ AND GD.EnServidor = 1 ORDER BY GD.ID ASC”;
}if($tipo == 4){
$query = “SELECT S.Nombre as Programa, S.Descripcion as DescPrograma, GS.Descripcion as DescGrabacion, L.ID as IdLocutor, L.Nombre as Locutor, Prod.ID as IdProductor, Prod.Nombre as Productor, Cat.Nombre as Categoria, GS.Liga as Liga, GS.Temporada as Temporada, GS.Emision as Emision, GS.Fecha as FechaEmision FROM GrabacionesSeries GS INNER JOIN Series S ON S.ID = GS.IdSerie INNER JOIN Locutores L ON L.ID = GS.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GS.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GS.IdCategoria WHERE GS.ID = ‘” . $id . “‘ AND GS.EnServidor = 1 ORDER BY GS.Emision ASC”;
$querya = “SELECT COUNT(GS.ID) As Contador FROM GrabacionesSeries GS INNER JOIN Series S ON S.ID = GS.IdSerie WHERE GS.ID <> ‘” . $id . “‘ AND GS.IdSerie = ” . $prog . ” AND GS.EnServidor = 1″;
$queryb = “SELECT DISTINCT GS.Temporada As Temporada, CONCAT(GS.Temporada, ‘ª Temporada ‘) As DescTemporada FROM GrabacionesSeries GS INNER JOIN Series S ON S.ID = GS.IdSerie INNER JOIN Locutores L ON L.ID = GS.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GS.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GS.IdCategoria WHERE GS.IdSerie = ” . $prog . ” AND GS.EnServidor = 1 ORDER BY GS.Emision ASC”;
}if($tipo == 5){
$query = “SELECT ‘Grabaciones de Eventos’ as Programa, GE.Nombre as DescPrograma, GE.Descripcion as DescGrabacion, GE.VariosInterpretes as IdLocutor, GE.Interprete as Locutor, GE.VariosCompositores as IdProductor, GE.Compositor as Productor, ‘0’ as Categoria, GE.Liga as Liga, ‘0’ as Temporada, ‘0’ as Emision, GE.Fecha as FechaEmision FROM GrabacionesEventos GE WHERE GE.ID = ‘” . $id . “‘ AND GE.EnServidor = 1 ORDER BY GE.ID ASC”;
$querya = “SELECT COUNT(GE.ID) As Contador FROM GrabacionesEventos GE WHERE GE.ID <> ‘” . $id . “‘ AND GE.EnServidor = 1”;
$queryb = “SELECT DISTINCT Clave FROM GrabacionesEventos GE WHERE Clave = ‘” . $prog . “‘ AND GE.EnServidor = 1 ORDER BY GE.ID ASC”;
}

$result = mysql_query($query) or die(‘Error, el query 1 falló: ‘ . $query);
$contenido = mysql_fetch_array($result, MYSQL_ASSOC);
$nombre = $contenido[‘Programa’];
$descprog = $contenido[‘DescPrograma’];
$descgrab = $contenido[‘DescGrabacion’];
$idloc = $contenido[‘IdLocutor’];
$locutor = $contenido[‘Locutor’];
$idprod = $contenido[‘IdProductor’];
$productor = $contenido[‘Productor’];
$categoria = $contenido[‘Categoria’];
$temp = $contenido[‘Temporada’];
$emision = $contenido[‘Emision’];
$fecemision = $contenido[‘FechaEmision’];
$reproductor = ““;
$reproductor = ““;

if($tipo==1){
echo “Regresar a "Programas"“;
}
if($tipo==2){
echo “Regresar a "Cápsulas"“;
}
if($tipo==3){
echo “Regresar a "Grabaciones Diversas"“;
}
if($tipo==4){
echo “Regresar a "Series"“;
}
if($tipo==5){
echo “Regresar a "Eventos"“;
}

if($tipo==1 && $prog<=7){ echo "

” . $nombre . “

“;
echo “

” . $reproductor;
}
if($tipo==1 && $prog==8){
echo “

” . $nombre . “

“;
echo “

” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==1 && $prog>=9){
if($tipo==1 && $prog<=13){ echo "

” . $nombre . “

“;
echo “

” . $temp . “ª Temporada ” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==1 && $prog==14){
echo “

” . $nombre . “

“;
echo “

” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==1 && $prog>=15){
echo “

” . $nombre . “

“;
echo “

” . $temp . “ª Temporada ” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
}
if($tipo==2 && $prog<>4){
echo “

” . $nombre . “

“;
echo “

” . $temp . “ª Temporada ” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==2 && $prog==4){
echo “

” . $nombre . “

“;
echo “

” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==3){
echo “

Grabaciones diversas

“;
echo “

” . $descgrab . ” (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==4){
echo “

” . $nombre . “

“;
echo “

” . $temp . “ª Temporada ” . $emision . “ª Emisión (” . $fecemision . “)

“;
echo “

” . $reproductor;
}
if($tipo==5){
echo “

” . $nombre . “

“;
echo “

” . $descprog . ” (” . $fecemision . “)

“;
echo “

” . $reproductor;
}

echo “

    “;

    $resultb = mysql_query($queryb) or die(‘Error, el query 3 falló: ‘ . $queryb);
    while($contenidob = mysql_fetch_array($resultb)){

    if($tipo==1 && $prog<>8 && $prog<>14){
    $queryc = “SELECT GP.ID as IdGrab, GP.Emision AS Emision, GP.Liga As Vinculo, CONCAT(GP.Emision, ‘ª Emisión ‘, ‘(‘, GP.Fecha, ‘)’) as NombreFecha FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma INNER JOIN Locutores L ON L.ID = GP.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GP.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GP.IdCategoria WHERE GP.IdPrograma = ” . $prog . ” AND GP.Temporada = ” . $contenidob[‘Temporada’] . ” AND GP.EnServidor = 1 ORDER BY GP.Temporada, GP.Emision”;
    $opcion = 1;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==1 && $prog==8){
    $queryc = “SELECT GP.ID as IdGrab, GP.Emision AS Emision, GP.Liga As Vinculo, CONCAT(GP.Emision, ‘ª Emisión ‘, ‘(‘, GP.Fecha, ‘)’) as NombreFecha FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma INNER JOIN Locutores L ON L.ID = GP.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GP.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GP.IdCategoria WHERE GP.IdPrograma = ” . $prog . ” AND GP.Temporada = ” . $contenidob[‘Temporada’] . ” AND GP.EnServidor = 1 ORDER BY GP.Temporada, GP.Emision”;
    $opcion = 2;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==1 && $prog==14){
    $queryc = “SELECT GP.ID as IdGrab, GP.Emision AS Emision, GP.Liga As Vinculo, CONCAT(GP.Emision, ‘ª Emisión ‘, ‘(‘, GP.Fecha, ‘)’) as NombreFecha FROM GrabacionesProgramas GP INNER JOIN Programas P ON P.ID = GP.IdPrograma INNER JOIN Locutores L ON L.ID = GP.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GP.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GP.IdCategoria WHERE GP.IdPrograma = ” . $prog . ” AND GP.Temporada = ” . $contenidob[‘Temporada’] . ” AND GP.EnServidor = 1 ORDER BY GP.Temporada, GP.Emision”;
    $opcion = 3;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==2 && $prog<>4){
    $queryc = “SELECT GC.ID as IdGrab, GC.Emision AS Emision, GC.Liga As Vinculo, CONCAT(GC.Emision, ‘ª Emisión ‘, ‘(‘, GC.Fecha, ‘)’) as NombreFecha FROM GrabacionesCapsulas GC INNER JOIN Capsulas C ON C.ID = GC.IdCapsula INNER JOIN Locutores L ON L.ID = GC.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GC.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GC.IdCategoria WHERE GC.IdCapsula = ” . $prog . ” AND GC.Temporada = ” . $contenidob[‘Temporada’] . ” AND GC.EnServidor = 1 ORDER BY GC.Emision ASC”;
    $opcion = 4;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==2 && $prog==4){
    $queryc = “SELECT GC.ID as IdGrab, GC.Emision AS Emision, GC.Liga As Vinculo, CONCAT(GC.Emision, ‘ª Emisión ‘, ‘(‘, GC.Fecha, ‘)’) as NombreFecha FROM GrabacionesCapsulas GC INNER JOIN Capsulas C ON C.ID = GC.IdCapsula INNER JOIN Locutores L ON L.ID = GC.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GC.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GC.IdCategoria WHERE GC.IdCapsula = ” . $prog . ” AND GC.Temporada = ” . $contenidob[‘Temporada’] . ” AND GC.EnServidor = 1 ORDER BY GC.Emision ASC”;
    $opcion = 5;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==3){
    $queryc = “SELECT DISTINCT GD.ID as IdGrab, CONCAT(GD.Descripcion, ‘ (‘, GD.Fecha, ‘)’) as NombreFecha, GD.Liga As Vinculo FROM GrabacionesDiversas GD WHERE Clave = ‘” . $contenidob[‘Clave’] . “‘ AND GD.EnServidor = 1 ORDER BY GD.ID ASC”;
    $opcion = 6;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==4){
    $queryc = “SELECT GS.ID as IdGrab, GS.Emision AS Emision, GS.Liga As Vinculo, CONCAT(GS.Emision, ‘ª Emisión ‘, ‘(‘, GS.Fecha, ‘)’) as NombreFecha FROM GrabacionesSeries GS INNER JOIN Series S ON S.ID = GS.IdSerie INNER JOIN Locutores L ON L.ID = GS.IdLocutor INNER JOIN Productores Prod ON Prod.ID = GS.IdProductor INNER JOIN Categorias Cat ON Cat.ID = GS.IdCategoria WHERE GS.IdSerie = ” . $prog . ” AND GS.Temporada = ” . $contenidob[‘Temporada’] . ” AND GS.EnServidor = 1 ORDER BY GS.ID ASC”;
    $opcion = 7;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidob[‘DescTemporada’] . ” ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }if($tipo==5){
    $queryc = “SELECT DISTINCT GE.ID as IdGrab, CONCAT(GE.Nombre, ‘ (‘, GE.Fecha, ‘)’) as NombreFecha, GE.Liga As Vinculo FROM GrabacionesEventos GE WHERE Clave = ‘” . $contenidob[‘Clave’] . “‘ AND GE.EnServidor = 1 ORDER BY GE.ID ASC”;
    $opcion = 8;
    $resultc = mysql_query($queryc) or die(‘Error, el query 3 falló: ‘ . $queryc);
    while($contenidoc = mysql_fetch_array($resultc)){
    if($contenidoc[‘IdGrab’] <> $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }if($contenidoc[‘IdGrab’] == $id){
    echo “

  • ” . $contenidoc[‘NombreFecha’] . “
  • “;
    }
    }
    }
    }

    echo “

“;

if($tipo==1){
echo “Regresar a "Programas"“;
}
if($tipo==2){
echo “Regresar a "Cápsulas"“;
}
if($tipo==3){
echo “Regresar a "Grabaciones Diversas"“;
}
if($tipo==4){
echo “Regresar a "Series"“;
}
if($tipo==5){
echo “Regresar a "Eventos"“;
}

echo ““;
[/insert_php]

Deja una respuesta

Tu dirección de correo electrónico no será publicada.

Cargando Captcha...

PHP Code Snippets Powered By : XYZScripts.com