Ejemplo n.º 1
0
function nuHashData()
{
    $form_data = nuV('form_data');
    $h['TABLE_ID'] = nuTT();
    $h['RECORD_ID'] = nuV('record_id');
    $h['FORM_ID'] = nuV('form_id');
    $h['nu_browse_filter'] = nuV('filter');
    $h['nu_edited_record'] = nuV('edited');
    $h['nu_cloned_record'] = nuV('cloned');
    $h['nu_new_record'] = nuV('record_id') == '-1' ? '1' : '0';
    for ($f = 0; $f < count($form_data['data']); $f++) {
        if (array_key_exists('records', $form_data['data'][$f])) {
            for ($r = 0; $r < count($form_data['data'][$f]['records']); $r++) {
                if (isset($form_data['data'][$f]['records'][$r]['fields'])) {
                    for ($i = 0; $i < count($form_data['data'][$f]['records'][$r]['fields']); $i++) {
                        $fd = $form_data['data'][$f]['records'][$r]['fields'][$i];
                        if ($form_data['data'][$f]['subform'] == '') {
                            $prefix = '';
                        } else {
                            $prefix = $form_data['data'][$f]['subform'] . substr('000' . $r, -4);
                        }
                        $h[$prefix . $fd['field']] = $fd['value'];
                    }
                    if ($form_data['data'][$f]['subform'] != '') {
                        $h[$form_data['data'][$f]['subform']][] = $prefix;
                        if ($form_data['data'][$f]['records'][$r]['delete_record'] == 'no') {
                            $h[$form_data['data'][$f]['subform'] . '_save'][] = $prefix;
                        }
                    }
                }
            }
        }
    }
    $v = nuV();
    foreach ($v as $key => $value) {
        //-- add nuV() to form_data
        $used = false;
        if (isset($_POST['nuWindow']['form_data'])) {
            for ($i = 0; $i < count($_POST['nuWindow']['form_data']['data'][0]['records'][0]['fields']); $i++) {
                //-- reapply hash variables from calling edit page (incase over written by $_POST['nuWindow'])
                if ($_POST['nuWindow']['form_data']['data'][0]['records'][0]['fields'][$i]['field'] == $key) {
                    $used = true;
                    break;
                }
            }
        }
        if (!$used) {
            $add['field'] = $key;
            $add['value'] = $value;
            $add['save'] = '0';
            $_POST['nuWindow']['form_data']['data'][0]['records'][0]['fields'][] = $add;
        }
    }
    $setup = $GLOBALS['nuSetup'];
    //-- Read SMTP AUTH Settings from zzsys_setup table
    $h['nu_denied'] = $setup->set_denied;
    //-- hide ids like .. eg. nu%
    $h['nu_smtp_username'] = $setup->set_smtp_username;
    $h['nu_smtp_password'] = $setup->set_smtp_password;
    $h['nu_smtp_host'] = $setup->set_smtp_host;
    $h['nu_smtp_from_address'] = $setup->set_smtp_from_address;
    $h['nu_smtp_port'] = $setup->set_smtp_port;
    $h['nu_smtp_use_ssl'] = $setup->set_smtp_use_ssl;
    $h['nu_smtp_from_name'] = $setup->set_smtp_from_name;
    $sessionData = nuSessionArray(nuV('session_id'));
    //-- user and access info
    $recordData = nuRecordArray(array_merge($sessionData, $h));
    //-- record data
    foreach ($_POST['nuWindow'] as $key => $value) {
        //-- add current hash variables
        $h[$key] = $value;
    }
    if (isset($form_data['data'][0]['records'][0]['fields'])) {
        for ($i = 0; $i < count($form_data['data'][0]['records'][0]['fields']); $i++) {
            //-- reapply hash variables from calling edit page (incase over written by $_POST['nuWindow'])
            $fd = $form_data['data'][0]['records'][0]['fields'][$i];
            $h[$fd['field']] = $fd['value'];
        }
    }
    return array_merge($recordData, $sessionData, $h);
}
Ejemplo n.º 2
0
<?php

require_once 'nucommon.php';
$jsonID = $_GET['i'];
$t = nuRunQuery("SELECT deb_message AS json FROM zzzsys_debug WHERE zzzsys_debug_id = ? ", array($jsonID));
$r = db_fetch_object($t);
$JSON = json_decode($r->json);
$DATA = $JSON->slp_php;
$ID = $JSON->zzzsys_php_id;
$DATA = nuGetSafePHP('slp_php', $ID, $DATA);
$TABLE_ID = nuTT();
$hashData = nuBuildHashData($JSON, $TABLE_ID);
$php = nuReplaceHashes($DATA, $hashData);
eval($php);
//-- run php code
nuRunQuery("DELETE FROM zzzsys_debug WHERE zzzsys_debug_id = ? ", array($jsonID));
Ejemplo n.º 3
0
function nuGetObjectLookup($f, $o, $recordID, $hashData)
{
    $hashData['TABLE_ID'] = nuTT();
    $nuObject = nuBaseObject($o, $recordID, $hashData);
    if ($recordID == '-1' or nuUseDefault($o)) {
        $recordID = nuGetDefaultValue($o->sob_all_default_value_sql, $hashData);
        $values = nuGetLookupValues($f, $o, $recordID, $hashData, 1);
    } else {
        $values = nuGetLookupValues($f, $o, $recordID, $hashData, 0);
    }
    $nuObject->value = $values;
    $nuObject->c_width = $o->sob_lookup_code_width;
    $nuObject->d_width = $o->sob_lookup_description_width;
    if ($nuObject->display != '1') {
        $nuObject->c_width = '0';
        $nuObject->d_width = '0';
    }
    $nuObject->width = $o->sob_lookup_description_width + $o->sob_lookup_code_width + 24;
    $nuObject->form = $o->sob_lookup_zzzsys_form_id;
    $nuObject->autocomplete = $o->sob_lookup_autocomplete;
    nuRemoveTempTables($hashData);
    return $nuObject;
}