Location: PHPKode > scripts > PHP Hosting Directory > phphost_directoryv2/ipn/intgold.php
<?

include ("../config.inc.php");

$order_id = $_POST['CUSTOM1'];
$status = mysql_result(mysql_query("SELECT `status` FROM `hsl_order` WHERE `order_id`='$order_id'"), 0, 0);

if ($status != 'Finished')
{
  mysql_query("UPDATE `hsl_order` SET `status`='Finished', `description`='This transaction has been approved' WHERE `order_id`='$order_id'");
  $order = mysql_fetch_assoc(mysql_query("SELECT *, h.`account_type` AS curr_acount_type, IF(h.`expired`<NOW(), 1, 0) AS expired_flag FROM `hsl_order` o LEFT JOIN `hsl_price` p ON o.`price_id`=p.`price_id` LEFT JOIN `hsl_host` h ON o.`username`=h.`username` WHERE o.`order_id`='$order_id'"));

  if ($order['account_type'] == $order['curr_acount_type'])
  {
    if ($order['expired_flag'] == 0)
    {
      $sql = "UPDATE `hsl_host` SET `expired`=FROM_DAYS(TO_DAYS(`expired`)+".($order['period']*30).") WHERE `username`='".$order['username']."'";
    }
    else
    {
      $sql = "UPDATE `hsl_host` SET `expired`=FROM_DAYS(TO_DAYS(NOW())+".($order['period']*30).") WHERE `username`='".$order['username']."'";
    }
  }
  else
  {
    $sql = "UPDATE `hsl_host` SET `account_type`='".$order['account_type']."', `expired`=FROM_DAYS(TO_DAYS(NOW())+".($order['period']*30).") WHERE `username`='".$order['username']."'";
  }
  mysql_query($sql);
}
?>
<script>location='<?=$config['base_url']?>profile/account';</script>
Return current item: PHP Hosting Directory