<?php
require_once('lib/extras.init.php');
/*
{status} (1 = completed 2 = canceled)
{trans_id} (unique ID )
{user_id} (your UserID)
{subid} (Your subId)
{subid_2} (Your subId2)
{amount_local} amount in your currency
{amount_usd} amount in USD
{ip_click} user click IP
{secure_hash} here we had a hash that you can validate the request the hash is a md5 hash: example: md5({trans_id}-yourappsecurehash)
*/
if ($_GET['status'] == 1)
{
//betrag auf konto buchen
$sql = sql::$db->prepare ("UPDATE `vms_kontodaten` SET `kontostand` = `kontostand` + :verdienst WHERE `uid` = :uid LIMIT 1");
$sql -> execute(array(':verdienst' => $_GET['verdienst'], ':uid' => $_GET['subid']));
//buchung eintragen
$buchungs_id=create_code(14);
$sql = sql::$db->prepare ("INSERT INTO `vms_buchungen` (`uid`,`buchungszeit`,`buchungs_id`,`buchungsmenge `,`verwendungszweck`) VALUES (?,?,?,?,?)");
$sql ->execute( array( $_GET['subid'], time(), $buchungs_id, $_GET['verdienst'], 'CPX Umfrage '.$_GET['trans_id'] ) );
}
if ($_GET['status'] == 2)
{
//betrag von konto abziehen
$sql = sql::$db->prepare ("UPDATE `vms_kontodaten` SET `kontostand` = `kontostand` - :verdienst WHERE `uid` = :uid LIMIT 1");
$sql -> execute(array(':verdienst' => $_GET['verdienst'], ':uid' => $_GET['uid']));
//buchung eintragen
$buchungs_id=create_code(14);
$sql = sql::$db->prepare ("INSERT INTO `vms_buchungen` (`uid`,`buchungszeit`,`buchungs_id`,`buchungsmenge `,`verwendungszweck`) VALUES (?,?,?,?,?)");
$sql ->execute( array( $_GET['subid'], time(), $buchungs_id, '-'.$_GET['verdienst'], 'CPX Umfrage '.$_GET['trans_id'].' Storno' ) );
}
?>