Jump to content
  • 0
Sign in to follow this  
aznan83

Donation Credits.. help

Question

hi.... i already edit /fluxcp/lib/Flux/LoginServer.php .... & #cashpoints functioning good...  but i have prob at flux cp Donation Credits, it still view data from cp_credits...

 

new at acc_reg_num_db  ... #CASHPOINTS

 

 

thanks all

post-12262-0-64852300-1454898050_thumb.jpg

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

hi... i already put below code to to LoginServer.php ... but it still not read from #CASHPOINTS ... i hope someone can fix it

 

 

 

public function depositCredits($targetAccountID, $credits, $donationAmount = null)

{

$sql = "SELECT COUNT(account_id) AS accountExists FROM {$this->loginDatabase}.login WHERE account_id = ?";

$sth = $this->connection->getStatement($sql);

if (!$sth->execute(array($targetAccountID)) || !$sth->fetch()->accountExists) {

return false; // Account doesn't exist.

}

 

if (!$this->hasCreditsRecord($targetAccountID)) {

$fields = $fields = '`account_id`, `key`, `index`, `value`';

$values = '?, ?, ?, ?';

 

/*if (!is_null($donationAmount)) {

$fields .= ', last_donation_date, last_donation_amount';

$values .= ', NOW(), ?';

}*/

 

$sql = "INSERT INTO {$this->charMapDatabase}.`acc_reg_num_db` ($fields) VALUES ($values)";

$sth = $this->connection->getStatement($sql);

$vals = array($targetAccountID, '#CASHPOINTS', 0, $credits);

 

/*if (!is_null($donationAmount)) {

$vals[] = $donationAmount;

}*/

 

return $sth->execute($vals);

}

else {

$vals = array();

$sql = "UPDATE {$this->charMapDatabase}.`acc_reg_num_db` SET value = value + ? ";

 

/*if (!is_null($donationAmount)) {

$sql .= ", last_donation_date = NOW(), last_donation_amount = ? ";

}*/

 

$vals[] = $credits;

 

/*if (!is_null($donationAmount)) {

$vals[] = $donationAmount;

}*/

 

$vals[] = $targetAccountID;

 

$sql .= "WHERE account_id = ? and `key` = '#CASHPOINTS'";

$sth = $this->connection->getStatement($sql);

 

return $sth->execute($vals);

}

}

Share this post


Link to post
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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.