<?php
 session_start();
 //Recibe Datos
 $LLAVE=$_SESSION['nick'];
 $COD_INTERNO=$_POST['COD_INTERNO'];
 $COD_BARRA=$_POST['COD_BARRA'];
 $GLOSA=$_POST['GLOSA'];
 $PRECIO=$_POST['PRECIO'];
 $CANTIDAD=$_POST['CANTIDAD'];

 //$PRECIO=number_format($_POST['PRECIO'],0,".",",");
 //$CANTIDAD=number_format($_POST['CANTIDAD'],0,".",",");
 //$STOTAL=number_format(($PRECIO*$CANTIDAD),0,".",",");
 $STOTAL=$_POST['hdtot'];
 
 //------INI-Coneccion Local
 require ("conecta.php");
 //------INI-Coneccion Local
 //Recibe descripcion
 $sqli="INSERT INTO m02004 (LLAVE, COD_INTERNO, COD_BARRA, GLOSA, CANTIDAD, PRECIO, STOTAL,ESTADO) VALUES('$LLAVE','$COD_INTERNO','$COD_BARRA','$GLOSA','$CANTIDAD','$PRECIO','$STOTAL','0');";
 $resi=mysql_query($sqli,$con) or die(mysql_error());
?>
<!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>

<TITLE>Agregar</TITLE>

<link rel="stylesheet" href="styles.css">
<script language="javascript">
function cerrarp(){
opener.document.form1.submit();
javascript:window.close();
}//cerrar
</script>
</HEAD>
<BODY onload="javascript:document.form1.cerrar.focus();">
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" align=center 
border=0>
  <TBODY>
  <TR>
    <TD vAlign=center align=middle height="100%">
      <TABLE height=371 cellSpacing=0 cellPadding=0 width=648 border=0>
        <TBODY>
        <TR>
          <TD width="718" height=22>
            <TABLE height=22 cellSpacing=0 cellPadding=0 width="100%" 
              border=0><TBODY>
              <TR>
                <TD vAlign=top align=left width=24><A 
                  href="index.php"><IMG 
                  height=22 src="images/xc_left.gif" width=24 
                  border=0></A></TD>
                <TD vAlign=top align=left width="100%"><IMG height=22 
                  src="images/xc_center.gif" width="100%" 
                border=0></TD>
              <TD vAlign=top align=right width=24><IMG height=22 
                  src="images/xc_right.gif" width=24 
              border=0></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD class=BottomTable vAlign=top 
          background=images/xc_stripes.gif height="100%">
            <TABLE class=IconsTable height=33 cellSpacing=0 cellPadding=0 
            width="100%" border=0>
              <TBODY>
              <TR>
                <TD height="32">&nbsp;</TD>
              </TR></TBODY></TABLE>
            <TABLE width="576" 
              border=0 align="center" cellPadding=0 cellSpacing=0>
              <TBODY>
              <TR>
                <TD width=52 height=8>&nbsp;</TD>
                <TD width="500" height=8 class="contentcell">
				<form id="form1" name="form1" method="post" onsubmit="return validar(this)" action="agregacarro.php">
                  <table width="73%" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="2" scope="col"><div align="center"><strong><span class="MainMenuHead">Los Siguientes datos fueron Agregados exitosamente:</span></strong><br />
                          <br />
                        </div></td>
                        </tr>
					  <tr>
                        <td width="11%" class="Emphasize" scope="row"><div align="right">Cod_interno:</div></td>
                        <td width="16%" scope="row"><div align="left">
                          <input name="COD_INTERNO" type="text" id="COD_INTERNO" disabled value="<?php echo $COD_INTERNO ?>" size="21" maxlength="20" />
                        </div></td>
                      </tr>
                      
                      <tr>
                        <td class="Emphasize" scope="row"><div align="right">Cod_barra:</div></td>
                        <td scope="row"><div align="left">
                          <input name="COD_BARRA" type="text" id="COD_BARRA" disabled value="<?php echo $COD_BARRA ?>" size="21" maxlength="20" />
                        </div></td>
                      </tr>
                      <tr>
                        <td class="Emphasize" scope="row"><div align="right"><strong>Glosa:</strong></div></td>
                        <td scope="row"><textarea name="GLOSA" cols="50" rows="5" disabled id="GLOSA"><?php echo $GLOSA ?>
</textarea></td>
                      </tr>
                      <tr>
                        <td class="Emphasize" scope="row"><div align="right"><strong>Cantidad:</strong></div></td>
                        <td scope="row"><div align="left">
                          <input name="CANTIDAD" type="text" disabled id="CANTIDAD" value="<?php echo $CANTIDAD ?>" size="11" maxlength="10" />
                        </div></td>
                      </tr>
                      <tr>
                        <td class="Emphasize" scope="row"><div align="right"><strong>Sub Total:</strong></div></td>
                        <td scope="row"><div align="left">
                            <input name="STOTAL" type="text" disabled="disabled" id="STOTAL" value="<?php echo $STOTAL ?>" size="11" maxlength="10" />
                        </div></td>
                      </tr>
                      <tr>
                        <td colspan="2" scope="row"><label>
                          <div align="center">
                            <input name="cerrar" type="button" id="cerrar" onclick="cerrarp()" value="Cerrar..."/>
                          </div>                          
                          </label></td>
                      </tr>
                      
                      <tr>
                        <th colspan="2" scope="row"><label></label></th>
                        </tr>
                    </table>
                </form>                </TD>
                <TD width=24 
      height=8>&nbsp;</TD></TR>
              <TR>
                <TD height=8 colspan="3">&nbsp;</TD>
                </TR>
              </TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY>
</TABLE>
</BODY>
</HTML>