First commit 31/12/2001
This commit is contained in:
		
							
								
								
									
										180
									
								
								miFicha.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										180
									
								
								miFicha.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,180 @@
 | 
			
		||||
<?
 | 
			
		||||
			session_name( "SYNCRO" );
 | 
			
		||||
			$v1="user_id";
 | 
			
		||||
			$v2="user_name";
 | 
			
		||||
			$v3="user_auth";
 | 
			
		||||
			session_register($v1,$v2,$v3);
 | 
			
		||||
			session_start();
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<html>
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
<meta http-equiv="Content-Type"
 | 
			
		||||
content="text/html; charset=iso-8859-1">
 | 
			
		||||
<title>-= SYNCRO =-</title>
 | 
			
		||||
<link href="syncro.ico" rel="SHORTCUT ICON">
 | 
			
		||||
<link rel="stylesheet" type="text/css" href="syncro.css"
 | 
			
		||||
body="syncro.css">
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body bgcolor="#57A44D">
 | 
			
		||||
 | 
			
		||||
<? 
 | 
			
		||||
 if (!empty($user_auth))
 | 
			
		||||
 {
 | 
			
		||||
	$conexion = mysql_connect( 'localhost', 'syncro_users', '29dic2001' ) OR die("No puedo conectar");
 | 
			
		||||
	$id = mysql_select_db( 'SYNCRO', $conexion ) OR die("No puedo abrir Base de Datos");
 | 
			
		||||
 | 
			
		||||
	if ( isset($nombre) )
 | 
			
		||||
	{
 | 
			
		||||
	 // Actualizamos la ficha...
 | 
			
		||||
	 $sql_upd = "UPDATE users SET ";
 | 
			
		||||
	 $sql_upd = $sql_upd . "  Nombre='$nombre'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Apellidos='$apellidos'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", e_Mail='$email'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Telefono1='$tlf1'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Telefono2='$tlf2'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Telefono3='$tlf3'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Telefono4='$tlf4'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", url='$url'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Calle='$calle'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Calle2='$calle2'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Num='$num'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Piso='$piso'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Letra='$letra'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", CP='$cp'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Poblacion='$poblacion'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Provincia='$provincia'";
 | 
			
		||||
	 $sql_upd = $sql_upd . ", Password='$pwd'";
 | 
			
		||||
 | 
			
		||||
	 $sql_upd = $sql_upd . " WHERE id = ".$user_id;
 | 
			
		||||
	
 | 
			
		||||
   	 $res = mysql_query( $sql_upd, $conexion ) OR die("No puedo realizar las actualizaciones<br>$sql_upd<br>".mysql_error($conexion));
 | 
			
		||||
	} else {
 | 
			
		||||
		if ( isset( $info_user ) )
 | 
			
		||||
			$consulta = "SELECT * FROM users WHERE id = ".$info_user;
 | 
			
		||||
		else
 | 
			
		||||
			$consulta = "SELECT * FROM users WHERE id = ".$user_id;
 | 
			
		||||
		$res = mysql_query( $consulta, $conexion ) OR die("No puedo realizar la consulta");
 | 
			
		||||
		if (  mysql_num_rows($res) > 0 )
 | 
			
		||||
		{
 | 
			
		||||
			$nombre   = mysql_result( $res, 0, 'Nombre' );
 | 
			
		||||
			$apellidos= mysql_result( $res, 0, 'Apellidos' );
 | 
			
		||||
			$email    = mysql_result( $res, 0, 'e_Mail' );
 | 
			
		||||
			$tlf1	  = mysql_result( $res, 0, 'Telefono1' );
 | 
			
		||||
			$tlf2	  = mysql_result( $res, 0, 'Telefono2' );
 | 
			
		||||
			$tlf3	  = mysql_result( $res, 0, 'Telefono3' );
 | 
			
		||||
			$tlf4	  = mysql_result( $res, 0, 'Telefono4' );
 | 
			
		||||
			$url	  = mysql_result( $res, 0, 'url' );
 | 
			
		||||
			$calle	  = mysql_result( $res, 0, 'Calle' );
 | 
			
		||||
			$calle2	  = mysql_result( $res, 0, 'Calle2' );
 | 
			
		||||
			$num	  = mysql_result( $res, 0, 'Num' );
 | 
			
		||||
			$piso	  = mysql_result( $res, 0, 'Piso' );
 | 
			
		||||
			$letra	  = mysql_result( $res, 0, 'Letra' );
 | 
			
		||||
			$cp	  = mysql_result( $res, 0, 'CP' );
 | 
			
		||||
			$poblacion= mysql_result( $res, 0, 'Poblacion' );
 | 
			
		||||
			$provincia= mysql_result( $res, 0, 'Provincia' );
 | 
			
		||||
			$pwd 	  = mysql_result( $res, 0, 'Password' );
 | 
			
		||||
		}
 | 
			
		||||
		mysql_free_result($res);
 | 
			
		||||
	}
 | 
			
		||||
	mysql_close($conexion);
 | 
			
		||||
 | 
			
		||||
if ( isset($info_user) ) $hidden_pwd = "hidden"; else $hidden_pwd ="";
 | 
			
		||||
?>
 | 
			
		||||
<form action="miFicha.php" method="POST">
 | 
			
		||||
    <div align="center"><center><table border="1" cellpadding="0"
 | 
			
		||||
    cellspacing="0"  width="600"  bgcolor="#427B42"
 | 
			
		||||
    bordercolor="#000000" bordercolordark="#000000"
 | 
			
		||||
    bordercolorlight="#000000">
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td><table border="0" width="100%">
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>Nombre:</td>
 | 
			
		||||
                    <td><input type="text" size="15"
 | 
			
		||||
                    name="nombre" value="<? echo $nombre ?>"></td>
 | 
			
		||||
                    <td>Apellidos:</td>
 | 
			
		||||
                    <td><input type="text" size="15"
 | 
			
		||||
                    name="apellidos" value="<? echo $apellidos ?>"></td>
 | 
			
		||||
                    <td>Password:</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
<?
 | 
			
		||||
 if ( !isset($info_user) ) 
 | 
			
		||||
	echo "<input type=\"password\" size=\"15\" name=\"pwd\" value=\"$pwd\">";
 | 
			
		||||
 else
 | 
			
		||||
	echo "<input type=\"password\" size=\"15\" name=\"fpwd\" value=\"QueTeLoHasCreido\">";
 | 
			
		||||
?>
 | 
			
		||||
</td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>Telefonos:</td>
 | 
			
		||||
                    <td><input type="text" size="15" name="tlf1"  value="<? echo $tlf1 ?>"></td>
 | 
			
		||||
                    <td><input type="text" size="15" name="tlf2"  value="<? echo $tlf2 ?>"></td>
 | 
			
		||||
                    <td><input type="text" size="15" name="tlf3"  value="<? echo $tlf3 ?>"></td>
 | 
			
		||||
                    <td>Fax:</td>
 | 
			
		||||
                    <td><input type="text" size="15" name="tlf4"  value="<? echo $tlf4 ?>"></td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>e-mail:</td>
 | 
			
		||||
                    <td><input type="text" size="15" name="email"  value="<? echo $email ?>"></td>
 | 
			
		||||
                    <td> </td>
 | 
			
		||||
                    <td>Direcci<63>n p<>g. WEB:</td>
 | 
			
		||||
                    <td colspan="2"><input type="text" size="30"
 | 
			
		||||
                    name="url"  value="<? echo $url ?>"></td>
 | 
			
		||||
                    <td> </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            </table>
 | 
			
		||||
<? if ( !isset($info_user) ){ ?>
 | 
			
		||||
            <hr>
 | 
			
		||||
            <table border="0" width="100%">
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td><table border="0">
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td>Calle</td>
 | 
			
		||||
                            <td><input type="text" size="30"
 | 
			
		||||
                            name="calle" value="<? echo $calle ?>"></td>
 | 
			
		||||
                            <td>Num/Piso/Letra</td>
 | 
			
		||||
                            <td><input type="text" size="5"
 | 
			
		||||
                            name="num" value="<? echo $num ?>">-<input type="text"
 | 
			
		||||
                            size="5" name="piso" value="<? echo $piso ?>">-<input
 | 
			
		||||
                            type="text" size="5" name="letra" value="<? echo $letra ?>"></td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td> </td>
 | 
			
		||||
                            <td><input type="text" size="30"
 | 
			
		||||
                            name="calle2" value="<? echo $calle2 ?>"></td>
 | 
			
		||||
                            <td>CP:</td>
 | 
			
		||||
                            <td><input type="text" size="10"
 | 
			
		||||
                            name="cp" value="<? echo $cp ?>"></td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <td>Poblaci<63>n:</td>
 | 
			
		||||
                            <td><input type="text" size="15"
 | 
			
		||||
                            name="poblacion" value="<? echo $poblacion ?>"></td>
 | 
			
		||||
                            <td>Provincia:</td>
 | 
			
		||||
                            <td><input type="text" size="15"
 | 
			
		||||
                            name="provincia" value="<? echo $provincia ?>"></td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                    </table>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td><input type="image" name="I1"
 | 
			
		||||
                    src="images/enviar.gif" alt="ENVIAR"
 | 
			
		||||
                    align="bottom" border="0" width="20"
 | 
			
		||||
                    height="71"></td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            </table>
 | 
			
		||||
<? 
 | 
			
		||||
 } 
 | 
			
		||||
?>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
    </table>
 | 
			
		||||
    </center></div>
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
<?
 | 
			
		||||
 }
 | 
			
		||||
?>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user