Hola!

Registrándote como bakuno podrás publicar, compartir y comunicarte en privado con otros bakuos :D

Regístrame ya!

AYUDAAAAAAAA...

spawn20

Bovino maduro
Desde
19 May 2008
Mensajes
395
Muy buenas tardes compañeros bacunos, necesito ayuda, tengo una base de datos ingredientes, quiero insertarle, modificar y eliminarlo por medio de una sola pagina que contengan estos trs botones, como puedo hacerlo, soy nuevo programando en php espero puedan ayudarme y tambien como utilizo el menu de lista para esto, ya que para modificar o eliminar un ingrediente quiero rellenar los input type text automaticamente despues de tomar la opcion espero que puedan ayudarme muchas gracias...
 
necesitas ajax pero si dices que no sabes mucho de php talvez no puedas usarlo aun, te invito a que pongas tu codigo y asi podamos indicarte que te falta
 
xD no entendí muy bien, te haces muchas bolas, pero creo que lo que quieres es auto_completar los campos, para eso como bien dicen necesitar AJAX osea javascript, te puede salvar la vida jQuery
 
Les dejo mi codigo compañeros espero puedan ayudarme por que si la neta no le entiendo...


<!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" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Programa</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<style type="text/css">
<!--
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #FFFFFF;
margin: 0;
padding: 0;
color: #000;
}


ul, ol, dl {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0;
padding-right: 15px;
padding-left: 15px;
}
a img {
border: none;
}


a:link {
color:#414958;
text-decoration: underline;
}
a:visited {
color: #4E5869;
text-decoration: underline;
}
a:hover, a:active, a:focus {
text-decoration: none;
}


.container {
width: 80%;
max-width: 1260px;
min-width: 780px;
background: #FFF;
margin: 0 auto;
}


.header {
background: #6F7D94;
}


.content {
padding: 10px 0;
}


.content ul, .content ol {
padding: 0 15px 15px 40px;
}


.footer {
padding: 10px 0;
background: #6F7D94;
}


.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style></head>

<body>

<div class="container">
<div class="header"><a href="#"><img src="Imagenes/titulo2.png" alt="Insertar logotipo aquí" name="Insert_logo" width="100%" height="115" id="Insert_logo" style="background: #8090AB; display:block;" /></a>
<form id="form1" name="form1" method="post" action="">
<center><table width="20" border="0">
<tr>
<td><div class="content">
<div class="footer">
<p>&nbsp;</p>
<table width="679" height="398" border="0">
<tr>
<td width="285" height="120"><table>
<tr>
<td><span style="width: 100%; float: left">
<label for="select"></label>
<select name="ingrediente" id="ingrediente" onchange="javascript: document.formulario.submit();">
<option value="" selected="selected">---Ingredientes---</option>
<option value="<?=$registro['id_tbl_ingredientes']?>"></option>
<?php
include("conectarse.php");

$result=mysql_query('Select id_tbl_ingredientes from ingredientes') or die (mysql_error());
$result=mysql_query('Select id_tbl_ingrediente,ingrediente from tbl_ingredientes order by ingredient asc') or die (mysql_error());
while($registro=mysql_fetch_assoc($result)){
?>
<?php
}
mysql_free_result($result);
?>
</select>
<? echo "<select name=personal id=personal onChange=document.URL='test.php?accion=nivel&id2=$departamento'>" ?>
<option value="">--Personal--</option>
<?php
/*if($departamento!=''){
$result=mysql_query('Select nombre,id_personal,depart from personal where depart='.$departamento.'') or die (mysql_error());*/
while($registro=mysql_fetch_assoc($result)){

?>
<option value="<?=$registro['id_tbl_ingredientes']?>" >
<?=$registro['ingrediente']?>
</option>
<?php
}
//}

?>
</span></td>
</tr>
</table></td>
<td width="135"></td>
<td width="329">&nbsp;
<table width="298" border="0">
<tr>
<td width="142" height="51" align="center" valign="top">&nbsp;
<label for="marca">Marca: </label></td>
<center>
<td width="146"><input type="text" name="marca" id="marca" title="Ingrese la marca" />
&nbsp;<br /></td>
</center>
</tr>
<tr>
<td height="54" align="center" valign="top">&nbsp;
<label for="Fuente de Funcionamiento">Fuente de Financiamiento:</label></td>
<center>
<td><input type="text" name="fuente" id="fuente" title="fuente" /></td>
</center>
</tr>
</table></td>
</tr>
<tr>
<td height="135"><table width="285" border="0">
<tr>
<td width="134" height="51" align="center" valign="top">&nbsp;
<label for="provedor">Provedor: </label></td>
<center>
<td width="141"><input type="text" name="provedor" id="provedor" title="Ingrese provedor" />
&nbsp;<br /></td>
</center>
</tr>
<tr>
<td height="58" align="center" valign="top">&nbsp;
<label for="ingredientes">Ingrediente:</label></td>
<center>
<td><input type="text" name="ingrediente" id="ingrediente" title="Ingrese ingrediente" /></td>
</center>
</tr>
</table></td>
<td width="135" height="135" >&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="117"><table width="279" height="61">
<tr>
<td><center>
<input type="submit" name="Agregar" id="Agregar" value="Agregar" />
</center></td>
</tr>
</table></td>
<center>
<td width="135"><table width="76" height="61">
<tr>
<td><center>
<input type="submit" name="Modificar" id="Modificar" value="Modificar" />
</center></td>
</tr>
</table>
<p>
<center>
</center>
</p></td>
</center>
<td><table width="303" height="61">
<tr>
<td><p>
<center>
<input type="reset" name="Eliminar" id="Eliminar" value="Eliminar" />
</center>
</p></td>
</tr>
</table></td>
</tr>
</table>
<p>&nbsp;</p>
<!-- end .footer -->
</div>
<!-- end .container -->
</div></td>
</tr>
</table></center>
</form>

<!-- end .header --></div>
</body>
</html>


Les agradecere todas sus opiniones...
 
Volver
Arriba