<?php require_once('../Connections/cn_conexion.php'); ?>
<?php
if (!isset($_SESSION)) {
  session_start();
}

$igv=$_GET["igv"];
$fecha=date("Y-m-d");

$_SESSION["igv"]=$igv;
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$insertSQL = sprintf("INSERT INTO igv (igv, fecha) VALUES (%s, %s)",
				   GetSQLValueString($igv, "int"),
				   GetSQLValueString($fecha, "date"));

mysql_select_db($database_cn_conexion, $cn_conexion);
$Result1 = mysql_query($insertSQL, $cn_conexion) or die(mysql_error());

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5%">&nbsp;</td>
    <td width="91%" bgcolor="#999999"><form id="form1" name="form1" method="POST" action="">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="3"><p class="rot_man">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IGV</p></td>
        </tr>
        <tr>
          <td width="8%">&nbsp;</td>
          <td width="32%" height="25">IGV</td>
          <td width="60%"><input name="igv" type="text" id="igv" value="<?php echo $igv; ?>" size="10" />
            %</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td height="25">&nbsp;</td>
          <td><input type="button" name="button2" id="button2" value="Guardar" onclick="guardar_cambio()"/></td>
        </tr>
      </table>
    </form></td>
    <td width="4%">&nbsp;</td>
  </tr>
</table>
