Guest User

Untitled

a guest
Dec 14th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <?php
  2. $conn = new mysqli("localhost", "root", "blahblah", "blahbla_database");
  3. $userglobal = $w['user']['username']; // this get username of logged user
  4. $sql = "SELECT emails FROM users WHERE (`username` = '{$userglobal}')";
  5. $result = $conn->query($sql);
  6. if($result->num_rows > 0) {
  7. while($row = $result->fetch_assoc()) {
  8. if ($row["emails"] !== NULL) {
  9. echo "<div class='list-group'>";
  10. echo "<a href='./mail' target='_blank' class='list-group-item list-group-item-action'>";
  11. $mail_showed = nl2br($row["emails"]);
  12. $mail_showed = str_replace('n', "<br />", $mail_showed);
  13. $mail_showed = str_replace('zn', "", $mail_showed);
  14.  
  15. echo $mail_showed;
  16. echo "<span class='badge badge-primary badge-pill'>".CountNewMails($mail_var)."</span></a>"; // Get new mails in number then show it
  17. echo "</div>";
  18. } else { echo "<h5 class='text-center'>".$w['user']['username']." You dont have yet mail</h5>";}
  19. }
  20. }
  21. ?>
  22.  
  23. <div class='list-group'>
  24. <a href='./mail' target='_blank' class='list-group-item list-group-item-action'>usermail@domain.com
  25. <span class='badge badge-primary badge-pill'>14</span></a>
  26. </div>
  27.  
  28. <div class='list-group'>
  29. <a href='./mail' target='_blank' class='list-group-item list-group-item-action'>usermail@domain.com<br>2mail@domain.com
  30. <span class='badge badge-primary badge-pill'>14</span></a>
  31. </div>
  32.  
  33. <div class='list-group'>
  34. <a href='./mail' target='_blank' class='list-group-item list-group-item-action'>usermail@domain.com
  35. <span class='badge badge-primary badge-pill'>14</span></a>
  36. <a href='./mail' target='_blank' class='list-group-item list-group--item-action'>2mail@domain.com
  37. <span class='badge badge-primary badge-pill'>99</span></a>
  38.  
  39. </div>
Add Comment
Please, Sign In to add comment