Exemple #1
0
function DetailTable($Param,$Show,$MaxLine,$MaskArray=array()) {
	global $ResultTable;
	
	$debug=false;

	$Ret=GetQuery($Param);
	$Header=$Ret[Basics][Header];
	$MyQuery=$Ret[Stats][Query];
	$Primary=$Ret[Basics][Prime];
	$Order=$Ret[Basics][Ord];
	
	if ($debug) { echo "Query created - about to run<BR>\n"; var_dump($Param);echo "<BR>MaskArray=";var_dump($MaskArray);echo "<HR>\n";var_dump($Ret); }
	
	$Div=$Param[CType].$Param[LCType];

	ShowTable($Header,$MyQuery,$Div,$Show,$MaxLine,$Title,$Param,$MaskArray);
	//echo "DEBUG: ResultTable=<BR>\n";var_dump($ResultTable);echo "<HR>\n";

	//echo "</body></html>\n";

	return;
}
Exemple #2
0
    function db_fetch($parms, $debug = false)
    {
        #	17/01/2009
        #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        $rows = array();
        $i = 0;
        $ii = 0;
        $query_id = $parms;
        #	17/01/2009
        if (is_array($parms)) {
            #
            #	0 = resource ID
            #	1 = recs found
            #	2 = query (SELECT only)
            #	3 = cache ID
            #
            $query_id = $parms[0];
            $t_rows = $parms[1];
        }
        #
        #	Get record by record
        #
        while ($row = @mysql_fetch_array($query_id, MYSQL_ASSOC)) {
            #	Build the output array
            #
            array_push($rows, $row);
            if ($debug) {
                #	Load array data
                #
                unset($tmp_array);
                $tmp_array = $rows[$i];
                $fields_record = count($tmp_array);
                # number of fields per record
                reset($tmp_array);
                # set to the first array field
                while ($tmp_next = each($tmp_array)) {
                    $labels[$ii] = $tmp_next['key'];
                    $table_field[$ii] = $tmp_next['value'];
                    $ii++;
                }
                $i++;
            }
        }
        if ($debug) {
            ?>
<br /><?php 
            if (!isset($labels)) {
                $labels[0] = 'No records in this table!';
                $table_field[0] = $labels[0];
                $fields_record = 0;
            }
            ShowTable($labels, $table_field, $fields_record, '80%', 'center', true, 'A');
        }
        return $rows;
    }
            $selecao = $_POST['selecao'];
            $filterby = $_POST['filterby'];
            $query = "SELECT * FROM udescti.equipamento WHERE tipo='{$filtro}' AND {$filterby}='{$selecao}'";
        } else {
            $query = "SELECT * FROM udescti.equipamento WHERE tipo='{$filtro}'";
        }
    } else {
        if (isset($_POST['selecao']) && isset($_POST['filterby'])) {
            $selecao = $_POST['selecao'];
            $filterby = $_POST['filterby'];
            $query = "SELECT * FROM udescti.equipamento WHERE {$filterby}='{$selecao}'";
        } else {
            $query = "SELECT * FROM udescti.equipamento";
        }
    }
    ShowTable($query);
}
//Original
/*
if (isset($_GET['patrimonio'])){
	$query = "SELECT patrimonio FROM udescti.equipamento";
	SelectValues(query($query));
}

if (isset($_GET['filtro'])) {
	$patrimonio = $_GET['filtro'];
	$query = "SELECT * FROM udescti.equipamento WHERE patrimonio='$patrimonio'";
	ShowTable($query);
}
*/
if (isset($_GET['filterby'])) {