Jump to content
Fórum Script Brasil
  • 0

Calculos automaticos em PHP


moisesc

Question

Me ajudem nesse calculo..

eu qro q a variavel $pendencias receba todos os dados contidos nos campos $quantidade q recebe o primeiro valor e depois dos seguintes campos $quant,$quant2,$quant3,nesses campos vou ter q adicionar valores q chegue o total da variavel $quantidade,caso não esteja com o mesmo resultado da seguite variavel $quantidade,mostre no campo $pendencias o valor que esteja faltando.

Por favor galera ajuda ae to precisando muito!!!!

Edited by moisesc
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
O que você já tem feito? se tiver, post!

Esse e o codigo da tabela onde quero usar os calculos para saber as pendencias!!!!

<!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">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Aluminio</title>

<style type="text/css">

<!--

.style1 { font-family: "monotype Corsiva";

color: #990099;

}

.style2 {font-family: "monotype Corsiva"}

.style3 {color: #000000}

.style4 {font-family: "monotype Corsiva"; font-weight: bold; }

.style5 {font-family: "Monotype Corsiva"}

-->

</style>

</head>

<body>

<form action="conexao_aluminio.php" method="post" name="form1" id="form1" onsubmit="MM_validateForm('obra','','R','perfil','','RisNum','tratamento','','NisNum','quantidade','','NisNum','medida','','NisNum','peso','','NisEmail');return document.MM_returnValue">

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<table width="457" border="1" align="center">

<tr>

<td colspan="2" bgcolor="#CCCCCC"><div align="center">

<h1 class="style5">Obra</h1>

</div></td>

</tr>

<tr>

<td width="145"><div align="center" class="style5">Obra</div></td>

<td width="249"><label>

<input name="obra" type="text" id="obra" size="60" maxlength="100" />

</label></td>

</tr>

</table>

<p>&nbsp;</p>

<table width="406" border="0" align="center" cellspacing="5">

<tr bgcolor="#999999">

<td colspan="2" bgcolor="#CCCCCC"><h1 align="center" class="style1 style3"><img src="../Imagens/construcao.jpg" width="422" height="126" /></h1>

<h1 align="center" class="style1 style3">Aluminio</h1></td>

</tr>

<tr>

<td width="70"><div align="center" class="style2">Tamanho</div></td>

<td width="317"><label>

<input name="tamanho" type="text" id="tamanho" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td><div align="center" class="style2">Descrição</div></td>

<td><label>

<input name="descricao" type="text" id="descricao" size="50" maxlength="30" />

</label></td>

</tr>

<tr>

<td><div align="center" class="style2">Cor</div></td>

<td><label> </label>

<div align="left">

<input name="cor" type="text" id="cor" size="50" maxlength="20" />

</div>

</label></td>

</tr>

<tr>

<td><div align="center" class="style2">Quantidade</div></td>

<td><label> </label>

<div align="left">

<label>

<input name="quantidade" type="text" id="quantidade" size="50" maxlength="20" />

</label>

</div></td>

</tr>

<tr>

<td><div align="center" class="style2">Peso Pç</div></td>

<td><label> </label>

<div align="left">

<label>

<input name="pesopc" type="text" id="pesopc" size="50" maxlength="100" />

</label>

</div></td>

</tr>

<tr>

<td><div align="center" class="style2">Peso Total</div></td>

<td><label> </label>

<div align="left">

<label>

<input name="pesototal" type="text" id="pesototal" size="50" maxlength="10" />

</label>

</div></td>

</tr>

<tr>

<td><div align="center" class="style2">Peso Entregue</div></td>

<td><label> </label>

<div align="left">

<label>

<input name="pesoentregue" type="text" id="pesoentregue" size="50" maxlength="20" />

</label>

</div></td>

</tr>

<tr>

<td class="style2"><div align="center">Pendente</div></td>

<td><label>

<input name="pendente" type="text" id="pendente" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td colspan="2"><div align="center" class="style4">Faturamento 1</div> <div align="center"></div></td>

</tr>

<tr>

<td class="style2"><div align="center">Nota Fiscal</div></td>

<td><label>

<input name="nf" type="text" id="nf" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Data</div></td>

<td><label>

<select name="dia" id="dia">

<option>Dia</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

<option value="13">13</option>

<option value="14">14</option>

<option value="15">15</option>

<option value="16">16</option>

<option value="17">17</option>

<option value="18">18</option>

<option value="19">19</option>

<option value="20">20</option>

<option value="21">21</option>

<option value="22">22</option>

<option value="23">23</option>

<option value="24">24</option>

<option value="25">25</option>

<option value="26">26</option>

<option value="27">27</option>

<option value="28">28</option>

<option value="29">29</option>

<option value="30">30</option>

<option value="31">31</option>

</select>

/

<select name="mes" id="mes">

<option>Mês</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

</select>

/

<select name="ano" id="ano">

<option selected="selected">Ano</option>

<option value="2010">2010</option>

<option value="2011">2011</option>

<option value="2012">2012</option>

<option value="2013">2013</option>

<option value="2014">2014</option>

</select>

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Quantidade</div></td>

<td><label>

<input name="quant" type="text" id="quant" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td colspan="2"><div align="center" class="style4">Faturamento 2</div>

<div align="center"></div></td>

</tr>

<tr>

<td class="style2"><div align="center">Nota Fiscal</div></td>

<td><label>

<input name="nf2" type="text" id="nf2" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Data</div></td>

<td><label>

<select name="dia2" id="dia2">

<option>Dia</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

<option value="13">13</option>

<option value="14">14</option>

<option value="15">15</option>

<option value="16">16</option>

<option value="17">17</option>

<option value="18">18</option>

<option value="19">19</option>

<option value="20">20</option>

<option value="21">21</option>

<option value="22">22</option>

<option value="23">23</option>

<option value="24">24</option>

<option value="25">25</option>

<option value="26">26</option>

<option value="27">27</option>

<option value="28">28</option>

<option value="29">29</option>

<option value="30">30</option>

<option value="31">31</option>

</select>

/

<select name="mes2" id="mes2">

<option>Mês</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

</select>

/

<select name="ano2" id="ano2">

<option selected="selected">Ano</option>

<option value="2010">2010</option>

<option value="2011">2011</option>

<option value="2012">2012</option>

<option value="2013">2013</option>

<option value="2014">2014</option>

</select>

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Quantidade</div></td>

<td><label>

<input name="quant2" type="text" id="quant2" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td colspan="2"><div align="center" class="style4">Faturamento 3</div>

<div align="center"></div></td>

</tr>

<tr>

<td class="style2"><div align="center">Nota Fiscal</div></td>

<td><label>

<input name="nf3" type="text" id="nf3" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Data</div></td>

<td><label>

<select name="dia3" id="dia3">

<option>Dia</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

<option value="13">13</option>

<option value="14">14</option>

<option value="15">15</option>

<option value="16">16</option>

<option value="17">17</option>

<option value="18">18</option>

<option value="19">19</option>

<option value="20">20</option>

<option value="21">21</option>

<option value="22">22</option>

<option value="23">23</option>

<option value="24">24</option>

<option value="25">25</option>

<option value="26">26</option>

<option value="27">27</option>

<option value="28">28</option>

<option value="29">29</option>

<option value="30">30</option>

<option value="31">31</option>

</select>

/

<select name="mes3" id="mes3">

<option>Mês</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

</select>

/

<select name="ano3" id="ano3">

<option selected="selected">Ano</option>

<option value="2010">2010</option>

<option value="2011">2011</option>

<option value="2012">2012</option>

<option value="2013">2013</option>

<option value="2014">2014</option>

</select>

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Quantidade</div></td>

<td><label>

<input name="quant3" type="text" id="quant3" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td colspan="2"><div align="center" class="style4">Faturamento 4</div>

<div align="center"></div></td>

</tr>

<tr>

<td class="style2"><div align="center">Nota Fiscal</div></td>

<td><label>

<input name="nf4" type="text" id="nf4" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Data</div></td>

<td><label>

<select name="dia4" id="dia4">

<option>Dia</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

<option value="13">13</option>

<option value="14">14</option>

<option value="15">15</option>

<option value="16">16</option>

<option value="17">17</option>

<option value="18">18</option>

<option value="19">19</option>

<option value="20">20</option>

<option value="21">21</option>

<option value="22">22</option>

<option value="23">23</option>

<option value="24">24</option>

<option value="25">25</option>

<option value="26">26</option>

<option value="27">27</option>

<option value="28">28</option>

<option value="29">29</option>

<option value="30">30</option>

<option value="31">31</option>

</select>

/

<select name="mes4" id="mes4">

<option>Mês</option>

<option value="01">01</option>

<option value="02">02</option>

<option value="03">03</option>

<option value="04">04</option>

<option value="05">05</option>

<option value="06">06</option>

<option value="07">07</option>

<option value="08">08</option>

<option value="09">09</option>

<option value="10">10</option>

<option value="11">11</option>

<option value="12">12</option>

</select>

/

<select name="ano4" id="ano4">

<option selected="selected">Ano</option>

<option value="2010">2010</option>

<option value="2011">2011</option>

<option value="2012">2012</option>

<option value="2013">2013</option>

<option value="2014">2014</option>

</select>

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Quantidade</div></td>

<td><label>

<input name="quant4" type="text" id="quant4" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td class="style2"><div align="center">Pendencias</div></td>

<td><label>

<input name="pendencias" type="text" id="pendencias" size="50" maxlength="20" />

</label></td>

</tr>

<tr>

<td><div align="center" class="style2"> Comentário:</div></td>

<td><label>

<textarea name="comentario" cols="50" rows="5" id="comentario"></textarea>

</label></td>

</tr>

<tr>

<td><div align="center"></div></td>

<td><div align="center">

<input type="submit" name="enviar" id="enviar" value="Enviar" />

<input type="reset" name="limpar" id="limpar" value="Limpar" />

</div></td>

</tr>

</table>

</form>

<label></label>

</body>

</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...