PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/View/Accept.php

https://bitbucket.org/onlinechessportal/onlinechessgameportal
PHP | 331 lines | 254 code | 67 blank | 10 comment | 10 complexity | fffcd1129143980314b6adbfa216bae6 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. require '../Model/Connect.php';
  3. require '../Control/RegisterLogic.php';
  4. require '../Control/LoginLogic.php';
  5. ob_start();
  6. if(LoggedIn()) {
  7. $UserNm=$_SESSION['username'];
  8. $Role = $_SESSION['role'];
  9. }else{
  10. echo '<script type="text/javascript">alert("Please Log in")</script>';
  11. echo '<script type="text/javascript"> window.location = "Home.php"</script>';
  12. }
  13. ?>
  14. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head>
  17. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  18. <title>Online Chess Portal </title>
  19. <!-- CSS Files -->
  20. <link href="css/reset.css" rel="stylesheet" type="text/css" />
  21. <link href="css/style.css" rel="stylesheet" type="text/css" />
  22. <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
  23. <style type="text/css">
  24. .sf-sub-indicator {
  25. behavior: url(css/iepngfix.htc)
  26. }
  27. ;
  28. </style>
  29. <!-- End of CSS Files -->
  30. <!-- Javascript Files -->
  31. <script type="text/javascript" src="javascript/jquery1.3.2.js"></script>
  32. <script language="javascript" type="text/javascript">
  33. $(document).ready(function(){
  34. //$(".slidingDiv").hide();
  35. $(".show_hide").show();
  36. $('.show_hide').click(function(){
  37. $(".slidingDiv").slideToggle();
  38. });
  39. });
  40. function accept(id,from,to)
  41. {
  42. $.ajax({
  43. url: '../Control/TournamentAccept.php',
  44. cache: false,
  45. data:{'id':id,'from':from,'to':to},
  46. success: function(html) {
  47. $('.slidingDiv').html(html);
  48. }
  49. //success:p
  50. });
  51. //loadcontent();
  52. }
  53. function reject(id,from)
  54. {
  55. $.ajax({
  56. url: '../Control/TournamentAcceptReject.php',
  57. cache: false,
  58. data:{'id':id,'from':from},
  59. success: function(html) {
  60. $('.slidingDiv').html(html);
  61. }
  62. //success:p
  63. });
  64. //loadcontent();
  65. }
  66. function acceptclub(id,from)
  67. {
  68. $.ajax({
  69. url: '../Control/ClubAccept.php',
  70. cache: false,
  71. data:{'id':id,'from':from},
  72. success: function(html) {
  73. $('.slidingDiv1').html(html);
  74. }
  75. //success:p
  76. });
  77. //loadcontent();
  78. }
  79. </script>
  80. <script language="javascript" type="text/javascript">
  81. $(document).ready(function(){
  82. // $(".slidingDiv1").hide();
  83. //$(".show_hide1").show();
  84. $('.show_hide1').click(function(){
  85. $(".slidingDiv1").slideToggle();
  86. });
  87. });
  88. </script>
  89. <!--popup-->
  90. <style type="text/css">
  91. table{
  92. border:1px solid white;
  93. }
  94. th
  95. {
  96. background-color:#CCCCCC;
  97. color:Black;
  98. background-image: url(images/dropdowntop.jpg);
  99. }
  100. td {
  101. font-family: Calibri;
  102. border: thin #CCCCCC;
  103. }
  104. #footer {
  105. background-color: #CCCCCC;
  106. color: #000000;
  107. font-family: Arial,Helvetica,sans-serif;
  108. font-size: 10px;
  109. height: 50px;
  110. margin-top: 0;
  111. text-transform: capitalize;
  112. width: 100%;
  113. }
  114. </style>
  115. <!-- End of Javascript Files -->
  116. </head>
  117. <body>
  118. <!-- Wrapper -->
  119. <div id="wrapper">
  120. <div id="topbar"> <img src="images/icon1.png" alt="logo" width="42" height="41" class="logo" id='test' /><img src="images/logo.gif" alt="logo" width="250" height="41" class="logo1" id='test' />
  121. <div id="secnav">
  122. <ul>
  123. <li>
  124. <li class="noimg"> <a href="../Control/LogoutLogic.php?Reason=Normal">Sign Out</a></li>
  125. </ul>
  126. </div>
  127. <div class="menu">
  128. <ul class="sf-menu">
  129. <?php if($Role == 'SiteAdmin') { ?>
  130. <li> <a href="SiteAdminProfile.php">Profile</a>
  131. <?php } else { ?>
  132. <li> <a href="MemberProfile.php">
  133. <?php
  134. $result = mysql_query("SELECT mp_fullname FROM memberprofile WHERE mp_username='".$_SESSION['username']."' ");
  135. $row = mysql_fetch_array($result);
  136. echo $row['mp_fullname']?>
  137. </a>
  138. <?php } ?>
  139. </ul>
  140. </div> </div><!-- menu end-->
  141. <div id="content_guest">
  142. <p align="right"><a href="#" class="show_hide Buttonview">Show Tournament Request</a>&nbsp;&nbsp;<a href="#" class="show_hide1 Buttonview">Show Club Request</a></p>
  143. <div class="froms">
  144. <div class="slidingDiv">
  145. <h3><font color="#000000">Tournament Request</font></h3>
  146. <br />
  147. <?php
  148. require '../Model/Connect.php';
  149. ob_start();
  150. $From ="";
  151. $TournamentNo ="";
  152. if($Role == 'SiteAdmin') {
  153. $Result = mysql_query("SELECT DISTINCT * FROM `tournamentrequest` , tournament,memberprofile WHERE tr_status =0 AND to_type = 'Open' AND to_id = tr_id and tr_from=mp_username LIMIT 0, 4");
  154. }else{
  155. $Result = mysql_query("SELECT DISTINCT * FROM `tournamentrequest` , tournament,memberprofile WHERE `tr_creator` ='".$UserNm."' AND tr_status =0 AND to_type = 'Private' AND to_id = tr_id and tr_from=mp_username LIMIT 0, 4");
  156. }
  157. if (mysql_num_rows($Result) == 0) {
  158. echo "<p align='center'> <font color='#FF0000'><h1>No Result</h1></font></p>";
  159. }else {
  160. echo "<table width='100%' table border='2' style='border:#999999'>
  161. <tr>
  162. <th> User Name</></th>
  163. <th>Message</th>
  164. <th>Tournament No</th>
  165. <th>Start Date</th>
  166. <th>Close date</th>
  167. </tr>";
  168. while($row = mysql_fetch_assoc($Result)){
  169. echo "<tr onmouseover=this.bgColor='#88BBDD' onmouseout=this.bgColor='#FFFFFF'> ";
  170. echo "<form action='' method='post'> ";
  171. $From=$row['mp_fullname'];
  172. echo "<input name='Clubno' type='hidden' value=". $From ."/>";
  173. $StrLink = "<a href = 'MemberProfile.php?id=".$row['mp_fullname']."'>".$From."</a>";
  174. echo "<td>" . $StrLink . "</td>";
  175. echo "<td>" . $row['tr_message'] . "</td> ";
  176. $TournamentNo=$row['to_id'];
  177. echo "<input name='Clubno' type='hidden' value=". $TournamentNo ."/>";
  178. $StrLink1 = "<a href = 'ViewTourna.php?TourID=".$row['to_id']."&Creator=".$row['to_creator']."'>".$TournamentNo."</a>";
  179. echo "<td>" . $StrLink1 . "</td>";
  180. echo "<td>" . $row['to_datefrom'] . "</td>";
  181. echo "<td>" . $row['to_dateto'] . "</td>";
  182. echo "<td align='center'> <button type='button' onclick='accept(\"{$row['tr_ID']}\",\"{$row['tr_from']}\",\"{$row['tr_creator']}\")' name='Accept'><img src='images/business_user_accept.png' alt='Accept'/></button></td>";
  183. echo "<td align='center'> <button type='button' onclick='reject(\"{$row['tr_ID']}\",\"{$row['tr_from']}\")' name='Reject'><img src='images/business_user_delete.png' alt=''/> </button></td>";
  184. echo "</tr>";
  185. }
  186. echo "</table>";
  187. }
  188. ?>
  189. </div>
  190. <div class="slidingDiv1">
  191. <h3><font color="#000000">Club Request</font></h3>
  192. <?php
  193. ob_start();
  194. require '../Model/Connect.php';
  195. $From ="";
  196. $ClubNo ="";
  197. $Result = mysql_query("SELECT * FROM clubrequest,memberprofile WHERE cr_status =0 AND cr_to='".$UserNm."' and cr_from =mp_username LIMIT 0, 30 ");
  198. if (mysql_num_rows($Result) == 0) {
  199. echo "<p align='center'> <font color='#FF0000'><h1>No Result</h1></font></p>";
  200. }else {
  201. echo "<table width='100%' table border='1'>
  202. <tr>
  203. <th>User Name</th>
  204. <th>Message</th>
  205. <th>Club No</th>
  206. </tr>";
  207. while($row = mysql_fetch_assoc($Result)){
  208. echo "<tr tr onmouseover=this.bgColor='#88BBDD' onmouseout=this.bgColor='#FFFFFF'> <form action='' method='post'>";
  209. $To=$row['cr_to'];
  210. $From = $row['mp_fullname'];
  211. echo "<input name='Clubno' type='hidden' value=". $From ."/>";
  212. $StrLink1 = "<a href = 'MemberProfile.php?id=".$row['mp_fullname']."'>".$From."</a>";
  213. echo "<td>" . $StrLink1 . "</td>";
  214. echo "<td>" . $row['cr_message'] . "<input name='message' type='hidden' value=". $row['cr_message'] ." /></td>";
  215. $ClubNo =$row['cr_clubid'];
  216. echo "<input name='Clubno' type='hidden' value=". $ClubNo ."/>";
  217. $StrLink = "<a href = 'ClubProfile.php?ClubNo=".$row['cr_clubid']."'>".$ClubNo."</a>";
  218. echo "<td>" . $StrLink . "</td>";
  219. echo "<td align='center'> <button type='button' onclick='acceptclub(".$row['cr_clubid'].",\"{$row['cr_from']}\")' name='Accept'><img src='images/home_accept.png' alt='Accept'/></button></td>";
  220. }
  221. echo "</table>";
  222. }
  223. ?>
  224. </div>
  225. </div>
  226. </div>
  227. <layer>
  228. <ul id="navigation">
  229. <li class="home"><a href="Home_Login.php" title="Home"></a></li>
  230. <li class="play"><a href="Play.php" title="Play Chess"></a></li>
  231. <li class="photos"><a href="Inbox.php" title="Inbox"></a></li>
  232. <li class="club"><a href="SearchClub.php" title="Clubs"></a></li>
  233. <li class="settings"><a href="Settings.php" title="Settings"></a></li>
  234. </ul>
  235. </layer>
  236. <script type="text/javascript">
  237. $(function() {
  238. $('#navigation a').stop().animate({'marginLeft':'-90px'},100);
  239. $('#navigation > li').hover(
  240. function () {
  241. $('a',$(this)).stop().animate({'marginLeft':'-70px'},100);
  242. },
  243. function () {
  244. $('a',$(this)).stop().animate({'marginLeft':'-90px'},100);
  245. }
  246. );
  247. });
  248. </script><!-- topbar-->
  249. <div class="clear"></div>
  250. <div id="footers">
  251. <div style="float:right"><div class="fotterlast">
  252. <a href="#" title="About Us">About Us</a>
  253. |
  254. <a href="#" title="Terms of Service">Terms of Service</a>
  255. |
  256. <a href="#" title="Privacy Statement">Privacy</a>
  257. |
  258. <a href="Contact.php" title="Contact Us">Contact Us</a>
  259. </div></div>
  260. <div style="float:Left"><div class="fotterlastdesing">Designed by SEP_WE_05 Team.</div></div>
  261. </div>
  262. </div></div>
  263. </body>
  264. </html>