Advertisement
Guest User

Untitled

a guest
Jun 5th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <style type="text/css">
  2.  
  3. #border {
  4. padding: 1px;
  5. border: 1px solid #000000;
  6. background-color: #FFFFFF;
  7. width: 170px;
  8. height: 170px;
  9. }
  10.  
  11. #showname-times {
  12. font-familly: Tahoma, Geneva, sans-serif;
  13. font-size: 12px;
  14. color: #333333;
  15. width: 170px;
  16. height: auto;
  17. }
  18.  
  19. a:link {
  20. color: #333;
  21. text-decoration: none;
  22. }
  23. a:visited {
  24. text-decoration: none;
  25. color: #333;
  26. }
  27. a:hover {
  28. text-decoration: none;
  29. color: #CAF00E;
  30. }
  31. a:active {
  32. text-decoration: none;
  33. color: #333;
  34. }
  35.  
  36. </style>
  37.  
  38.  
  39. <?php
  40.  
  41. // connect to database
  42. $db_host = "localhost";
  43. $db_pass = "onair";
  44. $db_user = "thepurea_onair";
  45. $db_name = "thepurea_onair";
  46.  
  47. mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
  48. mysql_select_db($db_name);
  49.  
  50. // this gets the HOUR of the day
  51. $sTime = date("H:00");
  52.  
  53. // query the database
  54. $query = mysql_query("SELECT * FROM sunday WHERE startTime = '{$sTime}'") or die(mysql_error());
  55.  
  56. // check to see if someone started at the start of the hour
  57. $num_rows = mysql_num_rows($query);
  58.  
  59. // if it is zero (nobody starts) then tell people that
  60. if($num_rows == 0){
  61. echo$image = $rows['image'];
  62. } else {
  63. // someone does start, so fetch the rows!
  64. $rows = mysql_fetch_array($query);
  65.  
  66. $image = $rows['image'];
  67. $username = $rows['username'];
  68. $profile = $rows['profile'];
  69. $startTime = $rows['startTime'];
  70. $endTime = $rows['endTime'];
  71. }
  72. ?>
  73.  
  74. <div id="border">
  75. <a href="<?php echo$username = $rows['profile']; ?>.php"><img src="<?php echo$image = $rows['image']; ?>" border="0px" /></a></br>
  76. </div>
  77.  
  78. <font face="Tahoma">
  79. <strong>
  80.  
  81. <div id="showname-times">
  82. <center>
  83. <a href="<?php echo$username = $rows['profile']; ?>.php"><?php echo$username = $rows['username']; ?></a></br>
  84. <?php echo$startTime = $rows['startTime']; echo(" - "); echo$startTime = $rows['endTime']; ?>
  85. </center>
  86. </div>
  87.  
  88. </strong>
  89. </font>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement