Advertisement
Betabrawler

Untitled

Aug 15th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.90 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(!isset($_SESSION["sess_user"])){
  4.     header("location:Index.php");
  5. } else {
  6. ?>
  7.  
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <style>
  13. * {
  14.     box-sizing: border-box;
  15. }
  16. .row::after {
  17.     content: "";
  18.     clear: both;
  19.     display: table;
  20. }
  21. [class*="col-"] {
  22.     float: left;
  23.     padding: 15px;
  24. }
  25. html {
  26.     font-family: "Lucida Sans", sans-serif;
  27. }
  28. .header {
  29.     background-color: #9933cc;
  30.     color: #ffffff;
  31.     padding: 15px;
  32. }
  33. .menu ul {
  34.     list-style-type: none;
  35.     margin: 0;
  36.     padding: 0;
  37. }
  38. .menu li {
  39.     padding: 8px;
  40.     margin-bottom: 7px;
  41.     background-color: #33b5e5;
  42.     color: #ffffff;
  43.     box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  44. }
  45. .menu li:hover {
  46.     background-color: #0099cc;
  47. }
  48. .aside {
  49.     background-color: #33b5e5;
  50.     padding: 15px;
  51.     color: #ffffff;
  52.     text-align: center;
  53.     font-size: 14px;
  54.     box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  55. }
  56. .footer {
  57.     background-color: #0099cc;
  58.     color: #ffffff;
  59.     text-align: center;
  60.     font-size: 12px;
  61.     padding: 15px;
  62. }
  63. /* For mobile phones: */
  64. [class*="col-"] {
  65.     width: 100%;
  66. }
  67. @media only screen and (min-width: 600px) {
  68.     /* For tablets: */
  69.     .col-m-1 {width: 8.33%;}
  70.     .col-m-2 {width: 16.66%;}
  71.     .col-m-3 {width: 25%;}
  72.     .col-m-4 {width: 33.33%;}
  73.     .col-m-5 {width: 41.66%;}
  74.     .col-m-6 {width: 50%;}
  75.     .col-m-7 {width: 58.33%;}
  76.     .col-m-8 {width: 66.66%;}
  77.     .col-m-9 {width: 75%;}
  78.     .col-m-10 {width: 83.33%;}
  79.     .col-m-11 {width: 91.66%;}
  80.     .col-m-12 {width: 100%;}
  81. }
  82. @media only screen and (min-width: 768px) {
  83.     /* For desktop: */
  84.     .col-1 {width: 8.33%;}
  85.     .col-2 {width: 16.66%;}
  86.     .col-3 {width: 25%;}
  87.     .col-4 {width: 33.33%;}
  88.     .col-5 {width: 41.66%;}
  89.     .col-6 {width: 50%;}
  90.     .col-7 {width: 58.33%;}
  91.     .col-8 {width: 66.66%;}
  92.     .col-9 {width: 75%;}
  93.     .col-10 {width: 83.33%;}
  94.     .col-11 {width: 91.66%;}
  95.     .col-12 {width: 100%;}
  96. }
  97. </style>
  98. </head>
  99. <body>
  100.  
  101. <div class="header">
  102.   <h1>Bienvenido</h1>
  103. </div>
  104.  
  105. <div class="row">
  106.  
  107.  
  108.  
  109. <div class="col-6 col-m-9">
  110.   <h1>Lista de usuarios</h1>
  111.  <?php
  112. $con=mysql_connect('localhost','root','') or die(mysql_error());
  113.     mysql_select_db('usuario') or die("cannot select DB");
  114.  
  115.  
  116. $query = "SELECT * FROM usuario";
  117. $result = mysql_query($query);
  118.  
  119. echo "<table>";
  120.  
  121. while($row = mysql_fetch_array($result)){  
  122. echo "<tr><td>" . $row['id'] . "</td><td>" . $row['email'] . "</td></tr>";
  123.  
  124.  
  125. echo "</table>";
  126.  
  127. mysql_close();
  128.  
  129. ?>
  130. </div>
  131.  
  132. <div class="col-3 col-m-12">
  133.   <div class="aside">
  134.     <h2><?=$_SESSION['sess_user'];?>! <a href="logout.php">Logout</a></h2>
  135.  
  136.   </div>
  137. </div>
  138.  
  139. </div>
  140.  
  141. <div class="footer">
  142.   <p>Resize the browser window to see how the content respond to the resizing.</p>
  143. </div>
  144.  
  145. </body>
  146. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement