<?php

include_once "../bd/bd_relatorios.inc";
include "../bd/funcoes.inc";


$filtro = recebevar("filtro");
$valor = recebevar("valor");

$pathgo = '../relatorios/mv143.php';

switch ($filtro) {


    case 'loja':
        $nomecookie = "mv143_loja";
        $codcookie = "mv143_codloja";
        $tabela = 'lojas';
        $campo = 'loja';
        $cod = 'codloja';
        break;

     case 'razao':
        $nomecookie = "mv143_razao";
        $codcookie = "mv143_codcli";
        $tabela = 'clientes';
        $campo = 'razao';
        $cod = 'codcli';
        break;

     case 'statusos':
        $nomecookie = "mv143_statusos";
        $codcookie = "mv143_codstatusos";
        $tabela = 'status';
        $campo = 'descricao';
        $cod = 'codstatus';
        break;

     case 'statuscli':
        $nomecookie = "mv143_statuscli";
        $codcookie = "mv143_codstatuscli";
        $tabela = 'clistatus';
        $campo = 'descricao';
        $cod = 'codclistatus';
        break;


}


ListaLookup($tabela, $campo, $cod, $valor, $nomecookie, $codcookie, $pathgo);



include "../html/htmlfin.php";
?>
