GIF89a;
| Direktori : /home/serb/public_html/ |
| Current File : /home/serb/public_html/upgrade_escort_payment_handler.php |
<?php
session_start();
include("lib/globals.php");
include("lib/common.php");
include("lib/functions.php");
$SITE_URL = "http://".$_SERVER['HTTP_HOST']."/";
if(isset($_REQUEST['payment_success_token']) && $_REQUEST['payment_success_token'] != "")
{
$_POST = sh_get_array_from_token($_REQUEST['payment_success_token']);
if(isset($_POST["__PAYMENT_STATUS__"]) && $_POST["__PAYMENT_STATUS__"] == "SUCCESS")
{
if(isset($_POST['__RECORD_ID__']) && $_POST['__RECORD_ID__'] != "")
{
$RECORD_ID = sh_decrypt($_POST['__RECORD_ID__']);
if($RECORD_ID == $_SESSION['SH_ESCORT_ID'])
{
$sql_day="SELECT * FROM escort_details where id='".$RECORD_ID."'";
$res_day=execute_query($sql_day);
$row_day=mysql_fetch_array($res_day);
$daay=$row_day['ft_ad_day'];
$expiry = date("Y-m-d", time() + $daay*24*60*60 );
//$payment_status_sql = "UPDATE `escort_details` SET `ft_ad_expair` = 'a',`ft_ad_status` = 'a', `status` = 'a' WHERE `id` = '".$RECORD_ID."' AND `status` = 'u'";
$payment_status_sql = "UPDATE `escort_details` SET `ft_ad_expair` = '$expiry',`ft_ad_status` = 'Yes', `status` = 'a' WHERE `id` = '".$RECORD_ID."'";
execute_query($payment_status_sql) or die(mysql_error());
$sql_postad="select id,nickname,ft_ad_price,email from escort_details where `id` = '".$RECORD_ID."' AND `status` = 'a'";
$res_postad=execute_query($sql_postad);
$num_postad=mysql_num_rows($res_postad);
$row_postad=mysql_fetch_array($res_postad);
$inser_pyment="INSERT into payment_dtls(id,post_id,fname,email,amount,status)Values('','".$RECORD_ID."','".$row_postad['nickname']."','".$row_postad['email']."','".$row_postad['ft_ad_price']."','a')";
execute_query($inser_pyment);
unset($_SESSION['SH_ESCORT_ID']);
header("Location: ".$_POST['__REDIRECT_URL__']);
exit;
}
}
}
}
function sh_decrypt($id)
{
$id = base64_decode($id);
$id = base64_decode($id);
$id = gzinflate($id);
$id = base64_decode($id);
return $id;
}
function sh_get_array_from_token($token)
{
$decoded_data = base64_decode(base64_decode($token));
$decrypted_data = gzinflate($decoded_data);
$decoded_data = base64_decode($decrypted_data);
return json_decode($decoded_data,1);
}