Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal,
estou com um probleminha!
tenho uma pagina de busca:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing=" 0">
<tr>
<td width="15"><div align="center" class="style13 style13"><img src="Imagens/Search_32.png" alt="" width="32" height="32" /></div></td>
<td class="style7 style13 style13"><strong>Buscar OS</strong></td>
</tr>
<tr>
<td> </td>
<td><form method="post" id="form1" name="form1" action="resultado_busca_contas_pagar1.php">
<table width="332" border="0">
<tr>
<td width="178" class="style7 style13 style13">VENDEDOR:</td>
<td width="144"><div align="right"> <span class="style7 style13 style13">
<input type="text" name="vendedor" id="vendedor" />
</span></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="332" border="0">
<tr>
<td width="178" class="style7 style13 style13">MES:</td>
<td width="144"><div align="right"> <span class="style7 style13 style13">
<input type="text" name="mes" id="mes" />
</span></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="332" border="0">
<tr>
<td width="178" class="style7 style13 style13">ANO:</td>
<td width="144"><div align="right">
<span class="style7 style13 style13">
<input type="text" name="ano" id="ano" />
</span></div></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<span class="style7 style13 style13">
<input type="submit" name="button" id="button" value="Buscar" />
</span></div></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html><?php
include "config.php"; //conexão mysql
$vendedor = $_POST["vendedor"];
$mes = $_POST["mes"];
$ano = $_POST["ano"];
$exec = mysql_query("SELECT * FROM os WHERE (vendedor LIKE '%".$vendedor."%' AND mes LIKE '%".$mes."%' AND ano LIKE '%".$ano."%')") or die("<script>alert('ERRO! Não foi possível conectar ao banco de dados.');location.href='javascript:history.go(-1)';</script>");
$total = mysql_num_rows($exec);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Relatório de OS</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="Imagens/FreeTravelBrazilLogo.png" width="200" height="69" />
<table width="100%" border="0" cellpadding="0" cellspacing=" 0">
<tr>
<td width="15"><div align="center"><img src="Imagens/7513_32x32.png" width="32" height="32" /></div></td>
<td><strong>Free Travel Turismo: Relatório de OS : <?php echo $row_Recordset1['vendedor']; ?>, <?php echo $row_Recordset1['mes']; ?>, <?php echo $row_Recordset1['ano']; ?></strong></td>
</tr>
<tr>
<td> </td>
<td><table width="105%" border="0" align="center">
<tr bgcolor="#0099FF">
<td bgcolor="#99FF00">OS N°</td>
<td bgcolor="#99FF00">Reserva N°</td>
<td bgcolor="#99FF00">Mes Lançado</td>
<td bgcolor="#99FF00">Ano Lançado</td>
<td bgcolor="#99FF00">Pax</td>
<td bgcolor="#99FF00">Serviço</td>
<td bgcolor="#99FF00">Data</td>
<td bgcolor="#99FF00">Titular</td>
<td bgcolor="#99FF00">Valor da Nota</td>
<td bgcolor="#99FF00">Valor da Comissão</td>
</tr>
<?php while ($row_Recordset1 = mysql_fetch_array($exec)) { ?>
<tr>
<td><?php echo $row_Recordset1['codigo']; ?></td>
<td><?php echo $row_Recordset1['codigo2']; ?></td>
<td><?php echo $row_Recordset1['mes']; ?> </td>
<td><?php echo $row_Recordset1['ano']; ?></td>
<td><?php echo $row_Recordset1['pax']; ?> </td>
<td><?php echo $row_Recordset1['servico']; ?> </td>
<td><?php echo $row_Recordset1['data']; ?></td>
<td><?php echo $row_Recordset1['vendedor']; ?> </td>
<td>R$<?php echo $row_Recordset1['valor_total']; ?></td>
<td>R$<?php echo $row_Recordset1['valor_vend']; ?></td>
</tr>
<?php } ?>
</table></td>
</tr>
</table>
<table width="54" border="0" align="right">
<tr>
<td><a href="#" onclick="window.print();"><img src="Imagens/Print_48.png" alt="ASD" width="48" height="48" border="0" /></a></td>
</tr>
</table>
</p><?php
// Make a MySQL Connection
$query = "SELECT SUM(valor_vend) FROM os";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo "Total: R$ ". $row['SUM(valor_vend)'];
echo "<br />";
}
?>
<p><a href="busca_contas_pagar1.php" class="style19">Fazer nova busca</a></p>
</body>
</html><?php
// Make a MySQL Connection
$query = "SELECT SUM(valor_vend) FROM os";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo "Total: R$ ". $row['SUM(valor_vend)'];
echo "<br />";
}
?>o que eu gostaria éh que desse o total e comissões que estão sendo listadas!
quem puder me ajudar, agradeço!
Carregando comentários...