Пример #1
0
 $frm = $_POST['form'];
 $PRO_UID = $frm['PRO_UID'];
 $DYN_UID = $frm['DYN_UID'];
 $DYN_TYPE = $frm['DYN_TYPE'];
 // checks if there are conditions attached to the dynaform
 $oFieldCondition = new FieldCondition();
 $aConditions = $oFieldCondition->getAllByDynUid($DYN_UID);
 $dynaform = new dynaform();
 /*Save Register*/
 $dynUid = G::generateUniqueID();
 $dynaform->setDynUid($dynUid);
 $dynaform->setProUid($PRO_UID);
 $dynaform->setDynType($DYN_TYPE);
 $dynaform->setDynFilename($PRO_UID . PATH_SEP . $dynUid);
 $con->begin();
 $res = $dynaform->save();
 $dynaform->setDynTitle($frm['DYN_TITLENEW']);
 $dynaform->setDynDescription(!$frm['DYN_DESCRIPTIONNEW'] ? 'Default Dynaform Description' : $frm['DYN_DESCRIPTIONNEW']);
 //$con->commit();
 $hd = fopen(PATH_DYNAFORM . $PRO_UID . '/' . $DYN_UID . '.xml', "r");
 $hd1 = fopen(PATH_DYNAFORM . $PRO_UID . '/' . $dynUid . '.xml', "w");
 $templateFilename = PATH_DYNAFORM . $PRO_UID . '/' . $DYN_UID . '.html';
 // also make a copy of the template file in case that the html edition is enabled
 if (file_exists($templateFilename)) {
     $templateHd = fopen($templateFilename, "r");
     $templateHd1 = fopen(PATH_DYNAFORM . $PRO_UID . '/' . $dynUid . '.html', "w");
 }
 // also copy all the necessarily conditions if there are any
 foreach ($aConditions as $condition) {
     $condition['FCD_UID'] = G::generateUniqueID();
     $condition['FCD_DYN_UID'] = $dynUid;