-=[ Mr. Bumblebee ]=-
_Indonesia_
<?php
/*
* =============================================
* Filename : result.php
* Function : PG»ç¿¡¼ ½ÂÀÎ °á°ú¸¦ ¹Þ¾Æ DBó¸®ÇÏ´Â ÆäÀÌÁö
* Author : All contents Copyright 2012 Bankwell Co. all rights reserved
* =============================================
*/
/*
* 1. °áÁ¦°ü·Ã º¯¼ö ¹Þ¾Æ¿À±â
* °áÁ¦¿äûÆäÀÌÁö pay.phpÀÇ PGIOForm ¾È¿¡ ¼±¾ðµÈ ¿ä¼ÒµéÀÌ ¸ðµÎ ³Ñ¾î¿É´Ï´Ù.
*/
$tid = $_POST["tid"];
$replycode = $_POST["replycode"];
/*
* 2. °áÁ¦¼º°ø½Ã DBó¸®
*/
if ($replycode == "0000"){
// °áÁ¦ ¼º°ø½Ã ó¸® ÀÛ¾÷
// À̰÷¿¡¼ µ¥ÀÌÅÍ º£À̽º ÀÛ¾÷À» ÇÏ½Ã¸é µË´Ï´Ù.
include $_SERVER['DOCUMENT_ROOT'] . '/inc/config_inc.php' ;
$server_connect = mysql_connect( 'localhost' , $dbid , $dbpw ) ;
$db_connect = mysql_select_db( $dbname , $server_connect ) ;
$now = date('Y-m-d H:i:s') ;
$ip = getenv('REMOTE_ADDR') ;
// get order info
$query = " select * " .
" from tbl_order where orderScode='{$_POST[mb_serial_no]}' " ;
$execute = mysql_query($query) ;
$tmpRs = mysql_fetch_assoc( $execute ) ;
$bSucc = "true" ;
if ( empty($tmpRs['numid'])) {
$bSucc = "false" ;
} else {
// check price
if ( $_POST['unitprice'] != $tmpRs['result_price'] ) {
$bSucc = "false" ;
$is_error = 'Y' ;
$error_message = '°áÁ¦±Ý¾×°ú ½Ç°áÁ¦±Ý¾×ÀÌ ÀÏÄ¡ÇÏÁö¾Ê½À´Ï´Ù.' ;
} else {
// check point
if ( $tmpRs['use_point'] == 'Y' && intval($tmpRs['point_price']) > 0 ) {
if ( empty($tmpRs['real_no'])) {
$bSucc = "false" ;
$is_error = 'Y' ;
$error_message = 'ºñȸ¿øÀÇ Àû¸³±Ý»ç¿ë' ;
} else {
$query = " select numid , have_point " .
" from tbl_member where numid = '{$tmpRs[real_no]}' " ;
$execute = mysql_query($query) ;
$memRs = mysql_fetch_assoc( $execute ) ;
if ( empty($memRs['numid'])) {
$bSucc = "false" ;
$is_error = 'Y' ;
$error_message = 'µî·ÏµÇÁö¾Ê¾Ò°Å³ª »èÁ¦µÈ ȸ¿øÀÇ Àû¸³±Ý»ç¿ë' ;
} elseif ( $memRs['have_point'] < $tmpRs['point_price'] ) {
$bSucc = "false" ;
$is_error = 'Y' ;
$error_message = '»ç¿ëÇÑ Àû¸³±ÝÀÌ ¼ÒÀ¯Çϰí ÀÖ´Â Àû¸³±ÝÃѾ׺¸´Ù ¸¹½À´Ï´Ù.' ;
} else {
// Æ÷ÀÎÆ® Á¦ÇÔ.
$query = " update tbl_member set have_point = have_point - " . intval($tmpRs['point_price']) . " where numid = '{$tmpRs[real_no]}' " ;
mysql_query($query);
$query = " insert into tbl_member_point ( keycode , write_date , ip , real_no , real_id , ord_code , point , totalpoint , contents ) " .
" values ( 'A02' , '{$now}' , '{$ip}' , '{$tmpRs[real_no]}' , '{$tmpRs[real_id]}' , '{$_POST[mb_serial_no]}' , '{$tmpRs[point_price]}' , '" . ( $memRs['have_point'] - $tmpRs['point_price'] ) . "' , 'ÁÖ¹®½Ã »ç¿ë' ) " ;
mysql_query($query);
}
}
}
// check point end
}
$actData = array (
// other info
'pay_price' => $_POST['unitprice'] ,
'paydate' => $now ,
'n_state' => ( $bSucc == "true" ? 'ÀԱݿϷá' : '°áÁ¦½ÇÆÐ' ) ,
'is_error' => $is_error ,
'error_message'=> $error_message ,
// pay only - bankwell
'replycode' => $_POST['replycode'] , // ÁöºÒ°á°úÄÚµå
'replyMsg' => $_POST['replyMsg'] , // ÁöºÒ°á°ú¸Þ½ÃÁö
'tid' => $_POST['tid'] , // ºí·çÆäÀÌ °Å·¡¹øÈ£(ÀÚµ¿Ã¤¹ø).
'bankaccount' => $_POST['bankaccount'] , // °¡»ó°èÁ¹߱ްèÁ¹øÈ£(ÀÚµ¿¹ß±ÞµÊ)
'bankexpyear' => $_POST['bankexpyear'] , // °¡»ó°èÁÂÀԱݱâÇÑ ³â(YYYY)
'bankexpmonth' => $_POST['bankexpmonth'] , // °¡»ó°èÁÂÀԱݱâÇÑ(DD)
'bankcode' => $_POST['bankcode'] , // °¡»ó°èÁ ¹ß±ÞÀºÇàÄÚµå
'cardauthcode' => $_POST['cardauthcode'] , // Ä«µå½ÂÀιøÈ£/¿¡½ºÅ©·Î¹øÈ£
'cardquota' => $_POST['cardquota'] , // Ä«µåÇҺαⰣ, °Å·¡ ¼º°øÈÄ Ã¤¿öÁü
'cardtype' => $_POST['cardtype'] , // °áÁ¦Ä«µåÁ¾·ù
'bankcodename' => $_POST['bankcodename'] , // °¡»ó°èÁ¹߱ÞÀºÇà¸í
'loanSt' => $_POST['loanSt'] , // ¿¡½ºÅ©·Î°áÁ¦¿©ºÎ
) ;
$condQuery = '';
foreach ( $actData as $k=>$v ) {
$condQuery .= ( empty($condQuery) ? "" : " , " ) . $k . "='{$v}' " ;
}
$query = " update tbl_order set {$condQuery} where orderScode='{$_POST[mb_serial_no]}' " ;
mysql_query($query);
}
// database end
echo '
<script language="javascript">
location.replace("./?mode=orderrst&ordercode=' . $_POST['mb_serial_no'] . '") ;
</script>
' ;
}
?>
Copyright © 2017 || Recoded By Mr.Bumblebee