<?php
//AJUSTE
$idobra = $_GET['idobra'];	  
$SelecionaObra = Seleciona("obras", "WHERE idobra='$idobra'", "LIMIT 0,1");
while($linha_obras = mysql_fetch_array($SelecionaObra)){
$idobra = $linha_obras['idobra']; 
$codmax = $linha_obras['codmax']; 
$idobra_origem = $linha_obras['idobra_origem']; 
$idcliente = $linha_obras['idcliente']; 
$idorcamento = $linha_obras['idorcamento']; 
$idvenda = $linha_obras['idvenda']; 
$titulo = $linha_obras['titulo']; 
$observacao = $linha_obras['observacao']; 
$valorprojeto = $linha_obras['valorprojeto']; 
$valormaximo = $linha_obras['valormaximo']; 
$lucro = $linha_obras['lucro']; 
$datainicio = $linha_obras['datainicio']; 
$datafim = $linha_obras['datafim']; 
$status = $linha_obras['status']; 
$idprofissional = $linha_obras['idprofissional']; 
$segunda = $linha_obras['segunda']; 
$terca = $linha_obras['terca']; 
$quarta = $linha_obras['quarta']; 
$quinta = $linha_obras['quinta']; 
$sexta = $linha_obras['sexta']; 
$sabado = $linha_obras['sabado']; 
$domingo = $linha_obras['domingo']; 
$horario_obra = $linha_obras['horario_obra']; 
$itens_obrigatorios = $linha_obras['itens_obrigatorios']; 
$local_obra = $linha_obras['local_obra']; 
$engenheiro_responsavel = $linha_obras['engenheiro_responsavel']; 
$arquiteto_responsavel = $linha_obras['arquiteto_responsavel']; 
$cordenador1 = $linha_obras['cordenador1']; 
$cordenador2 = $linha_obras['cordenador2']; 
$supervisor1 = $linha_obras['supervisor1']; 
$supervisor2 = $linha_obras['supervisor2']; 
$tecnicoseguranca = $linha_obras['tecnicoseguranca']; 
$descricao_obra = $linha_obras['descricao_obra']; 
$observacao_obra = $linha_obras['observacao_obra']; 

$listadeacesso = $linha_obras['listadeacesso']; 
$rrt = $linha_obras['rrt']; 
$seguro_obra = $linha_obras['seguro_obra']; 
$doc_segurancatrabalho = $linha_obras['doc_segurancatrabalho']; 
$verba_despesas = $linha_obras['verba_despesas']; 
}

$SelecionaClientes = Seleciona("clientes", "WHERE CodCli='$idcliente'", "LIMIT 0,1");
while($Clientes = mysql_fetch_array($SelecionaClientes)){
  $cliente = $Clientes['Fantasia'] . " - " . $Clientes['RazaoSoc'];
}

$selecionar_vendas = Seleciona("vendas", "WHERE idvenda='".$idvenda."'", "") or die(mysql_error());
while($linha_vendas=mysql_fetch_array($selecionar_vendas)){
		
$idvenda = $linha_vendas['idvenda']; 
$idcliente = $linha_vendas['idcliente']; 
$idorcamento = $linha_vendas['idorcamento'];  
$titulo = $linha_vendas['titulo'];  
$observacao = $linha_vendas['observacao']; 
$datavenda = InverteDataNovoSeparador($linha_vendas['datavenda'], "-", "/"); 
$idprofissional = $linha_vendas['idprofissional']; 	
$dataorcamento = InverteDataNovoSeparador($linha_vendas['dataorcamento'], "-", "/"); 

//CÓD VENDA        
if($linha_vendas['idorcamento'] == "" or $linha_vendas['idorcamento'] == "0"){
$CodVenda = substr($linha_vendas['dataorcamento'], 0, 4) ."-".$linha_vendas['idvenda'];
}else{
$CodVenda = substr($linha_vendas['dataorcamento'], 0, 4) ."-".$linha_vendas['idvenda']."- A: ".$linha_vendas['aditivo'];			
}   

if($linha_vendas['idvenda_revisao'] != ""){
	$CodVenda = substr($linha_vendas['dataorcamento'], 0, 4) . "-".$linha_vendas['idvenda_revisao']."- R: ".$linha_vendas['revisao'];			
}
}

?>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 12">
<link rel=Stylesheet href=stylesheet.css>
<style>
<!--table
	{mso-displayed-decimal-separator:"\,";
	mso-displayed-thousand-separator:"\.";}
@page
	{margin:.75in .24in .75in .24in;
	mso-header-margin:.31in;
	mso-footer-margin:.31in;}
-->
</style>
</head>

<body link="#0563C1" vlink="#954F72" class=xl70>

<table border=0 cellpadding=0 cellspacing=0 width=1109 style='border-collapse:
 collapse;table-layout:fixed;width:827pt'>
 <col class=xl70 width=10 style='mso-width-source:userset;mso-width-alt:365;
 width:8pt'>
 <col class=xl70 width=59 style='mso-width-source:userset;mso-width-alt:2157;
 width:44pt'>
 <col class=xl70 width=19 style='mso-width-source:userset;mso-width-alt:694;
 width:14pt'>
 <col class=xl70 width=79 style='mso-width-source:userset;mso-width-alt:2889;
 width:59pt'>
 <col class=xl70 width=164 style='mso-width-source:userset;mso-width-alt:5997;
 width:123pt'>
 <col class=xl70 width=19 span=3 style='mso-width-source:userset;mso-width-alt:
 694;width:14pt'>
 <col class=xl70 width=36 style='mso-width-source:userset;mso-width-alt:1316;
 width:27pt'>
 <col class=xl70 width=19 span=5 style='mso-width-source:userset;mso-width-alt:
 694;width:14pt'>
 <col class=xl70 width=31 style='mso-width-source:userset;mso-width-alt:1133;
 width:23pt'>
 <col class=xl70 width=19 span=9 style='mso-width-source:userset;mso-width-alt:
 694;width:14pt'>
 <col class=xl70 width=37 style='mso-width-source:userset;mso-width-alt:1353;
 width:28pt'>
 <col class=xl70 width=19 span=2 style='mso-width-source:userset;mso-width-alt:
 694;width:14pt'>
 <col class=xl70 width=16 style='mso-width-source:userset;mso-width-alt:585;
 width:12pt'>
 <col class=xl70 width=0 style='display:none;mso-width-source:userset;
 mso-width-alt:694'>
 <col class=xl70 width=12 style='mso-width-source:userset;mso-width-alt:438;
 width:9pt'>
 <col class=xl70 width=0 style='display:none;mso-width-source:userset;
 mso-width-alt:694'>
 <col class=xl70 width=14 style='mso-width-source:userset;mso-width-alt:512;
 width:11pt'>
 <col class=xl70 width=64 span=3 style='width:48pt'>
 <col class=xl70 width=79 style='mso-width-source:userset;mso-width-alt:2889;
 width:59pt'>
 <tr height=25 style='height:18.75pt'>
   <td height=25  style='height:18.75pt;width:8pt'></td>
   <td colspan=31 align="center" bgcolor="#FFFFFF"  style='border-right:1.0pt solid black;
  width:616pt'><img src="https://maxlayouts.minhaempresa.online/img/logobranco.fw.png" width="384" height="70" /></td>
   <td class=xl69 style='width:48pt'></td>
   <td class=xl69 style='width:48pt'></td>
   <td class=xl69 style='width:48pt'></td>
   <td class=xl69 style='width:59pt'></td>
 </tr>
 <tr class=xl69 height=25 style='height:18.75pt'>
  <td height=25 class=xl69 width=10 style='height:18.75pt;width:8pt'></td>
  <td colspan=31 class=xl80 width=828 style='border-right:1.0pt solid black;
  width:616pt'><a name="Print_Area">AUTORIZAÇÃO DE PAGAMENTO</a></td>
  <td class=xl69 width=64 style='width:48pt'></td>
  <td class=xl69 width=64 style='width:48pt'></td>
  <td class=xl69 width=64 style='width:48pt'></td>
  <td class=xl69 width=79 style='width:59pt'></td>
 </tr>
 <tr height=23 style='mso-height-source:userset;height:17.25pt'>
  <td height=23 class=xl70 style='height:17.25pt'></td>
  <td colspan=3 class=xl84 style='border-right:.5pt solid black'>DATA</td>
  <td colspan=2 class=xl87 style='border-right:.5pt solid black;border-left:
  none'><?php echo date('d/m/Y');?></td>
  <td colspan=5 class=xl89 style='border-right:.5pt solid black;border-left:
  none'>SOLICITANTE</td>
  <td colspan=21 class=xl92 style='border-right:1.0pt solid black;border-left:
  none'>ROQUE</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=21 style='height:15.75pt'>
  <td height=21 class=xl70 style='height:15.75pt'></td>
  <td colspan=3 class=xl95 style='border-right:.5pt solid black'>OBRA</td>
  <td class=xl77><?php echo $codmax;?></td>
  <td colspan=5 class=xl89>CLIENTE<span style='mso-spacerun:yes'> </span></td>
  <td colspan=22 class=xl101 style='border-right:1.0pt solid black'><?php echo $cliente;?></td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr class=xl78 height=45 style='mso-height-source:userset;height:33.75pt'>
  <td height=45 class=xl78 style='height:33.75pt'></td>
  <td colspan=3 class=xl154 style='border-right:.5pt solid black'>ORÇAMENTO</td>
  <td colspan=6 class=xl172 style='border-right:.5pt solid black;border-left:
  none'><?php echo $CodVenda;?></td>
  <td colspan=6 class=xl174 style='border-right:.5pt solid black;border-left:
  none'>ITEM DO ORÇ.</td>
  <td colspan=16 class=xl177 width=269 style='border-right:1.0pt solid black;
  border-left:none;width:200pt'>&nbsp;</td>
  <td colspan=4 class=xl78 style='mso-ignore:colspan'></td>
 </tr>
 <tr class=xl78 height=50 style='mso-height-source:userset;height:37.5pt'>
  <td height=50 class=xl78 style='height:37.5pt'></td>
  <td colspan=4 class=xl154 style='border-right:.5pt solid black'>DESCRIÇÃO DO
  SERVIÇO</td>
  <td colspan=27 class=xl169 width=507 style='border-right:1.0pt solid black;
  border-left:none;width:376pt'>BANCADA DE GRANITO</td>
  <td colspan=4 class=xl78 style='mso-ignore:colspan'></td>
 </tr>
 <tr class=xl78 height=52 style='mso-height-source:userset;height:39.0pt'>
  <td height=52 class=xl78 style='height:39.0pt'></td>
  <td colspan=6 class=xl154 style='border-right:.5pt solid black'>PERÍODO DE
  EXECUÇÃO DO SERVIÇO</td>
  <td colspan=25 class=xl162 style='border-right:1.0pt solid black;border-left:
  none'>ENTREGA ATÉ 10/07/2017</td>
  <td colspan=4 class=xl78 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=3 class=xl95>VALOR</td>
  <td class=xl76 width=164 style='border-top:none;width:123pt'>R$ 1.750,00</td>
  <td colspan=27 class=xl165 style='border-right:1.0pt solid black;border-left:
  none'><span style='mso-spacerun:yes'> </span>UM MIL, SETECENTOS E CINQUENTA
  REAIS<span style='mso-spacerun:yes'> </span></td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=35 style='mso-height-source:userset;height:26.25pt'>
  <td height=35 class=xl70 style='height:26.25pt'></td>
  <td colspan=4 class=xl95 style='border-right:.5pt solid black'>PAGAMENTO
  ATRAVÉS DE</td>
  <td colspan=10 class=xl113 style='border-left:none'>TRANSFER. BANCÁRIA:</td>
  <td colspan=2 class=xl115 style='border-right:1.0pt solid black'>X</td>
  <td colspan=8 class=xl99>BOLETO BANCÁRIO:</td>
  <td colspan=2 class=xl115 style='border-right:1.0pt solid black'>&nbsp;</td>
  <td class=xl71 style='border-top:none'>&nbsp;</td>
  <td class=xl71 style='border-top:none'>&nbsp;</td>
  <td class=xl71 style='border-top:none'>&nbsp;</td>
  <td class=xl71 style='border-top:none'>&nbsp;</td>
  <td class=xl72 style='border-top:none'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr class=xl78 height=34 style='mso-height-source:userset;height:25.5pt'>
  <td height=34 class=xl78 style='height:25.5pt'></td>
  <td colspan=4 class=xl154>FORMA DE PAGTO. (PARCELAS)</td>
  <td colspan=27 class=xl156 style='border-right:1.0pt solid black'>PAGAMENTO
  EM 21/07/2017</td>
  <td colspan=4 class=xl78 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=21 style='height:15.75pt'>
  <td height=21 class=xl70 style='height:15.75pt'></td>
  <td colspan=3 class=xl121 style='border-right:.5pt solid black'>FAVORECIDO</td>
  <td colspan=28 class=xl160 style='border-right:1.0pt solid black;border-left:
  none'>CEARÁ MAR MARMORES</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=21 style='height:15.75pt'>
  <td height=21 class=xl70 style='height:15.75pt'></td>
  <td colspan=3 class=xl95 style='border-right:.5pt solid black'>CNPJ / CPF</td>
  <td colspan=9 class=xl98 style='border-left:none'>&nbsp;</td>
  <td colspan=5 class=xl89 style='border-right:.5pt solid black'>I.E. / RG</td>
  <td colspan=14 class=xl125 style='border-right:1.0pt solid black;border-left:
  none'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=21 style='height:15.75pt'>
  <td height=21 class=xl70 style='height:15.75pt'></td>
  <td colspan=3 class=xl95 style='border-right:.5pt solid black'>CONTATO</td>
  <td colspan=9 class=xl98 style='border-right:.5pt solid black;border-left:
  none'>&nbsp;</td>
  <td colspan=5 class=xl89 style='border-right:.5pt solid black;border-left:
  none'>TELEFONE</td>
  <td colspan=14 class=xl98 style='border-right:1.0pt solid black;border-left:
  none'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=3 class=xl127 style='border-right:.5pt solid black'>BANCO</td>
  <td class=xl73 style='border-top:none;border-left:none'>&nbsp;</td>
  <td colspan=4 class=xl130 style='border-right:.5pt solid black;border-left:
  none'>AGÊNCIA</td>
  <td colspan=9 class=xl133 style='border-right:.5pt solid black;border-left:
  none'>&nbsp;</td>
  <td colspan=4 class=xl130 style='border-right:.5pt solid black;border-left:
  none'>C/C</td>
  <td colspan=10 class=xl134 style='border-right:1.0pt solid black'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=25 style='height:18.75pt'>
  <td height=25 class=xl70 style='height:18.75pt'></td>
  <td colspan=31 class=xl80 style='border-right:1.0pt solid black'>OBSERVAÇÃO</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=31 class=xl182 width=828 style='border-right:1.0pt solid black;
  width:616pt'>&nbsp;</td>
  <td colspan=3 class=xl70 style='mso-ignore:colspan'></td>
  <td class=xl79></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=31 class=xl182 width=828 style='border-right:1.0pt solid black;
  width:616pt'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=22 style='mso-height-source:userset;height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=31 class=xl182 width=828 style='border-right:1.0pt solid black;
  width:616pt'>&nbsp;</td>
  <td colspan=3 class=xl70 style='mso-ignore:colspan'></td>
  <td class=xl79></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=31 class=xl182 width=828 style='border-right:1.0pt solid black;
  width:616pt'>&nbsp;</td>
  <td colspan=3 class=xl70 style='mso-ignore:colspan'></td>
  <td class=xl79></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=31 class=xl151 width=828 style='border-right:1.0pt solid black;
  width:616pt'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=22 style='height:16.5pt'>
  <td height=22 class=xl70 style='height:16.5pt'></td>
  <td colspan=4 class=xl185 width=321 style='width:240pt'>CONTRATO</td>
  <td colspan=27 class=xl187 width=507 style='border-right:1.0pt solid black;
  width:376pt'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=46 style='mso-height-source:userset;height:35.1pt'>
  <td height=46 class=xl70 style='height:35.1pt'></td>
  <td colspan=4 class=xl143 style='border-right:1.0pt solid black'><span
  style='mso-spacerun:yes'> </span>AUTORIZADO POR:</td>
  <td colspan=27 class=xl146 style='border-right:1.0pt solid black'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <tr height=46 style='mso-height-source:userset;height:35.1pt'>
  <td height=46 class=xl70 style='height:35.1pt'></td>
  <td colspan=4 class=xl143 style='border-right:1.0pt solid black'><span
  style='mso-spacerun:yes'> </span>AUTORIZADO POR:</td>
  <td colspan=27 class=xl148 style='border-right:1.0pt solid black'>&nbsp;</td>
  <td colspan=4 class=xl70 style='mso-ignore:colspan'></td>
 </tr>
 <![if supportMisalignedColumns]>
 <tr height=0 style='display:none'>
  <td width=10 style='width:8pt'></td>
  <td width=59 style='width:44pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=79 style='width:59pt'></td>
  <td width=164 style='width:123pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=36 style='width:27pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=31 style='width:23pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=37 style='width:28pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=19 style='width:14pt'></td>
  <td width=16 style='width:12pt'></td>
  <td width=0></td>
  <td width=12 style='width:9pt'></td>
  <td width=0></td>
  <td width=14 style='width:11pt'></td>
  <td width=64 style='width:48pt'></td>
  <td width=64 style='width:48pt'></td>
  <td width=64 style='width:48pt'></td>
  <td width=79 style='width:59pt'></td>
 </tr>
 <![endif]>
</table>

</body>

</html>
