Example #1
0
 private function buildObject($o, $r)
 {
     $subformObject = new formObject($this->parentForm, $this->recordID);
     $subformObject->parentType = 'subform';
     $subformObject->session = $this->parentForm->session;
     $subformObject->formsessionID = $this->parentForm->formsessionID;
     $subformObject->customDirectory = $this->parentForm->customDirectory;
     $subformObject->setObjectProperties($o);
     //---decide whether to show or hide this object
     $subformObject->displayThisObject = displayCondition($this->parentForm->arrayOfHashVariables, $o->sob_all_display_condition);
     //---get the value and format it
     if ($subformObject->objectProperty['sob_' . $subformObject->objectProperty['sob_all_type'] . '_read_only'] != '1') {
         $GLOBALS['formValues'][] = $this->subformPrefix . $subformObject->objectProperty['sob_all_name'];
     }
     $subformObject->objectValue = $subformObject->setValue($this->recordID, $this->parentForm->cloning, $r[$subformObject->objectProperty['sob_all_name']]);
     //---create the html string that will display it
     $subformObject->objectHtml = $subformObject->buildObjectHTML($this->CRLF, $this->TAB . $this->TAB, $this->subformPrefix);
     return $subformObject->objectHtml;
 }
 private function buildObject($o)
 {
     $this->bgcolor = iif($this->bgcolor == 'Gainsboro', 'white', 'Gainsboro');
     $formObject = new formObject($this, $this->recordID);
     $formObject->bgcolor = $this->bgcolor;
     $formObject->parentType = 'form';
     $formObject->formsessionID = $this->formsessionID;
     $formObject->setObjectProperties($o);
     //---decide whether to show or hide this object
     $formObject->displayThisObject = displayCondition($o->sob_all_display_condition, $this->recordID, $this->recordValues);
     //---get the value and format it
     if ($this->holdingValues == 1) {
         $formObject->objectValue = $this->holdingValue($this->formID . $this->recordID . $this->session, $formObject->objectProperty['sob_all_name']);
         if ($formObject->objectProperty['sob_all_type'] == 'lookup') {
             $formObject->lookupArray['id'] = $this->holdingValue($this->formID . $this->recordID . $this->session, $formObject->objectProperty['sob_all_name']);
             //-------
             //--get sql from lookup form
             $lookupFormID = $formObject->objectProperty['sob_lookup_zzsysform_id'];
             $t = nuRunQuery("SELECT * FROM zzsys_form WHERE zzsys_form_id = '{$lookupFormID}'");
             $r = db_fetch_object($t);
             $TT = $this->TT;
             $browseTable = $TT;
             eval($r->sfo_custom_code_run_before_browse);
             $SQLwithGlobalValues = replaceVariablesInString($this->TT, $r->sfo_sql, '');
             $SQLwithRecordValues = getSqlRecordValues($SQLwithGlobalValues, $this->parentForm->recordAndFieldValues);
             $SQL = new sqlString($SQLwithRecordValues);
             //-------
             //				$SQL                                      = new sqlString(replaceVariablesInString($formObject->TT,$formObject->objectProperty['sob_lookup_sql'], ''));
             $SQL->setWhere("WHERE " . $formObject->objectProperty['sob_lookup_id_field'] . " = '{$formObject->objectValue}'");
             $SQL->removeAllFields();
             $SQL->addField($formObject->objectProperty['sob_lookup_id_field']);
             $SQL->addField($formObject->objectProperty['sob_lookup_code_field']);
             $SQL->addField($formObject->objectProperty['sob_lookup_description_field']);
             $T = nuRunQuery($SQL->SQL);
             $R = db_fetch_row($T);
             $formObject->lookupArray['id'] = $R[0];
             $formObject->lookupArray['code'] = $R[1];
             $formObject->lookupArray['description'] = $R[2];
         }
     } else {
         $formObject->objectValue = $formObject->setValue($this->recordID, $this->cloning, $this->recordValues[$formObject->objectProperty['sob_all_name']]);
     }
     //---create the html string that will display it
     $formObject->objectHtml = $formObject->buildObjectHTML($this->CRLF, $this->TAB . $this->TAB . $this->TAB . $this->TAB . $this->TAB, '');
     $this->formObjects[] = $formObject;
     nuRunQuery("DROP TABLE IF EXISTS {$formObject->TT}");
 }