292 lines
13 KiB
PHP
292 lines
13 KiB
PHP
<?
|
||
if ( isset( $insertUser ) )
|
||
{
|
||
if ( empty( $db_usaCorreo ) ) $db_usaCorreo = "N";
|
||
|
||
$consulta = "INSERT into users (nick, level, ultimaEntrada, primeraEntrada, pass, Nombre, Apellidos, fechaNacimiento, calle, ciudad, provincia, nacionalidad, cp, email, usaCorreo, preguntaSecreta, respuestaPregunta ) values".
|
||
" ('$db_nick',0, NOW(), NOW(), '$db_passwd', '$db_nombre', '$db_apellidos', '$db_ano/$db_mes/$db_dia', '$db_calle', '$db_ciudad', '$db_provincia', '$db_nacionalidad', '$db_cp', '$db_email', '$db_usaCorreo', '$db_preguntaSecreta', '$db_respuestaPregunta')";
|
||
mysql_query( $consulta, $conexion ) OR die("No puedo insertar tu ficha<br>$consulta<br>".mysql_error($conexion));
|
||
mysql_free_result($res);
|
||
|
||
// insertamos al usuario
|
||
require("registro/welcome.htm");
|
||
} else {
|
||
if ( isset( $updateUser ) )
|
||
{
|
||
if ( empty( $db_usaCorreo ) ) $db_usaCorreo = "N";
|
||
|
||
if ( $updateUser != $user_id && $user_level != -2 )
|
||
die("IP capturada.<br>Ataque ilegal contra nuestro sistema detectado");
|
||
$consulta = "UPDATE users SET ".
|
||
" pass='$db_passwd', preguntaSecreta='$preguntaSecreta', respuestaPregunta='$db_respuestaPregunta', ".
|
||
" Nombre='$db_nombre', Apellidos='$db_apellidos', calle='$db_calle', ciudad='$db_ciudad', provincia='$db_provincia', cp='$db_cp', nacionalidad='$db_nacionalidad', ".
|
||
" fechaNacimiento='$db_ano/$db_mes/$db_dia'".
|
||
" WHERE id='$updateUser'";
|
||
mysql_query( $consulta, $conexion ) OR die("No puedo actualizar tu ficha<br>$consulta<br>".mysql_error($conexion));
|
||
|
||
$showUser = $updateUser;
|
||
}
|
||
if ( $user_auth && isset( $showUser ) )
|
||
{
|
||
if ( $user_level != -2 ) $showUser = $user_id;
|
||
|
||
$consulta = "SELECT * FROM users WHERE id='$showUser'";
|
||
$res = mysql_query( $consulta, $conexion ) OR die("No puedo consultar la ficha");
|
||
if ( mysql_num_rows($res) > 0 )
|
||
{
|
||
$db_nick = mysql_result( $res, 0, "nick" );
|
||
$db_preguntaSecreta = mysql_result( $res, 0, "preguntaSecreta" );
|
||
$db_respuestaPregunta = mysql_result( $res, 0, "respuestaPregunta" );
|
||
|
||
$db_passwd = mysql_result( $res, 0, "pass" );
|
||
|
||
$db_nombre = mysql_result( $res, 0, "Nombre" );
|
||
$db_apellidos = mysql_result( $res, 0, "Apellidos" );
|
||
$db_calle = mysql_result( $res, 0, "calle" );
|
||
$db_ciudad = mysql_result( $res, 0, "ciudad" );
|
||
$db_provincia = mysql_result( $res, 0, "provincia" );
|
||
$db_cp = mysql_result( $res, 0, "cp" );
|
||
$db_nacionalidad = mysql_result( $res, 0, "nacionalidad" );
|
||
|
||
$db_usaCorreo = mysql_result( $res, 0, "usaCorreo" );
|
||
$db_email = mysql_result( $res, 0, "email" );
|
||
$db_fechaNacimiento = mysql_result( $res, 0, "fechaNacimiento" );
|
||
// Dividimos la fecha de nacimiento en DIA/MES/A<>O
|
||
$db_dia = substr($db_fechaNacimiento, 8, 2 );
|
||
$db_mes = substr($db_fechaNacimiento, 5, 2 );
|
||
$db_ano = substr($db_fechaNacimiento, 0, 4 );
|
||
|
||
mysql_free_result($res);
|
||
}
|
||
}
|
||
?>
|
||
|
||
<form method="POST" name="register"
|
||
onsubmit="return validateform( this.form )"
|
||
<? if ( !isset($showUser) ) echo " ACTION=$PHP_SELF?dgo=registro.php&insertUser=this";
|
||
else echo " ACTION=$PHP_SELF?dgo=registro.php&updateUser=$showUser";
|
||
?>>
|
||
<div align="center"><center><table border="0" cellpadding="0"
|
||
cellspacing="0" width="100%" >
|
||
<!-- width="580" -->
|
||
<tr>
|
||
<td><? if ( !isset( $showUser ) ) echo "<h1>Nuevo usuario</h1>"; else echo "<h1>Datos del usuario</h1>"; ?>
|
||
<table border="0" cellpadding="0" cellspacing="0"
|
||
width="100%" bgcolor="#800000">
|
||
<tr>
|
||
<td><font color="#FFFFFF"><strong>
|
||
<?
|
||
if ( !isset( $showUser ) ) echo "Unete a PortalMusica ahora!!!";
|
||
else echo "Verificando datos de registro";
|
||
?></strong></font></td>
|
||
</tr>
|
||
</table>
|
||
<table border="0">
|
||
<tr>
|
||
<td width="30%">Nick:</td>
|
||
<td width="20%"><input type="text" size="6"
|
||
name="db_nick" value="<? echo $db_nick ?>"></td>
|
||
<td valign="top" rowspan="5" width="50%"
|
||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||
de validaci<63>n</strong><p>Selecciona el
|
||
nombre de usuario para tu cuenta.</p>
|
||
<p>Ejemplo: sac@infdj.com</p>
|
||
<p>La pregunta secreta y su respuesta, ser<65>
|
||
usada para verificar su identidad.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Password:</td>
|
||
<td width="20%"><input type="password"
|
||
size="15" name="db_passwd" value="<?echo $db_passwd?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Reescriba el Password:</td>
|
||
<td width="20%"><input type="password"
|
||
size="15" name="db_passwd2"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Pregunta secreta:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_preguntaSecreta" value="<? echo $db_preguntaSecreta ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Respuesta pregunta:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_respuestaPregunta" value="<? echo $db_respuestaPregunta ?>"></td>
|
||
</tr>
|
||
</table>
|
||
<hr noshade color="#800000">
|
||
<table border="0">
|
||
<tr>
|
||
<td width="30%">Nombre:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_nombre" value="<? echo $db_nombre ?>"></td>
|
||
<td valign="top" rowspan="6" width="50%"
|
||
bgcolor="#B4CCE9" class="tdSuave"><strong>Informaci<63>n
|
||
de contacto</strong><p>Tu privacidad es
|
||
importante para nosotros.<br>Nos comprometemos a mantener tu informaci<63>n a
|
||
salvo y segura.<br>Por favor, lea nuestra <a
|
||
href="registro/privacyPolicy.htm"
|
||
target="_blank">Politica de Privacidad</a>
|
||
para saber m<>s.</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Apellidos:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_apellidos" value="<? echo $db_apellidos ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Direcci<63>n:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_calle" value="<? echo $db_calle ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Ciudad:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_ciudad" value="<? echo $db_ciudad ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Provincia:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_provincia" value="<? echo $db_provincia ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">C<>d. Postal:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_cp" value="<? echo $db_cp ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Nacionalidad:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_nacionalidad" value="<?echo $db_nacionalidad ?>"></td>
|
||
</tr>
|
||
</table>
|
||
<hr noshade color="#800000">
|
||
<table border="0">
|
||
<tr>
|
||
<td colspan="2" width="50%"><input
|
||
type="checkbox" name="db_usaCorreo"
|
||
<? if ( strcmp($db_usaCorreo, "Y" )==0 ) echo " checked "; ?> VALUE="Y">Quiero un correo con <strong>infdj.com</strong></td>
|
||
<td valign="top" rowspan="7" width="50%"
|
||
bgcolor="#B4CCE9" class="tdSuave"><strong><3E>Quieres estar al dia?</strong><p>Si deseas que
|
||
te informemos de eventos y modificaciones de este portal, indicanos tu e-mail,
|
||
para que podamos estar en contacto.<br><br>Actualmente esta opci<63>n no esta disponible</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Correo actual:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_email" value="<? echo $db_email ?>"></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Cumplea<65>os:</td>
|
||
<td width="20%"><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</option>";
|
||
}
|
||
?>
|
||
</select><br>
|
||
<select name="db_mes" size="1">
|
||
<option>Mes...</option>
|
||
<option <?if ($db_mes==1) echo "SELECTED";?> value="1">Enero</option>
|
||
<option <?if ($db_mes==2) echo "SELECTED";?> value="2">Febrero</option>
|
||
<option <?if ($db_mes==3) echo "SELECTED";?> value="3">Marzo</option>
|
||
<option <?if ($db_mes==4) echo "SELECTED";?> value="4">Abril</option>
|
||
<option <?if ($db_mes==5) echo "SELECTED";?> value="5">Mayo</option>
|
||
<option <?if ($db_mes==6) echo "SELECTED";?> value="6">Junio</option>
|
||
<option <?if ($db_mes==7) echo "SELECTED";?> value="7">Julio</option>
|
||
<option <?if ($db_mes==8) echo "SELECTED";?> value="8">Agosto</option>
|
||
<option <?if ($db_mes==9) echo "SELECTED";?> value="9">Septiembre</option>
|
||
<option <?if ($db_mes==10) echo "SELECTED";?> value="10">Octubre</option>
|
||
<option <?if ($db_mes==11) echo "SELECTED";?> value="11">Noviembre</option>
|
||
<option <?if ($db_mes==12) echo "SELECTED";?> value="12">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</option>";
|
||
}
|
||
?>
|
||
</select></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="30%">Ciudad:</td>
|
||
<td width="20%"><input type="text" size="15"
|
||
name="db_ciudad" value="<?echo $db_ciudad ?>"></td>
|
||
</tr>
|
||
</table>
|
||
<hr noshade color="#800000">
|
||
<?
|
||
if ( $user_level == -2 )
|
||
{
|
||
echo '<table border="0">
|
||
<tr>
|
||
<td width="30%">ID del Grupo</td>
|
||
<td width="20%"><input
|
||
type="text" size="15" name="db_idg" value="'.$db_idg.'"; ?>"</td>
|
||
<td valign="top" rowspan="7" width="50%"
|
||
bgcolor="#B4CCE9" class="tdSuave">Datos de control<br><br>Si este usuario puede "POSTEAR" noticias referente a un grupo, indique cual.
|
||
</td>
|
||
</tr>
|
||
</table>';
|
||
}
|
||
?>
|
||
<table border="0" cellpadding="0" cellspacing="0"
|
||
width="100%" bgcolor="#800000">
|
||
<tr>
|
||
<td><font color="#FFFFFF"> </font></td>
|
||
</tr>
|
||
</table>
|
||
|
||
<? if ( ($user_auth && isset($showUser)) || !isset($showUser) ) { ?>
|
||
<p align="center"><input type="button" name="btCancelar" value="Cancelar"><input
|
||
type="submit" name="B2" value="Enviar >>"></p>
|
||
<? } ?>
|
||
|
||
|
||
<p align="center">Si envias este formulario,
|
||
significa que estas de acuerdo con el "<a
|
||
href="registro/endUserAgreement.htm" target="_blank">Acuerdo de
|
||
usuario final</a>" y la "<a
|
||
href="registro/privacyPolicy.htm" target="_blank">Pol<6F>tica de
|
||
Privacidad</a>".</p>
|
||
<p><script language="JavaScript"><!--
|
||
function validateform()
|
||
{
|
||
|
||
if (document.register.db_nick.value=="")
|
||
{
|
||
window.alert ("Por favor, introduce tu NICK (nombre de usuario)")
|
||
return false;
|
||
}
|
||
if (document.register.db_passwd.value=="")
|
||
{
|
||
window.alert ("Por favor, introduce tu Password (contrase<73>a)")
|
||
return false;
|
||
}
|
||
if (document.register.db_passwd.value != document.register.db_passwd2.value )
|
||
{
|
||
window.alert ("La contrase<73>a no coincide, vuelva a introducirla")
|
||
return false;
|
||
}
|
||
}
|
||
// --></script><br>
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</center></div>
|
||
</form>
|
||
<?}?>
|