PDA

View Full Version : Cashout help :/ ..


Cookies
07-03-2009, 03:36 PM
Everything was working, now it is not working!
Problem- When cashing out, The cashout will not show in phpmyadmin and the admin menu.


Pictures.

http://i40.tinypic.com/1zzi3w1.jpg

http://i43.tinypic.com/154f2bl.jpg

Here is the php code for cashout in the members folder.

<?
include($_SERVER['DOCUMENT_ROOT'] . '/config.php');
?>
<? include($_SERVER['DOCUMENT_ROOT'] . '/header.php'); ?>
<!-- content-wrap starts here -->
<div id="content-wrap">
<? include($_SERVER['DOCUMENT_ROOT'] . '/left.php'); ?>
<? if($loggedin != 1) { ?>

<h3>Login</h3>
<p> You must be login to view this page! </p>
<? } else { ?>
<div id="main">
<h1>Cashing out with <? echo sname;?></h1>
<br>
<br>
Remember that we only pay <? echo paytype;?> and you must have <? echo cashout;?> to cashout. We pay <? echo paydate;?>!
<br /> <br />
<b> Please check your account information and make sure its right! </b>

<?php
include($_SERVER['DOCUMENT_ROOT'] . '/secure.php');
if ($_POST) {


//round 1
$cashout = $_POST["cashout"];
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$saddress = $_POST["saddress"];
$pnumber = $_POST["pnumber"];
$username = $_POST["username"];
$password = $_POST["password"];
$ip = $_POST["ip"];
$email = $_POST["email"];
$country = $_POST["country"];

if(!$cashout)
{
$error = 1;
$errormsg .= "<p><b>Error -</b> Please enter the amount to cashout.</p>";
}
if($error == 1)
{
print $errormsg;
} else {

$user=uc($_COOKIE["usNick"]);
$con = ("$dhost, $dusername, $dpassword, $ddatabase");


$cashout=$r["cashout"];
$fname=$r["fname"];
$lname=$r["lname"];
$saddress=$r["saddress"];
$pnumber=$r["pnumber"];
$username=$r["username"];
$password=$r["password"];
$ip=$r["ip"];
$email=$r["email"];
$country=$r["country"];
$laip=getRealIP();
$query = "INSERT INTO `cashout` (id, cashout, fname, lname, saddress, pnumber, username, password, ip, email, country) VALUES('$id','$cashout','$fname','$lname','$saddre ss','$pnumber','$username','$password','$ip','$ema il','$country')";
mysql_query($query) or die(mysql_error());

echo " <br/ > <br/ >
Thank you for cashing out. Our staff will review your account to check if you are a cheater or not. Please check over our TOS. <br/>
<br/>
This is the information you signed up with under your account.<br/>
First name:$fname<br/ >
Last name:$lname<br/ >
Street address:$saddress<br/ >
Phone number:$pnumber<br/ >
IP address:$ip<br/ >
Email:$email<br/ >
Country:$country<br/ >
<br/ ><br/ > ";
}
}
?>
<form action="cashout.php" method="POST">
<font color="9c1515">*</font> How much are you cashing out?
<input type="text" size="25" maxlength="150" name="cashout" class="form" autocomplete="off">
<br><br>
<center>
<input type="submit" value="cashout" class="button">
</center>

</div>
<? } ?>
<!-- content-wrap ends here -->
</div>
<? include($_SERVER['DOCUMENT_ROOT'] . '/footer.php'); ?>

Cookies
07-03-2009, 03:37 PM
Cashrequest.php in the admin menu.


<? include 'header.php';?>
<?
?>
<div class="content"><br />
<br />
<br />
<br />
<br />

<table align="center" class="table1" cellpadding="5" cellspacing="0">
<thead>
</thead>
<tbody>
<tr>
<td colspan="4">Welcome <? echo $r["username"]; ?>! You are currently at the Admins page. Remember to pay your members on time!
<br>
<b>Cashout request</b>

<?php

if (isset($_GET["id"]))
{

$id=$_GET["id"];
$option=$_GET["option"];

if ($option=="paid")
{


$username=$_POST["username"];



$tablae = mysql_query("SELECT * FROM users where username='$username'"); // Select all records in the users table, ordered by name
while ($registroe = mysql_fetch_array($tablae)) { // Begin a loop to read all the entries and execute the orders that follow

$lolze=$registroe["cashout"];
$lolza=$_POST["cashout"];

$moneye= $lolze - $lolza;

$lolzea=$registroe["paid"];
$moneyere= $lolzea + $lolza;

// Everything seems to come with the correct inserccion
$query = "UPDATE users SET money='$moneye', paid='$moneyere' where username='$username'";
mysql_query($query) or die(mysql_error());

$eltiempo=time();
$lafecha=date("d M Y H:i",$eltiempo);

// Everything seems to come with the correct inserccion
$query = "INSERT INTO cashhistory (user, date, amount, method, status) VALUES('$username','$lafecha','$lolza','PayPal','P ayment Sent')";
mysql_query($query) or die(mysql_error());

// Everything seems to come with the correct inserccion
$queryz = "DELETE FROM cashout WHERE id='$id'";
mysql_query($queryz) or die(mysql_error());


echo "<font color=\"green\"><b>User stats has been updated.</b></font><br><br>";

}

} elseif($option == "deny")
{


$username=$_POST["username"];



$tablae = mysql_query("SELECT * FROM users where username='$username'"); // Select all records in the users table, ordered by name
$registroe = mysql_fetch_array($tablae);

$lolze=$registroe["cashout"];
$lolza=$_POST["cashout"];

$moneye= $lolze - $lolza;

$lolzea=$registroe["paid"];
$moneyere= $lolzea + $lolza;

$eltiempo=time();
$lafecha=date("d M Y H:i",$eltiempo);


// Everything seems to come with the correct inserccion
$query = "INSERT INTO cashhistory (user, date, amount, method, status) VALUES('$username','$lafecha','$lolza','PayPal','P ayment Declined')";
mysql_query($query) or die(mysql_error());


// Everything seems to come with the correct inserccion
$queryz = "DELETE FROM cashout WHERE id='$id'";
mysql_query($queryz) or die(mysql_error());


echo "<font color=\"darkred\"><b>Payment Declined.</b></font><br><br>";
}

}

?>
<b>Payments requests</b>
<br><br>
When you have made the payment via <a href="http://www.paypal.com" target="_blank">paypal</a> push the buttom "Paid".<br />
<br><br>
<table border=1>
<tr>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Id
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Username
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
First name
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Last name
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Address
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Phone number
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
E-mail
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
PayPal Email
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Amount to pay
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Ip
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Cheater
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>
Requested
</b></td>
<td bgcolor="#cccccc"><font size="2" face="verdana"><b>

</b></td>
</tr>

<?
$et = ($_GET['username']) ? "WHERE username='".$_GET['username']."'" : "";
$tabla = mysql_query("SELECT * FROM cashout ".$et." ORDER BY id ASC") or die(mysql_error());
if($_GET['username'])
{
$uexis = mysql_query("SELECT COUNT(*) AS cnt FROM users WHERE username='{$_GET['username']}'");
$uexis = mysql_fetch_array($uexis);
$uexis = $uexis["cnt"];
}
if($_GET['username'] and $uexis == 0)
{
print "User doesn't exist.";
exit();
} elseif($_GET['username'] and mysql_num_rows($tabla) == 0)
{
print "No payments found.";
exit();
}
if($_GET['username'])
{
print "<tr><td colspan=9 class='midinfo'><b>Viewing {$_GET['username']}'s Payments</B></td></tr> ";
}
if($_GET['username'])
{
$extra_dt = "&username={$_GET['username']}";
}
while ($registro = mysql_fetch_array($tabla)) { // Begin a loop to read all the entries and execute the orders that follow
$multis = mysql_query("SELECT COUNT(*) AS cnt FROM users WHERE ip LIKE ('%{$registro['ip']}%')");
$multis = mysql_fetch_array($multis);
$multis = $multis["cnt"];
$tbq = mysql_query("SELECT tb.*,u.* FROM cashout tb LEFT JOIN users u ON tb.username=u.username WHERE tb.id='{$registro['id']}' ORDER BY tb.id ASC");
$tbr = mysql_fetch_array($tbq);

echo "
<tr>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["id"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["username"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["fname"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["lname"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["saddress"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["pnumber"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["username"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["email"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["pmail"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["cashout"] ."
</font></td>
<td bgcolor=\"#eeeeee\"><font size=\"2\" face=\"verdana\">
". $registro["ip"] ."
</font></td><td>";
$cheat = mysql_query("SELECT COUNT(*) AS cnt FROM users WHERE referer='{$registro['username']}' AND username LIKE ('%{$registro['username']}%')");
$cheat = mysql_fetch_array($cheat);
$cheat = $cheat["cnt"];
if($tbr["to_pay"] == 1)
{
print "<font color='green'><small>OK</small></font>";
} elseif($cheat > 0)
{
print "<font color=red><small>Cheater</small></font>";
} elseif($multis > 0)
{
print "<font color=red><small>Cheater</small></font>";
} elseif($varx > 0)
{
print "<font color=red><small>Cheater</small></font>";
} else {
print "<font color='green'><small>OK</small></font>";
}

?>

<td bgcolor="#eeeeee">
<form method="post" action="cashrequest.php?<?=$premz?>&id=<?= $registro["id"] ?><?=$extra_dt?>&option=paid">
<input type="hidden" name="cashout" value="<?= $registro["cashout"] ?>">
<input type="hidden" name="username" value="<?= $registro["username"] ?>">
<input type="submit" value="Paid">
</form>
<form method="post" action="cashrequest.php?<?=$premz?>&id=<?= $registro["id"] ?><?=$extra_dt?>&option=deny">
<input type="hidden" name="cashout" value="<?= $registro["cashout"] ?>">
<input type="hidden" name="username" value="<?= $registro["username"] ?>">
<input type="submit" value="Deny">
</form>
</td>
</tr>

<?



} // End loop orders



$next = $st + 10;
$prev = $st - 10;
?>


</td>
</td>
</tr>
</tbody>
</table>


<br />
<br />
<br />
</div>
</div>
<? include 'footer.php';?>
</div></body>
</html>

Pyros
07-03-2009, 04:22 PM
what should be displayed in cashout? it seems like the column is ther ein php admin

and in your admin page you simply did not query for the cashout or did not print it out

Pyros

Cookies
07-03-2009, 04:27 PM
but i think it did. The problem is that when cashing out, the money doesn't insert into the mysql.

i printed the cashout requested.
". $registro["cashout"] ."

Pyros
07-03-2009, 04:29 PM
but i think it did. The problem is that when cashing out, the money doesn't insert into the mysql.

i printed the cashout requested.
". $registro["cashout"] ."


hmmm whats $_POST['cashout']; print out as?

Pyros

Cookies
07-03-2009, 04:31 PM
As cashout.
The database is cashout and the cashout is cashout.

Here.

-- Table structure for table `cashout`
--

CREATE TABLE IF NOT EXISTS `cashout` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cashout` varchar(150) NOT NULL,
`fname` varchar(150) NOT NULL,
`lname` varchar(150) NOT NULL,
`saddress` varchar(150) NOT NULL,
`pnumber` varchar(150) NOT NULL,
`username` varchar(15) NOT NULL,
`password` varchar(15) NOT NULL,
`ip` varchar(15) NOT NULL,
`email` varchar(150) NOT NULL,
`country` varchar(150) NOT NULL,
PRIMARY KEY (`id`),
KEY `password_idx` (`password`(8)),
KEY `ip` (`ip`),
KEY `username_idx` (`username`(8)),
KEY `email_2` (`email`),
FULLTEXT KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=48

Pyros
07-03-2009, 04:48 PM
As cashout.
The database is cashout and the cashout is cashout.

Here.

-- Table structure for table `cashout`
--

CREATE TABLE IF NOT EXISTS `cashout` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cashout` varchar(150) NOT NULL,
`fname` varchar(150) NOT NULL,
`lname` varchar(150) NOT NULL,
`saddress` varchar(150) NOT NULL,
`pnumber` varchar(150) NOT NULL,
`username` varchar(15) NOT NULL,
`password` varchar(15) NOT NULL,
`ip` varchar(15) NOT NULL,
`email` varchar(150) NOT NULL,
`country` varchar(150) NOT NULL,
PRIMARY KEY (`id`),
KEY `password_idx` (`password`(8)),
KEY `ip` (`ip`),
KEY `username_idx` (`username`(8)),
KEY `email_2` (`email`),
FULLTEXT KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=48

Its not that, your table is fine cuz i can see the column itself it's gotta do something with your php

SPECIFICALLY when you do this cashout is missing somehow and you need to determine why

$query = "INSERT INTO `cashout` (id, cashout, fname, lname, saddress, pnumber, username, password, ip, email, country) VALUES('$id','$cashout','$fname','$lname','$saddre ss','$pnumber','$username','$password','$ip','$ema il','$country')";
mysql_query($query) or die(mysql_error());

im assuming the query does not die right? cuz it goes through? print out the variable $cashout and see what it is

Pyros

Cookies
07-03-2009, 04:49 PM
Yea i did. I sloved the problem <3. I thought to myself about changeing the cashout name!
>D
Closing thread + Delete.

Pyros
07-03-2009, 04:55 PM
since i help you out so much :p can i get some of the proceeds :D?

Pyros

Cookies
07-03-2009, 04:57 PM
Well, its gonna be free o.O .. I will put some credits!

god
07-03-2009, 05:05 PM
I like how you have..."creatively" name some variables. lolze and lolza :thumbs

Pyros
07-03-2009, 05:07 PM
Well, its gonna be free o.O .. I will put some credits!

is it

Pyros

Cookies
07-03-2009, 05:22 PM
Yes it is ^^. Sloved a problem, found another :/.