$r = $_GET['r'];
$s = $_GET['s'];
include '../' . $_SESSION['customDirectory'] . '/database.php';
include 'common.php';
$_SESSION['holding-Varibles'] = true;
print 'got there<br/>';
while (list($key, $value) = each($_POST)) {
    $_SESSION["{$f}{$r}"][$key] = $value;
    print 'gothere<br/>';
}
print_r($_SESSION);
$formID = $f;
$recordID = $r;
$sessionID = $s;
$value = array();
$form = formFields($formID);
$t = nuRunQuery("SELECT * FROM zzsys_object WHERE sob_zzsys_form_id = '{$f}'");
$dq = '"';
print "<html>\n";
print "<head>\n";
print "<meta http-equiv='Content-Type' content='text/html;'/>\n";
print "<title></title>\n";
print "<script type='text/javascript' src='common.js' language='javascript'></script>\n";
print "<!-- Form Functions -->\n";
print "<script type='text/javascript'>\n";
print "/* <![CDATA[ */\n\n";
print "function checkDuplicate(){\n";
while ($r = db_fetch_array($t)) {
    if ($r['sob_' . $r['sob_all_type'] . '_no_duplicates'] == '1') {
        // eg 'sob_dropdown_no_duplicates'
        $field = $r['sob_all_name'];
Example #2
0
 function loadAfterConstruct($theFormID, $theRecordID, $clone, $delete, $runActivity, $dir, $ses, $tempObjectTable, $session)
 {
     $this->access_level = $session->sss_access_level;
     $this->session_id = $session->sss_session_id;
     $this->zzsys_user_id = $session->sss_zzsys_user_id;
     $this->zzsys_user_group_name = $session->sss_zzsys_user_group_name;
     $this->startTime = time();
     $this->objectTableName = $tempObjectTable;
     $this->customDirectory = $dir;
     $this->session = $ses;
     $this->formsessionID = uniqid('1');
     nuRunQuery("DELETE FROM zzsys_variable WHERE sva_id = '{$this->formsessionID}'");
     $this->formID = $theFormID;
     //---Primary Key of zzsys_form Table
     $this->form = formFields($theFormID);
     $this->recordID = $theRecordID;
     //---ID of displayed record (-1 means a new record)
     setnuVariable($this->formsessionID, nuDateAddDays(Today(), 2), 'recordID', $this->recordID);
     $this->cloning = $clone;
     //---Whether this will be a new record cloned from $formID's record
     $this->delete = $delete;
     $this->setup = nuSetup();
     //----------create an array of hash variables that can be used in any "hashString"
     if ($this->form->sfo_report_selection != '1') {
         $T = nuRunQuery("SELECT " . $this->form->sfo_table . ".* FROM " . $this->form->sfo_table . " WHERE " . $this->form->sfo_primary_key . " = '{$this->recordID}'");
         $this->recordValues = db_fetch_array($T);
         $this->arrayOfHashVariables = recordToHashArray($this->form->sfo_table, $this->form->sfo_primary_key, $this->recordID);
         //--values of this record
     }
     $this->arrayOfHashVariables['#recordID#'] = $theRecordID;
     //--this record's id
     $this->arrayOfHashVariables['#id#'] = $theRecordID;
     //--this record's id
     $this->arrayOfHashVariables['#clone#'] = $clone;
     //--if it is a clone
     $this->arrayOfHashVariables['#formSessionID#'] = $this->formsessionID;
     //--form session id
     $sVariables = recordToHashArray('zzsys_session', 'zzsys_session_id', $ses);
     //--session values (access level and user etc. )
     $this->arrayOfHashVariables = joinHashArrays($this->arrayOfHashVariables, $sVariables);
     //--join the arrays together
     $nuHashVariables = $this->arrayOfHashVariables;
     //--added by sc 23-07-2009
     //----------allow for custom code----------------------------------------------
     //--replace hash variables then run code
     $runCode = replaceHashVariablesWithValues($this->arrayOfHashVariables, $this->form->sfo_custom_code_run_before_open);
     if ($_GET['debug'] != '') {
         tofile('sfo_custom_code_run_before_open hash variables : debug value:' . $_GET['debug']);
         tofile(print_r($this->arrayOfHashVariables, true));
         tofile($runCode);
     }
     eval($runCode);
     if ($newRecordID != '') {
         $this->recordID = $newRecordID;
     }
     //-----------custom code end---------------------------------------------------
     $this->runActivity = $runActivity;
     //----defaultJSfunctions needs $formTabs populated first
     $this->defaultJSfunctions();
     $this->createActionButtonsHTML();
 }
 function __construct($theFormID, $theRecordID, $clone, $delete, $runActivity, $dir, $ses)
 {
     $this->startTime = time();
     $this->customDirectory = $dir;
     $this->session = $ses;
     $this->formsessionID = uniqid('1');
     $this->formID = $theFormID;
     //---Primary Key of sysform Table
     $this->form = formFields($theFormID);
     $this->recordID = $theRecordID;
     //---ID of displayed record (-1 means a new record)
     if ($_GET['r'] == '') {
         //-----no 'r' passed means it hasn't been called from a lookup
         $this->holdingValues = 0;
         nuRunQuery("DELETE FROM zzsys_small_form_value WHERE sfv_form_record = '{$this->formID}{$this->recordID}{$this->session}'");
     } else {
         $this->holdingValues = 1;
     }
     //		$T                       = nuRunQuery("SELECT COUNT(*) FROM zzsys_small_form_value WHERE sfv_form_record = '$theFormID$theRecordID$ses' GROUP BY sfv_form_record");
     //		$R                       = db_fetch_row($T);
     //		$this->holdingValues     = iif($R[0]=='',0,1);
     //----------allow for custom code----------------------------------------------
     if ($this->form->sfo_custom_code_run_before_open != '') {
         eval($this->form->sfo_custom_code_run_before_open);
     }
     //-----------custom code end---------------------------------------------------
     $this->cloning = $clone;
     //---Whether this will be a new record cloned from $formID's record
     $this->delete = $delete;
     $this->setup = nuSetup();
     $formID = $this->form->zzsys_form_id;
     $formTableName = $this->form->sfo_table;
     $formPrimaryKey = $this->form->sfo_primary_key;
     $T = nuRunQuery("SELECT * FROM {$formTableName} WHERE {$formPrimaryKey} = '{$this->recordID}'");
     $this->recordValues = db_fetch_array($T);
     $this->runActivity = $runActivity;
     $this->defaultJSfunctions();
     $this->createActionButtonsHTML();
 }
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
$dir = $_GET['dir'];
$form_ses = $_GET['form_ses'];
$ses = $_GET['ses'];
$prefix = $_GET['p'];
$o = $_GET['o'];
$r = $_GET['r'];
$n = $_GET['n'];
include "../{$dir}/database.php";
include 'common.php';
$object = objectFields($r);
$lookupForm = formFields($object->sob_lookup_zzsysform_id);
$TT = TT();
$browseTable = $TT;
$updateField = array();
//----------create an array of hash variables that can be used in any "hashString"
$sesVariables = recordToHashArray('zzsys_session', 'zzsys_session_id', $ses);
//--session values (access level and user etc. )
$sesVariables['#TT#'] = $TT;
$sesVariables['#browseTable#'] = $TT;
$sesVariables['#formSessionID#'] = $form_ses;
$sesVariables['#rowPrefix#'] = $prefix;
$sysVariables = sysVariablesToHashArray($form_ses);
//--values in sysVariables from the calling lookup page
$arrayOfHashVariables = joinHashArrays($sysVariables, $sesVariables);
//--join the arrays together
$nuHashVariables = $arrayOfHashVariables;
//--session values (access level and user etc. )
//----------allow for custom code----------------------------------------------
//	eval(replaceHashVariablesWithValues($sVariables, $setup->set_php_code)); //--replace hash variables then run code
print "<html>\n";
print "<head>\n";
print "<meta http-equiv='Content-Type' content='text/html'/>\n";
print "<title></title>\n";
print "<!-- Form Functions -->\n";
print "<script type='text/javascript'>\n";
print "/* <![CDATA[ */\n";
print "function reload(pthis){//  reload form.php\n";
if ($_POST['del_ok'] == '1') {
    print "   parent.window.close();\n";
    print "   parent.opener.document.focus();\n";
    print "   parent.opener.document.forms[0].submit();\n";
    $theform = formFields($sysformID);
    nuRunQuery("DELETE FROM {$theform->sfo_table} WHERE {$theform->sfo_primary_key} = '{$recordID}'");
    $t = nuRunQuery("SELECT * FROM zzsys_object WHERE sob_zzsys_form_id = '{$sysformID}' and sob_all_type = 'subform'");
    while ($r = db_fetch_object($t)) {
        nuRunQuery("DELETE FROM {$r->sob_subform_table} WHERE {$r->sob_subform_foreign_key} = '{$recordID}'");
    }
    //----------create an array of hash variables that can be used in any "hashString"
    $arrayOfHashVariables1 = postVariablesToHashArray();
    //--values of this record
    $arrayOfHashVariables1['#id#'] = $theRecordID;
    //--this record's id
    $arrayOfHashVariables = recordToHashArray('zzsys_session', 'zzsys_session_id', $ses);
    //--session values (access level and user etc. )
    $arrayOfHashVariables = joinHashArrays($arrayOfHashVariables, $arrayOfHashVariables1);
    //--join the arrays together
    $nuHashVariables = $arrayOfHashVariables;
//-- zzsys_session_id in zzsys_session
$f = $_GET['f'];
//-- zzsys_form_id in zzsys_form
$rID = $_GET['r'];
//-- lookup's selected record id
$fr = $_GET['fr'];
//-- form's record id
$ob = $_GET['ob'];
//-- zzsys_object_id in zzsys_object of selected lookup
$value = $_GET['value'];
//-- selected value to go back into lookup field
include "../{$dir}/database.php";
include 'common.php';
$TT = TT();
$object = objectFields($ob);
$browse = formFields($object->sob_lookup_zzsysform_id);
$SQL = new sqlString(replaceVariablesInString($TT, $browse->sfo_sql, ''));
if ($SQL->where == '') {
    $SQL->setWhere(" WHERE {$object->sob_lookup_id_field} = '{$rID}'");
} else {
    $SQL->setWhere(" {$SQL->where} AND ({$object->sob_lookup_id_field} = '{$rID}')");
}
$SQL->removeAllFields();
$SQL->addField($object->sob_lookup_id_field);
$fieldNames[] = $object->sob_all_name;
$SQL->addField($object->sob_lookup_code_field);
$fieldNames[] = 'code' . $object->sob_all_name;
$SQL->addField($object->sob_lookup_description_field);
$fieldNames[] = 'description' . $object->sob_all_name;
$t = nuRunQuery("SELECT * FROM zzsys_lookup WHERE slo_zzsys_object_id = '{$object->zzsys_object_id}'");
while ($r = db_fetch_object($t)) {
 function __construct($theFormID, $thePageNumber, $theOrderBy, $isDescending, $theSearchString, $subformPrefix, $objectID, $recordID)
 {
     $this->TT = TT();
     //---temp table name
     $this->theFormID = $theFormID;
     $this->objectID = $objectID;
     $this->recordID = $recordID;
     $this->rowPrefix = $subformPrefix;
     $this->PageNo = $thePageNumber;
     $this->orderBy = $theOrderBy;
     $this->isDescending = $isDescending;
     $this->form = formFields($theFormID);
     if ($objectID == '') {
         $this->callingForm = formFields($theFormID);
     } else {
         $this->isLookup = true;
         $t = nuRunQuery("SELECT sob_lookup_zzsysform_id FROM zzsys_object WHERE zzsys_object_id = '{$objectID}'");
         $r = db_fetch_row($t);
         $this->callingForm = formFields($r[0]);
         while (list($key, $va) = each($_POST)) {
             $uniq = uniqid('1');
             $key = str_replace("'", "\\'", $key);
             nuRunQuery("INSERT INTO zzsys_small_form_value (zzsys_small_form_value_id, sfv_form_record, sfv_name, sfv_value) VALUES ('{$uniq}', '{$theFormID}{$this->recordID}{$ses}" . $_GET['ses'] . "', '{$key}', '{$va}')");
         }
     }
     $this->searchString = $theSearchString;
     $this->pageLength = 10;
     $this->rowHeight = 20;
     $this->startTime = time();
     $this->setup = nuSetup();
     $this->getColumnInfo($this->callingForm->zzsys_form_id);
     $this->defaultJSfunctions();
     if ($this->callingForm->sfo_sql_run_before_display != '') {
         $beforeDisplaySQL = replaceVariablesInString($this->TT, $this->callingForm->sfo_sql_run_before_display, '');
         $sqlStatements = array();
         $sqlStatements = explode(';', $beforeDisplaySQL);
         //---create a tempfile to be used later as object is being built.
         for ($i = 0; $i < count($sqlStatements); $i++) {
             if (trim($sqlStatements[$i]) != '') {
                 nuRunQuery($sqlStatements[$i]);
             }
         }
     }
     $this->SQL = new sqlString(replaceVariablesInString($this->TT, $this->callingForm->sfo_sql, ''));
     $this->buildWhereClause($theSearchString);
     $this->SQL->setWhere($this->pageWhereClause);
     $this->SQL->setOrderBy($this->buildOrderBy());
     $this->pageBody = $this->buildBody();
     $this->pageHeader = $this->buildHeader();
 }
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
$dir = $_GET['dir'];
$ses = $_GET['ses'];
$f = $_GET['f'];
$r = $_GET['r'];
$c = $_GET['c'];
$d = $_GET['d'];
$debug = $_GET['debug'];
$fb = '1';
include "../{$dir}/database.php";
include 'common.php';
$form = formFields($f);
print "<html>\n";
print "<head><title>{$form->sfo_title}</title></head>\n";
print "<frameset frameborder='no' rows='100%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%,0%'>\n";
print "<body>\n";
if ($f == 'index') {
    print "<frame name='index' scrolling='yes' src='form.php?x=1&f={$f}&r={$r}&dir={$dir}&ses={$ses}&c={$c}&d={$d}&debug={$debug}'>\n";
} else {
    print "<frame name='main' scrolling='yes' src='form.php?x=1&f={$f}&r={$r}&dir={$dir}&ses={$ses}&c={$c}&d={$d}&debug={$debug}'>\n";
}
for ($i = 0; $i < 11; $i++) {
    print "<frame name='hide{$i}'  frameborder='{$fb}' src='blank.html'>\n";
}
print "</body>\n";
print "</frameset>\n";
print "</html>\n";
 function loadAfterConstruct($theFormID, $thePageNumber, $theOrderBy, $isDescending, $theSearchString, $subformPrefix, $dir, $ses, $form_ses, $zzsys_user_id)
 {
     $this->TT = TT();
     //---temp table name
     $this->rowPrefix = $subformPrefix;
     $this->customDirectory = $dir;
     $this->session = $ses;
     $this->form_session = $form_ses;
     $this->PageNo = $thePageNumber;
     $this->orderBy = $theOrderBy;
     $this->isDescending = $isDescending;
     $this->oldFormID = $theFormID;
     $this->theFormID = $this->getFormID($theFormID);
     $this->searchString = $theSearchString;
     $this->pageLength = 27;
     $this->rowHeight = 20;
     $this->startTime = time();
     $this->setup = nuSetup();
     $this->getColumnInfo($this->theFormID);
     $this->form = formFields($this->theFormID);
     $this->defaultJSfunctions();
     $this->zzsys_user_id = $zzsys_user_id;
     //----------create an array of hash variables that can be used in any "hashString"
     $sesVariables = recordToHashArray('zzsys_session', 'zzsys_session_id', $ses);
     //--session values (access level and user etc. )
     $sesVariables['#TT#'] = $this->TT;
     $sesVariables['#browseTable#'] = $this->TT;
     $sesVariables['#formSessionID#'] = $form_ses;
     $sysVariables = sysVariablesToHashArray($form_ses);
     //--values in sysVariables from the calling lookup page
     $this->arrayOfHashVariables = joinHashArrays($sysVariables, $sesVariables);
     //--join the arrays together
     $nuHashVariables = $this->arrayOfHashVariables;
     //--added by sc 23-07-2009
     //----------allow for custom code----------------------------------------------
     $globalValue = getglobalValue($this->session);
     $browseTable = $this->TT;
     eval(replaceHashVariablesWithValues($this->arrayOfHashVariables, $this->form->sfo_custom_code_run_before_browse));
     $this->old_sql_string = $this->form->sfo_sql;
     $this->new_sql_string = replaceHashVariablesWithValues($this->arrayOfHashVariables, $this->form->sfo_sql);
     $s = "\n/*\n old : {$this->old_sql_string} \n*/\n";
     $s = $s . "\n/*\n new : {$this->new_sql_string} \n*/\n";
     $this->appendJSfuntion($s);
     $this->SQL = new sqlString($this->new_sql_string);
     $this->buildWhereClause($theSearchString);
     $this->SQL->setWhere($this->pageWhereClause);
     $this->SQL->setOrderBy($this->buildOrderBy());
     $this->pageBody = $this->buildBody();
     $this->pageHeader = $this->buildHeader();
 }