nanduzenho
Member
Good morning, my gesior shop system is not working properly. I can make the first purchase of the item, but the second time, I can't activate the item for the character to receive. I noticed that in the database, in z_shop_payment, the columns are getting the same id. Does anyone know how I solve this problem??
z_shop_payment:
Shop.php
z_shop_payment:
Shop.php
PHP:
if(empty($services_errors)) {
if( $_SERVER['REQUEST_METHOD']=='POST' ) {
$hash = md5( implode( $_POST ) );
if( isset( $_SESSION['hash'] ) && $_SESSION['hash'] == $hash ) {
// Refresh! Não faz nada ou re-exibe o formulário preenchido
} else {
$_SESSION['hash'] = $request;
if($sendTo == "friend") {
$add_order = $SQL->query("INSERT INTO `z_shop_payment` (`account_name`,`service_id`,`service_category_id`,`payment_method_id`,`coins`,`status`,`date`,`gift`) VALUES ('$account_name','$service_id','$serviceCategoryID','$payment_method','$service_points','gift','$orderDate','0')");
$add_friend = $SQL->query("INSERT INTO `z_shop_payment` (`account_name`,`service_id`,`service_category_id`,`payment_method_id`,`coins`,`status`,`date`,`gift`) VALUES ('$friend_acc','$service_id','$serviceCategoryID','$payment_method','$service_points','ready','$orderDate','1')");
} else {
$add_order = $SQL->query("INSERT INTO `z_shop_payment` (`account_name`,`service_id`,`service_category_id`,`payment_method_id`,`coins`,`status`,`date`,`gift`) VALUES ('$account_name','$service_id','$serviceCategoryID','$payment_method','$service_points','ready','$orderDate','0')");
}
$account_logged->setPremiumPoints($debitPoints);
$account_logged->save();
}
}
}