OK, that’s all cleared up now…
Now I’m trying to solve the null date problems on the connector file, but I can’t get it right:
I’m trying to get the two calendars (“DATA_DECO” and “DATA_REST_PR”) to write NULL in the relevant date field of the table, if they are empty. I’ve tried a zillion combinations of $nullDate but none work…
<?php
require_once("toitoi_config.php");
require_once("./dhtmlx/connector/codebase/form_connector.php");
$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);
function checkUp($data){
// $nullDate = "NULL";
$nullDate = "0000-00-00";
$dtFr = $data->get_value("DATA_DECO");
if ($dtFr==NULL) $data->set_value("DATA_DECO",$nullDate);
$dtTo = $data->get_value("DATA_REST_PR");
if ($dtTo==NULL) $data->set_value("DATA_REST_PR",$nullDate);
}
$form = new FormConnector($res);
$form->enable_log("./logs/logFile.txt",true);
$form->event->attach("beforeUpdate","checkUp")
$form->render_table("prevent","PrevId","COD_FILIALE,ANNO,NUMERO,DATA,NOMINATIVO,INDIRIZZO,CITTA,PV,ATTENZIONE,PAGAMENTI,IVA,SPI,NF,DES_RAG_SOC1,DES_RAG_SOC2,IND_DEST,CITTA_DEST,CAP_DEST,PROV_DEST,LAT,LNG,REFERENTE,TELEF_DEST,DATA_DECO,DATA_REST_PR,INTERVALLO_P,TOTALE_SCONT,TRASPORTO,COSTO_SPURGO,TOTALE_EURO,TOTALE_IVA,TOTALE_OFFER,COMMENTO");
?>