Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

igorfds

Passar Parâmetro _get para Consulta em Modal

Recommended Posts

Olá Bom dia!

 

Precisava de uma força!

 

Tenho uma tabela de informações sobre NF e nela abri uns itens de consulta em um modal para fazer algumas alterações!

 

O problema é não consigo criar um parâmetro para que exiba essas informações no modal!

 

Segue código:

<script language="Javascript" type="text/javascript">  parent.document.getElementById("klaus").height = document.getElementById("conteudo").scrollHeight + 40; //40: Margem Superior e Inferior, somadas</script></script><script language="javascript">function voltar(){	self.location.href = '../controle/voltar.php';	}</script><?phpinclude("BD/ConnectDB.php");/*function cnpj_for ($cnpj){$carac = array('.','/','-');$cnpj = str_replace($carac,"",$cnpj);return $cnpj;	}*/class configurar extends Conexao  {			private $cnpj_de;			private $cfop_de;			private $cnpj_para;			private $cfop_para;public function __construct() {      $this->setAtributos(null,null,null,null);	}public function setAtributos($cnpj_de,$cfop_de,$cnpj_para,$cfop_para) {	$this->Cnpj_de         = $cnpj_de;	$this->Cfop_de 		   = $cfop_de;	$this->Cnpj_para       = $cnpj_para; 	$this->Cfop_para       = $cfop_para;	}public function getCnpj_de(){ return $this->Cnpj_de;}public function getCfop_de(){ return $this->Cfop_de;}public function getCnpj_para(){ return $this->Cnpj_para;}public function getCfop_para(){ return $this->Cfop_para;}public function setConfiguracao($cnpj_de){		$query  = new Conexao();		$EMP    = $query->cnpj_for($cnpj_de);$select = $query->consulta("SELECT COD_EMPRESA, dbo.FCT_CNPJ_MASCARA(CNPJ) as CNPJ ,NOME_EMPRESA FROM TBL_EMPRESA WHERE CNPJ = '".$EMP ."'");		$dados         = $query->busca_unica($select);		$nome_pesquisa = $dados['NOME_EMPRESA'];	  $s   = "Select A.infNFe as infNFe,A.Chave as Chave ,A.dEmi as dEmi,substring(A.chave,26,9) as NumeroNota,B.xNome as Fornecedor,B.CNPJ as CNPJFROM VW_NFE as A, TBL_NFE_emit as B where B.infNFe=A.infNFeand A.cnpj='07107001000260' and (A.dEmi BETWEEN '05-01-2011' and '05-31-2013') and A.status='NF'and A.TIPO_ES='E' order by A.dEmi,A.vNF";   $consul = $query->consulta($s);   $total_campos = $query->conta($consul);   $cont=0;		 echo '<table  cellpadding="0" cellspacing="0" border="0" class="table">';		 echo '<tr>';		 echo '<td width="50px"></td>';		  		 echo '<td width="00px"><img src="http://ohmsapoio.com.br/2.0/sistema/img/topo_bt/cadastro_cfop.png" style="position:relative; top:-20px; left:-25px"/><p><p></td>';		 echo '</tr>';		 echo '</table>';		 echo '<table id="tb1" cellpadding="0" cellspacing="0" border="0" class="table">';		 echo '<tr class="header">';		 echo '<th width="50px">FORNECEDOR</th >';		 echo '<th width="10px"></th >';		 echo '<th width="100px">CNPJ</th >';		 echo '<th width="50px">NUMERO NF-e</th>';		 echo '<th width="50px">CHAVE NF-e</th >';		 echo '<th width="50px">DATA ENT.</th >';		 echo "</tr>";		 echo '<form name="FormDepara" id="FormDepara"  method="post" action="../controle/gravar_config.php"';		 while ($l = $query->busca($consul))		{		$cont  = $cont+1;			$nomes = $l['Nome1'];		echo '<tr>';		echo '<input  style="background:#b7dcff;" type="hidden"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="50" maxlength="50" value='.$l['infNFe'].'></input>';		echo '<td width="50px"><input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="50" maxlength="50" value='.$l['Fornecedor'].'></input></td >';		echo '<td width="10px"><a href="#dialog" name="modal"><input style="/* background:#b7dcff; */background-image: url(../class/modal/itens.png);/* position: relative; */width: 26px;height: 21px;" type="button" title="Editar Itens"</a></input></td >';		echo '<td width="50px"><input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="14" maxlength="14" value='.$l['CNPJ'].'></input></td >';		echo '<td width="50px"><input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="9" maxlength="9" value='.$l['NumeroNota'].'></input></td >';		echo '<td width="50px"><input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="44" maxlength="44" value='.$l['Chave'].'></input></td >';		echo '<td width="50px"><input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="10" maxlength="10" value='.$l['dEmi'].'></input></td >';		echo '</tr>';					$b   = "Select A.nItem as nItem,A.cProd as CodigoProduto, A.xProd as DescricaoProduto,A.NCM as NCM,A.CFOP as CFOP,B.CFOP as NovaCFOP,B.CODINTERNO as NovoCodigo,C.CST as CST,B.CSTICMS as CSTNOVA from ([nfe_prod].dbo.TBL_NFE_prod as AINNER JOIN [nfe_prod].dbo.TBL_NFE_ICMS as C on A.infNFe=C.infNFe and A.nItem=C.nItem)LEFT OUTER JOIN [nfe_prod].dbo.TBL_SPED_PROD as B ON A.cProd=B.CODIGOFABRICANTEand B.cod_cliente='0650' and B.CNPJFAB='07107001000693'where A.infNFe='11899' order by A.nItem";   $consul1 = $query->consulta($b);   while ($c = $query->busca($consul1))		{			echo '<div id="dialog" class="window">';		echo '<a href="#" class="close">Fechar [X]</a><br />';		echo '<input  style="background:#b7dcff;"  type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="3" maxlength="3" value='.$c['nItem'].'></input>'; 		echo '<input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="20" maxlength="20" value='.$c['CodigoProduto'].'></input>';		echo '<input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="50" maxlength="50" value='.$c['DescricaoProduto'].'></input>';		echo '<input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="8" maxlength="8" value='.$c['NCM'].'></input>';		echo '<input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="4" maxlength="4" value='.$c['CFOP'].'></input>';		echo '<input  style="background:#b7dcff;" type="text"  name="cnpj_saida_'.$cont.'" id="cnpj_saida_'.$cont.'" readonly="true" size="3" maxlength="3" value='.$c['CST'].'></input>';		echo '<input type="text" style="background:#FFFFFF;" name="cfop_para_'.$cont.'" id="cfop_para_'.$cont.'" size="5" maxlength="4" value='.$c['NovaCFOP'].'></input>';		echo '<input type="text" style="background:#FFFFFF;" name="cfop_para_'.$cont.'" id="cfop_para_'.$cont.'" size="5" maxlength="4" value='.$c['NovoCodigo'].'></input>';		echo '<input type="text" style="background:#FFFFFF;" name="cfop_para_'.$cont.'" id="cfop_para_'.$cont.'" size="5" maxlength="4" value='.$c['CSTNOVA'].'></input>';		echo '</div>'; 				}			}		echo '</table>';//		<img src="http://ohmsapoio.com.br/2.0/sistema/img/topo_bt/cadastro_cfop.png" style="position:relative; top:0px; left:-25px">		echo '<input type="hidden" name="cont" id="cont" size="5" maxlength="4" value='.$cont.'></input>';		echo '<input type="hidden" name="cnpj_pesquisa" id="cnpj_pesquisa" value='.$EMP.'></input>';	//	echo '<input type="image" src="http://ohmsapoio.com.br/2.0/sistema/img/topo_bt/gravar.png" style="position: relative; left: 324px; top:0px; border: 0px;" value="Gravar" name="Gravar"></input>';		echo '<input type="hidden" name="paginacao" id="paginacao" value="'.$total_campos.'" />' ;		echo '</form>';			?><div id="green" style="margin: auto">	<?php	}		}?>

Modal

<script type="text/javascript">$(document).ready(function() {		$('a[name=modal]').click(function(e) {		e.preventDefault();				var id = $(this).attr('href');			var maskHeight = $(document).height();		var maskWidth = $(window).width();			$('#mask').css({'width':maskWidth,'height':maskHeight});		$('#mask').fadeIn(1000);			$('#mask').fadeTo("slow",0.8);				//Get the window height and width		var winH = $(window).height();		var winW = $(window).width();              		$(id).css('top',  winH/2-$(id).height()/2);		$(id).css('left', winW/2-$(id).width()/2);			$(id).fadeIn(2000); 		});		$('.window .close').click(function (e) {		e.preventDefault();				$('#mask').hide();		$('.window').hide();	});				$('#mask').click(function () {		$(this).hide();		$('.window').hide();	});				var dialog = document.getElementById ('dialog'); 		$(dialog).load('/sistema/class/consulta.php?id=01&acao=0'); 	});</script>

Agradeço a quem puder dar uma luz!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.