La pagina la estoy haciendo en dreamweaver 8, este es el codigo para insertar
Código PHP:
Ver originalfunction GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
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;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO actividades (ot_id, actividad, monto, iva, horas_soporte) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['hiddenField'], "int"),
GetSQLValueString($_POST['actividad'], "text"),
GetSQLValueString($_POST['monto'], "int"),
if(isset($_POST['chkIva'])) GetSQLValueString($_POST['monto'] * 0.19, "int"),
GetSQLValueString($_POST['hora'].":".$_POST['minuto'], "date"));
$insertGoTo = "cerrarPopUp.php";
if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ?
"&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING'];
}
}