Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/05/2013, 21:57
Aldoar
 
Fecha de Ingreso: agosto-2011
Mensajes: 4
Antigüedad: 12 años, 8 meses
Puntos: 0
Php+jquery+mysql

tengo una consulta si alguien me puede explicar como hacerlo, es un sistema para direcciones...
el código es una mezcla de php+sql+jquery

Codigo de ACM

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
script type="text/javascript" src="jquery-1.9.1.js"></script>


<script>
function cargar(div, desde)
{
     $(div).load(desde);
}
</script>

<style type="text/css">
.cabecera {
    color: #FFF;
    background-color: #F60;
}
h1 {
    color: #00F;
}
.input {
    color: #FFF;
    background-color: #00F;
}
a {
    color: #00F;
    text-decoration: none;
}
</style>
</head>
<body>
<h1>ACM sistema de direcciones</h1>
<p>Estados de las direcciones.</p>
<p>
1 Ingresado <br />
2 Revision <br />
3 Intranet</p>
<p>&nbsp;</p>
<table width="600" height="46" border="0">
  <tr>
    <td width="145" class="cabecera">Consultar estado: 
<a href="#" onclick="cargar('#divtest', '1.php')">1 </a> //  
<a href="#" onclick="cargar('#divtest', '2.php')">2</a>  //  
<a href="#" onclick="cargar('#divtest', '3.php')">3</a></td>
  </tr>
</table>

<div id="divtest"> Seleccionar Estado.</div> 
Codigo de 1.php:
Código PHP:
<?php
include ('conexion.php');

$sql mysql_query("SELECT * FROM  `faltantes` WHERE  `estado` = 1"$connect);

echo
'<table width="600" height="46" border="1">
  <tr>
    <td width="145" class="cabecera">Villa</td>
    <td width="135" class="cabecera">Dirección</td>
    <td width="52" class="cabecera">Numero</td>
    <td width="90" class="cabecera">Departamento</td>
    <td width="49" class="cabecera">Estado</td>
    <td width="103" class="cabecera">Cambiar estado<form method="post" action="save1.php"></td>
  </tr>'
;
  

while(
$row mysql_fetch_assoc($sql)){

$query 'UPDATE `faltantes` SET  `estado` = '.$estado.' WHERE  `faltantes`.`id` = '.$id.';';

    echo 
'<tr>
    <td width="145">'
.$row['villa'].'</td>
    <td width="135">'
.$row['direccion'].'</td>
    <td width="52">'
.$row['numero'].'</td>
    <td width="90">'
.$row['departamento'].'</td>
    <td width="49">'
.$row['estado'].'</td>
    <td width="103"><input name="value'
.$id.'" type="text" size="10" maxlength="5" /></td></tr>';

}

    echo 
'<tr>
    <td width="145"></td>
    <td width="135"></td>
    <td width="52"></td>
    <td width="90"></td>
    <td width="49"></td>
    <td width="103"><input type="submit" value="Enviar" /></form></td></tr>'
;

echo 
'</table>';

?>
Lo que necesito es enviar los datos del formulario, con la actualización de estado.
Alguna idea