<? 
require_once('../conf/connection.php');

 $codigo = $_GET["cod"];
 $numero=$_GET["num"];
 $sucu =$_GET["sucu"];
 $nombreuser =$_GET["nombreuser"];
 $fecha = date("Y-m-d");
 $hora =  date("H:i:s");
 
  $query_num="SELECT * FROM articulos WHERE sucu='$sucu' AND referencia='$codigo'";
  $res_num=mysql_query($query_num); 
  $nr_ide=mysql_num_rows($res_num);

 if($codigo<>""){
  // consulta si el arcticulo existe...
  if($nr_ide<>0){
	  $producto=mysql_result($res_num,0,"descripcion");
	  $des_max=mysql_result($res_num,0,"des");
	  $valor=mysql_result($res_num,0,"precio_tienda");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head>
    <meta charset="utf-8">
    <title>mod_venta</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">

    <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="../style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="../style.responsive.css" media="all">

    <script src="../jquery.js"></script>
    <script src="../script.js"></script>
    <script src="../script.responsive.js"></script>



<style>.art-content .art-postcontent-0 .layout-item-0 { border-top-width:1px;border-top-style:solid;border-top-color:#B1C9C7;margin-top: 10px;margin-bottom: 10px;  }
.art-content .art-postcontent-0 .layout-item-1 { border-right-style:solid;border-right-width:1px;border-right-color:#B1C9C7; padding-right: 10px;padding-left: 10px;  }
.ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
.ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }

</style>
<script> 
function enviar(){ 
   document.venta.submit() 
} 

function volver(){ 
   window.history.back(); 
} 
</script>

</head>
<body>
<div id="art-main">

<div class="art-sheet clearfix">
            <div class="art-layout-wrapper">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content"><article class="art-post art-article">
                                
                                                
                                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-1" style="width: 100%" >
       
        <p>
        <font size="+1">Producto: <? echo $producto;  ?> | Precio venta: <? echo $valor ?> |  Descuento maximo:<? echo $des_max ?>%</font>
        <form name="venta" id="venta" action="add_pro.php" method=post> 
        <table width="533" border="0">
  <tr>
    <td width="126">
    <input type="hidden" name="numero" id="numero" value="<? echo $numero ?>">
    <input type="hidden" name="des_max" id="des_max" value="<? echo $des_max ?>">
    <input type="hidden" name="codigo" id="codigo" value="<? echo $codigo?>">
     <input type="hidden" name="sucu" id="sucu" value="<? echo $sucu ?>">
     <input type="hidden" name="nombreuser" id="nombreuser" value="<? echo $nombreuser ?>">
      Descuento: </td>
    <td width="397"><input type="text" name="des" id="des" style="font-size:14px" autofocus></td>
    </tr>
  <tr>
    <td>Cantidad: </td>
    <td><input type="text" name="cantidad" id="cantidad" style="font-size:14px"onChange="enviar()"
       ></td>
  </tr>
        </table>
</form><br>

<a href="#" onClick="volver()" class="art-button">Volver</a>
        </p>
    </div>
    </div>
</div>
<div class="art-content-layout-br layout-item-0">
</div></div>


</article></div>
                    </div>
                </div>
            </div>

    </div>
    
</div>


</body></html>
<? }else{?>
<script>
alert("articulo no encontrado...consulte con su adminitrador de sistemas...")
window.history.back();
</script>
<? }
}else{?><script>alert("Existen campos vacios, verifique la informacion...");window.history.back();</script> <? }?>