function run_html_report()
{
    $parameters = $_GET['ses'];
    $form_ses = $_GET['form_ses'];
    $report = $_GET['r'];
    $dir = $_GET['dir'];
    $emailer = $_GET['emailer'];
    include_once "../{$dir}/database.php";
    include_once 'common.php';
    if ($emailer != '1') {
        if (activityPasswordNeeded($report)) {
            $session = nuSession($parameters, false);
            if ($session->foundOK == '') {
                print 'you have been logged out..';
                return;
            }
        }
    }
    $setup = nuSetup();
    $T = nuRunQuery("SELECT * FROM zzsys_activity WHERE sat_all_code = '{$report}'");
    $A = db_fetch_object($T);
    //----------allow for custom code----------------------------------------------
    //--already done now..	eval($A->sat_report_display_code);
    $id = uniqid('1');
    $thedate = date('Y-m-d H:i:s');
    $dq = '"';
    if ($A->zzsys_activity_id != '') {
        //$viewer               = $_SESSION['zzsys_user_id'];
        $viewer = $session->sss_zzsys_user_id;
        $s = "INSERT INTO zzsys_report_log (zzsys_report_log_id, ";
        $s = $s . "srl_zzsys_activity_id, srl_date ,srl_viewer) ";
        $s = $s . "VALUES ('{$id}', '{$report}', '{$thedate}', '{$viewer}')";
        nuRunQuery($s);
    } else {
        print 'No Such Report...';
        return;
    }
    $s = "SELECT count(*), MAX(sva_expiry_date) FROM zzsys_variable ";
    $s = $s . "WHERE sva_id = '{$form_ses}' ";
    $s = $s . "GROUP BY sva_expiry_date";
    $t1 = nuRunQuery($s);
    $r1 = db_fetch_row($t1);
    $numberOfVariables = $r1[0];
    $expiryDate = $r1[1];
    //---must have at least 1 variable
    if ($numberOfVariables > 0) {
        $s = "DELETE FROM zzsys_variable ";
        $s = $s . "WHERE sva_id = '{$form_ses}' ";
        $s = $s . "AND sva_name = 'ReportTitle'";
        nuRunQuery($s);
        setnuVariable($form_ses, $expiryDate, 'ReportTitle', $A->sat_all_description);
        MakeReport($form_ses, $A);
    } else {
        print 'Report has Expired...';
    }
}
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
$GLOBALS['nuRunQuery'] = 0;
$GLOBALS['formValues'][] = 'xxx';
$dir = $_GET['dir'];
$ses = $_GET['ses'];
$f = $_GET['f'];
$r = $_GET['r'];
$c = $_GET['c'];
$delete = $_GET['delete'];
include "../{$dir}/database.php";
include 'common.php';
if (passwordNeeded($f)) {
    $session = nuSession($ses, 'F' . $f);
    if ($session->foundOK == '') {
        print 'you have been logged out..';
        return;
    }
}
$setup = nuSetup();
$al = $session->sss_access_level;
if ($f == 'index' and $session->sss_access_level != 'globeadmin') {
    $inString = "'x'";
    $s = "SELECT zzsys_object_id FROM zzsys_object ";
    $s = $s . "INNER JOIN zzsys_access_level_object ON zzsys_object_id = sao_zzsys_object_id ";
    $s = $s . "INNER JOIN zzsys_access_level ON sao_zzsys_access_level_id = zzsys_access_level_id ";
    $s = $s . "WHERE sob_zzsys_form_id = 'index' ";
    $s = $s . "AND sal_name = '{$session->sss_access_level}' ";
    $ttt = nuRunQuery($s);
** wiki and forums. For details on contributing a patch for nuBuilder, please
** visit the `Project Contributions' forum.
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
$ses = $_GET['ses'];
$form_ses = $_GET['form_ses'];
$report = $_GET['r'];
$dir = $_GET['dir'];
include "../{$dir}/database.php";
include 'common.php';
if (activityPasswordNeeded($report)) {
    $session = nuSession($ses, false);
    if ($session->foundOK == '') {
        print 'you have been logged out..';
        return;
    }
}
$formValue = getSelectionFormVariables($form_ses);
$setup = nuSetup();
$T = nuRunQuery("SELECT * FROM zzsys_activity WHERE sat_all_code = '{$report}'");
$A = db_fetch_object($T);
//----------allow for custom code----------------------------------------------
$globalValue = getglobalValue($ses);
//----------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. )
$sysVariables = sysVariablesToHashArray($form_ses);
//-- directory of database.php
$ses = $_GET['ses'];
//-- zzsys_session_id in zzsys_session
$f = $_GET['f'];
//-- zzsys_form_id in zzsys_form
$r = $_GET['r'];
//-- lookup's selected record id
$fr = $_GET['fr'];
//-- form's record id
$c = $_GET['c'];
//-- cloned record (1=yes)
$delete = $_GET['delete'];
//-- ask if you want this record deleted (1=yes)
include "../{$dir}/database.php";
include 'common.php';
$session = nuSession($ses);
if ($session->foundOK == '') {
    print 'you have been logged out..';
    return;
}
$al = $session->sss_access_level;
if ($f == 'index' and $al != 'globeadmin') {
    $inString = "'x'";
    $s = "SELECT zzsys_object_id FROM zzsys_object ";
    $s = $s . "INNER JOIN zzsys_access_level_object ON zzsys_object_id = sao_zzsys_object_id ";
    $s = $s . "INNER JOIN zzsys_access_level ON sao_zzsys_access_level_id = zzsys_access_level_id ";
    $s = $s . "WHERE sob_zzsys_form_id = 'index' ";
    $s = $s . "AND sal_name = '{$al}' ";
    $ttt = nuRunQuery($s);
    while ($rrr = db_fetch_row($ttt)) {
        $inString = "{$inString}, '{$rrr['0']}'";
function build_report_object()
{
    $GLOBALS['time'] = array();
    $ses = $_GET['ses'];
    $form_ses = $_GET['form_ses'];
    $report = $_GET['r'];
    $dir = $_GET['dir'];
    $get_array = array();
    $emailer = $_GET['emailer'];
    while (list($key, $value) = each($_GET)) {
        $get_array["#{$key}#"] = $value;
    }
    include_once "../{$dir}/database.php";
    include_once 'common.php';
    //--------security check-------------------------------
    if ($emailer != '1') {
        if (activityPasswordNeeded($report)) {
            $session = nuSession($ses, false);
            if ($session->foundOK == '') {
                print 'you have been logged out..';
                return;
            }
        }
    }
    //---------------------------------------------------
    $id = uniqid('1');
    $thedate = date('Y-m-d H:i:s');
    $dq = '"';
    $setup = nuSetup();
    $T = nuRunQuery("SELECT * FROM zzsys_activity WHERE sat_all_code = '{$report}'");
    $activity = db_fetch_object($T);
    //----------allow for custom code----------------------------------------------
    //--already done now..	eval($activity->sat_report_display_code);   //---(Reporting Class)
    $displayClass = new Reporting();
    $REPORT = new REPORT($displayClass, $dir, $ses);
    if ($activity->zzsys_activity_id == '') {
        print 'No Such Report...';
        return;
    }
    $viewer = $session->sss_zzsys_user_id;
    $s = "INSERT INTO zzsys_report_log (zzsys_report_log_id, ";
    $s .= "srl_zzsys_activity_id, srl_date ,srl_viewer) ";
    $s .= "VALUES ('{$id}', '{$report}', '{$thedate}', '{$viewer}')";
    nuRunQuery($s);
    $s = "SELECT count(*), MAX(sva_expiry_date) FROM zzsys_variable ";
    $s .= "WHERE sva_id = '{$form_ses}' ";
    $s .= "GROUP BY sva_expiry_date";
    $t1 = nuRunQuery($s);
    $r1 = db_fetch_row($t1);
    $numberOfVariables = $r1[0];
    $expiryDate = $r1[1];
    if ($numberOfVariables == 0) {
        //---must have at least 1 variable
        print 'Report has Expired...';
        return;
    }
    $s = "DELETE FROM zzsys_variable ";
    $s .= "WHERE sva_id = '{$form_ses}' ";
    $s .= "AND sva_name = 'ReportTitle'";
    nuRunQuery($s);
    setnuVariable($form_ses, $expiryDate, 'ReportTitle', $activity->sat_all_description);
    $TT = TT();
    //--Temp table name
    //----------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['#dataTable#'] = $TT;
    $sesVariables['#TT#'] = $TT;
    $GLOBALS['TT'] = $TT;
    $dataTable = $TT;
    $sysVariables = sysVariablesToHashArray($form_ses);
    //--values in sysVariables from the calling lookup page
    $arrayOfHashVariables = joinHashArrays($sysVariables, $sesVariables);
    //--join the arrays together
    $formValue = array();
    while (list($key, $value) = each($sesVariables)) {
        $formValue[substr($key, 1, -1)] = $value;
    }
    //-------------------------------build $TT with PHP----------------------------------------
    $v = getSelectionFormVariables($form_ses);
    $hashV = arrayToHashArray($v);
    $arrayOfHashVariables = joinHashArrays($arrayOfHashVariables, $hashV);
    //--join the arrays together
    $REPORT->tablesUsed = getSelectionFormTempTableNames($form_ses, $v);
    //--temp tables to delete when finished
    $formValue = $v;
    $nuHashVariables = $arrayOfHashVariables;
    //--added by sc 23-07-2009
    eval(replaceHashVariablesWithValues($arrayOfHashVariables, $activity->sat_report_data_code));
    $REPORT->no_data = addVariablesToTT($TT, $v);
    nuRunQuery("ALTER TABLE `{$TT}` ADD `nu__id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
    $REPORT->nuloopThroughRecords($TT);
}
** GPLv3. For support on developing in nuBuilder, please visit the nuBuilder
** wiki and forums. For details on contributing a patch for nuBuilder, please
** visit the `Project Contributions' forum.
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
$parameters = $_GET['ses'];
$form_ses = $_GET['form_ses'];
$report = $_GET['r'];
$dir = $_GET['dir'];
include "../{$dir}/database.php";
include 'common.php';
$session = nuSession($parameters, false);
if ($session->foundOK == '') {
    print 'you have been logged out..';
    return;
}
$setup = nuSetup();
$T = nuRunQuery("SELECT * FROM zzsys_activity WHERE sat_all_code = '{$report}'");
$A = db_fetch_object($T);
//----------allow for custom code----------------------------------------------
eval($A->sat_report_display_code);
$id = uniqid('1');
$thedate = date('Y-m-d H:i:s');
$dq = '"';
if ($A->zzsys_activity_id != '') {
    $viewer = $_SESSION['zzsys_user_id'];
    $s = "INSERT INTO zzsys_report_log (zzsys_report_log_id, ";
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
ignore_user_abort(true);
set_time_limit(0);
$dir = $_GET['dir'];
$udir = $_GET['udir'];
$ses = $_GET['ses'];
$field = $_GET['field'];
include "../{$dir}/database.php";
include 'common.php';
$setup = nuSetup();
$session = nuSession($ses, '');
if ($session->foundOK == '') {
    print 'you have been logged out..';
    return;
}
print makeCSS();
print "<html><head><title>Upload</title></head>\n";
if ($_POST['filename'] == '') {
    $filename = uniqid('1');
    print "<body>";
    print "<form name='upload' enctype='multipart/form-data' method='POST' action = 'fileuploader.php?dir={$dir}&udir={$udir}&ses={$ses}&field={$field}'>\n";
    print "<table class='upload'><tr align='center'><td class='nuBorder' align='center'><input type='hidden' name='MAX_FILE_SIZE' value='4500000' />\n";
    print "Choose a file to upload: ";
    print "<input type='file'   name='uploadedfile'  value=''/>\n";
    print "<input type='hidden' name='filename'      value='{$filename}'/> \n <br/> \n";
    print "<input type='submit'                      value='Upload File' />\n";
** wiki and forums. For details on contributing a patch for nuBuilder, please
** visit the `Project Contributions' forum.
**
**   Website:  http://www.nubuilder.com
**   Wiki:     http://wiki.nubuilder.com
**   Forums:   http://forums.nubuilder.com
*/
session_start();
include '../' . $_GET['dir'] . '/database.php';
include 'common.php';
$id = uniqid('1');
$now = date('Y-n-d H:i:s');
$_SESSION['customDirectory'] = '';
$setup = nuSetup();
// 2009/06/02 - Michael
$session = nuSession($_GET['f']);
nuRunQuery("DELETE FROM zzsys_variable WHERE sva_session_id = '" . $_GET['f'] . "'");
nuRunQuery("DELETE FROM zzsys_session WHERE zzsys_session_id = '" . $_GET['f'] . "'");
// 2009/06/02 - Michael - added IP logging.
nuRunQuery("INSERT INTO zzsys_user_log (zzsys_user_log_id, sul_zzsys_user_id, sul_ip, sul_end) VALUES ('{$id}', '" . $session->sss_zzsys_user_id . "', '{$_SERVER['REMOTE_ADDR']}', '{$now}')");
//nuRunQuery("INSERT INTO zzsys_user_log (zzsys_user_log_id, sul_zzsys_user_id, sul_end) VALUES ('$id', '".$_SESSION['zzsys_user_id']."', '$now')");
//---direct back to..
if ($setup->set_logout_page == '') {
    //	$url = "http://www.nubuilder.com";
    $url = "/" . $_GET['dir'];
} else {
    //	$url = $setup->set_logout_page;
    $url = $setup->set_logout_page;
}
print "<html>\n";
print "<body onload='closeall()'>\n";
function replaceVariablesInString($pTT, $pString, $pID)
{
    $ses = nuSession($GLOBALS['security_check']);
    //	$ses     = nuSession($_GET['ses']);
    $pString = str_replace("#session_parameter#", $ses->sss_parameter, $pString);
    $pString = str_replace("#access_level#", $ses->sss_access_level, $pString);
    $pString = str_replace("#zzsys_user_id#", $ses->sss_zzsys_user_id, $pString);
    $pString = str_replace("#zzsys_user_group_name#", $ses->sss_zzsys_user_group_name, $pString);
    $pString = str_replace("#clone#", $_GET['c'], $pString);
    $pString = str_replace("#id#", $pID, $pString);
    $pString = str_replace("#TT#", $pTT, $pString);
    $pString = str_replace("#browseTable#", $pTT, $pString);
    $pString = str_replace("#small#", $ses->sss_small, $pString);
    return $pString;
}