Newbie Spellweaver
- Joined
- Nov 7, 2011
- Messages
- 24
- Reaction score
- 24
I have found a "bug".
The Confirm donations sistem doesent work
I am going to explai detailed right now
I seted up the site to use the paypal system so users can donate/purchase with money coins
So o user choses to buy some coins
He will go here
View attachment 94902
After that he will have to Confirm the purchase
View attachment 94903
so an site admin will Aprove it or denie it if the tranfer is succesfull or not
View attachment 94904
If the admin confirms it the cahs is not given to the user as it should be.Normal that should be the functions.So i checked the file structure and i found in the sisConfirmDonate.php from the _administrador folder of the site that the mssql query does not insert any data in the CabalCash database where the coins(in my case) are stored.
here is the query
PHP:if($_POST['sbmtConf']) { $txtCod = $_POST['txtCod']; $sql = "UPDATE ".DB_ACC.".dbo.CADDONATE Set ckEntrega = 1, DataEntr = getdate(), RespEntr = '".$txtLogin."' where CodDon = '".$txtCod."'"; $sql_result = mssql_query($sql); echo '<script>alert(\'Donation successfully confirmed !\'); location=\'sisConfirmDonate.php\'</script>'; mssql_close(); }
To make this work it must insert in the databse CabalCash in the field Alz and to the correct UserNum.
I tried some ways but couldnt make it work.
I would apreciate some help.
Thanks
Hello
Use these codes and see if it solves your case
PHP:
if($_POST['sbmtConf']) {
$txtId = $_POST['txtId'];
$txtCod = $_POST['txtCod'];
$txtQntCash = $_POST['txtQntCash'];
$sql_verifica = mssql_fetch_row(mssql_query("SELECT UserNum FROM ".DB_ACC.".dbo.cabal_auth_table WHERE ID = '".$txtId."'"));
$sql = "UPDATE ".DB_ACC.".dbo.CADDONATE Set
ckEntrega = 1,
DataEntr = getdate(),
RespEntr = '".$txtLogin."'
where CodDon = '".$txtCod."'
UPDATE ".DB_CSH.".dbo.Bank Set
Alz = Alz + '".$txtQntCash."'
WHERE UserNum = '".$sql_verifica[0]."'";
$sql_result = mssql_query($sql);
echo '<script>alert(\'Donation successfully confirmed !\'); location=\'sisConfirmDonate.php\'</script>';
mssql_close();
}

