dashboard.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. session_start();
  3. if(isset($_SESSION['userlogin'])) {
  4. $email = $_SESSION['userlogin'];
  5. unset($_SESSION['canvas_id']);
  6. require_once('../../php/db_utils.php');
  7. $conn = db_connect(); // Connect to the database
  8. // Check if the username exists
  9. if(($result = mysqli_query($conn, 'SELECT name FROM user WHERE username = "' . $email . '"'))) {
  10. // Check that there is only one user with this email
  11. if(mysqli_num_rows($result) == 1) {
  12. $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
  13. $name = $row['name'];
  14. $_SESSION['userfirstname'] = $name;
  15. ?>
  16. <!DOCTYPE html>
  17. <html lang="en">
  18. <head>
  19. <meta charset="UTF-8">
  20. <meta name="viewport" content="width=device-width, initial-scale=1">
  21. <title>The Ethics Canvas</title>
  22. <!-- Favicons -->
  23. <link rel="icon" href="../../icon/favicon.ico"/>
  24. <!-- Bootstrap -->
  25. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  26. <!-- Google font -->
  27. <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
  28. <!-- App style -->
  29. <link rel="stylesheet" type="text/css" href="../css/dashboard.css">
  30. <!-- retieving the user's email sent by php, as a js variable -->
  31. <script language="javascript" type="text/javascript">
  32. var loggedin_user_email = '<?php echo $email; ?>';
  33. </script>
  34. </head>
  35. <body>
  36. <div class="container-fluid user-dashboard">
  37. <!-- Start of .user-canvas-gallery -->
  38. <div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
  39. <!--logo -->
  40. <h1 class="page_title">
  41. <a class="logo" href="../../index.html">
  42. <img src="../icons/logo-black-text.svg" alt="Online Ethics Canvas"/>
  43. </a>
  44. </h1>
  45. </div>
  46. <div class="row">
  47. <div class="user-bar col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 text-center">
  48. <img src="../../icon/profile.svg"/><span class="welcome-user">Welcome, </span><span class="user-name"><?php echo $name; ?></span>
  49. </div>
  50. </div>
  51. <div class="row">
  52. <div class="create-new-canvas col-md-4 col-md-offset-4 col-sm-4 col-sm-offset-4 col-xs-8 col-xs-offset-2 text-center">
  53. <button class="dashbord-logout-btn">Log out</button>
  54. </div>
  55. </div>
  56. <div class="row">
  57. <div class="create-new-canvas col-md-4 col-md-offset-4 col-sm-4 col-sm-offset-4 col-xs-8 col-xs-offset-2 text-center">
  58. <p>
  59. <a class="create-canvas-btn" href="../index.php"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>Create a new canvas</a>
  60. </p>
  61. </div>
  62. </div>
  63. <div class="row">
  64. <div class="user-canvases-intro text-center col-md-6 col-md-offset-3">
  65. <h2>Your canvases</h2>
  66. <p>The canvases that you have created are displayed here.</p>
  67. </div>
  68. </div>
  69. <div class="row user-canvas-gallery">
  70. </div>
  71. <div class="row">
  72. <div class="shared-canvases-intro text-center col-md-6 col-md-offset-3">
  73. <h2>Shared with you</h2>
  74. <p>The canvases that have been shared with you are displayed here.</p>
  75. </div>
  76. </div>
  77. <div class="row shared-canvases-gallery">
  78. </div>
  79. <div class="row">
  80. <div class="public-canvases-intro text-center col-md-6 col-md-offset-3">
  81. <h2>Public canvases</h2>
  82. <p>The canvases that have been published by other users are displayed here.</p>
  83. </div>
  84. </div>
  85. <div class="row public-canvases-gallery">
  86. </div>
  87. <!-- End of .user-canvas-gallery -->
  88. <!-- Start of dialogs -->
  89. <div id="shadow">&nbsp;</div>
  90. <div class="dialog" id="dialog-remove-canvas">
  91. <div class="dialog-header">
  92. <button type="button" class="close" aria-label="Close">
  93. <span aria-hidden="true">&times;</span>
  94. </button>
  95. <h2>
  96. Remove?
  97. </h2>
  98. </div>
  99. <div class="dialog-content">
  100. <p>Are you sure you want to remove this canvas?</p>
  101. <button type="button" class="window-button" id="button-yes">Yes</button>
  102. <button type="button" class="window-button" id="button-no">Cancel</button>
  103. </div>
  104. </div>
  105. <!-- End of dialogs -->
  106. <!-- Start of footer .row -->
  107. <div class="row">
  108. <footer class="col-md-12 text-center">
  109. <div class="contact">
  110. <h2>Contact us:</h2>
  111. <p>hello@ethicscanvas.org</p>
  112. </div>
  113. <div class="license">
  114. <p>The Ethics Canvas is adapted from Alex Osterwalder’s Business Model Canvas.</p>
  115. <p>The Business Model Canvas is designed by: Business Model Foundry AG.
  116. </p>
  117. <p>
  118. This work is licensed under the Creative Commons Attribution-Share Alike 3.0 unported license.</p>
  119. <p class="cc"><span class="glyphicon glyphicon-list" aria-hidden="true"></span> View a copy of this license on:</p>
  120. <p>
  121. <a href="https://creativecommons.org/licenses/by-sa/3.0/">creativecommons.org</a>
  122. </p>
  123. <p class="bmc"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
  124. View the original Business Model Canvas on:
  125. </p>
  126. <p>
  127. <a href="https://strategyzer.com/canvas">strategyzer.com</a>
  128. </p>
  129. </div>
  130. <div class="license-icons">
  131. <ul>
  132. <li><img src="../../icon/by.large.png" alt="ethics-canvas-by-icon"/> </li>
  133. <li><img src="../../icon/share.large.png" alt="ethics-canvas-share-icon"/> </li>
  134. <li><img src="../../icon/cc.large.png" alt="ethics-canvas-cc-icon"/> </li>
  135. <li><img src="../../icon/remix.large.png" alt="ethics-canvas-remix-icon"/></li>
  136. <li><img src="../../icon/sa.large.png" alt="ethics-canvas-sa-icon"/></li>
  137. </ul>
  138. </div>
  139. <p class="ethics-copy terms"><a href="../../privacy-terms/terms.html">Terms of Service</a></p>
  140. <p class="ethics-copy privacy"><a href="../../privacy-terms/privacy.html">Privacy Policy</a></p>
  141. <p class="ethics-copy">The ADAPT Centre for Digital Content Technology</p>
  142. <p class="ethics-copy">is funded under the SFI Research Centres Programme (Grant 13/RC/2106).</p>
  143. <p class="ethics-copy">It is co-funded under the European Regional Development Fund.</p>
  144. <p class="ethics-copy">Ethics Canvas v1.8&nbsp;|&nbsp;&copy; ADAPT Centre &amp; Trinity College Dublin &amp; Dublin City University, 2017</p>
  145. </footer>
  146. </div>
  147. <!-- End of footer .row -->
  148. </div>
  149. <!-- End of container-fluid -->
  150. <!-- Add jquery -->
  151. <script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0=" crossorigin="anonymous"></script>
  152. <!-- The dashboard javascript -->
  153. <script src="../js/dashboard.js" charset="utf-8"></script>
  154. </body>
  155. </html>
  156. <?php
  157. }
  158. }
  159. }
  160. ?>