Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. $mysqli = NEW MySQLi('localhost','root','','server');
  3.  
  4. $sqlFatura = $mysqli->query("SELECT login as NOME,fatura AS
  5. Fatura, Emissao, Vcto, group_concat(reserva) AS RESERVAS
  6. FROM usuarios INNER JOIN faturas,anexos WHERE
  7. usuarios.ID=IDlogin AND faturas.ID=IDfatura AND login='".
  8. mysql_real_escape_string($_SESSION['login'])."' GROUP BY fatura");
  9.  
  10.  
  11. if($sqlFatura->num_rows > 0){
  12. while($rows = $sqlFatura->fetch_assoc()){
  13. $fatura = $rows['Fatura'];
  14. $loc = $fatura .".pdf";
  15. $stur = $rows['RESERVAS'];
  16. $emissao = $rows['Emissao'];
  17. $vcto = $rows['Vcto'];
  18.  
  19. echo "<p> Fatura $fatura Emitida dia $emissao Vencimento
  20. $vcto=><a href='$loc' target='_blank'>DOWNLOAD</a> ANEXO: $stur<br></p>";
  21.  
  22. }
  23. }else{
  24. echo "SEM FATURAS.";
  25.  
  26. }
  27.  
  28. ?>
  29.  
  30. echo "<p> Fatura $fatura Emitida dia $emissao Vencimento
  31. $vcto=><a href='$loc' target='_blank'>DOWNLOAD</a>
  32. ANEXO:<a href='url_stur' target='_blank'>$stur</a><br></p>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement