/View/Accept.php
PHP | 331 lines | 254 code | 67 blank | 10 comment | 10 complexity | fffcd1129143980314b6adbfa216bae6 MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- require '../Model/Connect.php';
- require '../Control/RegisterLogic.php';
- require '../Control/LoginLogic.php';
- ob_start();
- if(LoggedIn()) {
- $UserNm=$_SESSION['username'];
- $Role = $_SESSION['role'];
- }else{
- echo '<script type="text/javascript">alert("Please Log in")</script>';
- echo '<script type="text/javascript"> window.location = "Home.php"</script>';
- }
-
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Online Chess Portal </title>
- <!-- CSS Files -->
- <link href="css/reset.css" rel="stylesheet" type="text/css" />
- <link href="css/style.css" rel="stylesheet" type="text/css" />
- <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
- <style type="text/css">
- .sf-sub-indicator {
- behavior: url(css/iepngfix.htc)
- }
- ;
-
- </style>
- <!-- End of CSS Files -->
- <!-- Javascript Files -->
- <script type="text/javascript" src="javascript/jquery1.3.2.js"></script>
- <script language="javascript" type="text/javascript">
-
- $(document).ready(function(){
-
-
- //$(".slidingDiv").hide();
- $(".show_hide").show();
-
- $('.show_hide').click(function(){
- $(".slidingDiv").slideToggle();
- });
-
- });
-
- function accept(id,from,to)
- {
- $.ajax({
-
- url: '../Control/TournamentAccept.php',
- cache: false,
- data:{'id':id,'from':from,'to':to},
- success: function(html) {
- $('.slidingDiv').html(html);
- }
- //success:p
-
- });
- //loadcontent();
- }
- function reject(id,from)
- {
- $.ajax({
-
- url: '../Control/TournamentAcceptReject.php',
- cache: false,
- data:{'id':id,'from':from},
- success: function(html) {
- $('.slidingDiv').html(html);
- }
- //success:p
-
- });
- //loadcontent();
- }
-
- function acceptclub(id,from)
- {
- $.ajax({
-
- url: '../Control/ClubAccept.php',
- cache: false,
- data:{'id':id,'from':from},
- success: function(html) {
- $('.slidingDiv1').html(html);
- }
- //success:p
-
- });
- //loadcontent();
- }
- </script>
- <script language="javascript" type="text/javascript">
-
- $(document).ready(function(){
-
-
- // $(".slidingDiv1").hide();
- //$(".show_hide1").show();
-
- $('.show_hide1').click(function(){
- $(".slidingDiv1").slideToggle();
- });
-
- });
-
- </script>
- <!--popup-->
- <style type="text/css">
- table{
-
- border:1px solid white;
- }
- th
- {
- background-color:#CCCCCC;
- color:Black;
- background-image: url(images/dropdowntop.jpg);
- }
- td {
- font-family: Calibri;
- border: thin #CCCCCC;
-
- }
- #footer {
- background-color: #CCCCCC;
- color: #000000;
- font-family: Arial,Helvetica,sans-serif;
- font-size: 10px;
- height: 50px;
- margin-top: 0;
- text-transform: capitalize;
- width: 100%;
- }
-
- </style>
- <!-- End of Javascript Files -->
- </head>
- <body>
- <!-- Wrapper -->
- <div id="wrapper">
-
- <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' />
- <div id="secnav">
- <ul>
- <li>
- <li class="noimg"> <a href="../Control/LogoutLogic.php?Reason=Normal">Sign Out</a></li>
- </ul>
- </div>
-
- <div class="menu">
- <ul class="sf-menu">
-
- <?php if($Role == 'SiteAdmin') { ?>
-
- <li> <a href="SiteAdminProfile.php">Profile</a>
- <?php } else { ?>
- <li> <a href="MemberProfile.php">
- <?php
- $result = mysql_query("SELECT mp_fullname FROM memberprofile WHERE mp_username='".$_SESSION['username']."' ");
- $row = mysql_fetch_array($result);
- echo $row['mp_fullname']?>
- </a>
- <?php } ?>
-
- </ul>
-
- </div> </div><!-- menu end-->
-
- <div id="content_guest">
- <p align="right"><a href="#" class="show_hide Buttonview">Show Tournament Request</a> <a href="#" class="show_hide1 Buttonview">Show Club Request</a></p>
- <div class="froms">
-
-
- <div class="slidingDiv">
- <h3><font color="#000000">Tournament Request</font></h3>
- <br />
- <?php
- require '../Model/Connect.php';
- ob_start();
-
- $From ="";
- $TournamentNo ="";
- if($Role == 'SiteAdmin') {
- $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");
- }else{
-
- $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");
-
- }
-
- if (mysql_num_rows($Result) == 0) {
- echo "<p align='center'> <font color='#FF0000'><h1>No Result</h1></font></p>";
-
- }else {
- echo "<table width='100%' table border='2' style='border:#999999'>
- <tr>
- <th> User Name</></th>
- <th>Message</th>
- <th>Tournament No</th>
- <th>Start Date</th>
- <th>Close date</th>
-
- </tr>";
-
- while($row = mysql_fetch_assoc($Result)){
- echo "<tr onmouseover=this.bgColor='#88BBDD' onmouseout=this.bgColor='#FFFFFF'> ";
- echo "<form action='' method='post'> ";
- $From=$row['mp_fullname'];
- echo "<input name='Clubno' type='hidden' value=". $From ."/>";
- $StrLink = "<a href = 'MemberProfile.php?id=".$row['mp_fullname']."'>".$From."</a>";
- echo "<td>" . $StrLink . "</td>";
- echo "<td>" . $row['tr_message'] . "</td> ";
- $TournamentNo=$row['to_id'];
- echo "<input name='Clubno' type='hidden' value=". $TournamentNo ."/>";
- $StrLink1 = "<a href = 'ViewTourna.php?TourID=".$row['to_id']."&Creator=".$row['to_creator']."'>".$TournamentNo."</a>";
- echo "<td>" . $StrLink1 . "</td>";
- echo "<td>" . $row['to_datefrom'] . "</td>";
- echo "<td>" . $row['to_dateto'] . "</td>";
- 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>";
- 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>";
- echo "</tr>";
- }
- echo "</table>";
- }
-
-
- ?>
- </div>
- <div class="slidingDiv1">
- <h3><font color="#000000">Club Request</font></h3>
-
- <?php
- ob_start();
- require '../Model/Connect.php';
- $From ="";
- $ClubNo ="";
-
- $Result = mysql_query("SELECT * FROM clubrequest,memberprofile WHERE cr_status =0 AND cr_to='".$UserNm."' and cr_from =mp_username LIMIT 0, 30 ");
-
- if (mysql_num_rows($Result) == 0) {
- echo "<p align='center'> <font color='#FF0000'><h1>No Result</h1></font></p>";
-
- }else {
-
- echo "<table width='100%' table border='1'>
- <tr>
- <th>User Name</th>
- <th>Message</th>
- <th>Club No</th>
- </tr>";
-
- while($row = mysql_fetch_assoc($Result)){
-
- echo "<tr tr onmouseover=this.bgColor='#88BBDD' onmouseout=this.bgColor='#FFFFFF'> <form action='' method='post'>";
- $To=$row['cr_to'];
- $From = $row['mp_fullname'];
- echo "<input name='Clubno' type='hidden' value=". $From ."/>";
- $StrLink1 = "<a href = 'MemberProfile.php?id=".$row['mp_fullname']."'>".$From."</a>";
- echo "<td>" . $StrLink1 . "</td>";
- echo "<td>" . $row['cr_message'] . "<input name='message' type='hidden' value=". $row['cr_message'] ." /></td>";
- $ClubNo =$row['cr_clubid'];
- echo "<input name='Clubno' type='hidden' value=". $ClubNo ."/>";
- $StrLink = "<a href = 'ClubProfile.php?ClubNo=".$row['cr_clubid']."'>".$ClubNo."</a>";
- echo "<td>" . $StrLink . "</td>";
- 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>";
- }
- echo "</table>";
-
- }
-
-
- ?>
-
-
- </div>
- </div>
- </div>
-
-
-
-
- <layer>
- <ul id="navigation">
- <li class="home"><a href="Home_Login.php" title="Home"></a></li>
- <li class="play"><a href="Play.php" title="Play Chess"></a></li>
- <li class="photos"><a href="Inbox.php" title="Inbox"></a></li>
- <li class="club"><a href="SearchClub.php" title="Clubs"></a></li>
- <li class="settings"><a href="Settings.php" title="Settings"></a></li>
-
- </ul>
-
- </layer>
-
- <script type="text/javascript">
- $(function() {
- $('#navigation a').stop().animate({'marginLeft':'-90px'},100);
-
- $('#navigation > li').hover(
- function () {
- $('a',$(this)).stop().animate({'marginLeft':'-70px'},100);
- },
- function () {
- $('a',$(this)).stop().animate({'marginLeft':'-90px'},100);
- }
- );
- });
- </script><!-- topbar-->
- <div class="clear"></div>
- <div id="footers">
-
- <div style="float:right"><div class="fotterlast">
- <a href="#" title="About Us">About Us</a>
- |
- <a href="#" title="Terms of Service">Terms of Service</a>
- |
- <a href="#" title="Privacy Statement">Privacy</a>
- |
- <a href="Contact.php" title="Contact Us">Contact Us</a>
- </div></div>
-
- <div style="float:Left"><div class="fotterlastdesing">Designed by SEP_WE_05 Team.</div></div>
-
-
-
- </div>
- </div></div>
- </body>
- </html>