unset($aData['DYN_UID']); } } else { $aData = $_POST; //For Extjs (Since we are not using form in ExtJS) $aFields = array(); $aVariables = array(); if (isset($aData['FIELDS'])) { $aFields = G::json_decode($_POST['FIELDS']); $aVariables = G::json_decode($_POST['VARIABLES']); } $aData['FIELDS'] = array(); for ($i = 0; $i < count($aFields); $i++) { $aData['FIELDS'][$i + 1]['FLD_NAME'] = $aFields[$i]; $aData['FIELDS'][$i + 1]['PRO_VARIABLE'] = $aVariables[$i]; } } //if ($aData['DYN_UID']==='') unset($aData['DYN_UID']); if (isset($aData['DYN_UID'])) { $dynaform->Save($aData); } else { if (!isset($aData['ADD_TABLE']) || $aData['ADD_TABLE'] == "") { $aFields = $dynaform->create($aData); } else { $aFields = $dynaform->createFromPMTable($aData, $aData['ADD_TABLE']); } $aData['DYN_UID'] = $dynaform->getDynUid(); $dynaform->update($aData); } echo $dynaform->getDynUid(); }