Advertisement
ajjunior33

Sistema Conta

Apr 24th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  include("includes/conexa.php");
  4. require_once 'init.php';
  5. require 'check.php';
  6. $voce = $_SESSION['user_name'];
  7. $id = $_SESSION['user_id'];
  8. $salario = $_SESSION['user_salario'];
  9.  
  10. ?>
  11. <?php include("includes/topotw.php");
  12. echo "Olá, $voce Seu ID: $id Seu Salario: R$ $salario";
  13. ?>
  14.  
  15. <?php
  16. echo "<div id='linhamaior'>";
  17. include('includes/conexa.php');
  18. $consulta = $PDO->query("SELECT * FROM  `contas`  WHERE id_pessoa LIKE '%".$id."%'");  
  19.     while($linha = $consulta ->fetch(PDO::FETCH_ASSOC)) {  
  20.       header('Content-Type: text/html; charset=utf-8');
  21.       echo "<div class='linha'><h1>Conta: </h1>{$linha['nome_conta']}</div><br/>";
  22.       echo "<div class='linha'><h1>Valor: </h1>R$ {$linha['valor_conta']}</div><br/>";
  23.       echo "<div class='linha'><h1>Vezes a Pagar:</h1>{$linha['vezes_conta']}</div><br/>";
  24.       $vl = $linha['valor_conta'];
  25.             $vx = $linha['vezes_conta'];
  26.             $total = $vl * $vx;
  27.             echo "<h1>Total: </h1> R$".number_format($total, 2, '.', ',')."<br/>";
  28.             $totalGeral += $vl;
  29.             echo "<br/><br/> <hr>";
  30.     }
  31. /*
  32. $somaconta = 200+80+43+38;
  33. $salario = 430.00;
  34. echo "R$ $somaconta - Soma de Dividas<br />";
  35. $geral = $salario - $somaconta;
  36. echo "R$ $geral - Montante Restante";
  37. */
  38. echo "<br />";
  39. $geral = $salario - $totalGeral;
  40. echo "<h1>R$ $totalGeral - Soma de Contas <br/></h1>";
  41. echo "<h1>R$ $geral - Restante <br/></h1>";
  42. echo "</div>";
  43. ?>
  44. <a href="panel.php"><button class="btn button_login">Voltar</button></a>
  45. <?php include("includes/rodape.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement