<?php 
session_start();
foreach($_GET as $campo => $valor){${$campo}=trim($valor);} 
foreach($_POST as $campo => $valor){${$campo}=trim($valor);} 

include_once('lib_main.php');
if(!empty($empr)){$link_data=msql_connect('','','',$empr); $cfg_empr=$empr;}
$user_codigo=$_SESSION['user_codigo'];
$user0=data_maes('user',$user_codigo);

$modu=strtolower($modu);     

if($modu=='inve'){$xtitulo='INVENTARIOS';}
if($modu=='vtas'){$xtitulo='VENTAS';}

$sql_info ='select * ';
$sql_info.='from inve1 ';
$sql_info.='left join inve2 on idnum1=idnum2 ';
$sql_info.='left join docu0 on docu=docu_codigo ';
$sql_info.='where status not in ("O","X") ';
if(!empty($item))
{$sql_info.='and item like "'.$item.'%" ';}

$calc_tran=calc_tran('inve');
if(!empty($calc_tran))
{$sql_info=str_replace(' from ',','.$calc_tran.' from ',$sql_info);}

echo '*/*/*'.$sql_info;


?>