Advertisement
Guest User

Untitled

a guest
Jan 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <?php include 'connectionDetails.php'; ?>
  5. <?php include 'login_form.php'; ?>
  6.  
  7. <?php
  8. if(!isset($_SESSION['loggedin'])){ //if login in session is not set
  9. header("Location: index.php");
  10. }
  11. ?>
  12.  
  13. <title>Juan - Clients</title>
  14. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  15. <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" media="all">
  16. <link rel="stylesheet" href="styles/igotswag.css" type="text/css">
  17. <link rel="stylesheet" href="styles/swaganimations.css" type="text/css">
  18.  
  19. </head>
  20. <body>
  21.  
  22. <!-- Header Area -->
  23. <table class="header-container" style="width: 100%;">
  24. <tr>
  25. <td style="width: 40%; text-align: left;"><a href="index.php"><img class="hover-cursor" src="Images/TEAMS_Logo.png"></a></td>
  26. <td style="width: 10%; text-align: center;" class="custom-header custom-font">TEAMS
  27. <span style="color: #cc2020" class="custom-font">J</span><span style="color: #1a488c" class="custom-font">U</span><span style="color: #2a9e56" class="custom-font">A</span><span style="color: #d87f0a" class="custom-font">N </span><span style="font-size: 30px;" class="glyphicon glyphicon-globe"></span></td>
  28. <td style="width: 40%; text-align: right; font-size: 18px; vertical-align: bottom;" class="custom-font">
  29. <?php
  30. if (isset($_SESSION["username"]))
  31. {
  32. echo $_SESSION["username"];
  33. echo "&nbsp;&nbsp;";
  34. echo "<span style='font-size: 20px; vertical-align: bottom; text-align: right;' class='fa fa-user'>&nbsp;&nbsp;&nbsp;</span>";
  35. }
  36. ?>
  37. </td>
  38. </tr>
  39. </table>
  40.  
  41. <div class="pull-down-container">
  42. <div class="panel1">
  43. <br />
  44. <p>Now you see me!</p>
  45. </div>
  46. <p class="slide" style="text-align: center;">
  47. <div class="pull-me hvr-icon-hang" style="text-align: center; vertical-align: top;">More</div>
  48. </p>
  49. </div>
  50. <!-- End Header Area -->
  51.  
  52.  
  53.  
  54.  
  55. <!-- Main Body Area -->
  56. <div style="width: 100%; text-align: center;">
  57.  
  58. <div style="font-weight: bold; text-align: center; font-size: 30px; margin-bottom: 10px;" class="custom-font">Client Management</div>
  59.  
  60. <?php
  61.  
  62. $clientInfo = "SELECT * FROM Clients ORDER BY Client ASC";
  63. $stmt = sqlsrv_query($conn, $clientInfo);
  64.  
  65. echo "<div style='width: 100%; display: inline-block;'>";
  66.  
  67. while ($client = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC))
  68. {
  69. $positive = $client['Pos'];
  70. $negative = $client['Neg'];
  71. $total = ($positive + $negative);
  72.  
  73. // Calculate width in percentage
  74. if ($total > 0)
  75. {
  76. $positiveWidth = ($positive/$total)*100;
  77. $negativeWidth = ($negative/$total)*100;
  78. }
  79. else
  80. {
  81. $positiveWidth = "0%";
  82. $negativeWidth = "0%";
  83. }
  84.  
  85.  
  86. echo "<div class='clientid' style='height: 50px; font-size: 18px; vertical-align: middle; width: 100%'>" .
  87.  
  88. "<div class='positive-container'>
  89. <div class='positive-bar hover-cursor' style='width: $positiveWidth;%;'></div>
  90. </div>
  91.  
  92. <div style='display: inline-block; width: 5%;'>
  93. <span style='font-size: 20px;' class='hover-cursor fa fa-chevron-up vote-up'></span>
  94. </div>" .
  95.  
  96. "<div id='client-name' class='hover-cursor hvr-underline-reveal voteup votedown' data-clientid='{$client['ClientID']}' style='width: 20%; display: inline-block;'>" . $client['Client'] . "</div>" .
  97.  
  98. "<div style='display: inline-block; width: 5%;'>
  99. <span style='font-size: 20px; text-align: right;' class='hover-cursor fa fa-chevron-down vote-down'></span>
  100. </div>
  101.  
  102. <div class='negative-container'>
  103. <div class='negative-bar hover-cursor' style='width: $negativeWidth;%;'></div>
  104. </div>
  105.  
  106. </div>
  107. <br />";
  108. }
  109.  
  110. echo "</div>";
  111.  
  112. ?>
  113.  
  114.  
  115. </div>
  116.  
  117. <!-- Main Body Area -->
  118.  
  119.  
  120.  
  121.  
  122. <!-- Footer Area -->
  123.  
  124.  
  125. <!-- End Footer Area -->
  126.  
  127. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
  128. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  129. <script type="text/javascript" src="scripts/scripts.js"></script>
  130. </body>
  131. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement