the idea is when forzen's time user get limit, change the status congelacion=0, and reset congelacion time
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE cursosxcliente SET idCliente=%s, idCurso=%s, tiempo=%s, valor_curso=%s, congelado=%s, notas_cliente=%s, Fecha_inicio=%s, Fecha_exp=%s,Fecha_inicio_congelacion=%s,Fecha_fin_congelacion=%s WHERE idCursoXCliente=%s",
GetSQLValueString($_POST['idCliente'], "int"),
GetSQLValueString($_POST['idCurso'], "text"),
GetSQLValueString($_POST['tiempo'], "text"),
GetSQLValueString($_POST['valor_curso'], "int"),
GetSQLValueString($_POST['congelado'], "int"),
GetSQLValueString($_POST['notas_cliente'], "text"),
GetSQLValueString($_POST['Fecha_inicio'], "text"),
GetSQLValueString($_POST['Fecha_exp'], "text"),
GetSQLValueString($_POST['Fecha_inicio_congelacion'], "text"),
GetSQLValueString($_POST['Fecha_fin_congelacion'], "text"),
GetSQLValueString($_POST['idCursoXCliente'], "int"));
$hoy = date("Y-m-d");
$decongelar = explode("-",$row_actualizarCursoCliente['Fecha_fin_congelacion']);
if ($descongelar[0] == $hoy[0] && $descongelar[1] == $hoy[1] && $descongelar[2] == $hoy[2] && $row_actualizarCursoCliente['congelado']=="1") {
$updateSQLs = sprintf("UPDATE cursosxcliente SET congelado=0,Fecha_inicio_congelacion=default,Fecha_fin_congelacion=default WHERE idCursoXCliente=%s",
GetSQLValueString($_POST['congelado'], "int"),
GetSQLValueString($_POST['Fecha_inicio_congelacion'], "text"),
GetSQLValueString($_POST['Fecha_fin_congelacion'], "text"));
}
mysql_select_db($database_connectBD_fc, $connectBD_fc);
$Result1 = mysql_query($updateSQL,$updateSQLs, $connectBD_fc) or die(mysql_error());
$updateGoTo = "exito-act-curs-cliente.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
Here is a how it work. but I am not sure why it no update.