First commit ~0,10
This commit is contained in:
337
adm/artistas.php
Normal file
337
adm/artistas.php
Normal file
@ -0,0 +1,337 @@
|
||||
<?
|
||||
if ( $user_auth && $user_level <= -1 )
|
||||
{
|
||||
$blq1 ="Nombre,Apellido,Instrumento,url,comentario";
|
||||
$blq2 ="e_Mail,NIF,Calle,Localidad,Provincia,CP,Telefono1,Telefono2,FechaNacimiento";
|
||||
|
||||
$list = true;
|
||||
|
||||
if ( isset( $sins ) )
|
||||
{
|
||||
displayForm( "./?dgo=adm/artistas.php&ins=new" );
|
||||
$list = false;
|
||||
}
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id,$blq1,$blq2 FROM artistas WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array( $res );
|
||||
|
||||
list( $db_id, $db_nombre,$db_apellidos,$db_instrumento,$db_url,$db_comentario,
|
||||
$db_email,$db_nif,$db_calle,$db_localidad,$db_provincia,$db_cp,$db_tlf1,$db_tlf2,$db_fechaN ) = $datos;
|
||||
|
||||
displayForm( "./?dgo=adm/artistas.php&mod=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto_mime='$imgData_name', Foto_w='$db_Foto_w', Foto_h='$db_Foto_h'";
|
||||
}
|
||||
|
||||
$sql = "UPDATE artistas SET ".
|
||||
"Nombre='$db_nombre' ".
|
||||
",Apellido='$db_apellidos' ".
|
||||
",Instrumento='$db_instrumento' ".
|
||||
",url='$db_url' ".
|
||||
",comentario='".urlencode($db_comentario)."' ".
|
||||
|
||||
",e_Mail='$db_email' ".
|
||||
",NIF='$db_nif' ".
|
||||
",Calle='$db_calle' ".
|
||||
",Localidad='$db_localidad' ".
|
||||
",Provincia='$db_provincia' ".
|
||||
",CP='$db_cp' ".
|
||||
",Telefono1='$db_tlf1' ".
|
||||
",Telefono2='$db_tlf2' ".
|
||||
",FechaNacimiento='$db_ano/$db_mes/$db_dia' $addsql_p1".
|
||||
" WHERE id=$mod";
|
||||
$res = @mysql_query( $sql, $conexion );
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
$imgDEL = "db/artistas/$mod"."_i001@*";
|
||||
echo `rm -rf $imgDEL`;
|
||||
fwrite( fopen("db/artistas/".$mod."_i001@$imgData_name", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $ins ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto_mime, Foto_w, Foto_h";
|
||||
$addsql_p2 = ",'$imgData_name', '$db_Foto_w', '$db_Foto_h'";
|
||||
}
|
||||
$sql = "INSERT INTO artistas (FAlta, $blq1,$blq2 $addsql_p1) VALUES (NOW(),'$db_nombre','$db_apellidos','$db_instrumento','$db_url','".urlencode($db_comentario).
|
||||
"','$db_email','$db_nif','$db_calle','$db_localidad','$db_provincia','$db_cp','$db_tlf1','$db_tlf2','$db_ano/$db_mes/$db_dia' $addsql_p2)";
|
||||
$res = @mysql_query( $sql, $conexion ) OR die( "Error<br>".@mysql_error($conexion) );
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
fwrite( fopen("db/artistas/".$last_id."_i001@$imgData_name", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
|
||||
}
|
||||
|
||||
echo "<h1>Artista insertado</h1><br><br><br>";
|
||||
echo "<p class=remark>ID asignado = ".@mysql_insert_id($conexion)."</p>";
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $del ) )
|
||||
{
|
||||
$imgDEL = "db/artistas/$del"."_i001*";
|
||||
echo `rm -rf $imgDEL`;
|
||||
|
||||
$res = @mysql_query( "DELETE FROM artistas WHERE id=$del" );
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if ( isset( $list ) && $list )
|
||||
{
|
||||
if ( !isset($orderBy) ) $orderBy ="id";
|
||||
if ( !isset($orderDir) ) $orderDir ="ASC";
|
||||
|
||||
displayList($conexion, $orderBy, $orderDir);
|
||||
}
|
||||
displayMenu();
|
||||
}
|
||||
|
||||
|
||||
function displayList($cnx, $orderBy, $orderDir)
|
||||
{
|
||||
$thisLOCATION = "./?dgo=adm/artistas.php";
|
||||
$res = @mysql_query( "SELECT id, CONCAT(Apellido,', ',Nombre) Nombre, Telefono1, Telefono2 FROM artistas ORDER BY $orderBy $orderDir" );
|
||||
|
||||
echo "<br><br><br><table width=100% cellpadding=0 cellspacing=0 class=td_lista>";
|
||||
|
||||
echo "<td class=menuL>id <a href=\"$thisLOCATION&oderBy=id&orderDir=DESC\"><img src=\"images/actions/down.gif\" border=0></a><a href=\"$thisLOCATION&oderBy=id&orderDESC=ASC\"><img src=\"images/actions/up.gif\" border=0></a></td>".
|
||||
"<td class=menuL>Nombre <a href=\"$thisLOCATION&oderBy=Apellidos+Nombre&orderDir=DESC\"><img src=\"images/actions/down.gif\" border=0></a><a href=\"$thisLOCATION&oderBy=Apellidos+Nombre&orderDESC=ASC\"><img src=\"images/actions/up.gif\" border=0></a></td>".
|
||||
"<td class=menuL>Telefonos</td>".
|
||||
"<td class=menuL>Borrar</td>";
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_id, $db_nombre, $db_tlf1, $db_tlf2 )= $datos;
|
||||
echo "<tr><td><a href=\"./?dgo=adm/artistas.php&smod=$db_id\">$db_id</a></td><td>$db_nombre</td><td>$db_tlf1 # $db_tlf2</td><td><a href=\"javascript::deleteUser($db_id)\"><img src=\"images/actions/cancel.gif\" border=0></a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo '<script language="JavaScript">
|
||||
function deleteUser( which )
|
||||
{
|
||||
var submitOK = confirm("Atencion: Esta a punto de eliminar al artista.");
|
||||
if ( submitOK )
|
||||
document.location.href = "'.$thisLOCATION.'&orderBy='.$orderBy.'&orderDir='.$orderDir.'&del="+which;
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
function displayMenu()
|
||||
{
|
||||
echo '<hr noshade color="#800000">';
|
||||
echo '<p align="center"><a href="./?dgo=adm/artistas.php&sins=new">Insertar nuevo artista</a></p>';
|
||||
echo '<hr noshade color="#800000">';
|
||||
}
|
||||
|
||||
function displayForm( $form_action )
|
||||
{
|
||||
global $db_nombre, $db_apellidos, $db_instrumento, $db_url, $db_comentario;
|
||||
global $db_email, $db_nif, $db_calle, $db_localidad, $db_provincia, $db_cp, $db_tlf1, $db_tlf2, $db_fechaN;
|
||||
global $imgData;
|
||||
|
||||
// Dividimos la fecha de nacimiento en DIA/MES/A<>O
|
||||
$db_dia = substr($db_fechaN, 8, 2 );
|
||||
$db_mes = substr($db_fechaN, 5, 2 );
|
||||
$db_ano = substr($db_fechaN, 0, 4 );
|
||||
|
||||
echo '<form action="'.$form_action.'" method="POST" name="register" enctype="multipart/form-data" onsubmit="return validateform( this.form )">';
|
||||
echo '<p align="center"> </p><div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="100%">';
|
||||
echo '<tr>
|
||||
<td><h1>Datos del artista</h1>
|
||||
<p> </p>
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
width="100%" bgcolor="#800000">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td width="30%">Nombre:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_nombre"
|
||||
value="'.$db_nombre.'"></td>
|
||||
<td valign="top" rowspan="5" width="50%"
|
||||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||||
del artista</strong><p>Estos son los datos
|
||||
que cualquier usuario de la p<>gina puede
|
||||
consultar. <br>
|
||||
(Cuando Escoja un disco y/o se muestre la
|
||||
informaci<63>n de un Grupo, saldran sus
|
||||
componentes y esta es la informaci<63>n de cada
|
||||
uno de ellos).</p>
|
||||
<p>ATENCION: <20><> Se admiten controles HTML
|
||||
!!, por lo que aconsejamos sea muy cuidadoso
|
||||
con los mismos.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Apellidos:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_apellidos"
|
||||
value="'. $db_apellidos .'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Instrumento:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_instrumento"
|
||||
value="'. $db_instrumento .'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" colspan=2>Fotografia:
|
||||
<input type="file" size="15"
|
||||
name="imgData"
|
||||
value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>url:</td>
|
||||
<td><input type="text" size="15"
|
||||
name="db_url" value="'.$db_url.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" width="30%">Comentarios
|
||||
adicionales:<p><textarea name="db_comentario" rows="5"
|
||||
cols="40">'.urldecode($db_comentario).'</textarea></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr noshade color="#800000">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td width="30%">email:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_email"
|
||||
value="'.$db_email.'"></td>
|
||||
<td valign="top" rowspan="9" width="50%"
|
||||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||||
de contacto</strong><p>Estos datos solo son
|
||||
accesibles por el administrador/es de la p<>gina.
|
||||
Por lo que nadie mas tendr<64> acceso a los
|
||||
mismos.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">NIF:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_nif"
|
||||
value="'.$db_nif.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Direcci<63>n:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_calle"
|
||||
value="'.$db_calle.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Localidad:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_localidad"
|
||||
value="'.$db_localidad.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Provincia:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_provincia"
|
||||
value="'.$db_provincia.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">C<>d. Postal:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_cp" value="'.$db_cp.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Telefono</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_tlf1"
|
||||
value="'.$db_tlf1.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Movil:</td>
|
||||
<td><input type="text" size="15"
|
||||
name="db_tlf2"
|
||||
value="'.$db_tlf2.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cumplea<65>os:</td>
|
||||
<td><select name="db_dia" size="1">
|
||||
<option>Dia...</option>';
|
||||
for ( $i=1;$i<32; $i++)
|
||||
{
|
||||
echo "<option "; if ( $i==$db_dia ) echo " SELECTED "; echo ">$i"; echo "</option>";
|
||||
}
|
||||
echo ' </select>
|
||||
<br>
|
||||
<select name="db_mes" size="1">
|
||||
<option>Mes...</option>
|
||||
<option value="1"'; if($db_mes==1)echo" selected "; echo '>Enero</option>
|
||||
<option value="2"'; if($db_mes==2)echo" selected "; echo '>Febrero</option>
|
||||
<option value="3"'; if($db_mes==3)echo" selected "; echo '>Marzo</option>
|
||||
<option value="4"'; if($db_mes==4)echo" selected "; echo '>Abril</option>
|
||||
<option value="5"'; if($db_mes==5)echo" selected "; echo '>Mayo</option>
|
||||
<option value="6"'; if($db_mes==6)echo" selected "; echo '>Junio</option>
|
||||
<option value="7"'; if($db_mes==7)echo" selected "; echo '>Julio</option>
|
||||
<option value="8"'; if($db_mes==8)echo" selected "; echo '>Agosto</option>
|
||||
<option value="9"'; if($db_mes==9)echo" selected "; echo '>Septiembre</option>
|
||||
<option value="10"'; if($db_mes==10)echo" selected "; echo '>Octubre</option>
|
||||
<option value="11"'; if($db_mes==11)echo" selected "; echo '>Noviembre</option>
|
||||
<option value="12"'; if($db_mes==12)echo" selected "; echo '>Diciembre</option>
|
||||
</select><br>
|
||||
<select name="db_ano" size="1">
|
||||
<option>A<>o...</option>';
|
||||
for($i=2003;$i>1900;$i--)
|
||||
{
|
||||
echo "<option"; if ( $i==$db_ano ) echo " SELECTED "; echo ">$i";echo "</option>";
|
||||
}
|
||||
echo '</select></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr noshade color="#800000">
|
||||
<p align="center"><input type="button" name="btCancelar" value="Cancelar"><input
|
||||
type="submit" name="B2" value="Enviar >>"></p>
|
||||
<p><script language="JavaScript"><!--
|
||||
|
||||
function validateform(wf)
|
||||
{
|
||||
|
||||
if (document.register.db_nombre.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce el nombre")
|
||||
return false;
|
||||
}
|
||||
if (document.register.db_nif.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce el NIF")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// --></script><br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center></div>
|
||||
</form>';
|
||||
}
|
||||
?>
|
0
adm/artistas.php~
Normal file
0
adm/artistas.php~
Normal file
BIN
adm/discos.php
Normal file
BIN
adm/discos.php
Normal file
Binary file not shown.
0
adm/discos.php~
Normal file
0
adm/discos.php~
Normal file
145
adm/editC.php
Normal file
145
adm/editC.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?
|
||||
require( "../addons/open_db.php" );
|
||||
require( "../addons/autenticate.php" );
|
||||
if ( ! $user_auth ) die( "<META CONTENT=\"0; URL=..\error.htm\" HTTP-EQUIV=\"REFRESH\"> ");
|
||||
|
||||
$showF = "";
|
||||
|
||||
|
||||
if ( isset( $delFt ) )
|
||||
{
|
||||
`rm -rf db/discos/$idd_c_$smod_$delFt_*`;
|
||||
@mysql_query( "UPDATE cancionesDisco SET $FIELD_T='' WHERE id=$smod");
|
||||
}
|
||||
|
||||
if ( isset( $idd ) )
|
||||
{
|
||||
if ( isset( $sins ) )
|
||||
$showF = "$PHP_SELF?idd=$idd&ins=new";
|
||||
if ( isset( $ins ) )
|
||||
{
|
||||
$FIELDS = "idd, posicion, duracion, titulo, autorMusica, autorLetra";
|
||||
$FVALUES= "'$idd', '$db_posicion', '$db_duracion', '$db_titulo', '$db_autorMusica', '$db_autorLetra'";
|
||||
$res = @mysql_query( "INSERT INTO cancionesDisco ($FIELDS) VALUES ($FVALUES)", $conexion );
|
||||
$ins = @mysql_insert_id($conexion);
|
||||
$showF = "$PHP_SELF?idd=$idd&mod=$ins";
|
||||
$smod = $ins;
|
||||
}
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
$VALUES = "posicion='$db_posicion', duracion='$db_duracion', titulo='$db_titulo', autorMusica='$db_autorMusica', autorLetra='$db_autorLetra'";
|
||||
$res = @mysql_query( "UPDATE cancionesDisco SET $VALUES WHERE id=$mod", $conexion ) OR Die("error ".mysql_error($conexion));
|
||||
$smod = $mod;
|
||||
}
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id, posicion, titulo, duracion, autorMusica, autorLetra, f_partitura, f_audio, f_letra, f_midi FROM cancionesDisco WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array($res);
|
||||
$showF = "$PHP_SELF?idd=$idd&mod=$smod";
|
||||
}
|
||||
if ( isset( $del ) )
|
||||
{
|
||||
`rm -rf db/discos/$idd_c_*`;
|
||||
@mysql_query( "DELETE FROM cancionesDisco WHERE id=$del", $conexion );
|
||||
echo "<html><head><script>self.close();</script></head></html>";
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty( $showF ) )
|
||||
{
|
||||
print_header();
|
||||
showForm($showF, $datos);
|
||||
print_footer();
|
||||
}
|
||||
mysql_close($conexion);
|
||||
|
||||
function showForm( $action, $datos )
|
||||
{
|
||||
global $idd;
|
||||
list( $db_id, $db_posicion, $db_titulo, $db_duracion, $db_autorMusica, $db_autorLetra, $db_fp, $db_fa, $db_fl, $db_fm ) = $datos;
|
||||
echo '<form method="POST" action="'.$action.'">
|
||||
<p><strong><u>Datos de la canci<63>n:</u></strong></p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>Posici<63>n:</td>
|
||||
<td><input type="text" size="15" name="db_posicion" value="'.$db_posicion.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Titulo:</td>
|
||||
<td><input type="text" size="15" name="db_titulo" value="'.$db_titulo.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Duraci<63>n</td>
|
||||
<td><input type="text" size="15" name="db_duracion" value="'.$db_duracion.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Autor Letra</td>
|
||||
<td><input type="text" size="15" name="db_autorLetra" value="'.$db_autorLetra.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Autor Musica</td>
|
||||
<td><input type="text" size="15" name="db_autorMusica" value="'.$db_autorMusica.'"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="center" colspan="2"><br><center>';
|
||||
if ( !empty($db_fp) ) echo "[ <a href='$PHP_SELF?idd=$idd&mod=$db_id&delFt=P'>-</a>".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=P', 320, 200);\">+</a>".
|
||||
" <a href='../db/discos/$idd"."_c_".$db_id."_P_"."$db_fp' target='_blank'>Partitura</a>".
|
||||
"] ";
|
||||
else if ( isset( $db_id ) )
|
||||
echo "[ - ".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft==P', 320, 200);\">+</a>".
|
||||
" Partitura ".
|
||||
" ] ";
|
||||
if ( !empty($db_fa) ) echo "[ <a href='$PHP_SELF?idd=$idd&mod=$db_id&delFt=A'>-</a>".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=A', 320, 200 );\">+</a>".
|
||||
" <a href='../db/discos/$idd"."_c_".$db_id."_A_"."$db_fa' target='_blank'>Audio</a>".
|
||||
"] ";
|
||||
else if ( isset( $db_id) )
|
||||
echo "[ - ".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=A', 320, 200 );\">+</a>".
|
||||
" Audio ".
|
||||
" ] ";
|
||||
|
||||
if ( !empty($db_fl) ) echo "[ <a href='$PHP_SELF?idd=$idd&mod=$db_id&delFt=L'>-</a>".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=L', 320, 200 );\">+</a>".
|
||||
" <a href='../db/discos/$idd"."_c_".$db_id."_L_"."$db_fl' target='_blank'>Letra</a>".
|
||||
"] ";
|
||||
else if ( isset( $db_id ) )
|
||||
echo "[ - ".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=L', 320, 200 );\">+</a>".
|
||||
" Letra ".
|
||||
" ] ";
|
||||
|
||||
if ( !empty($db_fm) ) echo "[ <a href='$PHP_SELF?idd=$idd&mod=$db_id&delFt=M'>-</a>".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=M', 320, 200 );\">+</a>".
|
||||
" <a href='../db/discos/$idd"."_c_".$db_id."_M_"."$db_fm' target='_blank'>Midi</a>".
|
||||
"] ";
|
||||
else if ( isset( $db_id ) )
|
||||
echo "[ - ".
|
||||
" <a href=\"javascript:abreVentana( selectFT, 'insertFC.php?idd=$idd&idc=$db_id&ft=M', 320, 200 );\">+</a>".
|
||||
" Midi ".
|
||||
" ] ";
|
||||
echo '</center></td>
|
||||
</tr>
|
||||
</table><br><center><input type="submit" value="enviar >>"></center>
|
||||
</form>';
|
||||
|
||||
}
|
||||
|
||||
function print_header()
|
||||
{
|
||||
echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Portal -web- --------------------------------------------------------------www.infdj.com-----------------------------------------------------------------------------------------------------</title>
|
||||
<link rel="stylesheet" type="text/css" href="../addons/estilo.css" body="../addons/estilo.css">
|
||||
<script language="JavaScript" src="../addons/misc.js"></script>
|
||||
<script language="JavaScript">var selectFT="selectFT";</script>
|
||||
</head>
|
||||
<body background="../images/bg.gif" text="#000000">';
|
||||
}
|
||||
|
||||
function print_footer()
|
||||
{
|
||||
echo '</body></html>';
|
||||
}
|
0
adm/editC.php~
Normal file
0
adm/editC.php~
Normal file
249
adm/estilos.php
Normal file
249
adm/estilos.php
Normal file
@ -0,0 +1,249 @@
|
||||
<?
|
||||
if ( $user_auth && $user_level <= -1 )
|
||||
{
|
||||
$blq1 ="parent,titulo,descr";
|
||||
|
||||
$list = true;
|
||||
|
||||
if ( isset( $sins ) )
|
||||
{
|
||||
displayForm( "./?dgo=adm/estilos.php&ins=new" );
|
||||
$list = false;
|
||||
}
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id,$blq1 FROM estilos WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array( $res );
|
||||
|
||||
list( $db_id, $db_parent,$db_titulo,$db_descr ) = $datos;
|
||||
|
||||
displayForm( "./?dgo=adm/estilos.php&mod=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto_mime='$imgData_type', Foto_w='$db_Foto_w', Foto_h='$db_Foto_h'";
|
||||
}
|
||||
$sql = "UPDATE estilos SET ".
|
||||
"parent='$db_parent' ".
|
||||
",titulo='$db_titulo' ".
|
||||
",descr='".urlencode($db_descr)."' $addsql_p1".
|
||||
" WHERE id=$mod";
|
||||
$res = @mysql_query( $sql, $conexion );
|
||||
$last_id = $mod;
|
||||
echo "Algunos datos:<br>";
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
|
||||
fwrite( fopen("db/estilos/".$last_id."_i001", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
|
||||
|
||||
}
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $ins ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto_mime, Foto_w, Foto_h";
|
||||
$addsql_p2 = ",'$imgData_type', '$db_Foto_w', '$db_Foto_h'";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO estilos ($blq1 $addsql_p1) VALUES ('$db_parent','$db_titulo','$db_descr' $addsql_p2)";
|
||||
$res = @mysql_query( $sql, $conexion ) OR die( "Error<br>".@mysql_error($conexion) );
|
||||
$last_id = @mysql_insert_id($conexion);
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
fwrite( fopen("db/estilos/".$last_id."_i001", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
|
||||
}
|
||||
echo "<h1>Estilo insertado</h1><br><br><br>";
|
||||
echo "<p class=remark>ID asignado = ".$last_id."</p>";
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $del ) )
|
||||
{
|
||||
if ( !unlink( "estilos/".$del."_i001" ) )
|
||||
echo "<h1>No he podido eliminar la imagen asociada:</h1><br><p class=remark>Borre el fichero: estilos/$del"."_i001 manualmente por favor...<br>";
|
||||
else
|
||||
echo "<li>Ficheros asociados eliminados</li>";
|
||||
|
||||
$res = @mysql_query( "UPDATE estilos SET parent='0' WHERE parent=$del", $conexion );
|
||||
echo "<li>Estilos heredados, descompuestos</li>";
|
||||
$res = @mysql_query( "DELETE FROM estilos WHERE id=$del", $conexion );
|
||||
echo "<li>Estilo $del, ELIMINADO</li><br>";
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if ( isset( $list ) && $list )
|
||||
{
|
||||
if ( !isset($orderBy) ) $orderBy ="id";
|
||||
if ( !isset($orderDir) ) $orderDir ="ASC";
|
||||
|
||||
echo "Listado de Estilos >> Ver listado<br><br>";
|
||||
displayList($conexion, $orderBy, $orderDir);
|
||||
}
|
||||
displayMenu();
|
||||
}
|
||||
|
||||
function cambiaProporciones()
|
||||
{
|
||||
global $db_Foto_w, $db_Foto_h;
|
||||
$W = 150; $H=150;
|
||||
|
||||
// Las proporciones correctas seran de 100x100
|
||||
// $db_Foto_w=50;
|
||||
// $db_Foto_h=50;
|
||||
|
||||
if ( $db_Foto_w > 0 )
|
||||
{
|
||||
if ( $db_Foto_w > $db_Foto_h )
|
||||
{
|
||||
$db_Foto_h = intval(($db_Foto_h/$db_Foto_w)*$W); $db_Foto_w=$W;
|
||||
} else {
|
||||
$db_Foto_w = intval(($db_Foto_w/$db_Foto_h)*$H); $db_Foto_h=$H;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function displayList($cnx, $orderBy, $orderDir)
|
||||
{
|
||||
global $db_Foto_w, $db_Foto_h;
|
||||
|
||||
$thisLOCATION = "./?dgo=adm/estilos.php";
|
||||
$res = @mysql_query( "SELECT e.id, ep.titulo, e.titulo, e.descr, e.Foto_mime, e.Foto_w, e.Foto_h FROM estilos AS e LEFT JOIN estilos AS ep ON (ep.id=e.parent) ORDER BY e.$orderBy $orderDir", $cnx ) OR die( "Error<br>".@mysql_error($conexion) );;
|
||||
|
||||
$parity = true;
|
||||
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_id, $db_ptitulo, $db_titulo, $db_descr, $db_Foto_mime, $db_Foto_w, $db_Foto_h )= $datos;
|
||||
$parity = !$parity;
|
||||
|
||||
cambiaProporciones(/* $db_Foto_w, $db_Foto_h*/);
|
||||
$lBlq1 = "<img src=\"gimage.php?db=estilos&db_id=$db_id&db_mime=$db_Foto_mime\" width=\"$db_Foto_w\" height=\"$db_Foto_h\"><br>$db_titulo";
|
||||
$lBlq2 = "<p><a href=\"javascript:deleteUser($db_id)\" class=lmenuo>>> >Eliminar Estilo</a> ## "
|
||||
."<a href=\"$thisLOCATION&smod=$db_id\" class=lmenuo>>> >Modificar Estilo</a><br></p>";
|
||||
if ( $parity )
|
||||
echo "<table class=td_estilos><tr><td>$lBlq1</td><td>".urldecode($db_descr)."$lBlq2</td></tr></table><br><br>";
|
||||
else
|
||||
echo "<table class=td_estilos><tr><td>".urldecode($db_descr)."$lBlq2</td><td>$lBlq1</td></tr></table><br><br>";
|
||||
}
|
||||
|
||||
echo '<script language="JavaScript">
|
||||
function deleteUser( which )
|
||||
{
|
||||
var submitOK = confirm("Atencion: Esta a punto de eliminar el estilo.");
|
||||
if ( submitOK )
|
||||
document.location.href = "'.$thisLOCATION.'&orderBy='.$orderBy.'&orderDir='.$orderDir.'&del="+which;
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
function displayMenu()
|
||||
{
|
||||
echo '<hr noshade color="#800000">';
|
||||
echo '<p align="center"><a href="./?dgo=adm/estilos.php&sins=new">Insertar nuevo estilo</a></p>';
|
||||
echo '<hr noshade color="#800000">';
|
||||
}
|
||||
|
||||
function displayForm( $form_action )
|
||||
{
|
||||
global $db_parent, $db_titulo, $db_descr, $imgData;
|
||||
|
||||
echo '<form action="'.$form_action.'" method="POST" name="register" enctype="multipart/form-data" onsubmit="return validateform( this.form )">';
|
||||
echo '<p align="center"> </p><div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="100%">';
|
||||
echo '<tr>
|
||||
<td><h1>Datos del estilo</h1>
|
||||
<p> </p>
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
width="100%" bgcolor="#800000">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td width="30%">Titulo:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_titulo"
|
||||
value="'.$db_titulo.'"></td>
|
||||
<td valign="top" rowspan="3" width="50%"
|
||||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||||
del estilo</strong><p>Aqui van el titulo y descripci<63>n del estilo que esta definiendo. <br>
|
||||
Tambien puede agregar una imagen que represente este estilo. Recuerde que deberia ser JPG con un tama<6D>o de 50x50 m<>ximo.</p>
|
||||
<p>ATENCION: <20><> Se admiten controles HTML
|
||||
!!, por lo que aconsejamos sea muy cuidadoso
|
||||
con los mismos.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Padre:</td>
|
||||
<td width="20%"><select name="db_parent" size="1">
|
||||
<option value="0">ninguno</option>';
|
||||
|
||||
global $conexion;
|
||||
$resp = @mysql_query( "SELECT id, titulo FROM estilos WHERE parent ='0' Order By titulo", $conexion );
|
||||
while( $datos=@mysql_fetch_array($resp) )
|
||||
{
|
||||
list ( $epid, $eptit ) = $datos;
|
||||
echo "<option value=\"$epid\">$eptit</option>";
|
||||
}
|
||||
echo '</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="30%">Comentarios
|
||||
adicionales:<p><textarea name="db_descr" rows="5"
|
||||
cols="20">'.urldecode($db_descr).'</textarea></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Imagen:</td>
|
||||
<td width="20%" colspan="2">
|
||||
<input type="file" size="15" name="imgData"></td>
|
||||
</tr> </table>
|
||||
|
||||
<hr noshade color="#800000">
|
||||
<p align="center"><input type="button" name="btCancelar" value="Cancelar"><input
|
||||
type="submit" name="B2" value="Enviar >>"></p>
|
||||
|
||||
<p><script language="JavaScript"><!--
|
||||
|
||||
function validateform(wf)
|
||||
{
|
||||
|
||||
if (document.register.db_titulo.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce el titulo")
|
||||
return false;
|
||||
}
|
||||
if (document.register.db_descr.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce la descripcion")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// --></script><br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center></div>
|
||||
</form>';
|
||||
}
|
||||
?>
|
344
adm/grupos.php
Normal file
344
adm/grupos.php
Normal file
@ -0,0 +1,344 @@
|
||||
<?
|
||||
if ( $user_auth && $user_level <= -1 )
|
||||
{
|
||||
$blq1 ="ide, nombre, comentario, cache, equipoSonidoLuces, estadisticas, croquiMusicos, sugerenciasGrupo, contratacion";
|
||||
$list = true;
|
||||
|
||||
if ( isset( $sins ) )
|
||||
{
|
||||
displayForm( "./?dgo=adm/grupos.php&ins=new" );
|
||||
$list = false;
|
||||
}
|
||||
if( isset( $ins ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto, Foto_w, Foto_h";
|
||||
$addsql_p2 = ",'$imgData_name', '$db_Foto_w', '$db_Foto_h'";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO grupos (FAlta, $blq1 $addsql_p1) VALUES (NOW(), '$db_ide','$db_nombre','".urlencode($db_comentario)."','$db_cache','$db_equipoSonidoLuces', '$db_estadisticas', '$db_croquiMusicos', '$db_sugerenciasGrupo', '".urlencode($db_contratacion)."' $addsql_p2)";
|
||||
$res = @mysql_query( $sql, $conexion ) OR die( "Error<br>".@mysql_error($conexion) );
|
||||
$last_id = @mysql_insert_id($conexion);
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
fwrite( fopen("db/grupos/".$last_id."_i001@".$imgData_name, "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
|
||||
}
|
||||
echo "<h1>Grupo insertado</h1><br><br><br>";
|
||||
echo "<p class=remark>ID asignado = ".$last_id."<br>Agrege ahora los componentes del Grupo</p>";
|
||||
|
||||
displayForm( "./?dgo=adm/grupos.php&mod=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
|
||||
if ( isset( $insc ) )
|
||||
{
|
||||
|
||||
if ( isset( $db_ida ) && !empty( $db_ida ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id FROM artistas WHERE id='$db_ida'", $conexion );
|
||||
if ( @mysql_num_rows( $res ) > 0 )
|
||||
@mysql_query( "INSERT INTO componentesGrupo (idg, idp) VALUES ('$insc','$db_ida')", $conexion );
|
||||
}
|
||||
$smod = $insc;
|
||||
}
|
||||
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id,$blq1 FROM grupos WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array( $res );
|
||||
|
||||
list( $db_id, $db_ide, $db_nombre, $db_comentario, $db_cache,
|
||||
$db_equipoSonidoLuces, $db_estadisticas, $db_croquiMusicos,
|
||||
$db_sugerenciasGrupo, $db_contratacion ) = $datos;
|
||||
|
||||
echo "<a href='./?dgo=adm/grupos.php'>Listado de Grupos</a>-><a href='./?dgo=adm/discos.php&filter=$smod'>Sus Discos</a>->[<a href='./?dgo=adm/grupos.php&smod=$smod'>Refrescar</a>]";
|
||||
|
||||
displayForm( "./?dgo=adm/grupos.php&mod=$smod" );
|
||||
displayListC( $conexion, $smod, "./?dgo=adm/grupos.php&insc=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto='$imgData_name', Foto_w='$db_Foto_w', Foto_h='$db_Foto_h'";
|
||||
}
|
||||
|
||||
$sql = "UPDATE grupos SET ".
|
||||
"nombre='$db_nombre' ".
|
||||
",comentario='".urlencode($db_comentario)."' ".
|
||||
",cache='$db_cache'".
|
||||
",equipoSonidoLuces='$db_equipoSonidoLuces'".
|
||||
",estadisticas='$db_estadisticas'".
|
||||
",croquiMusicos='$db_croquiMusicos'".
|
||||
",sugerenciasGrupo='$db_sugerenciasGrupo'".
|
||||
",contratacion='".urlencode($db_contratacion)."'".
|
||||
" $addsql_p1".
|
||||
" WHERE id=$mod";
|
||||
$res = @mysql_query( $sql, $conexion );
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
|
||||
fwrite( fopen("db/grupos/".$mod."_i001@".$imgData_name, "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
}
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $del ) )
|
||||
{
|
||||
if ( !unlink( "grupos/".$del."_i001*" ) )
|
||||
echo "<h1>No he podido eliminar la imagen asociada:</h1><br><p class=remark>Borre el fichero: grupos/$del"."_i001 manualmente por favor...<br>";
|
||||
else
|
||||
echo "<li>Ficheros asociados eliminados</li>";
|
||||
|
||||
$res = @mysql_query( "UPDATE grupos SET parent='0' WHERE parent=$del", $conexion );
|
||||
echo "<li>grupos heredados, descompuestos</li>";
|
||||
$res = @mysql_query( "DELETE FROM grupos WHERE id=$del", $conexion );
|
||||
echo "<li>Estilo $del, ELIMINADO</li><br>";
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if ( isset( $list ) && $list )
|
||||
{
|
||||
if ( !isset($orderBy) ) $orderBy ="id";
|
||||
if ( !isset($orderDir) ) $orderDir ="ASC";
|
||||
|
||||
echo "Listado de grupos >> Ver listado<br><br>";
|
||||
displayList($conexion, $orderBy, $orderDir);
|
||||
}
|
||||
displayMenu();
|
||||
}
|
||||
|
||||
function cambiaProporciones()
|
||||
{
|
||||
global $db_Foto_w, $db_Foto_h;
|
||||
$W = 150; $H=150;
|
||||
|
||||
// Las proporciones correctas seran de 100x100
|
||||
// $db_Foto_w=50;
|
||||
// $db_Foto_h=50;
|
||||
|
||||
if ( $db_Foto_w > 0 )
|
||||
{
|
||||
if ( $db_Foto_w > $db_Foto_h )
|
||||
{
|
||||
$db_Foto_h = intval(($db_Foto_h/$db_Foto_w)*$W); $db_Foto_w=$W;
|
||||
} else {
|
||||
$db_Foto_w = intval(($db_Foto_w/$db_Foto_h)*$H); $db_Foto_h=$H;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function displayListC( $cnx, $idg, $url_form )
|
||||
{
|
||||
$res = @mysql_query( "SELECT a.id, CONCAT(a.nombre, ' ', a.apellido) AS Artista FROM componentesGrupo AS c LEFT JOIN artistas a ON( a.id=c.idp ) WHERE c.idg = " . $idg, $cnx );
|
||||
|
||||
echo "<br><br><br>";
|
||||
echo "<a name=\"componentes\"></a><form name='comp' method=POST action=$url_form"."#componentes><table width=100% cellpadding=0 cellspacing=0 class=\"td_lista\"><tr>";
|
||||
echo "<td class=menuL>id</td>";
|
||||
echo "<td class=menuL>Nombre del Artista</td>";
|
||||
echo "<td class=menuL>Borrar</td>";
|
||||
echo "</tr>";
|
||||
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_ida, $db_nomb ) = $datos;
|
||||
echo "<tr><td><a href=\"./?dgo=adm/artistas.php&smod=$db_ida\">$db_ida</a></td>";
|
||||
echo "<td>$db_nomb</td>";
|
||||
echo "<td><a href=\"./?dgo=adm/grupos.php$delc=$db_id\"><img src=\"images/actions/cancel.gif\" border=0></a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "<tr><td><br><br></td><td></td><td></td></tr>";
|
||||
echo "<tr><td> </td><td><input type=submit value=\"Nuevo artista\"> -= ID: <input type=text name=\"db_ida\" value=\"\"></td><td></td></tr>";
|
||||
echo "</table></form>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
function displayList($cnx, $orderBy, $orderDir, $filter)
|
||||
{
|
||||
$thisLOCATION = "./?dgo=adm/grupos.php";
|
||||
$res = @mysql_query( "SELECT g.id, g.nombre, e.titulo FROM grupos AS g LEFT JOIN estilos AS e ON (g.ide=e.id) $filter ORDER BY e.$orderBy $orderDir", $cnx ) OR die( "Error<br>".@mysql_error($cnx) );
|
||||
|
||||
$parity = true;
|
||||
|
||||
echo "<br><br><br><table width=100% cellpadding=0 cellspacing=0 class=td_lista><tr>";
|
||||
|
||||
echo "<td class=menuL>id <a href=\"$thisLOCATION&oderBy=id&orderDir=DESC\"><img src=\"images/actions/down.gif\" border=0></a><a href=\"$thisLOCATION&oderBy=id&orderDESC=ASC\"><img src=\"images/actions/up.gif\" border=0></a></td>".
|
||||
"<td class=menuL>Nombre del Grupo <a href=\"$thisLOCATION&oderBy=nombre&orderDir=DESC\"><img src=\"images/actions/down.gif\" border=0></a><a href=\"$thisLOCATION&oderBy=nombre&orderDESC=ASC\"><img src=\"images/actions/up.gif\" border=0></a></td>".
|
||||
"<td class=menuL>Estilo <a href=\"$thisLOCATION&oderBy=ide&orderDir=DESC\"><img src=\"images/actions/down.gif\" border=0></a><a href=\"$thisLOCATION&oderBy=ide&orderDESC=ASC\"><img src=\"images/actions/up.gif\" border=0></a></td>".
|
||||
"<td class=menuL>Borrar</td></tr>";
|
||||
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_id, $db_nombre, $db_estilo )= $datos;
|
||||
$parity = !$parity;
|
||||
|
||||
echo "<tr><td><a href=\"$thisLOCATION&smod=$db_id\">$db_id</a></td>" .
|
||||
"<td>$db_nombre</td>".
|
||||
"<td>$db_estilo</td>".
|
||||
"<td><a href=\"javascript::deleteID($db_id)\"><img src=\"images/actions/cancel.gif\" border=0></a></td></tr>";
|
||||
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo '<script language="JavaScript">
|
||||
function deleteID( which )
|
||||
{
|
||||
var submitOK = confirm("Atencion: Esta a punto de eliminar el grupo.");
|
||||
if ( submitOK )
|
||||
document.location.href = "'.$thisLOCATION.'&orderBy='.$orderBy.'&orderDir='.$orderDir.'&del="+which;
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
function displayMenu()
|
||||
{
|
||||
echo '<hr noshade color="#800000">';
|
||||
echo '<p align="center"><a href="./?dgo=adm/grupos.php&sins=new">Insertar nuevo grupo</a></p>';
|
||||
echo '<hr noshade color="#800000">';
|
||||
}
|
||||
|
||||
function displayForm( $form_action )
|
||||
{
|
||||
global $db_ide, $db_nombre, $db_comentario, $db_cache,
|
||||
$db_equipoSonidoLuces, $db_estadisticas, $db_croquiMusicos,
|
||||
$db_sugerenciasGrupo, $db_contratacion;
|
||||
|
||||
global $imgData;
|
||||
|
||||
echo '<form action="'.$form_action.'" method="POST" name="register" enctype="multipart/form-data" onsubmit="return validateform( this.form )">';
|
||||
echo '<p align="center"> </p><div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="100%">';
|
||||
echo '<tr>
|
||||
<td><h1>Datos del grupo</h1>
|
||||
<p> </p>
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
width="100%" bgcolor="#800000">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td width="30%">Grupo:</td>
|
||||
<td width="20%"><input type="text" size="15"
|
||||
name="db_nombre"
|
||||
value="'.$db_nombre.'"></td>
|
||||
<td valign="top" rowspan="3" width="50%"
|
||||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||||
del grupo</strong><p>Aqui van el nombre del grupo y descripci<63>n del mismo. <br>
|
||||
Tambien puede agregar una imagen que represente a este grupo. Recuerde que deberia ser JPG con un tama<6D>o de 50x50 m<>ximo. <br><br>No se olvide de asociar un estilo al grupo para que este pueda ser clasificado.</p>
|
||||
<p>ATENCION: <20><> Se admiten controles HTML
|
||||
!!, por lo que aconsejamos sea muy cuidadoso
|
||||
con los mismos.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%">Estilo:</td>
|
||||
<td width="20%"><select name="db_ide" size="1">
|
||||
<option value="0">ninguno</option>';
|
||||
|
||||
global $conexion;
|
||||
$resp = @mysql_query( "SELECT id, titulo FROM estilos WHERE parent ='0' Order By titulo", $conexion );
|
||||
while( $datos=@mysql_fetch_array($resp) )
|
||||
{
|
||||
list ( $epid, $eptit ) = $datos;
|
||||
echo "<option value=\"$epid\"";
|
||||
if ( $epid == $db_ide ) echo " SELECTED";
|
||||
echo ">$eptit</option>";
|
||||
}
|
||||
echo '</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="30%">Comentarios
|
||||
adicionales:<p><textarea name="db_comentario" rows="5"
|
||||
cols="20">'.urldecode($db_comentario).'</textarea></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Foto:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="file" size="15" name="imgData"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Cache:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="text" size="30" name="db_cache" value="'.$db_cache.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Equipo de sonido y luces:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="text" size="30" name="db_equipoSonidoLuces" value="'.$db_equipoSonidoLuces.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Estadisticas:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="text" size="30" name="db_estadisticas" value="'.$db_estadisticas.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%"> Croquis Musicos:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="text" size="30" name="db_croquiMusicos" value="'.$db_croquiMusicos.'"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="30%"> Sugerencias del Grupo:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<input type="text" size="30" name="db_sugerenciasGrupo" value="'.$db_sugerenciasGrupo.'"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="30%"> Contratacion:</td>
|
||||
<td width="70%" colspan="2">
|
||||
<textarea name="db_contratacion" rows="5" cols="30">'.urldecode($db_contratacion).'</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<hr noshade color="#800000">
|
||||
<p align="center"><input type="button" name="btCancelar" value="Cancelar"><input
|
||||
type="submit" name="B2" value="Enviar >>"></p>
|
||||
|
||||
<p><script language="JavaScript"><!--
|
||||
|
||||
function validateform(wf)
|
||||
{
|
||||
|
||||
if (document.register.db_nombre.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce el nombre del grupo")
|
||||
return false;
|
||||
}
|
||||
if (document.register.db_comentario.value=="")
|
||||
{
|
||||
window.alert ("Por favor, introduce algun comentario sobre este grupo")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// --></script><br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center></div>
|
||||
</form>';
|
||||
}
|
||||
?>
|
78
adm/insertFC.php
Normal file
78
adm/insertFC.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?
|
||||
require( "../addons/open_db.php" );
|
||||
require( "../addons/autenticate.php" );
|
||||
if ( ! $user_auth ) die( "<META CONTENT=\"0; URL=..\error.htm\" HTTP-EQUIV=\"REFRESH\"> ");
|
||||
|
||||
if ( !empty($imgData_name) && isset( $idd ) && isset( $idc ) && isset( $ft ) )
|
||||
{
|
||||
if ( $imgData_size > 0 )
|
||||
{
|
||||
copy( $imgData, "../db/discos/".$idd."_c_".$idc."_".$ft."_".$imgData_name );
|
||||
|
||||
/*
|
||||
fwrite( fopen( "../db/discos/".$idd."_c_".$idc."_".$ft."_".$imgData_name, "wb" ),
|
||||
fread(fopen($imgData,"rb"), $fsize), $fsize);
|
||||
*/
|
||||
} else {
|
||||
if ( strcmp($imgData_name, "ninguna" ) != 0 ) die("<script language=\"javascript\">window.close();</script>");
|
||||
}
|
||||
if ( strcmp( $ft, "A" ) == 0 ) $fte="f_audio";
|
||||
if ( strcmp( $ft, "P" ) == 0 ) $fte="f_partitura";
|
||||
if ( strcmp( $ft, "L" ) == 0 ) $fte="f_letra";
|
||||
|
||||
$res=@mysql_query( "SELECT $fte FROM cancionesDisco WHERE id='$idc'", $conexion ) OR die( mysql_error($conexion) );
|
||||
if ( @mysql_num_rows( $res ) > 0 )
|
||||
{
|
||||
$db_file = mysql_fetch_array( $res );
|
||||
unlink("../db/discos/".$idd."_c_".$idc."_".$ft."_".$db_file[0] );
|
||||
|
||||
}
|
||||
$sql_upd = "UPDATE cancionesDisco SET $fte = '$imgData_name'" .
|
||||
" WHERE id = ".$idc;
|
||||
$res = mysql_query( $sql_upd, $conexion ) OR die("No puedo modificar esta foto<br>$sql_upd<br>".mysql_error($conexion));
|
||||
mysql_close($conexion);
|
||||
|
||||
echo "<html><head></head><body onload='window.close();'><p>Procesando petici<63>n.<br>Por favor, espere...<br></body></html>";
|
||||
|
||||
} else {
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Portal -web- -FT------------------------------------------------------------ -www.infdj.com- ---------------------------------------------------------------------------------------------------- </title>
|
||||
<link href="skins/articulos.ico" rel="SHORTCUT ICON">
|
||||
<link rel="stylesheet" type="text/css" href="../addons/estilo.css" body="../addons/estilo.css">
|
||||
|
||||
<body background="../images/bg.gif" bgcolor="<?echo $bg_color ?>" text="#000000">
|
||||
|
||||
<div align="center"><center>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="340">
|
||||
<?
|
||||
if ( !isset( $idd ) )
|
||||
{
|
||||
echo "<tr><td>";
|
||||
echo "<br>Error procesando su petici<63>n.<br><li>ACCESO DENEGADO</li>";
|
||||
echo "</td></tr>";
|
||||
} else {
|
||||
echo "<tr></tr>";
|
||||
?>
|
||||
<u>Cambiar o Agregar archivo:</u><img src="../images/box.gif"
|
||||
align="left" hspace="0" width="100" height="98"><br><br>
|
||||
<li>Pulse examinar y busque la imagen en su
|
||||
equipo.</li>
|
||||
<li>Envie la imagen al servidor.</li>
|
||||
<br><br>Este proceso puede tardar varios minutos
|
||||
dependiendo de su conexi<78>n y el tr<74>fico.
|
||||
<?
|
||||
echo "<tr><td><form ACTION=\"$PHP_SELF?idd=$idd&idc=$idc&ft=$ft\" method=\"POST\" enctype=\"multipart/form-data\">";
|
||||
echo "<INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"3000000\"><input type=\"file\" size=\"15\" name=\"imgData\">";
|
||||
echo " <input type=\"image\" name=\"I2\" src=\"../images/enviar.gif\" align=\"absmiddle\" width=\"69\" height=\"14\" border=\"0\">";
|
||||
echo "</form></td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</center></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<? } ?>
|
162
adm/publicidad.php
Normal file
162
adm/publicidad.php
Normal file
@ -0,0 +1,162 @@
|
||||
<?
|
||||
if ( $user_auth && $user_level <= -1 )
|
||||
{
|
||||
$blq1 ="anunciante, descr, url, tipo, nVistos, nVisitas, filename";
|
||||
|
||||
$list = true;
|
||||
|
||||
if ( isset( $sins ) )
|
||||
{
|
||||
displayForm( "./?dgo=adm/publicidad.php&ins=new" );
|
||||
$list = false;
|
||||
}
|
||||
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id,$blq1 FROM publicidad WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array( $res );
|
||||
|
||||
list( $db_id, $db_anunciante, $db_descr, $db_url, $db_tipo, $db_nVistos, $db_nVisitas, $db_filename ) =$datos;
|
||||
|
||||
displayForm( "./?dgo=adm/publicidad.php&mod=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
/*
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
*/
|
||||
$addsql_p1 = ",filename='$imgData_name'"; //, Foto_w='$db_Foto_w', Foto_h='$db_Foto_h'";
|
||||
|
||||
}
|
||||
|
||||
$sql = "UPDATE publicidad SET ".
|
||||
"anunciante='$db_anunciante' ".
|
||||
",url='$db_url' ".
|
||||
",tipo='$db_tipo' ".
|
||||
",descr='$db_descr' $addsql_p1".
|
||||
" WHERE id=$mod";
|
||||
$res = @mysql_query( $sql, $conexion ) OR die("eror");
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
$imgDEL = "db/publicidad/$mod"."_i001@*";
|
||||
echo `rm -rf $imgDEL`;
|
||||
fwrite( fopen("db/publicidad/".$mod."_i001@$imgData_name", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
}
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if( isset( $ins ) )
|
||||
{
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
/*
|
||||
$db_Foto_w = $img_prop[0];
|
||||
$db_Foto_h = $img_prop[1];
|
||||
$addsql_p1 = ",Foto_mime, Foto_w, Foto_h";
|
||||
*/
|
||||
$addsql_p2 = ",'$imgData_name'";//, '$db_Foto_w', '$db_Foto_h'";
|
||||
}
|
||||
$sql = "INSERT INTO publicidad (FAlta, $blq1 $addsql_p1) VALUES ".
|
||||
"(NOW(),'$db_anunciante','$db_descr','$db_url','$db_tipo','0','0','$imgData_name')";
|
||||
|
||||
$res = @mysql_query( $sql, $conexion ) OR die( "Error<br>".@mysql_error($conexion) );
|
||||
|
||||
if ( !empty($imgData_name) && $imgData_size > 0 )
|
||||
{
|
||||
$file_size = filesize($imgData);
|
||||
$last_id = @mysql_insert_id($conexion);
|
||||
fwrite( fopen("db/publicidad/".$last_id."_i001@$imgData_name", "wb"),
|
||||
fread(fopen($imgData,"rb"),$file_size), $file_size);
|
||||
}
|
||||
|
||||
echo "<h1>Publicidad insertada</h1><br><br><br>";
|
||||
echo "<p class=remark>ID asignado = ".@mysql_insert_id($conexion)."</p>";
|
||||
$list = true;
|
||||
}
|
||||
if( isset( $del ) )
|
||||
{
|
||||
$imgDEL = "db/publicidad/$del"."_i001*";
|
||||
echo `rm -rf $imgDEL`;
|
||||
|
||||
$res = @mysql_query( "DELETE FROM artistas WHERE id=$del" );
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if ( isset( $list ) && $list )
|
||||
displayList($conexion);
|
||||
|
||||
displayMenu();
|
||||
}
|
||||
|
||||
function displayList($cnx, $orderBy, $orderDir)
|
||||
{
|
||||
$thisLOCATION = "./?dgo=adm/publicidad.php";
|
||||
|
||||
$res = @mysql_query( "SELECT id, anunciante, descr, nVistos, nVisitas FROM publicidad", $cnx );
|
||||
|
||||
echo "<br><br><br><table width=100% cellpadding=0 cellspacing=0 class=td_lista>";
|
||||
|
||||
echo "<td class=menuL>id</td>".
|
||||
"<td class=menuL>Anunciante</td>".
|
||||
"<td class=menuL>Descripción</td>".
|
||||
"<td class=menuL>Vistos / Visitas</td>".
|
||||
"<td class=menuL>Borrar</td>";
|
||||
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_id, $db_anunciante, $db_descr, $db_nVistos, $db_nVisitas )= $datos;
|
||||
echo "<tr><td><a href=\"./?dgo=adm/publicidad.php&smod=$db_id\">$db_id</a></td>".
|
||||
"<td>$db_anunciante</td><td>$db_descr</td><td>$db_nVistos / $db_nVisitas</td><td><a href=\"javascript::deleteUser($db_id)\"><img src=\"images/actions/cancel.gif\" border=0></a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
echo '<script language="JavaScript">
|
||||
function deleteUser( which )
|
||||
{
|
||||
var submitOK = confirm("Atencion: Esta a punto de eliminar al artista.");
|
||||
if ( submitOK )
|
||||
document.location.href = "'.$thisLOCATION.'&del="+which;
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
function displayMenu()
|
||||
{
|
||||
echo '<hr noshade color="#800000">';
|
||||
echo '<p align="center"><a href="./?dgo=adm/publicidad.php&sins=new">Insertar nuevo banner</a></p>';
|
||||
echo '<hr noshade color="#800000">';
|
||||
}
|
||||
|
||||
function displayForm( $form_action )
|
||||
{
|
||||
global $db_id, $db_url, $db_anunciante, $db_descr, $db_tipo, $db_nVistos, $db_nVisitas, $db_filename;
|
||||
global $imgData;
|
||||
|
||||
echo '<form action="'.$form_action.'" method="POST" name="register" enctype="multipart/form-data">
|
||||
<table width=100%>
|
||||
<tr><td>ID: '.$db_id.'</td><td></td></tr>
|
||||
<tr><td>Anunciante:</td><td><input type=text name=db_anunciante value="'.$db_anunciante.'"></td></tr>
|
||||
<tr><td>Descripción:</td><td><input type=text name=db_descr value="'.$db_descr.'"></td></tr>
|
||||
<tr><td>Tipo:</td><td><select name=db_tipo>
|
||||
<option value="H">Horizontal</option>
|
||||
<option value="V">Vertical</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>Visionados:</td><td>'.$db_nVistos.'</td></tr>
|
||||
<tr><td>Visitas:</td><td>'.$db_nVisitas.'</td></tr>
|
||||
<tr><td>url Publicidad:</td><td><input name=db_url value="'.$db_url.'"></td></tr>
|
||||
<tr><td>Fichero imagen:</td><td><input name="imgData" value="" type=file></td>
|
||||
<tr><td colspan=2><img src="db/publicidad/'.$db_id.'_i001@'.$db_filename.'"></td></tr>
|
||||
</table><center><input type=submit value=Enviar></center></form>';
|
||||
}
|
||||
?>
|
0
adm/publicidad.php~
Normal file
0
adm/publicidad.php~
Normal file
79
adm/selectIMGd.php
Normal file
79
adm/selectIMGd.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?
|
||||
require( "../addons/open_db.php" );
|
||||
require( "../addons/autenticate.php" );
|
||||
if ( ! $user_auth ) die( "<META CONTENT=\"0; URL=..\error.htm\" HTTP-EQUIV=\"REFRESH\"> ");
|
||||
|
||||
if ( !empty($imgData_name) && isset( $idd ) && isset( $img ) )
|
||||
{
|
||||
if ( $imgData_size > 0 )
|
||||
{
|
||||
$img_prop = GetImageSize($imgData);
|
||||
$imgW = $img_prop[0]; $p_imgW = $imgW;
|
||||
$imgH = $img_prop[1]; $p_imgH = $imgH;
|
||||
$fsize = filesize($imgData);
|
||||
fwrite( fopen( "../db/discos/".$idd."_".$img."_".$imgData_name, "wb" ),
|
||||
fread(fopen($imgData,"rb"), $fsize), $fsize);
|
||||
} else {
|
||||
if ( strcmp($imgData_name, "ninguna" ) != 0 ) die("<script language=\"javascript\">window.close();</script>");
|
||||
$data = "";
|
||||
$imgW = 0;
|
||||
$imgH = 0;
|
||||
$img_prop = "";
|
||||
}
|
||||
|
||||
$res = @mysql_query( "SELECT file FROM extrasDiscos WHERE idd=$idd AND tipo='F' AND id_data='$img'", $conexion );
|
||||
if ( @mysql_num_rows( $res ) > 0 )
|
||||
{
|
||||
$db_file = mysql_fetch_array( $res );
|
||||
unlink("../db/discos/".$idd."_".$img."_".$db_file[0] );
|
||||
$sql_upd = "UPDATE extrasDiscos SET file = '$imgData_name', W='$imgW', H='$imgH'" .
|
||||
" WHERE id = ".$idd;
|
||||
$res = mysql_query( $sql_upd, $conexion ) OR die("No puedo modificar esta foto<br>$sql_upd<br>".mysql_error($conexion));
|
||||
}else{
|
||||
@mysql_query( "INSERT INTO extrasDiscos (file, W, H, idd, tipo, id_data) VALUES ".
|
||||
" ('$imgData_name', '$imgW', '$imgH', '$idd', 'F', '$img') ", $conexion );
|
||||
}
|
||||
mysql_close($conexion);
|
||||
echo "<html><head></head><body onload='window.close();'><p>Procesando petici<63>n.<br>Por favor, espere...<br></body></html>";
|
||||
} else {
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Portal -web- ------------------------------------------------------------- -www.infdj.com- ---------------------------------------------------------------------------------------------------- </title>
|
||||
<link href="skins/articulos.ico" rel="SHORTCUT ICON">
|
||||
<link rel="stylesheet" type="text/css" href="../addons/estilo.css" body="../addons/estilo.css">
|
||||
|
||||
<body background="../images/bg.gif" bgcolor="<?echo $bg_color ?>" text="#000000">
|
||||
|
||||
<div align="center"><center>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="340">
|
||||
<?
|
||||
if ( !isset( $idd ) )
|
||||
{
|
||||
echo "<tr><td>";
|
||||
echo "<br>Error procesando su petici<63>n.<br><li>ACCESO DENEGADO</li>";
|
||||
echo "</td></tr>";
|
||||
} else {
|
||||
echo "<tr></tr>";
|
||||
?>
|
||||
<u>Cambiar o Agregar foto:</u><img src="../images/box.gif"
|
||||
align="left" hspace="0" width="100" height="98"><br><br>
|
||||
<li>Pulse examinar y busque la imagen en su
|
||||
equipo.</li>
|
||||
<li>Envie la imagen al servidor.</li>
|
||||
<br><br>Este proceso puede tardar varios minutos
|
||||
dependiendo de su conexi<78>n y el tr<74>fico.
|
||||
<?
|
||||
echo "<tr><td><form ACTION=\"$PHP_SELF?idd=$idd&img=$img\" method=\"POST\" enctype=\"multipart/form-data\">";
|
||||
echo "<INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"300000\"><input type=\"file\" size=\"15\" name=\"imgData\">";
|
||||
echo " <input type=\"image\" name=\"I2\" src=\"../images/enviar.gif\" align=\"absmiddle\" width=\"69\" height=\"14\" border=\"0\">";
|
||||
echo "</form></td></tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</center></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<? } ?>
|
113
adm/tdiscos.php
Normal file
113
adm/tdiscos.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?
|
||||
if ( $user_auth && $user_level <= -1 )
|
||||
{
|
||||
$blq1 ="pvp,descrCorta,descrLarga";
|
||||
|
||||
$list = true;
|
||||
|
||||
if ( isset( $sins ) )
|
||||
{
|
||||
displayForm( "./?dgo=adm/tdiscos.php&ins=new" );
|
||||
$list = false;
|
||||
}
|
||||
|
||||
if ( isset( $smod ) )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id,$blq1 FROM TiposDiscos WHERE id=$smod", $conexion );
|
||||
$datos = @mysql_fetch_array( $res );
|
||||
|
||||
list( $db_id, $db_pvp, $db_descrCorta, $db_descrLarga ) = $datos;
|
||||
|
||||
displayForm( "./?dgo=adm/tdiscos.php&mod=$smod" );
|
||||
$list = false;
|
||||
}
|
||||
if ( isset( $mod ) )
|
||||
{
|
||||
$sql = "UPDATE TiposDiscos SET ".
|
||||
"pvp='$db_pvp' ".
|
||||
",descrCorta='$db_descrCorta' ".
|
||||
",descrLarga='".urlencode($db_descrLarga)."' ".
|
||||
" WHERE id=$mod";
|
||||
$res = @mysql_query( $sql, $conexion );
|
||||
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if( isset( $ins ) )
|
||||
{
|
||||
$sql = "INSERT INTO TiposDiscos ($blq1) VALUES ('$db_pvp','$db_descrCorta','$db_descrLarga')";
|
||||
$res = @mysql_query( $sql, $conexion ) OR die( "Error<br>".@mysql_error($conexion) );
|
||||
|
||||
echo "<h1>Nuevo tipo insertado</h1><br><br><br>";
|
||||
echo "<p class=remark>ID asignado = ".@mysql_insert_id($conexion)."</p>";
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if( isset( $del ) )
|
||||
{
|
||||
$res = @mysql_query( "DELETE FROM TiposDisco WHERE id=$del" );
|
||||
$list = true;
|
||||
}
|
||||
|
||||
if ( isset( $list ) && $list )
|
||||
{
|
||||
displayList($conexion);
|
||||
}
|
||||
displayMenu();
|
||||
}
|
||||
|
||||
|
||||
function displayList($cnx)
|
||||
{
|
||||
$thisLOCATION = "./?dgo=adm/tdiscos.php";
|
||||
$res = @mysql_query( "SELECT id, pvp, descrCorta FROM TiposDiscos", $cnx );
|
||||
|
||||
echo "<br><br><br><table width=100% cellpadding=0 cellspacing=0 class=td_lista>";
|
||||
|
||||
echo "<tr><td class=menuL>id</td>".
|
||||
"<td class=menuL>Descripción</td>".
|
||||
"<td class=menuL>PVP</td>".
|
||||
"<td>Borrar</td></tr>";
|
||||
|
||||
while( $datos=@mysql_fetch_array($res) )
|
||||
{
|
||||
list ( $db_id, $db_pvp, $db_descrCorta )= $datos;
|
||||
echo "<tr><td><a href=\"./?dgo=adm/tdiscos.php&smod=$db_id\">$db_id</a></td>".
|
||||
"<td>$db_descrCorta</td>".
|
||||
"<td>$db_pvp # $db_tlf2</td>".
|
||||
"<td><a href=\"javascript::deleteUser($db_id)\">X</a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
echo '<script language="JavaScript">
|
||||
function deleteUser( which )
|
||||
{
|
||||
var submitOK = confirm("Atencion: Esta a punto de eliminar el Tipo de Disco.");
|
||||
if ( submitOK )
|
||||
document.location.href = "'.$thisLOCATION.'&del="+which;
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
function displayMenu()
|
||||
{
|
||||
echo '<hr noshade color="#800000">';
|
||||
echo '<p align="center"><a href="./?dgo=adm/tdiscos.php&sins=new">Insertar nuevo tipo</a></p>';
|
||||
echo '<hr noshade color="#800000">';
|
||||
}
|
||||
|
||||
function displayForm( $form_action )
|
||||
{
|
||||
global $db_id, $db_pvp, $db_descrCorta, $db_descrLarga;
|
||||
|
||||
echo '<form action="'.$form_action.'" method="POST" name="register">';
|
||||
echo '<p align="center"> </p><div align="center"><center>';
|
||||
echo '<table>';
|
||||
echo '<tr><td>Breve Descripción:</td><td><input type=text name=db_descrCorta value="'.$db_descrCorta.'"></td></tr>';
|
||||
echo '<tr><td>PVP</td><td><input type=text name=db_pvp value="'.$db_pvp.'"></td></tr>';
|
||||
echo '<tr><td valign=top>Descripción Larga:</td><td><textarea name=db_descrLarga rows=5 cols=20>'.urldecode($db_descrLarga).'</textarea></td></tr>';
|
||||
echo '</table>';
|
||||
echo '<p align="center"><input type="button" name="btCancelar" value="Cancelar"><input
|
||||
type="submit" name="B2" value="Enviar >>"></p>';
|
||||
echo '</center></div></form>';
|
||||
}
|
||||
?>
|
0
adm/tdiscos.php~
Normal file
0
adm/tdiscos.php~
Normal file
Reference in New Issue
Block a user