jhylands

Page dumnp for index.php

Mar 23rd, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.21 KB | None | 0 0
  1. <?php
  2. include 'scripts/fblog.php';
  3. // Create connection to database
  4. include 'scripts/sql.php';
  5. //SQL Table Persons - PID key, Firstname, Lastname,Gender
  6. $result = mysqli_query($con,"SELECT PID FROM Persons WHERE PID='" . $user_profile['id'] . "'");
  7. $Signedup = "";
  8. while($row = mysqli_fetch_array($result))
  9.   {
  10.   $signedup = $row['PID'];
  11.   }
  12. if ($signedup == "")
  13.   {
  14.   echo "<script> window.location = 'http://calander.site90.net/monopoly/signup.php' </script>";
  15.   }
  16. //close connection to db
  17. mysqli_close($con);
  18. ?>
  19. <head>
  20. <link rel="stylesheet" type="text/css" href="style.css">
  21. <script src="scripts/deed.js"></script>
  22. <script src="scripts/create.js"></script>
  23. <script src="scripts/play.js"></script>
  24. <script>
  25. var Vdeed = true;
  26. function loadMain(){
  27.                         if(Vdeed){
  28.             if(gameid==0){
  29.                         loading();
  30.                         var xmlhttp;
  31.                         if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  32.                             xmlhttp=new XMLHttpRequest();
  33.                         }
  34.                         else{// code for IE6, IE5
  35.                             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  36.                         }
  37.                             xmlhttp.onreadystatechange=function(){
  38.                             if (xmlhttp.readyState==4 && xmlhttp.status==200){
  39.                                 document.getElementById("the").innerHTML=xmlhttp.responseText;
  40.                                    
  41.                                                         }
  42.                         }
  43.                         xmlhttp.open("GET","main.php?id=" + <?php echo $user_profile['id']; ?> ,true);
  44.                         xmlhttp.send();  
  45.                         }else{
  46.                         play(gameid);
  47.                         }
  48. }}
  49.  
  50. function AllowDeed(){
  51. Vdeed =true;
  52. }
  53. var Players = new Array();
  54. function loading(){
  55. document.getElementById("the").innerHTML="<h1>Loading stuff...</h1>";
  56. }
  57.  
  58. var id0 = <?php echo $user_profile['id']; ?>;
  59. var gameid = 0;
  60. //is it this users go?
  61. function isgo(gamid){
  62.     //send request
  63.         var xmlhttp;
  64.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  65.     xmlhttp=new XMLHttpRequest();
  66.     }
  67.     else{// code for IE6, IE5
  68.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  69.     }
  70.     xmlhttp.onreadystatechange=function(){
  71.     if (xmlhttp.readyState==4 && xmlhttp.status==200){
  72.     document.getElementById("the").innerHTML=xmlhttp.responseText;
  73.           
  74.     }
  75.     }
  76.     xmlhttp.open("GET","game.php?gid=" + gamid + "&id=" + id0,true);
  77.     xmlhttp.send();
  78. }  
  79. function isngo(gamid){
  80.     //send request
  81.         var xmlhttp;
  82.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  83.     xmlhttp=new XMLHttpRequest();
  84.     }
  85.     else{// code for IE6, IE5
  86.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  87.     }
  88.     xmlhttp.onreadystatechange=function(){
  89.     if (xmlhttp.readyState==4 && xmlhttp.status==200){
  90.     document.getElementById("the").innerHTML=xmlhttp.responseText;
  91.           
  92.     }
  93.     }
  94.     xmlhttp.open("GET","ogame.php?gid=" + gamid + "&id=" + id0,true);
  95.     xmlhttp.send();
  96. function play(gamid){
  97. loading();
  98. gameid = gamid;
  99. //check weather it is this users go or not
  100.     var xmlhttp;
  101.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  102.     xmlhttp=new XMLHttpRequest();
  103.     }
  104.     else{// code for IE6, IE5
  105.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  106.     }
  107.     xmlhttp.onreadystatechange=function(){
  108.     if (xmlhttp.readyState==4 && xmlhttp.status==200){
  109.     var response=xmlhttp.responseText;
  110.         if(response.substring(0,1) == "1"){
  111.            //its the users go
  112.            isgo(gamid);
  113.         }
  114.         else{
  115.            //its not the users go
  116.            isngo(gamid);
  117.         }
  118.        
  119.     }
  120.     }
  121.     xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
  122.     xmlhttp.send();
  123. }
  124. function sub(){
  125.         //The request takes time, tell the user this
  126.         document.getElementById("the").innerHTML= "<h1>Creating your game, please wait...</h1>";
  127.    //build request
  128.     var reques = "creategame.php" + "?p6=" + id0;
  129.         var n = 0;
  130.     for(i=0;i<6;i++){
  131.         if (Players[i] != null){
  132.         reques = reques + "&p" + i + "=" + Players[i];
  133.         }
  134.         else
  135.         {
  136.                 n++;
  137.         }
  138.     }
  139.         if(n>5){
  140.                 alert('Hay, no players selected!');
  141.         }
  142.         else{
  143.     //send request
  144.     var xmlhttp;
  145.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  146.     xmlhttp=new XMLHttpRequest();
  147.     }
  148.     else{// code for IE6, IE5
  149.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  150.     }
  151.     xmlhttp.onreadystatechange=function(){
  152.     if (xmlhttp.readyState==4 && xmlhttp.status==200){
  153.     document.getElementById("the").innerHTML=xmlhttp.responseText;
  154.           
  155.     }
  156.     }
  157.     xmlhttp.open("GET",reques,true);
  158.     xmlhttp.send();
  159.        }
  160. }
  161. function senddata(dieval){
  162. dieval = dieval.substring(1,10);
  163. //id#game id, id1#playerid, prop1#properistion
  164. var req = "noti.php?id=" + gameid + "&id1=" + id0 + "&prop1=" + dieval;
  165. //alert(req);
  166. //loading();
  167.                         var xmlhttp;
  168.                         if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  169.                             xmlhttp=new XMLHttpRequest();
  170.                         }
  171.                         else{// code for IE6, IE5
  172.                             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  173.                         }
  174.                             xmlhttp.onreadystatechange=function(){
  175.                             if (xmlhttp.readyState==4 && xmlhttp.status==200){
  176.                                                                 var resp = xmlhttp.responseText;
  177.                                 moveme(gameid,id0,dieval);
  178.                                                         }
  179.                         }
  180.                         xmlhttp.open("GET",req ,true);
  181.                         xmlhttp.send();
  182.  
  183. }
  184. function End(){
  185. if(rolled){
  186. nextgo(gameid);
  187. alert('Go ended!');
  188. play(gameid);
  189. }else
  190. {
  191. alert('You must roll before ending your turn');
  192. }
  193. }
  194. function checkend(){
  195. if (gameid!=0){
  196. //check weather it is this users go or not
  197.     var xmlhttp;
  198.     if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
  199.     xmlhttp=new XMLHttpRequest();
  200.     }
  201.     else{// code for IE6, IE5
  202.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  203.     }
  204.     xmlhttp.onreadystatechange=function(){
  205.     if (xmlhttp.readyState==4 && xmlhttp.status==200){
  206.     var response=xmlhttp.responseText;
  207.         if(response.substring(0,1) == "1"){
  208.            //its the users go
  209.            End();
  210.         }        
  211.     }
  212.     }
  213.     xmlhttp.open("GET","isgo.php?gid=" + gamid + "&id=" + id0,true);
  214.     xmlhttp.send();
  215. }
  216. </script>
  217. </head>
  218. <body onload="loadMain();">
  219.  
  220. <table border="1" class="a1" style="">
  221. <tr><td class="property" ><b>GO</b> </td><td class="property" ><table class="property"><tr><td id="a"></td></tr><tr><td onclick="loadDeed('Old Kent Road')" >Old kent road</td></tr></table></td><td class="property" id="chest">Chest</td><td class="property" ><table class="property"><tr><td id="a"></td></tr><tr><td onclick="loadDeed('Whitechapel Road')" >white...le</td></tr></table></td><td class="property" >Income tax</td></td><td class="property" >Kings cross station</td></td><td class="property" ><table class="property"><tr><td id="b"></td></tr><tr><td onclick="loadDeed('The Angel, Islington')" >The Angle islington</td></tr></table></td><td class="property" id="chance">?</td><td class="property" ><table class="property"><tr><td id="b"></td></tr><tr><td onclick="loadDeed('Eusten Road')" >Eusten road</td></tr></table></td><td class="property" ><table class="property"><tr><td id="b"></td></tr><tr><td onclick="loadDeed('Pentonville Road')" >Pentavil road</td></tr></table></td><td class="property" ><img width="50%" src="http://3.bp.blogspot.com/-IfpDgdvq7Y0/UTyRKWGJkTI/AAAAAAAAAbk/9U8SQQhRrQY/s1600/graphic_jail.jpg" /> </td></tr>
  222. <tr><td class="property" ><table class="property"><tr><td id="h"></td></tr><tr><td onclick="loadDeed('Mayfair')" >Mayfair</td></tr></table></td>
  223.  
  224. <td id="the" colspan="9" rowspan="9">
  225. <h1>Loading please wait...</h1>
  226.  
  227. <?php
  228. function isuser($Userid) {
  229. // Create connection to database
  230. include 'scripts/sql.php';
  231. //SQL Table Persons - PID key, Firstname, Lastname,Gender
  232. $result = mysqli_query($con,"SELECT PID FROM Persons WHERE PID='" . $Userid . "'");
  233. $Signedup = "";
  234. while($row = mysqli_fetch_array($result))
  235.   {
  236.   $signedup = $row['PID'];
  237.   }
  238. if ($signedup != ""){
  239.     return false;
  240.     }
  241. else{
  242.     return true;
  243.     }
  244. mysqli_close($con);
  245. }
  246.  ?>
  247. <div style="position:absolute;right:11%;top:11%;width:75px;text-align: justify;display: inline-block;">
  248. <p><img class="profileimage" name="" src="https://graph.facebook.com/<?php echo $user; ?>/picture" width="50" height="50" alt=""><br />
  249. <?php echo $user_profile['name']; ?><br />
  250. </p>
  251. </div>
  252. </td>
  253.  
  254. <td class="property" ><table class="property"><tr><td id="c"></td></tr><tr><td onclick="loadDeed('Pall Mall')" >Pall mall</td></tr></table></td></tr>
  255. <tr><td class="property" >Super tax</td><td class="property" ><img width="50%" src="http://4.bp.blogspot.com/-3q1uxh1D9JA/UTEnxRIi5GI/AAAAAAAAAaU/RqQ6uUnnp44/s320/SKU1827.gif" /></td></tr>
  256. <tr><td class="property" ><table class="property"><tr><td id="h"></td></tr><tr><td onclick="loadDeed('Park Lane');">Park lane</td></tr></table></td><td class="property" ><table class="property" ><tr><td id="c"></td></tr><tr><td onclick="loadDeed('Whitehall');" >Whitehall</td></tr></table></td></tr>
  257. <tr><td class="property" id="chance">?</td><td class="property" ><table class="property"><tr><td id="c"></td></tr><tr><td onclick="loadDeed('Northumberland Avenue');" >North...land avernue</td></tr></table></tr>
  258. <tr><td class="property" >Liver... station</td><td class="property" >Mal...ne station</td></tr>
  259. <tr><td class="property" ><table class="property"><tr><td id="g"></td></tr><tr><td onclick="loadDeed('Bond Street');" >Bond street</td></tr></table></td><td class="property" ><table class="property"><tr><td id="d"></td></tr><tr><td onclick="loadDeed('Bow Street');" >Bow Street</td></tr></table></td></tr>
  260. <tr><td class="property" id="chest">Chest</td><td class="property" id="chest">Chest</td></tr>
  261. <tr><td class="property" ><table class="property"><tr><td id="g"></td></tr><tr><td onclick="loadDeed('Oxford Street');" >Oxford street</td></tr></table></td><td class="property" ><table class="property"><tr><td id="d"></td></tr><tr><td onclick="loadDeed('Marlborough Street');" >Malbura street</td></tr></table></td></tr>
  262. <tr><td class="property" ><table class="property"><tr><td id="g"></td></tr><tr><td onclick="loadDeed('Regent Street');" >Regent street</td></tr></table></td><td class="property" ><table class="property"><tr><td id="d"></td></tr><tr><td onclick="loadDeed('Vine Street');" >Vine street</td></tr></table></td></tr>
  263. <tr><td class="property" >go to jail</td><td class="property" ><table class="property"><tr><td id="f"></td></tr><tr><td onclick="loadDeed('Piccadilly');" >Piccadilly</td></tr></table></td><td class="property" ><img width="97%" src="http://1.bp.blogspot.com/--72tDF4Ew9A/UTEl1Bxir2I/AAAAAAAAAaM/BOcwShc0kXY/s320/nowater.jpg" /></td><td class="property" ><table class="property"><tr><td id="f"></td></tr><tr><td onclick="loadDeed('Coventry Street');" >Coventry street</td></tr></table></td><td class="property" ><table class="property"><tr><td id="f"></td></tr><tr><td onclick="loadDeed('Leicester Square');" >lester square</td></tr></table></td><td class="property" >Fen...ch station</td><td class="property" ><table class="property"><tr><td id="e"></td></tr><tr><td onclick="loadDeed('Trafalgar Square');" >trafalgar square</td></tr></table></td><td class="property" ><table class="property"><tr><td id="e"></td></tr><tr><td onclick="loadDeed('Fleet Street');" >Fleet street</td></tr></table></td><td class="property" id="chance">?</td><td class="property" ><table class="property"><tr><td id="e"></td></tr><tr><td onclick="loadDeed('Strand');" >strand</td></tr></table></td><td class="property" >free parking</td></tr>
  264. </table>
  265.  
  266. </body>
Advertisement
Add Comment
Please, Sign In to add comment