View difference between Paste ID: JGgmCfig and 836UnvkK
SHOW: | | - or go back to the newest paste.
1-
<?php
1+
<?php
2-
include 'scripts/fblog.php';
2+
include 'scripts/fblog.php';
3-
// Create connection to database
3+
// Create connection to database
4-
include 'scripts/sql.php';
4+
include 'scripts/sql.php';
5-
//SQL Table Persons - PID key, Firstname, Lastname,Gender
5+
//SQL Table Persons - PID key, Firstname, Lastname,Gender
6-
$result = mysqli_query($con,"SELECT PID FROM Persons WHERE PID='" . $user_profile['id'] . "'");
6+
$result = mysqli_query($con,"SELECT PID FROM Persons WHERE PID='" . $user_profile['id'] . "'");
7-
$Signedup = "";
7+
$Signedup = "";
8-
while($row = mysqli_fetch_array($result))
8+
while($row = mysqli_fetch_array($result))
9-
  {
9+
  {
10-
  $signedup = $row['PID'];
10+
  $signedup = $row['PID'];
11-
  }
11+
  }
12-
if ($signedup == "")
12+
if ($signedup == "")
13-
  {
13+
  {
14-
  echo "<script> window.location = 'http://calander.site90.net/monopoly/signup.php' </script>";
14+
  echo "<script> window.location = 'http://calander.site90.net/monopoly/signup.php' </script>";
15-
  }
15+
  }
16-
//close connection to db
16+
//close connection to db
17-
mysqli_close($con);
17+
mysqli_close($con);
18-
?>
18+
?>
19-
<head>
19+
<head>
20-
<link rel="stylesheet" type="text/css" href="style.css">
20+
<link rel="stylesheet" type="text/css" href="style.css">
21-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
21+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
22-
<script src="scripts/deed.js"></script>
22+
<script src="scripts/deed.js"></script>
23-
<script src="scripts/create.js"></script>
23+
<script src="scripts/create.js"></script>
24-
<script src="scripts/play.js"></script>
24+
<script src="scripts/play.js"></script>
25-
<script>
25+
<script>
26-
var Vdeed = true;
26+
var Vdeed = true;
27-
function loadMain(){
27+
function loadMain(){
28-
                        if(Vdeed){
28+
                        if(Vdeed){
29-
			if(gameid==0){
29+
			if(gameid==0){
30-
                        loading();
30+
                        loading();
31-
                        var xmlhttp;
31+
                        var xmlhttp;
32-
						if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
32+
						if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
33-
							xmlhttp=new XMLHttpRequest();
33+
							xmlhttp=new XMLHttpRequest();
34-
						}
34+
						}
35-
						else{// code for IE6, IE5
35+
						else{// code for IE6, IE5
36-
							xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
36+
							xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
37-
						}
37+
						}
38-
							xmlhttp.onreadystatechange=function(){
38+
							xmlhttp.onreadystatechange=function(){
39-
							if (xmlhttp.readyState==4 && xmlhttp.status==200){
39+
							if (xmlhttp.readyState==4 && xmlhttp.status==200){
40-
								document.getElementById("the").innerHTML=xmlhttp.responseText;
40+
								document.getElementById("the").innerHTML=xmlhttp.responseText;
41-
							        
41+
							        
42-
                                                        }
42+
                                                        }
43-
						}
43+
						}
44-
						xmlhttp.open("GET","main.php?id=" + <?php echo $user_profile['id']; ?> ,true);
44+
						xmlhttp.open("GET","main.php?id=" + <?php echo $user_profile['id']; ?> ,true);
45-
						xmlhttp.send();  
45+
						xmlhttp.send();  
46-
						}else{
46+
						}else{
47-
						play(gameid);
47+
						play(gameid);
48-
						}
48+
						}
49-
}}
49+
}}
50-
50+
51-
function AllowDeed(){
51+
function AllowDeed(){
52-
Vdeed =true;
52+
Vdeed =true;
53-
}
53+
}
54-
var Players = new Array();
54+
var Players = new Array();
55-
function loading(){
55+
function loading(){
56-
document.getElementById("the").innerHTML="<h1>Loading stuff...</h1>";
56+
document.getElementById("the").innerHTML="<h1>Loading stuff...</h1>";
57-
}
57+
}
58-
58+
59-
var id0 = <?php echo $user_profile['id']; ?>;
59+
var id0 = <?php echo $user_profile['id']; ?>;
60-
var gameid = 0;
60+
var gameid = 0;
61-
//is it this users go?
61+
//is it this users go?
62-
function isgo(gamid){
62+
function isgo(gamid){
63-
	//send request
63+
	//send request
64-
        var xmlhttp;
64+
        var xmlhttp;
65-
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
65+
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
66-
	xmlhttp=new XMLHttpRequest();
66+
	xmlhttp=new XMLHttpRequest();
67-
	}
67+
	}
68-
	else{// code for IE6, IE5
68+
	else{// code for IE6, IE5
69-
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
69+
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
70-
	}
70+
	}
71-
	xmlhttp.onreadystatechange=function(){
71+
	xmlhttp.onreadystatechange=function(){
72-
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
72+
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
73-
	document.getElementById("the").innerHTML=xmlhttp.responseText;
73+
	document.getElementById("the").innerHTML=xmlhttp.responseText;
74-
	      
74+
	      
75-
    }
75+
    }
76-
	}
76+
	}
77-
	xmlhttp.open("GET","game.php?gid=" + gamid + "&id=" + id0,true);
77+
	xmlhttp.open("GET","game.php?gid=" + gamid + "&id=" + id0,true);
78-
	xmlhttp.send();
78+
	xmlhttp.send();
79-
}	
79+
}	
80-
function isngo(gamid){
80+
function isngo(gamid){
81-
	//send request
81+
	//send request
82-
        var xmlhttp;
82+
        var xmlhttp;
83-
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
83+
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
84-
	xmlhttp=new XMLHttpRequest();
84+
	xmlhttp=new XMLHttpRequest();
85-
	}
85+
	}
86-
	else{// code for IE6, IE5
86+
	else{// code for IE6, IE5
87-
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
87+
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
88-
	}
88+
	}
89-
	xmlhttp.onreadystatechange=function(){
89+
	xmlhttp.onreadystatechange=function(){
90-
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
90+
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
91-
	document.getElementById("the").innerHTML=xmlhttp.responseText;
91+
	document.getElementById("the").innerHTML=xmlhttp.responseText;
92-
	      
92+
	      
93-
    }
93+
    }
94-
	}
94+
	}
95-
	xmlhttp.open("GET","ogame.php?gid=" + gamid + "&id=" + id0,true);
95+
	xmlhttp.open("GET","ogame.php?gid=" + gamid + "&id=" + id0,true);
96-
	xmlhttp.send();
96+
	xmlhttp.send();
97-
97+
98-
function play(gamid){
98+
function play(gamid){
99-
loading();
99+
loading();
100-
gameid = gamid;
100+
gameid = gamid;
101-
//check weather it is this users go or not
101+
//check weather it is this users go or not
102-
	var xmlhttp;
102+
	var xmlhttp;
103-
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
103+
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
104-
	xmlhttp=new XMLHttpRequest();
104+
	xmlhttp=new XMLHttpRequest();
105-
	}
105+
	}
106-
	else{// code for IE6, IE5
106+
	else{// code for IE6, IE5
107-
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
107+
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
108-
	}
108+
	}
109-
	xmlhttp.onreadystatechange=function(){
109+
	xmlhttp.onreadystatechange=function(){
110-
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
110+
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
111-
	var response=xmlhttp.responseText;
111+
	var response=xmlhttp.responseText;
112-
        if(response.substring(0,1) == "1"){
112+
        if(response.substring(0,1) == "1"){
113-
           //its the users go
113+
           //its the users go
114-
           isgo(gamid);
114+
           isgo(gamid);
115-
        }
115+
        }
116-
        else{
116+
        else{
117-
           //its not the users go
117+
           //its not the users go
118-
           isngo(gamid);
118+
           isngo(gamid);
119-
        }
119+
        }
120-
        
120+
        
121-
    } 
121+
    } 
122-
	}
122+
	}
123-
	xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
123+
	xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
124-
	xmlhttp.send();
124+
	xmlhttp.send();
125-
}
125+
}
126-
function sub(){
126+
function sub(){
127-
        //The request takes time, tell the user this
127+
        //The request takes time, tell the user this
128-
        document.getElementById("the").innerHTML= "<h1>Creating your game, please wait...</h1>";
128+
        document.getElementById("the").innerHTML= "<h1>Creating your game, please wait...</h1>";
129-
 	//build request
129+
 	//build request
130-
	var reques = "creategame.php" + "?p6=" + id0;
130+
	var reques = "creategame.php" + "?p6=" + id0;
131-
        var n = 0;
131+
        var n = 0;
132-
	for(i=0;i<6;i++){
132+
	for(i=0;i<6;i++){
133-
		if (Players[i] != null){
133+
		if (Players[i] != null){
134-
		reques = reques + "&p" + i + "=" + Players[i];
134+
		reques = reques + "&p" + i + "=" + Players[i];
135-
		}
135+
		}
136-
		else
136+
		else
137-
		{
137+
		{
138-
                n++;
138+
                n++;
139-
		}
139+
		}
140-
	}
140+
	}
141-
        if(n>5){
141+
        if(n>5){
142-
                alert('Hay, no players selected!');
142+
                alert('Hay, no players selected!');
143-
        }
143+
        }
144-
        else{
144+
        else{
145-
	//send request
145+
	//send request
146-
    var xmlhttp;
146+
    var xmlhttp;
147-
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
147+
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
148-
	xmlhttp=new XMLHttpRequest();
148+
	xmlhttp=new XMLHttpRequest();
149-
	}
149+
	}
150-
	else{// code for IE6, IE5
150+
	else{// code for IE6, IE5
151-
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
151+
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
152-
	}
152+
	}
153-
	xmlhttp.onreadystatechange=function(){
153+
	xmlhttp.onreadystatechange=function(){
154-
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
154+
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
155-
	document.getElementById("the").innerHTML=xmlhttp.responseText;
155+
	document.getElementById("the").innerHTML=xmlhttp.responseText;
156-
	      
156+
	      
157-
    }
157+
    }
158-
	}
158+
	}
159-
	xmlhttp.open("GET",reques,true);
159+
	xmlhttp.open("GET",reques,true);
160-
	xmlhttp.send(); 
160+
	xmlhttp.send(); 
161-
       }
161+
       }
162-
}
162+
}
163-
function senddata(dieval){
163+
function senddata(dieval){
164-
dieval = dieval.substring(1,10);
164+
dieval = dieval.substring(1,10);
165-
//id#game id, id1#playerid, prop1#properistion
165+
//id#game id, id1#playerid, prop1#properistion
166-
var req = "noti.php?id=" + gameid + "&id1=" + id0 + "&prop1=" + dieval;
166+
var req = "noti.php?id=" + gameid + "&id1=" + id0 + "&prop1=" + dieval;
167-
//alert(req);
167+
//alert(req);
168-
//loading();
168+
//loading();
169-
						var xmlhttp;
169+
						var xmlhttp;
170-
						if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
170+
						if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
171-
							xmlhttp=new XMLHttpRequest();
171+
							xmlhttp=new XMLHttpRequest();
172-
						}
172+
						}
173-
						else{// code for IE6, IE5
173+
						else{// code for IE6, IE5
174-
							xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
174+
							xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
175-
						}
175+
						}
176-
							xmlhttp.onreadystatechange=function(){
176+
							xmlhttp.onreadystatechange=function(){
177-
							if (xmlhttp.readyState==4 && xmlhttp.status==200){
177+
							if (xmlhttp.readyState==4 && xmlhttp.status==200){
178-
                                                                var resp = xmlhttp.responseText;
178+
                                                                var resp = xmlhttp.responseText;
179-
								moveme(gameid,id0,dieval);
179+
								moveme(gameid,id0,dieval);
180-
                                                        }
180+
                                                        }
181-
						}
181+
						}
182-
						xmlhttp.open("GET",req ,true);
182+
						xmlhttp.open("GET",req ,true);
183-
						xmlhttp.send();	
183+
						xmlhttp.send();	
184-
184+
185-
}
185+
}
186-
function End(){
186+
function End(){
187-
if(rolled){
187+
if(rolled){
188-
nextgo(gameid);
188+
nextgo(gameid);
189-
alert('Go ended!');
189+
alert('Go ended!');
190-
play(gameid);
190+
play(gameid);
191-
}else
191+
}else
192-
{
192+
{
193-
alert('You must roll before ending your turn');
193+
alert('You must roll before ending your turn');
194-
}
194+
}
195-
}
195+
}
196-
function checkend(){
196+
function checkend(){
197-
if (gameid!=0){
197+
if (gameid!=0){
198-
//check weather it is this users go or not
198+
//check weather it is this users go or not
199-
	var xmlhttp;
199+
	var xmlhttp;
200-
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
200+
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
201-
	xmlhttp=new XMLHttpRequest();
201+
	xmlhttp=new XMLHttpRequest();
202-
	}
202+
	}
203-
	else{// code for IE6, IE5
203+
	else{// code for IE6, IE5
204-
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
204+
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
205-
	}
205+
	}
206-
	xmlhttp.onreadystatechange=function(){
206+
	xmlhttp.onreadystatechange=function(){
207-
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
207+
	if (xmlhttp.readyState==4 && xmlhttp.status==200){
208-
	var response=xmlhttp.responseText;
208+
	var response=xmlhttp.responseText;
209-
        if(response.substring(0,1) == "1"){
209+
        if(response.substring(0,1) == "1"){
210-
           //its the users go
210+
           //its the users go
211-
           End();
211+
           End();
212-
        }        
212+
        }        
213-
    } 
213+
    } 
214-
	}
214+
	}
215-
	xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
215+
	xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
216-
	xmlhttp.send();
216+
	xmlhttp.send();
217-
217+
218-
}
218+
}
219-
</script>
219+
</script>
220-
</head>
220+
</head>
221-
<body onload="loadMain();">
221+
<body onload="loadMain();">
222-
222+
223-
<table border="1" class="a1" style=""><tr>
223+
<table border="1" class="a1" style=""><tr>
224-
<?php
224+
<?php
225-
//Draw the map
225+
//Draw the map
226-
// Create connection to database
226+
// Create connection to database
227-
include 'scripts/sql.php';
227+
include 'scripts/sql.php';
228-
//use $i as a counter, for 0<$i<=10{first line} for 10<$i<=28{[($i-10)/2]th line} for 28<$i<38{10th line)
228+
//use $i as a counter, for 0<$i<=10{first line} for 10<$i<=28{[($i-10)/2]th line} for 28<$i<38{10th line)
229-
$i=0
229+
$i=0;
230-
//SQL Table Property
230+
//SQL Table Property
231-
$result = mysqli_query($con,"SELECT * FROM Property");
231+
$result = mysqli_query($con,"SELECT * FROM Property");
232-
while($row = mysqli_fetch_array($result))
232+
while($row = mysqli_fetch_array($result))
233-
  {
233+
  {
234-
	if($i=11 or $i=13){
234+
	if($i=11 or $i=13){
235-
		//before the 12th,13th: </tr><tr>
235+
		//before the 12th,13th: </tr><tr>
236-
		echo "</tr><tr>";
236+
		echo "</tr><tr>";
237-
	}
237+
	}
238-
	if($i == 12){
238+
	if($i == 12){
239-
		//if middle needs putting in 
239+
		//if middle needs putting in 
240-
		echo '<td id="the" colspan="9" rowspan="9">';
240+
		echo '<td id="the" colspan="9" rowspan="9">';
241-
		echo '<h1>Loading please wait...</h1>';
241+
		echo '<h1>Loading please wait...</h1>';
242-
		echo '</td>';
242+
		echo '</td>';
243-
	}
243+
	}
244-
	if($i % 2 == 1 and $i<28 and $i>13){
244+
	if($i % 2 == 1 and $i<28 and $i>13){
245-
		//even i in main body
245+
		//even i in main body
246-
		echo "</tr><tr>";
246+
		echo "</tr><tr>";
247-
	}
247+
	}
248-
	
248+
	
249-
	//Draw this [sql] row's property
249+
	//Draw this [sql] row's property
250-
	if($row['Band']==null){
250+
	if($row['Band']==null){
251-
		//not a banded place
251+
		//not a banded place
252-
		echo '<td class="property">' . $row['name'] . "</td>";
252+
		echo '<td class="property">' . $row['name'] . "</td>";
253-
	}elseif($row['Band']=="Train" OR $row['Band']=="Utility"){
253+
	}elseif($row['Band']=="Train" OR $row['Band']=="Utility"){
254-
		//Train or utility 
254+
		//Train or utility 
255-
		//show the ablilty to show deed but not the colored band
255+
		//show the ablilty to show deed but not the colored band
256-
		echo '<td class="property" onclick="loadDeed(' . "'" . $row['id'] . "'" . ')">';
256+
		echo '<td class="property" onclick="loadDeed(' . "'" . $row['id'] . "'" . ')">';
257-
		echo $row['name'] . "</td>";
257+
		echo $row['name'] . "</td>";
258-
	}else{
258+
	}else{
259-
		//property with band
259+
		//property with band
260-
		echo '<td class="property" ><table class="property"><tr>';
260+
		echo '<td class="property" ><table class="property"><tr>';
261-
		echo '<td id="' . $row['Band'] . '"</td></tr>';
261+
		echo '<td id="' . $row['Band'] . '"</td></tr>';
262-
		echo '<tr><td onclick="loadDeed(' . "'" . $row['id'] . "'" . ')">';
262+
		echo '<tr><td onclick="loadDeed(' . "'" . $row['id'] . "'" . ')">';
263-
		echo $row['name'] . '</td></tr></table></td>';
263+
		echo $row['name'] . '</td></tr></table></td>';
264-
	}
264+
	}
265-
	//increase the counter
265+
	//increase the counter
266-
	$i++;
266+
	$i++;
267-
  }
267+
  }
268-
//close connection to db
268+
//close connection to db
269-
mysqli_close($con);
269+
mysqli_close($con);
270-
?>
270+
?>
271-
</tr></table>
271+
</tr></table>
272-
272+
273
</body>