PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/View/ClubProfile.php

https://bitbucket.org/onlinechessportal/onlinechessgameportal
PHP | 271 lines | 239 code | 30 blank | 2 comment | 19 complexity | c0cf8405619365608c11445750d36960 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. require '../Model/Connect.php';
  3. require '../Control/RegisterLogic.php';
  4. ob_start();
  5. if(LoggedIn()) {
  6. $UserNm=$_SESSION['username'];
  7. if(isset($_GET['id'])) {
  8. $SearchID = $_GET['id'];
  9. }
  10. if(isset($_GET['ClubNo'])) {
  11. $club_id=$_GET['ClubNo']; // User session id
  12. }
  13. if(isset($_GET['Admin'])) {
  14. $Admin = $_GET['Admin'];
  15. }else {
  16. $Admin = $UserNm;
  17. }
  18. }else{
  19. echo '<script type="text/javascript">alert("Please Log in")</script>';
  20. echo '<script type="text/javascript"> window.location = "Home.php"</script>';
  21. }
  22. ?>
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <title>Online Chess Portal</title>
  28. <!-- CSS Files -->
  29. <link href="css/reset.css" rel="stylesheet" type="text/css" />
  30. <link href="css/screen.css" rel="stylesheet" type="text/css" />
  31. <link href="css/style.css" rel="stylesheet" type="text/css" />
  32. <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
  33. <style type="text/css">
  34. table{
  35. border:1px solid white;
  36. float: right;
  37. width: 50%;
  38. margin-top: 2%;
  39. margin-right: 5%;
  40. margin-bottom: 2%;
  41. margin-left: 2%;
  42. height: 25%;
  43. }
  44. th
  45. {
  46. color:Black;
  47. text-align: left;
  48. width: 40%;
  49. height: 100%;
  50. }
  51. td {
  52. font-family: Calibri;
  53. border: thin #CCCCCC;
  54. margin: 4%;
  55. }
  56. tr{
  57. margin: 4%;
  58. padding: 2%;
  59. width: 20%;
  60. height: 50%;
  61. }
  62. </style>
  63. <!-- End of CSS Files -->
  64. <!-- Javascript Files -->
  65. <script type="text/javascript" src="javascript/jquery1.3.2.js"></script>
  66. <!--<script type="text/javascript" src="javascript/jquery.cycle.all.js"></script>
  67. <script type="text/javascript" src="javascript/superfish.js"></script>
  68. <script type="text/javascript" src="javascript/dd.min.js"></script>-->
  69. <script type="text/javascript" src="javascript/popup-window.js"></script>
  70. <!--<script type="text/javascript" src="http://www.google.com/jsapi"></script>
  71. <script type="text/javascript">google.load('jquery', '1.5');</script>-->
  72. <script type="text/javascript" src="js/jquery.gritter.js"></script>
  73. <script language="javascript" type="text/javascript">
  74. $(document).ready(function(){
  75. $(".slidingDiv1").hide();
  76. $(".show_hide1").show();
  77. $('.show_hide1').click(function(){
  78. $(".slidingDiv1").slideToggle();
  79. });
  80. });
  81. </script>
  82. <script type="text/javascript">
  83. <!--popup-->
  84. var time_interval = setInterval(
  85. function ()
  86. {
  87. $('#popup').load('../Control/Notification.php').fadeIn("slow");
  88. }, 5000); // refresh every 5000 milliseconds
  89. </script>
  90. <!-- End of Javascript Files -->
  91. </head>
  92. <body>
  93. <!-- Wrapper -->
  94. <div id="wrapper">
  95. <div id="topbar">
  96. <img src="images/icon1.png" alt="logo" width="42" height="41" class="logo" id='test' /><img src="images/logo.gif" alt="logo" width="322" height="41" class="logo1" id='test' />
  97. <div id="secnav">
  98. <ul>
  99. <li class="noimg"> <a href="../Control/LogoutLogic.php?Reason=Normal">SIGN OUT</a> </li>
  100. </ul>
  101. </div>
  102. <div class="menu">
  103. <ul class="sf-menu">
  104. <li> <?php if($_SESSION['role'] == 'SiteAdmin') {
  105. ?> <a href="SiteAdminProfile.php">
  106. <?php } else { ?>
  107. <a href="MemberProfile.php">
  108. <?php }
  109. $result = mysql_query("SELECT mp_fullname FROM memberprofile WHERE mp_username='".$_SESSION['username']."' ");
  110. $row = mysql_fetch_array($result);
  111. if($_SESSION['role'] == 'SiteAdmin') {
  112. echo 'Profile';
  113. } else {
  114. echo $row['mp_fullname'];
  115. }?></a>
  116. </li>
  117. </div> </div><!-- menu end-->
  118. <div id="content">
  119. <?Php
  120. if($UserNm == $Admin) {
  121. echo "<p align='right'><a href='PhotoUpload.php?ClubNo=".$club_id."'' class='Buttonview'>Change Image</a> </p>" ;
  122. }
  123. ?>
  124. <div class="froms"><div>
  125. <span id="popup"></span>
  126. <?php
  127. $CheckMembershipSql = "SELECT `cm_member` FROM Clubmember WHERE `cm_member`='".$UserNm."' AND `cm_clubid` = ".$club_id." ";
  128. $Result = mysql_query($CheckMembershipSql);
  129. if ($Result) {
  130. $rows = mysql_num_rows($Result);
  131. if ($rows == 0) {
  132. if($Admin != $UserNm) {?>
  133. <a class="Buttonview"href="../Control/SendClubRequest.php?clubID=<?php echo $club_id ?>&to=<?php echo $UserNm ?>&Admin=<?php echo $Admin ?>">Send Request to join this Club</a></li>
  134. <?php
  135. }
  136. }
  137. } ?>
  138. <?php
  139. include('ajaximage.php');
  140. /* if(isset($_GET['ClubNo'])) {
  141. $club_id=$_GET['ClubNo']; // User session id
  142. }*/
  143. $_SESSION['clubid']=$club_id;
  144. $actual_image_name="";
  145. $name="";
  146. $ImageResult = mysql_query("SELECT cl_image,cl_name FROM club where cl_id='".$club_id."'");
  147. //$ImageResult = mysql_query("SELECT cl_name FROM club where cl_id='".$club_id."'");
  148. while($Info = mysql_fetch_assoc( $ImageResult )) {
  149. $actual_image_name = $Info['cl_image'];
  150. $name=$Info['cl_name'];
  151. }
  152. echo"<p align='Left'><strong> ".$name."&nbsp;</strong></p>";
  153. echo"<br/>";
  154. echo "<img src='uploads/".$actual_image_name."'width='25%'height='25%'>";
  155. //if($UserNm == $Admin) {
  156. // echo "<a href='PhotoUpload.php?ClubNo=".$club_id."''>Change Image</a>" ;
  157. //}
  158. $result = mysql_query("SELECT * FROM club, memberprofile where cl_id='".$club_id."' and cl_administrator = mp_username");
  159. $result2 = mysql_query("SELECT count(`cm_member`) as count FROM `clubmember` where cm_clubid='".$club_id."' GROUP BY `cm_clubid` LIMIT 0, 30");
  160. echo "<table width='75%' table border='0'>";
  161. while($row = mysql_fetch_array($result)){
  162. echo"<tr><th>Club ID:</th> <td> ". $row['cl_id'] ." </td></tr>
  163. <tr><th></th> <td> </td></tr>";
  164. if($row['cl_type'] == 'uni')
  165. $Type = 'University';
  166. else if($row['cl_type'] == 'scl')
  167. $Type = 'School';
  168. else
  169. $Type = 'Other';
  170. echo "<tr><th>Club Type:</th> <td> ". $Type ." </td></tr>
  171. <tr><th></th> <td> </td></tr>
  172. <tr><th>Club administrator:</th> <td> ". $row['mp_fullname'] ." </td></tr>
  173. <tr><th></th> <td> </td></tr>
  174. ";}
  175. while($row = mysql_fetch_array($result2)){
  176. echo "<tr><th>Number of club Member :</th> <td> ". $row['count'] ." </td></tr>";}
  177. echo "</table>";
  178. //unset($_SESSION[clubid]);
  179. ?>
  180. </div>
  181. </div>
  182. </div>
  183. <?php if($UserNm == $Admin) { ?>
  184. <div id="sidebar">
  185. <li class="content">
  186. <!--------------------------------------------------------------->
  187. <h2>Requests </h2>
  188. <ul>
  189. <li><a href="Accept.php">Request</a></li>
  190. </ul>
  191. </li>
  192. </div>
  193. <?php } ?>
  194. <!-- new code-->
  195. <layer>
  196. <ul id="navigation">
  197. <li class="home"><a href="Home_Login.php" title="Home"></a></li>
  198. <li class="play"><a href="Play.php" title="Play Chess"></a></li>
  199. <li class="photos"><a href="Inbox.php" title="Inbox"></a></li>
  200. <li class="club"><a href="SearchClub.php" title="Clubs"></a></li>
  201. <li class="settings"><a href="Settings.php" title="Settings"></a></li>
  202. </ul>
  203. </layer>
  204. <script type="text/javascript">
  205. $(function() {
  206. $('#navigation a').stop().animate({'marginLeft':'-90px'},100);
  207. $('#navigation > li').hover(
  208. function () {
  209. $('a',$(this)).stop().animate({'marginLeft':'-70px'},100);
  210. },
  211. function () {
  212. $('a',$(this)).stop().animate({'marginLeft':'-90px'},100);
  213. }
  214. );
  215. });
  216. </script>
  217. <!--new code end -->
  218. <div class="clear"></div>
  219. <div id="footers">
  220. <div style="float:right"><div class="fotterlast">
  221. <a href="#" title="About Us">About Us</a>
  222. |
  223. <a href="#" title="Terms of Service">Terms of Service</a>
  224. |
  225. <a href="#" title="Privacy Statement">Privacy</a>
  226. |
  227. <a href="Contact.php" title="Contact Us">Contact Us</a>
  228. </div></div>
  229. <div style="float:Left"><div class="fotterlastdesing">Designed by SEP_WE_05 Team.</div></div>
  230. </div>
  231. </div>
  232. </div></div>
  233. </body>
  234. </html>