Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/03/2013, 07:09
AxacrosS
 
Fecha de Ingreso: marzo-2013
Mensajes: 38
Antigüedad: 11 años, 1 mes
Puntos: 0
No me guarda ni elimina con combobox

Hola disculpen nuevamente molestando con mi ignorancia, tengo este codigo y no me guarda creo que por los combobox que utiliza :S
Código PHP:

<?php

include ("Conexion.php");


if (isset(
$_POST["btneliminar"])){
$cborut $_POST["cborut"] ? $_POST["cborut"]:"";
$numdoc$_POST["text6"] ? $_POST["text6"]: "";
$del "delete from ingreso_doc where rut_provee = '$cborut' and num_doc = '$numdoc'";    
$xdelmysql_query($del,$con);
if (!
$xdel){
    echo 
"Datos no Eliminados";

}}

if (isset(
$_POST["btnguardar"])){
$cborut $_POST["cborut"] ? $_POST["cborut"]:"";
$fechadoc=$_POST["text2"] ? $_POST["text2"]: "";
$fechaing=$_POST["text3"] ? $_POST["text3"]: "";
$cbotipo=$_POST["cbotipo"] ? $_POST["cbotipo"]: "";
$ordcom=$_POST["text5"] ? $_POST["text5"]: "";
$numdoc$_POST["text6"] ? $_POST["text6"]: "";
$codpro=$_POST["text7"] ? $_POST["text7"]: "";
$lote$_POST["text8"] ? $_POST["text8"]: "";
$cant$_POST["text9"] ? $_POST["text9"]: ""
$valor$_POST["text10"] ? $_POST["text10"]:"";
$fechaven$_POST["text11"] ? $_POST["text11"]:"";
$marca=  $_POST["text12"] ? $_POST["text12"]:"";
    
$consulta"insert into ingreso_doc values('$cborut','$fechadoc','$fechaing','$cbotipo','$ordcom','$numdoc','$codpro','$lote','$cant','$valor','$fechaven','$marca')";

$sqlmysql_query($consulta,$con);
if(!
$sql){
    echo(
"Datos No Ingresados");
    echo 
"<a href='Ingreso_Documentos.php'></a>";}    
}
?>
<!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" /></title>
<?php
$cborut
='';
$cbotipo='';
?>
</head>

<body bgcolor="#666666">
<H1 align="center"><i><b>INGRESO DOCUMENTOS</b></i></H1>
<form id="form1" name="form1" method="post" action="">
<div align="center">
  <table width="375" border="3">
       <tr>
      <td colspan="2"><div align="center"><font color="#FFFFFF"><b>Ingreso Documento General</b></font></div></td>
    </tr>
    <tr>
      <td width="173"><div align="center"><b>Rut Proveedor</b></div></td>
      <td width="168"><div align="center">
        <label for="cborut"></label>
        <select name="cborut" id="cborut">
        <?php
        $preg
="select * from proveedor";
        
$lol=mysql_query($preg,$con);
        while (
$rs=mysql_fetch_array($lol,$db)){        
        
?>
        <option value="<?php $rs["prov_rut"];?>"
        <?php
        
if ($rs["prov_rut"]==$cborut){
        echo 
"selected='selected'";
        }
        
?>
        ><?php echo $rs["prov_rut"];?></option>
        <?php }
        
?>
        </select>
* </div></td>
    </tr>
    <tr>
      <td><div align="center"><strong>Fecha Documento</strong></div></td>
      <td><label for="text2"></label>
        <div align="center">
          <input type="text" name="text2" id="text2" />
        </div>
      </td>
    </tr>
    <tr>
      <td><div align="center"><strong>Fecha Ingreso</strong></div></td>
      <td><div align="center">
            <label for="text3"></label>
            <div align="center">
              <input type="text" name="text3" id="text3" />
            </div></td>
    </tr>
    <tr>
      <td><div align="center"><strong>Tipo Documento</strong></div></td>
      <td><label for="text4"></label>
        <div align="center">
          <label for="cbotipo"></label>
          <select name="cbotipo" id="cbotipo">
          <?php
          $denue
="select * from bod_serie";
          
$opo=mysql_query($denue,$con);
          while (
$rs=mysql_fetch_array($opo,$db)){
          
?>
          <option value="<?php $rs["tipo_doc"];?>"
          <?php
          
if ($rs["tipo_doc"]==$cbotipo){
             echo 
"select='select'";
           }
          
?>>
          <?php
          
echo $rs["tipo_doc"];?></option>
          <?php
          
}?>
          </select>
        </div>
      </td>
    </tr>
    <tr>
      <td><div align="center"><strong>Orden de Compra</strong></div></td>
      <td><label for="text5"></label>
        <div align="center">
          <input type="text" name="text5" id="text5" />
      </div></td>
    </tr>
    <tr>
      <td height="23"><div align="center"><strong>N° Documento</strong></div></td>
      <td><label for="text6"></label>
        <div align="center">
          <input type="text" name="text6" id="text6" />
      *</div></td>
    </tr>
  </table>
  * Datos Necesarios Para Eliminar
  <br>&nbsp;</br>
  <table width="377" height="195" border="3">
    <tr>
      <td colspan="2"><div align="center"><font color="#FFFFFF"><strong>Ingreso Detalles</strong></font></div></td>
    </tr>
    <tr>
      <td width="154"><div align="center"><b>Código Producto</b></div></td>
      <td width="178"><div align="center">
          <label for="text7"></label>
          <input type="text" name="text7" id="text7"  />
      </div></td>
    </tr>
    <tr>
      <td><div align="center"><b>Lote</b></div></td>
      <td><div align="center">
          <label for="text8"></label>
          <input type="text" name="text8" id="text8"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="center"><b>Cantidad</b></div></td>
      <td><div align="center">
          <label for="text9"></label>
          <input type="text" name="text9" id="text9" />
      </div></td>
    </tr>
    <tr>
      <td><div align="center"><b>Valor</b></div></td>
      <td><div align="center">
          <label for="text10"></label>
          <input type="text" name="text10" id="text10" />
      </div></td>
    </tr>
    <tr>
      <td><div align="center"><b>Fecha Vencimiento</b></div></td>
      <td><div align="center">
          <label for="text11"></label>
          <input type="text" name="text11" id="text11" />    
      </div></td>
    </tr>
    <tr>
      <td><div align="center"><b>Marca</b></div></td>
      <td><div align="center">
          <label for="text12"></label>
          <input type="text" name="text12" id="text12"/>
      </div></td>
    </tr>
  </table>
  <p>
    <input type="submit" name="btnguardar" id="btnguardar" value="Guardar" />

    <input type="submit" name="btneliminar" id="btneliminar" value="Eliminar" />
  </p>
  <p><a href="MenuUsuario.php"><I>VOLVER</I></a></p>
  <table width="957" border="1">
    <tr>
      <td><strong>Rut Proveedor</strong></td>
      <td><strong>Fecha Documento</strong></td>
      <td><strong>Fecha Ingreso</strong></td>
      <td><strong>Tipo Documento</strong></td>
      <td><strong>Orden Compra</strong></td>
      <td><strong>N° Documento</strong></td>
      <td><strong>Código Producto</strong></td>
      <td><strong>Lote</strong></td>
      <td><strong>Cantidad</strong></td>
      <td><strong>Valor</strong></td>
      <td><strong>Fecha Vencimiento</strong></td>
      <td><strong>Marca</strong></td>
    </tr>
    <tr>
     <?php
    $listado 
"select * from ingreso_doc";
    
$sentencia mysql_query($listado,$con);
    while(
$rs=mysql_fetch_array($sentencia,$db)){ 
    
?>
    </tr>
    <tr>
      <td ><pre><strong><?php echo $rs["rut_provee"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["fecha_doc"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["fecha_ingre"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["tipo_doc"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["orden_com"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["num_doc"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["prod_cod"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["lote"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["cant"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["valor"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["fecha_venc"];?></strong></pre></td>
      <td ><pre><strong><?php echo $rs["marca"];?></strong></pre></td> 
     </tr>
    <?php
    
}
    
?>
  </table>
</div>
</form>
</body>
</html>
y no se que puede ser agradeceria mucho las ayudas.

Saludos y gracias