Jump to content
MakeWebGames

got a problem


Raven1992
 Share

Recommended Posts

hey people i got one problem which i can't seem to sort out fors ome strange reaon i got this for my error

Parse error: syntax error, unexpected T_STRING in /home/bigbangx/public_html/partner.php on line 3

is it possible to help me wher ei gone wrong on this thanks

here the code for the marrage mods

 

<?php
include "globals.php";
$m=$db->query SELECT FROM users WHERE userid={$ir['married']};
$par=$db->fetch_row($m);
if($ir['married'] == 0)
{
die("You are not married, come back when you have a partner");
}
$_GET['action']  = (isset($_GET['action']) && is_string($_GET['action'])) ? stripslashes(trim($_GET['action'])) : FALSE;
switch($_GET['action'])
{
case 'givemoney': give_money_form(); break;
case 'givemoneysub': give_money_submit(); break;
case 'givecrystals': give_crystals_form(); break;
case 'givecrystalssub': give_crystals_submit(); break;
case 'givebank': give_bank_form(); break;
case 'givebanksub': give_bank_submit(); break;
case 'givebankcrystals': give_bankcrystals_form(); break;
case 'givebankcrystalssub': give_bankcrystals_submit(); break;
case 'takemoney': take_money_form(); break;
case 'takemoneysub': take_money_submit(); break;
case 'takecrystals': take_crystals_form(); break;
case 'takecrystalssub': take_crystals_submit(); break;
case 'takebank': take_bank_form(); break;
case 'takebanksub': take_bank_submit(); break;
case 'takecbank': take_cbank_form(); break;
case 'takecbanksub': take_cbank_submit(); break;
case 'sleep': sleep_form(); break;
case 'sleepsub': sleep_submit(); break;
case 'divorce': divorce(); break;
case 'allowence': allowence_form(); break;
default: index(); break;
}
function give_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Money</h3>
This action will give your money to your partner

You currently have <b>\${$ir['money']}</b> that you could send.

<form action='partner.php?action=givemoneysub' method='post'>
Money: <input type='text' name='money' value='0'>

<input type='submit' value='Give Money' /></form>";
}
function give_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['money'] < $_POST['money'])
{
die("You are trying to give more money than you can
<a href='partner.php'?action=givemoney>Back</a>");
}
else
{
$db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
$db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c);
print"You gave \${$_POST['money']} to your partner";
}
}
function give_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving crystals</h3>
This action will give your crystals to your partner

You currently have <b>{$ir['crystals']}</b> crystals that you could send.

<form action='partner.php?action=givecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='0'>

<input type='submit' value='Give crystals' /></form>";
}
function give_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['crystals'] < $_POST['crystals'])
{
die("You are trying to give more crystals than you can.
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
$db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
$db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c);
print"You gave {$_POST['crystals']} crystals to your partner";
}
}
function give_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner doesnt have a bank account");
}
else
{
print "<h3>Giving Bank Money</h3>
This action will give bank money to your partner

You currently have <b>\${$ir['bankmoney']}</b> that you could send.

<form action='partner.php?action=givebanksub' method='post'>
Bank Money: <input type='text' name='bankmoney' value='0'>

<input type='submit' value='Give Bank Money' /></form>";
}
}
function give_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to give more bank money than you can
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
$db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
$db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just wired you \${$_POST['bankmoney']} into your bank account",$c);
print"You wired \${$_POST['bankmoney']} to your partner";
}
}
function give_bankcrystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Bank crystals</h3>
This action will give your bank crystals to your partner

You currently have <b>{$ir['bankcrystals']}</b> bank crystals that you could send.

<form action='partner.php?action=givebankcrystalssub' method='post'>
Bank Crystals: <input type='text' name='bankcrystals' value='0'>

<input type='submit' value='Give Bank Crystals' /></form>";
}
function give_bankcrystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankcrystals'] < $_POST['bankcrystals'])
{
die("You are trying to give more bank crystals than you can.
<a href='partner.php'?action=givebankcrystals>Back</a>");
}
else
{
$db->query("UPDATE users SET bankcrystal=bankcrystal+".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
$db->query("UPDATE users SET bankcrystal=bankcrystal-".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['bankcrystals']} crystals",$c);
print"You gave {$_POST['bankcrystals']} crystals to your partner";
}
}
function take_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
else
{
print "<h3>Take Money</h3>
This action will take money from your partner

Your partner has \${$par['money']}.

<form action='partner.php?action=takemoneysub' method='post'>
Money: <input type='text' name='money' value='{$par['money']}'>

<input type='submit' value='Take Money' /></form>";
}
}
function take_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
if ($par['money'] < $_POST['money'])
{
die("You are trying to take more money than you can.
<a href='partner.php'?action=takemoney>Back</a>");
}
else
{
$db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid=$userid");
$db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c);
print"You took \${$_POST['money']} from your partner";
}
}
function take_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals");
}
else
{
print "<h3>Take Crystals</h3>
This action will take crystals from your partner

Your partner has {$par['crystals']} crystals.

<form action='partner.php?action=takecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='{$par['crystals']}'>

<input type='submit' value='Take Crystals' /></form>";
}
}
function take_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals.");
}
if ($par['crystals'] < $_POST['crystals'])
{
die("You are trying to take more crystals than you can.
<a href='partner.php'?action=takecrystals>Back</a>");
}
else
{
$db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
$db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c);
print"You took {$_POST['crystals']} crystals from your partner";
}
}
function take_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their finacial bank money.");
}
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner dose not have a bank account");
}
else
{
print "<h3>Take Bank Money</h3>
This action will take bank money from your partner

Your partner has \${$par['bankmoney']}.

<form action='partner.php?action=takebanksub' method='post'>
Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank money.");
}
if ($par['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takebank>Back</a>");
}
else
{
$db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
$db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c);
print"You took \${$_POST['bank']} from your partner";
}
}
function take_cbank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($ir['bankcrystals'] < 0)
{
die("You dont have a crystal bank account");
}
if ($par['bankcrystals'] < 0)
{
die("Your partner doesnt have a crystal bank account.");
}
else
{
print "<h3>Take Bank Crystals</h3>
This action will take bank money from your partner

Your partner has {$par['bankcrystals']} bank crystals.

<form action='partner.php?action=takebanksub' method='post'>
Bank Crystals: <input type='text' name='cbank' value='{$par['bankcrystals']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_cbank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($par['bankcrystals'] < $_POST['cbank'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takecbank>Back</a>");
}
else
{
$db->query("UPDATE users SET bankcrystals=bankcrystals+".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
$db->query("UPDATE users SET bankcrystals=bankcrystals-".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['bankcrystals']} crystals from your bank account",$c);
print"You took {$_POST['bankcrystals']} bank crystals from your partner";
}
}
function sleep_form()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
print "<h3>Sleep with your Partner?</h3>
<form action='partner.php?action=sleepsub' method='post'>
<input type='submit' value='Sleep With {$par['username']}' /></form>";
}
function sleep_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
if (!$_POST['msg'])
{
$db->query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid");
$db->query("UPDATE users SET tired=1 WHERE userid=$userid");
event_add($par['userid'],"Your partner has just slept with you. Please take a pregnancy test.",$c);
print"You slept with your partner and gained 1 happiness!";
}
}
function divorce()
{
global $ir, $mr, $c, $userid, $h;
mysql_query("UPDATE users SET married=0 WHERE userid IN($userid, {$ir['married']})", $c);
event_add($ir['married'],"{$ir['username']} divorced you... Your now single...",$c);
print "You divorced your partner and went back to being single.

> <a href='index.php'>Back</a>";
}
function allowence_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>C</h3>
This action will decide wether you want to allow your partner to take
money, crystals, bank money, bank crystals, etc or not...

[<a href='partner.php'?action=allowence&allow=yes>Allow</a>]

[<a href='partner.php'?action=allowence&allow=no>Do Not Allow</a>]
";
if($_GET['allow'] == yes)
{
$db->query("UPDATE users SET allowence=1 WHERE userid=$userid");
print" Now your partner is allowed to access your finance";
}
else if($_GET['allow'] == no)
{
$db->query("UPDATE users SET allowence=0 WHERE userid=$userid");
print" Now your partner isnt allowed to access your finance";
}
}

function index()
{
global $db,$ir,$c,$h,$userid,$par;
print "

<h3><center>Information</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<th><font color=gold>Theirs</th>
<th><font color=gold>Yours</th>
</tr>

<tr>
<td><center>Money: \${$par['money']}</td>
<td><center>Money: \${$ir['money']}</td>
</tr>
<td><center>Crystals: {$par['crystals']}</td>
<td><center>Crystals: {$ir['crystals']}</td>
</tr>
<tr>
<td><center>Banked Money: \${$par['bankmoney']}</td>
<td><center>Banked Money: \${$ir['bankmoney']}</td>
</tr>
<tr>
<td><center>Banked Crystals: {$par['bankcrystals']}</td>
<td><center>Banked Crystals: {$ir['bankcrystals']}</td>
</tr>
</table>

<h3><center>Partner Managment</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><a href='partner.php'?action=givemoney><center>Send Money</a></td>
<td><a href='partner.php'?action=takemoney><center>Take Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebank><center>Send Bank Money</a></td>
<td><a href='partner.php'?action=takebank><center>Take Bank Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givecrystals><center>Send Crystals</a></td>
<td><a href='partner.php'?action=takecrystals><center>Take Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebankcrystals><center>Send Bank Crystals</a></td>
<td><a href='partner.php'?action=takecbank><center>Take Bank Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=sleep'><center>Sleep With {$par['username']}</td>
<td><a href='partner.php'?action=allowence><center>Marriage Allowence!</a></td>
</tr><tr>
<td colspan='2'><a href='partner.php'?action=divorce><center>Divorce</a></td></tr></table>



<h3><center>Marriage Stats</h3>
<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><center>Your Happiness: {$ir['happiness']}</td>
<td><center>Their Happiness: {$par['happiness']}</td></tr></table>";
}
$h->endpage();
?>
Link to comment
Share on other sites

$db->query() makes it v2. Make sure you have either uploaded everything to get the database classes working. In that case you can ignore the $db->query(), otherwise you would have to replace them one by one.

That being said, you need something like this for v2.

$m=$db->query("SELECT * FROM users WHERE userid={$ir['married']}");

If you get the error "function query() on a non-object in /home/bigbangx/public_html/partner.php on line 3 " that's rather normal as v1 doesn't have the database classes. Either get them working or change it to the query below.

and this for v1

$m=mysql_query("SELECT * FROM users WHERE userid={$ir['married']}", $c);
  • Like 1
Link to comment
Share on other sites

This right here:

<?php 
include "globals.php"; 
$m=$db->query SELECT FROM users WHERE userid={$ir['married']}; 
$par=$db->fetch_row($m); 
if($ir['married'] == 0) 
{ 

Is calling out for globals.php.so what you should do is like what the thread I posted and what nickson says. Change your globals.php with what that other thread says and change all your db->query with mysql_query

Edited by KyleMassacre
Corrected typo
  • Like 1
Link to comment
Share on other sites

ok well thank you for the help line 3 did respond but now i got to do something about the line 4 do i paste the same thing again or not

Fatal error: Call to a member function fetch_row() on a non-object in /home/bigbangx/public_html/partner.php on line 4

nick and kyle for helping u get +1

Link to comment
Share on other sites

If it is still this same string:

$par=$db->fetch_row($m); 

you need to change the $db-> to mysql. Any where it wants to call out for a $db must be changed to mysql_query. The easiest way to do that is in your code editor click on the binoculars (dont know it thats spelled right, im on my phone and no spell check) type in the find $db->query and then under it put in replace with mysql_query. V1 and lite dont use the term $db they use mysql.

Link to comment
Share on other sites

If it is still this same string:
$par=$db->fetch_row($m); 

you need to change the $db-> to mysql. Any where it wants to call out for a $db must be changed to mysql_query. The easiest way to do that is in your code editor click on the binoculars (dont know it thats spelled right, im on my phone and no spell check) type in the find $db->query and then under it put in replace with mysql_query. V1 and lite dont use the term $db they use mysql.

nothing much changed still got the same error on line 4

Link to comment
Share on other sites

I'm not sure what your current information is as we're lacking some info, however if below is still you error, you need to adapt the same changes as before.

Fatal error: Call to a member function fetch_row() on a non-object in /home/bigbangx/public_html/partner.php on line 4

Let us know what happens when you have added these changes or update the error and eventually post lines 1-5

$db->query() to mysql_query()

$db->fetch_row() to mysql_fetch_array()

$db->num_rows() to mysql_num_rows()

and so on

Link to comment
Share on other sites

I'm not sure what your current information is as we're lacking some info, however if below is still you error, you need to adapt the same changes as before.

Fatal error: Call to a member function fetch_row() on a non-object in /home/bigbangx/public_html/partner.php on line 4

Let us know what happens when you have added these changes or update the error and eventually post lines 1-5

$db->query() to mysql_query()

$db->fetch_row() to mysql_fetch_array()

$db->num_rows() to mysql_num_rows()

and so on

what u mean nick all i know is that i fixed line 4 but line 17 is bugging me Parse error: syntax error, unexpected T_STRING in /home/bigbangx/public_html/partner.php on line 17

Link to comment
Share on other sites

Raven we cant help you if your not prepared to show us the code for the line the error is reporting too also be aware unexpected T_STRING often refers to a missing

" or '

and could even be something like

". $ir['userid'] ."

If you fail to give us more info and this topic continues without your giving any helpful prompts then it will be locked for time wasting.

Link to comment
Share on other sites

ok i get the line for line 17 for you

<?php
include_once(DIRNAME(__FILE__) ."/globals.php");
?>
<script language = "javascript" type = "text/javascript">
   var ticked = new Array();
   function tickBox(val) {
       var theid = "id" + val;
       if(document.getElementById(theid).checked == true) {
           ticked.push(theid);
       }
       else if(document.getElementById(theid).checked == false) {
           for(var sp = 0; sp < ticked.length; sp++) {
               if(ticked[sp] == theid) {
                   ticked.splice(sp,1);
               }
           }
       }

Parse error: syntax error, unexpected T_STRING in /home/bigbangx/public_html/partner.php on line 17

Edited by Raven1992
Link to comment
Share on other sites

ok i tried recoding it again for you so ill post this up and maybe we all can help from this point

I just would like you all to know that im no coder and V1 is all new to me<----my disclaimer

so what i did was i believe he had an error here in my original reply to him:

$m=mysql_query SELECT FROM users WHERE userid={$ir['married']};

so what i did was added () and a couple " and maybe you guys can help with input:

<?php
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
$m=mysql_query("SELECT FROM users WHERE userid={$ir['married']}");
$par=mysql_fetch_row($m);
if($ir['married'] == 0)
{
die("You are not married, come back when you have a partner");
}
$_GET['action']  = (isset($_GET['action']) && is_string($_GET['action'])) ? stripslashes(trim($_GET['action'])) : FALSE;
switch($_GET['action'])
{
case 'givemoney': give_money_form(); break;
case 'givemoneysub': give_money_submit(); break;
case 'givecrystals': give_crystals_form(); break;
case 'givecrystalssub': give_crystals_submit(); break;
case 'givebank': give_bank_form(); break;
case 'givebanksub': give_bank_submit(); break;
case 'givebankcrystals': give_bankcrystals_form(); break;
case 'givebankcrystalssub': give_bankcrystals_submit(); break;
case 'takemoney': take_money_form(); break;
case 'takemoneysub': take_money_submit(); break;
case 'takecrystals': take_crystals_form(); break;
case 'takecrystalssub': take_crystals_submit(); break;
case 'takebank': take_bank_form(); break;
case 'takebanksub': take_bank_submit(); break;
case 'takecbank': take_cbank_form(); break;
case 'takecbanksub': take_cbank_submit(); break;
case 'sleep': sleep_form(); break;
case 'sleepsub': sleep_submit(); break;
case 'divorce': divorce(); break;
case 'allowence': allowence_form(); break;
default: index(); break;
}
function give_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Money</h3>
This action will give your money to your partner

You currently have <b>\${$ir['money']}</b> that you could send.

<form action='partner.php?action=givemoneysub' method='post'>
Money: <input type='text' name='money' value='0'>

<input type='submit' value='Give Money' /></form>";
}
function give_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['money'] < $_POST['money'])
{
die("You are trying to give more money than you can
<a href='partner.php'?action=givemoney>Back</a>");
}
else
{
mysql_query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c);
print"You gave \${$_POST['money']} to your partner";
}
}
function give_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving crystals</h3>
This action will give your crystals to your partner

You currently have <b>{$ir['crystals']}</b> crystals that you could send.

<form action='partner.php?action=givecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='0'>

<input type='submit' value='Give crystals' /></form>";
}
function give_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['crystals'] < $_POST['crystals'])
{
die("You are trying to give more crystals than you can.
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c);
print"You gave {$_POST['crystals']} crystals to your partner";
}
}
function give_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner doesnt have a bank account");
}
else
{
print "<h3>Giving Bank Money</h3>
This action will give bank money to your partner

You currently have <b>\${$ir['bankmoney']}</b> that you could send.

<form action='partner.php?action=givebanksub' method='post'>
Bank Money: <input type='text' name='bankmoney' value='0'>

<input type='submit' value='Give Bank Money' /></form>";
}
}
function give_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to give more bank money than you can
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just wired you \${$_POST['bankmoney']} into your bank account",$c);
print"You wired \${$_POST['bankmoney']} to your partner";
}
}
function give_bankcrystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Bank crystals</h3>
This action will give your bank crystals to your partner

You currently have <b>{$ir['bankcrystals']}</b> bank crystals that you could send.

<form action='partner.php?action=givebankcrystalssub' method='post'>
Bank Crystals: <input type='text' name='bankcrystals' value='0'>

<input type='submit' value='Give Bank Crystals' /></form>";
}
function give_bankcrystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankcrystals'] < $_POST['bankcrystals'])
{
die("You are trying to give more bank crystals than you can.
<a href='partner.php'?action=givebankcrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankcrystal=bankcrystal+".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET bankcrystal=bankcrystal-".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['bankcrystals']} crystals",$c);
print"You gave {$_POST['bankcrystals']} crystals to your partner";
}
}
function take_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
else
{
print "<h3>Take Money</h3>
This action will take money from your partner

Your partner has \${$par['money']}.

<form action='partner.php?action=takemoneysub' method='post'>
Money: <input type='text' name='money' value='{$par['money']}'>

<input type='submit' value='Take Money' /></form>";
}
}
function take_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
if ($par['money'] < $_POST['money'])
{
die("You are trying to take more money than you can.
<a href='partner.php'?action=takemoney>Back</a>");
}
else
{
mysql_query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid=$userid");
mysql_query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c);
print"You took \${$_POST['money']} from your partner";
}
}
function take_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals");
}
else
{
print "<h3>Take Crystals</h3>
This action will take crystals from your partner

Your partner has {$par['crystals']} crystals.

<form action='partner.php?action=takecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='{$par['crystals']}'>

<input type='submit' value='Take Crystals' /></form>";
}
}
function take_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals.");
}
if ($par['crystals'] < $_POST['crystals'])
{
die("You are trying to take more crystals than you can.
<a href='partner.php'?action=takecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
mysql_query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c);
print"You took {$_POST['crystals']} crystals from your partner";
}
}
function take_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their finacial bank money.");
}
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner dose not have a bank account");
}
else
{
print "<h3>Take Bank Money</h3>
This action will take bank money from your partner

Your partner has \${$par['bankmoney']}.

<form action='partner.php?action=takebanksub' method='post'>
Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank money.");
}
if ($par['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takebank>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
mysql_query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c);
print"You took \${$_POST['bank']} from your partner";
}
}
function take_cbank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($ir['bankcrystals'] < 0)
{
die("You dont have a crystal bank account");
}
if ($par['bankcrystals'] < 0)
{
die("Your partner doesnt have a crystal bank account.");
}
else
{
print "<h3>Take Bank Crystals</h3>
This action will take bank money from your partner

Your partner has {$par['bankcrystals']} bank crystals.

<form action='partner.php?action=takebanksub' method='post'>
Bank Crystals: <input type='text' name='cbank' value='{$par['bankcrystals']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_cbank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($par['bankcrystals'] < $_POST['cbank'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takecbank>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankcrystals=bankcrystals+".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
mysql_query("UPDATE users SET bankcrystals=bankcrystals-".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['bankcrystals']} crystals from your bank account",$c);
print"You took {$_POST['bankcrystals']} bank crystals from your partner";
}
}
function sleep_form()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
print "<h3>Sleep with your Partner?</h3>
<form action='partner.php?action=sleepsub' method='post'>
<input type='submit' value='Sleep With {$par['username']}' /></form>";
}
function sleep_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
if (!$_POST['msg'])
{
mysql_query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid");
mysql_query("UPDATE users SET tired=1 WHERE userid=$userid");
event_add($par['userid'],"Your partner has just slept with you. Please take a pregnancy test.",$c);
print"You slept with your partner and gained 1 happiness!";
}
}
function divorce()
{
global $ir, $mr, $c, $userid, $h;
mysql_query("UPDATE users SET married=0 WHERE userid IN($userid, {$ir['married']})", $c);
event_add($ir['married'],"{$ir['username']} divorced you... Your now single...",$c);
print "You divorced your partner and went back to being single.

> <a href='index.php'>Back</a>";
}
function allowence_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>C</h3>
This action will decide wether you want to allow your partner to take
money, crystals, bank money, bank crystals, etc or not...

[<a href='partner.php'?action=allowence&allow=yes>Allo  w</a>]

[<a href='partner.php'?action=allowence&allow=no>Do Not Allow</a>]
";
if($_GET['allow'] == yes)
{
mysql_query("UPDATE users SET allowence=1 WHERE userid=$userid");
print" Now your partner is allowed to access your finance";
}
else if($_GET['allow'] == no)
{
mysql_query("UPDATE users SET allowence=0 WHERE userid=$userid");
print" Now your partner isnt allowed to access your finance";
}
}

function index()
{
global $db,$ir,$c,$h,$userid,$par;
print "

<h3><center>Information</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<th><font color=gold>Theirs</th>
<th><font color=gold>Yours</th>
</tr>

<tr>
<td><center>Money: \${$par['money']}</td>
<td><center>Money: \${$ir['money']}</td>
</tr>
<td><center>Crystals: {$par['crystals']}</td>
<td><center>Crystals: {$ir['crystals']}</td>
</tr>
<tr>
<td><center>Banked Money: \${$par['bankmoney']}</td>
<td><center>Banked Money: \${$ir['bankmoney']}</td>
</tr>
<tr>
<td><center>Banked Crystals: {$par['bankcrystals']}</td>
<td><center>Banked Crystals: {$ir['bankcrystals']}</td>
</tr>
</table>

<h3><center>Partner Managment</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><a href='partner.php'?action=givemoney><center>Send Money</a></td>
<td><a href='partner.php'?action=takemoney><center>Take Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebank><center>Send Bank Money</a></td>
<td><a href='partner.php'?action=takebank><center>Take Bank Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givecrystals><center>Sen  d Crystals</a></td>
<td><a href='partner.php'?action=takecrystals><center>Tak  e Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebankcrystals><center  >Send Bank Crystals</a></td>
<td><a href='partner.php'?action=takecbank><center>Take Bank Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=sleep'><center>Sleep With {$par['username']}</td>
<td><a href='partner.php'?action=allowence><center>Marria  ge Allowence!</a></td>
</tr><tr>
<td colspan='2'><a href='partner.php'?action=divorce><center>Divorce</a></td></tr></table>



<h3><center>Marriage Stats</h3>
<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><center>Your Happiness: {$ir['happiness']}</td>
<td><center>Their Happiness: {$par['happiness']}</td></tr></table>";
}
$h->endpage();

 

Hope this helps

Edited by KyleMassacre
remove a space in line 17
Link to comment
Share on other sites

ok i tried recoding it again for you so ill post this up and maybe we all can help from this point

I just would like you all to know that im no coder and V1 is all new to me<----my disclaimer

so what i did was i believe he had an error here in my original reply to him:

$m=mysql_query SELECT FROM users WHERE userid={$ir['married']};

so what i did was added () and a couple " and maybe you guys can help with input:

<?php
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
$m=mysql_query("SELECT FROM users WHERE userid={$ir['married']}");
$par=mysql_fetch_row($m);
if($ir['married'] == 0)
{
die("You are not married, come back when you have a partner");
}
$_GET['action']  = (isset($_GET['action']) && is_string($_GET['action'])) ? stripslashes(trim($_GET['action'])) : FALSE;
switch($_GET['action'])
{
case 'givemoney': give_money_form(); break;
case 'givemoneysub': give_money_submit(); break;
case 'givecrystals': give_crystals_form(); break;
case 'givecrystalssub': give_crystals_submit(); break;
case 'givebank': give_bank_form(); break;
case 'givebanksub': give_bank_submit(); break;
case 'givebankcrystals': give_bankcrystals_form(); break;
case 'givebankcrystalssub': give_bankcrystals_submit(); break;
case 'takemoney': take_money_form(); break;
case 'takemoneysub': take_money_submit(); break;
case 'takecrystals': take_crystals_form(); break;
case 'takecrystalssub': take_crystals_submit(); break;
case 'takebank': take_bank_form(); break;
case 'takebanksub': take_bank_submit(); break;
case 'takecbank': take_cbank_form(); break;
case 'takecbanksub': take_cbank_submit(); break;
case 'sleep': sleep_form(); break;
case 'sleepsub': sleep_submit(); break;
case 'divorce': divorce(); break;
case 'allowence': allowence_form(); break;
default: index(); break;
}
function give_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Money</h3>
This action will give your money to your partner

You currently have <b>\${$ir['money']}</b> that you could send.

<form action='partner.php?action=givemoneysub' method='post'>
Money: <input type='text' name='money' value='0'>

<input type='submit' value='Give Money' /></form>";
}
function give_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['money'] < $_POST['money'])
{
die("You are trying to give more money than you can
<a href='partner.php'?action=givemoney>Back</a>");
}
else
{
mysql_query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c);
print"You gave \${$_POST['money']} to your partner";
}
}
function give_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving crystals</h3>
This action will give your crystals to your partner

You currently have <b>{$ir['crystals']}</b> crystals that you could send.

<form action='partner.php?action=givecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='0'>

<input type='submit' value='Give crystals' /></form>";
}
function give_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['crystals'] < $_POST['crystals'])
{
die("You are trying to give more crystals than you can.
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c);
print"You gave {$_POST['crystals']} crystals to your partner";
}
}
function give_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner doesnt have a bank account");
}
else
{
print "<h3>Giving Bank Money</h3>
This action will give bank money to your partner

You currently have <b>\${$ir['bankmoney']}</b> that you could send.

<form action='partner.php?action=givebanksub' method='post'>
Bank Money: <input type='text' name='bankmoney' value='0'>

<input type='submit' value='Give Bank Money' /></form>";
}
}
function give_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to give more bank money than you can
<a href='partner.php'?action=givecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just wired you \${$_POST['bankmoney']} into your bank account",$c);
print"You wired \${$_POST['bankmoney']} to your partner";
}
}
function give_bankcrystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>Giving Bank crystals</h3>
This action will give your bank crystals to your partner

You currently have <b>{$ir['bankcrystals']}</b> bank crystals that you could send.

<form action='partner.php?action=givebankcrystalssub' method='post'>
Bank Crystals: <input type='text' name='bankcrystals' value='0'>

<input type='submit' value='Give Bank Crystals' /></form>";
}
function give_bankcrystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($ir['bankcrystals'] < $_POST['bankcrystals'])
{
die("You are trying to give more bank crystals than you can.
<a href='partner.php'?action=givebankcrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankcrystal=bankcrystal+".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
mysql_query("UPDATE users SET bankcrystal=bankcrystal-".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
event_add($par['userid'],"You partner has just given you {$_POST['bankcrystals']} crystals",$c);
print"You gave {$_POST['bankcrystals']} crystals to your partner";
}
}
function take_money_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
else
{
print "<h3>Take Money</h3>
This action will take money from your partner

Your partner has \${$par['money']}.

<form action='partner.php?action=takemoneysub' method='post'>
Money: <input type='text' name='money' value='{$par['money']}'>

<input type='submit' value='Take Money' /></form>";
}
}
function take_money_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their money.");
}
if ($par['money'] < $_POST['money'])
{
die("You are trying to take more money than you can.
<a href='partner.php'?action=takemoney>Back</a>");
}
else
{
mysql_query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid=$userid");
mysql_query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c);
print"You took \${$_POST['money']} from your partner";
}
}
function take_crystals_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals");
}
else
{
print "<h3>Take Crystals</h3>
This action will take crystals from your partner

Your partner has {$par['crystals']} crystals.

<form action='partner.php?action=takecrystalssub' method='post'>
Crystals: <input type='text' name='crystals' value='{$par['crystals']}'>

<input type='submit' value='Take Crystals' /></form>";
}
}
function take_crystals_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their crystals.");
}
if ($par['crystals'] < $_POST['crystals'])
{
die("You are trying to take more crystals than you can.
<a href='partner.php'?action=takecrystals>Back</a>");
}
else
{
mysql_query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid=$userid");
mysql_query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c);
print"You took {$_POST['crystals']} crystals from your partner";
}
}
function take_bank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their finacial bank money.");
}
if ($ir['bankmoney'] < 0)
{
die("You dont have a bank account");
}
if ($par['bankmoney'] < 0)
{
die("Your partner dose not have a bank account");
}
else
{
print "<h3>Take Bank Money</h3>
This action will take bank money from your partner

Your partner has \${$par['bankmoney']}.

<form action='partner.php?action=takebanksub' method='post'>
Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_bank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank money.");
}
if ($par['bankmoney'] < $_POST['bankmoney'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takebank>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid");
mysql_query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c);
print"You took \${$_POST['bank']} from your partner";
}
}
function take_cbank_form()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($ir['bankcrystals'] < 0)
{
die("You dont have a crystal bank account");
}
if ($par['bankcrystals'] < 0)
{
die("Your partner doesnt have a crystal bank account.");
}
else
{
print "<h3>Take Bank Crystals</h3>
This action will take bank money from your partner

Your partner has {$par['bankcrystals']} bank crystals.

<form action='partner.php?action=takebanksub' method='post'>
Bank Crystals: <input type='text' name='cbank' value='{$par['bankcrystals']}'>

<input type='submit' value='Take Bank Money' /></form>";
}
}
function take_cbank_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if ($par['allowence'] == 0)
{
die("Your partner hasnt allowed your to access their bank crystals.");
}
if ($par['bankcrystals'] < $_POST['cbank'])
{
die("You are trying to take more bank money than you can
<a href='partner.php'?action=takecbank>Back</a>");
}
else
{
mysql_query("UPDATE users SET bankcrystals=bankcrystals+".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid");
mysql_query("UPDATE users SET bankcrystals=bankcrystals-".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}");
event_add($par['userid'],"Your partner has just taken {$_POST['bankcrystals']} crystals from your bank account",$c);
print"You took {$_POST['bankcrystals']} bank crystals from your partner";
}
}
function sleep_form()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
print "<h3>Sleep with your Partner?</h3>
<form action='partner.php?action=sleepsub' method='post'>
<input type='submit' value='Sleep With {$par['username']}' /></form>";
}
function sleep_submit()
{
global $db,$ir,$c,$h,$userid,$par;
if($ir['tired'] == 1)
{
die("You are too tired to sleep with your partner again");
}
if (!$_POST['msg'])
{
mysql_query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid");
mysql_query("UPDATE users SET tired=1 WHERE userid=$userid");
event_add($par['userid'],"Your partner has just slept with you. Please take a pregnancy test.",$c);
print"You slept with your partner and gained 1 happiness!";
}
}
function divorce()
{
global $ir, $mr, $c, $userid, $h;
mysql_query("UPDATE users SET married=0 WHERE userid IN($userid, {$ir['married']})", $c);
event_add($ir['married'],"{$ir['username']} divorced you... Your now single...",$c);
print "You divorced your partner and went back to being single.

> <a href='index.php'>Back</a>";
}
function allowence_form()
{
global $db,$ir,$c,$h,$userid,$par;
print "<h3>C</h3>
This action will decide wether you want to allow your partner to take
money, crystals, bank money, bank crystals, etc or not...

[<a href='partner.php'?action=allowence&allow=yes>Allo  w</a>]

[<a href='partner.php'?action=allowence&allow=no>Do Not Allow</a>]
";
if($_GET['allow'] == yes)
{
mysql_query("UPDATE users SET allowence=1 WHERE userid=$userid");
print" Now your partner is allowed to access your finance";
}
else if($_GET['allow'] == no)
{
mysql_query("UPDATE users SET allowence=0 WHERE userid=$userid");
print" Now your partner isnt allowed to access your finance";
}
}

function index()
{
global $db,$ir,$c,$h,$userid,$par;
print "

<h3><center>Information</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<th><font color=gold>Theirs</th>
<th><font color=gold>Yours</th>
</tr>

<tr>
<td><center>Money: \${$par['money']}</td>
<td><center>Money: \${$ir['money']}</td>
</tr>
<td><center>Crystals: {$par['crystals']}</td>
<td><center>Crystals: {$ir['crystals']}</td>
</tr>
<tr>
<td><center>Banked Money: \${$par['bankmoney']}</td>
<td><center>Banked Money: \${$ir['bankmoney']}</td>
</tr>
<tr>
<td><center>Banked Crystals: {$par['bankcrystals']}</td>
<td><center>Banked Crystals: {$ir['bankcrystals']}</td>
</tr>
</table>

<h3><center>Partner Managment</h3>

<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><a href='partner.php'?action=givemoney><center>Send Money</a></td>
<td><a href='partner.php'?action=takemoney><center>Take Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebank><center>Send Bank Money</a></td>
<td><a href='partner.php'?action=takebank><center>Take Bank Money</a></td>
</tr><tr>
<td><a href='partner.php'?action=givecrystals><center>Sen  d Crystals</a></td>
<td><a href='partner.php'?action=takecrystals><center>Tak  e Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=givebankcrystals><center  >Send Bank Crystals</a></td>
<td><a href='partner.php'?action=takecbank><center>Take Bank Crystals</a></td>
</tr><tr>
<td><a href='partner.php'?action=sleep'><center>Sleep With {$par['username']}</td>
<td><a href='partner.php'?action=allowence><center>Marria  ge Allowence!</a></td>
</tr><tr>
<td colspan='2'><a href='partner.php'?action=divorce><center>Divorce</a></td></tr></table>



<h3><center>Marriage Stats</h3>
<center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr>
<td><center>Your Happiness: {$ir['happiness']}</td>
<td><center>Their Happiness: {$par['happiness']}</td></tr></table>";
}
$h->endpage();

 

Hope this helps

yep it did help thanks but one problem it jus loged me out lol

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...