Etou com o seguinte erro : Parse error: syntax error, unexpected T_IF in C:\Inetpub\SitePHP\desenvolvimento\doctor\cadastro\fichafinanceira\grava_fichafinanceira.php on line 30
onde linha 30: if $qtd > 0
<?php require_once('../../Connections/doctor.php'); ?>
<?php
mysql_select_db($database_doctor, $doctor);
$query_loc_procedimentos = "SELECT * FROM procedimentos ORDER BY PROCEDIMENTOS_ID ASC";
$loc_procedimentos = mysql_query($query_loc_procedimentos, $doctor) or die(mysql_error());
$row_loc_procedimentos = mysql_fetch_assoc($loc_procedimentos);
$totalRows_loc_procedimentos = mysql_num_rows($loc_procedimentos);
// recebe variaveis
//$checkBoxArr = $_POST['procedimento_id'];
//$paciente = $_POST['paciente_info'];
//$data = $_POST['data_info'];
//$porcentagem = $_POST['porcentagem_info'];
//$qtd = $_POST['qtd_info'];
//$valor = $_POST['valor']
foreach ($checkBoxArr as $key => $value)
// recebe variaveis
$checkBoxArr = $_POST['procedimento_id'];
$paciente = $_POST['paciente_info'];
$data = $_POST['data_info'];
$porcentagem = $_POST['porcentagem_info'];
$qtd = $_POST['qtd_info'];
$valor = $_POST['valor']
{
if $qtd > 0
{
$valor = $valor - ($valor/100)*$porcentagem;
$valor = $valor * $qtdtotal;
// INSERE OS VALORES NA TABELA DE FICHA FINANCEIRA
mysql_select_db($database_doctor, $doctor);
$query_insert_ficha = "INSERT INTO ficha_financeira (DATAPROCEDIMENTOS,PACIENTE_ID,PROCEDIMENTOS_ID,VALOR) VALUES ('$data','$paciente','$value','$valor') ";
$insert_ficha = mysql_query($query_insert_ficha, $doctor) or die(mysql_error());
}
}
?>
<?php
$colname_loc_paciente = "-1";
if (isset($_POST['paciente_info'])) {
$colname_loc_paciente = (get_magic_quotes_gpc()) ? $_POST['paciente_info'] : addslashes($_POST['paciente_info']);
}
mysql_select_db($database_doctor, $doctor);
$query_loc_paciente = sprintf("SELECT * FROM paciente WHERE PACIENTE_ID = %s", $colname_loc_paciente);
$loc_paciente = mysql_query($query_loc_paciente, $doctor) or die(mysql_error());
$row_loc_paciente = mysql_fetch_assoc($loc_paciente);
$totalRows_loc_paciente = mysql_num_rows($loc_paciente);
$colname1_loc_procedimento_total = "-2";
if (isset($_POST['data_info'])) {
$colname1_loc_procedimento_total = (get_magic_quotes_gpc()) ? $_POST['data_info'] : addslashes($_POST['data_info']);
}
$colname_loc_procedimento_total = "-1";
if (isset($_POST['paciente_info'])) {
$colname_loc_procedimento_total = (get_magic_quotes_gpc()) ? $_POST['paciente_info'] : addslashes($_POST['paciente_info']);
}
mysql_select_db($database_doctor, $doctor);
$query_loc_procedimento_total = sprintf("SELECT SUM(VALOR) AS TOTAL FROM ficha_financeira WHERE PACIENTE_ID = %s AND DATAPROCEDIMENTOS='%s'", $colname_loc_procedimento_total,$colname1_loc_procedimento_total);
$loc_procedimento_total = mysql_query($query_loc_procedimento_total, $doctor) or die(mysql_error());
$row_loc_procedimento_total = mysql_fetch_assoc($loc_procedimento_total);
$totalRows_loc_procedimento_total = mysql_num_rows($loc_procedimento_total);
$colname1_loc_procedimento_lista = "-2";
if (isset($_POST['data_info'])) {
$colname1_loc_procedimento_lista = (get_magic_quotes_gpc()) ? $_POST['data_info'] : addslashes($_POST['data_info']);
}
$colname_loc_procedimento_lista = "-1";
if (isset($_POST['paciente_info'])) {
$colname_loc_procedimento_lista = (get_magic_quotes_gpc()) ? $_POST['paciente_info'] : addslashes($_POST['paciente_info']);
}
mysql_select_db($database_doctor, $doctor);
$query_loc_procedimento_lista = sprintf("SELECT procedimentos.DESCRICAO, ficha_financeira.VALOR, DATE_FORMAT(ficha_financeira.DATAPROCEDIMENTOS,'%%d/%%m/%%Y') AS DATA FROM ficha_financeira INNER JOIN procedimentos ON(procedimentos.PROCEDIMENTOS_ID=ficha_financeira.PROCEDIMENTOS_ID) WHERE ficha_financeira.PACIENTE_ID = %s AND ficha_financeira.DATAPROCEDIMENTOS='%s' ORDER BY ficha_financeira.PROCEDIMENTOS_ID", $colname_loc_procedimento_lista,$colname1_loc_procedimento_lista);
$loc_procedimento_lista = mysql_query($query_loc_procedimento_lista, $doctor) or die(mysql_error());
$row_loc_procedimento_lista = mysql_fetch_assoc($loc_procedimento_lista);
$totalRows_loc_procedimento_lista = mysql_num_rows($loc_procedimento_lista);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Clinica Geller</title>
<link href="../../css/doctor.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="700" border="0" class="tabela_preta_texto_branco_negrito_centro">
<tr>
<td>Pagamento(s) cadastrado(s) com sucesso. </td>
</tr>
</table>
<p> </p>
<table width="700" border="0">
<tr>
<td width="39" class="texto_azul_negrito_14">Nome</td>
<td width="651" class="texto_azul_13"><?php echo $row_loc_paciente['NOME']; ?></td>
</tr>
<tr>
<td class="texto_azul_negrito_14">Data</td>
<td class="texto_azul_13"><?php echo $row_loc_procedimento_lista['DATA']; ?></td>
</tr>
</table>
<p> </p>
<table width="700" border="0" class="tabela_laranja_texto_branco_esquerda_negrito">
<tr>
<td width="343">Procedimentos</td>
<td width="347">Valor</td>
</tr>
</table>
<?php do { ?>
<table width="700" border="0">
<tr>
<td width="344" class="tabela_branca_texto_azul_13_borda_cinza"><?php echo $row_loc_procedimento_lista['DESCRICAO']; ?></td>
<td width="346" class="tabela_branca_texto_azul_13_borda_cinza"><?php echo $row_loc_procedimento_lista['VALOR']; ?></td>
</tr>
</table>
<?php } while ($row_loc_procedimento_lista = mysql_fetch_assoc($loc_procedimento_lista)); ?>
<table width="700" border="0" class="box_cinza_texto_azul_13_borda_cinza">
<tr>
<td width="345" class="tabela_preta_texto_branco_negrito_centro">Total</td>
<td width="345" class="tabela_preta_texto_branco_negrito_centro"><?php echo $row_loc_procedimento_total['TOTAL']; ?></td>
</tr>
</table>
<table width="700" border="0" class="texto_vermelho_13_centro">
<tr>
<td> <a href="pesquisa_paciente.php" target="_self"><img src="../../imagem/png/butao_voltar_120x20.png" width="100" height="20" border="0" /></a></td>
</tr>
</table>
<?php
mysql_free_result($loc_procedimentos);
?>
</body>
</html>
<?php
mysql_free_result($loc_paciente);
mysql_free_result($loc_procedimento_total);
mysql_free_result($loc_procedimento_lista);
?>

Erro0No Array
Started By poy, 05/10/2010, 14:47
2 replies to this topic
#1
Posted 05/10/2010, 14:47
#3
Posted 13/10/2010, 14:42
vlw !
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)