-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/zbk_product.bk.20210326/
File Upload :
Current File : /var/www/html/zbk_product.bk.20210326/rt_vpay.php

<?
// Å×½ºÆ®½Ã ¾Æ·¡¿¡¼­ °¡»ó°èÁ ¸ðÀÇÀÔ±ÝÀ» ÇØº¼ ¼ö ÀÖ½À´Ï´Ù. (*½Ç°áÁ¦¸ðµå¿¡¼­´Â »ç¿ëºÒ°¡)
// http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti.jsp

   /* ============================================================================== */
    /* =   PAGE : °øÅë Å뺸 PAGE                                                    = */
    /* = -------------------------------------------------------------------------- = */
    /* =   ¿¬µ¿½Ã ¿À·ù°¡ ¹ß»ýÇÏ´Â °æ¿ì ¾Æ·¡ÀÇ ÁÖ¼Ò·Î Á¢¼ÓÇϼż­ È®ÀÎÇϽñ⠹ٶø´Ï´Ù.= */
    /* =   Á¢¼Ó ÁÖ¼Ò : http://kcp.co.kr/technique.requestcode.do			        = */
    /* = -------------------------------------------------------------------------- = */
    /* =   Copyright (c)  2013   KCP Inc.   All Rights Reserverd.                   = */
    /* ============================================================================== */
    /* ============================================================================== */
    /* =   01. °øÅë Å뺸 ÆäÀÌÁö ¼³¸í(Çʵ¶!!)                                        = */
    /* = -------------------------------------------------------------------------- = */
    /* =   °øÅë Å뺸 ÆäÀÌÁö¿¡¼­´Â,                                                  = */
    /* =   °¡»ó°èÁ ÀÔ±Ý Å뺸 µ¥ÀÌÅ͸¦ KCP¸¦ ÅëÇØ ½Ç½Ã°£À¸·Î Å뺸 ¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù. = */
    /* =                                                                            = */
    /* =   common_return ÆäÀÌÁö´Â ÀÌ·¯ÇÑ Å뺸 µ¥ÀÌÅ͸¦ ¹Þ±â À§ÇÑ »ùÇà ÆäÀÌÁö        = */
    /* =   ÀÔ´Ï´Ù. ÇöÀçÀÇ ÆäÀÌÁö¸¦ ¾÷ü¿¡ ¸Â°Ô ¼öÁ¤ÇϽŠÈÄ, ¾Æ·¡ »çÇ×À» Âü°íÇϼż­  = */
    /* =   KCP °ü¸®ÀÚ ÆäÀÌÁö¿¡ µî·ÏÇØ Áֽñ⠹ٶø´Ï´Ù.                              = */
    /* =                                                                            = */
    /* =   µî·Ï ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.                                             = */
    /* =  - KCP °ü¸®ÀÚÆäÀÌÁö(admin.kcp.co.kr)¿¡ ·Î±×ÀÎ ÇÕ´Ï´Ù.                      = */
    /* =  - [¼îÇθô °ü¸®] -> [Á¤º¸º¯°æ] -> [°øÅë URL Á¤º¸] -> [°øÅë URL º¯°æ ÈÄ]¿¡  = */
    /* =    °á°ú°ªÀº Àü¼Û¹ÞÀ» °¡¸ÍÁ¡ URLÀ» ÀÔ·ÂÇÕ´Ï´Ù.                              = */
    /* ============================================================================== */


    /* ============================================================================== */
    /* =   02. °øÅë Å뺸 µ¥ÀÌÅÍ ¹Þ±â                                                = */
    /* = -------------------------------------------------------------------------- = */
    $site_cd      = $_POST [ "site_cd"  ];                 // »çÀÌÆ® ÄÚµå
    $tno          = $_POST [ "tno"      ];                 // KCP °Å·¡¹øÈ£
    $order_no     = $_POST [ "order_no" ];                 // ÁÖ¹®¹øÈ£
    $tx_cd        = $_POST [ "tx_cd"    ];                 // ¾÷¹«Ã³¸® ±¸ºÐ ÄÚµå
    $tx_tm        = $_POST [ "tx_tm"    ];                 // ¾÷¹«Ã³¸® ¿Ï·á ½Ã°£
    /* = -------------------------------------------------------------------------- = */
    $ipgm_name    = "";                                    // ÁÖ¹®ÀÚ¸í
    $remitter     = "";                                    // ÀÔ±ÝÀÚ¸í
    $ipgm_mnyx    = "";                                    // ÀÔ±Ý ±Ý¾×
    $bank_code    = "";                                    // ÀºÇàÄÚµå
    $account      = "";                                    // °¡»ó°èÁ ÀԱݰèÁ¹øÈ£
    $op_cd        = "";                                    // 󸮱¸ºÐ ÄÚµå
    $noti_id      = "";                                    // Å뺸 ¾ÆÀ̵ð
    /* = -------------------------------------------------------------------------- = */
	$refund_nm    = "";                                    // ȯºÒ°èÁÂÁÖ¸í
    $refund_mny   = "";                                    // ȯºÒ±Ý¾×
    $bank_code    = "";                                    // ÀºÇàÄÚµå
    /* = -------------------------------------------------------------------------- = */
    $st_cd        = "";                                    // ±¸¸ÅÈ®ÀÎ ÄÚµå
    $can_msg      = "";                                    // ±¸¸ÅÃë¼Ò »çÀ¯
    /* = -------------------------------------------------------------------------- = */
    $waybill_no   = "";                                    // ¿î¼ÛÀå ¹øÈ£
    $waybill_corp = "";                                    // ÅÃ¹è ¾÷ü¸í
    /* = -------------------------------------------------------------------------- = */
	$cash_a_no    = "";                                    // Çö±Ý¿µ¼öÁõ ½ÂÀιøÈ£
    $cash_a_dt    = "";                                    // Çö±Ý¿µ¼öÁõ ½ÂÀνð£
    /* = -------------------------------------------------------------------------- = */

    /* = -------------------------------------------------------------------------- = */
    /* =   02-1. °¡»ó°èÁ ÀÔ±Ý Å뺸 µ¥ÀÌÅÍ ¹Þ±â                                     = */
    /* = -------------------------------------------------------------------------- = */
    if ( $tx_cd == "TX00" )
    {
        $ipgm_name = $_POST[ "ipgm_name" ];                // ÁÖ¹®ÀÚ¸í
        $remitter  = $_POST[ "remitter"  ];                // ÀÔ±ÝÀÚ¸í
        $ipgm_mnyx = $_POST[ "ipgm_mnyx" ];                // ÀÔ±Ý ±Ý¾×
        $bank_code = $_POST[ "bank_code" ];                // ÀºÇàÄÚµå
        $account   = $_POST[ "account"   ];                // °¡»ó°èÁ ÀԱݰèÁ¹øÈ£
        $op_cd     = $_POST[ "op_cd"     ];                // 󸮱¸ºÐ ÄÚµå
        $noti_id   = $_POST[ "noti_id"   ];                // Å뺸 ¾ÆÀ̵ð
        $cash_a_no = $_POST[ "cash_a_no" ];                // Çö±Ý¿µ¼öÁõ ½ÂÀιøÈ£
        $cash_a_dt = $_POST[ "cash_a_dt" ];                // Çö±Ý¿µ¼öÁõ ½ÂÀνð£
        $total_mnyx = $_POST[ "totl_mnyx" ];                // ÃÑ ÀԱݱݾ×
    }

    /* = -------------------------------------------------------------------------- = */
    /* =   02-2. °¡»ó°èÁ ȯºÒ Å뺸 µ¥ÀÌÅÍ ¹Þ±â                                     = */
    /* = -------------------------------------------------------------------------- = */
    else if ( $tx_cd == "TX01" )
    {
        $refund_nm  = $_POST[ "refund_nm"  ];               // ȯºÒ°èÁÂÁÖ¸í
        $refund_mny = $_POST[ "refund_mny" ];               // ȯºÒ±Ý¾×
        $bank_code  = $_POST[ "bank_code"  ];               // ÀºÇàÄÚµå
    }
    /* = -------------------------------------------------------------------------- = */
    /* =   02-3. ±¸¸ÅÈ®ÀÎ/±¸¸ÅÃë¼Ò Å뺸 µ¥ÀÌÅÍ ¹Þ±â                                  = */
    /* = -------------------------------------------------------------------------- = */
    else if ( $tx_cd == "TX02" ) {

        $st_cd = $_POST[ "st_cd" ] ;                          // ±¸¸ÅÈ®ÀÎ ÄÚµå

        if ( $st_cd == "N"  )                                // ±¸¸ÅÈ®ÀÎ »óŰ¡ ±¸¸ÅÃë¼ÒÀÎ °æ¿ì
        {
            $can_msg = $_POST[ "can_msg"   ];               // ±¸¸ÅÃë¼Ò »çÀ¯
        }
	}
    /* = -------------------------------------------------------------------------- = */
    /* =   02-4. ¹è¼Û½ÃÀÛ Å뺸 µ¥ÀÌÅÍ ¹Þ±â                                           = */
    /* = -------------------------------------------------------------------------- = */
    else if ( $tx_cd == "TX03" )
	{

        $waybill_no   = $_POST[ "waybill_no"   ];           // ¿î¼ÛÀå ¹øÈ£
        $waybill_corp = $_POST[ "waybill_corp" ];           // ÅÃ¹è ¾÷ü¸í
	}


    /* ============================================================================== */
    /* =   03. °øÅë Å뺸 °á°ú¸¦ ¾÷ü ÀÚüÀûÀ¸·Î DB ó¸® ÀÛ¾÷ÇϽô ºÎºÐÀÔ´Ï´Ù.      = */
    /* = -------------------------------------------------------------------------- = */
    /* =   Å뺸 °á°ú¸¦ DB ÀÛ¾÷ ÇÏ´Â °úÁ¤¿¡¼­ Á¤»óÀûÀ¸·Î Å뺸µÈ °Ç¿¡ ´ëÇØ DB ÀÛ¾÷¿¡  = */
    /* =   ½ÇÆÐÇÏ¿© DB update °¡ ¿Ï·áµÇÁö ¾ÊÀº °æ¿ì, °á°ú¸¦ ÀçÅ뺸 ¹ÞÀ» ¼ö ÀÖ´Â     = */
    /* =   ÇÁ·Î¼¼½º°¡ ±¸¼ºµÇ¾î ÀÖ½À´Ï´Ù.                                            = */
    /* =                                                                            = */
    /* =   * DB update°¡ Á¤»óÀûÀ¸·Î ¿Ï·áµÈ °æ¿ì                                     = */
    /* =   ÇÏ´ÜÀÇ [04. result °ª ¼¼ÆÃ Çϱâ] ¿¡¼­ result °ªÀÇ value°ªÀ» 0000À¸·Î     = */
    /* =   ¼³Á¤ÇØ Áֽñ⠹ٶø´Ï´Ù.                                                  = */
    /* =                                                                            = */
    /* =   * DB update°¡ ½ÇÆÐÇÑ °æ¿ì                                                = */
    /* =   ÇÏ´ÜÀÇ [04. result °ª ¼¼ÆÃ Çϱâ] ¿¡¼­ result °ªÀÇ value°ªÀ» 0000ÀÌ¿ÜÀÇ   = */
    /* =   °ªÀ¸·Î ¼³Á¤ÇØ Áֽñ⠹ٶø´Ï´Ù.                                           = */
    /* = -------------------------------------------------------------------------- = */

    /* = -------------------------------------------------------------------------- = */
    /* =   03-1. °¡»ó°èÁ ÀÔ±Ý Å뺸 µ¥ÀÌÅÍ DB ó¸® ÀÛ¾÷ ºÎºÐ                        = */
    /* = -------------------------------------------------------------------------- = */
    if ( $tx_cd == "TX00" )
    {
		include $_SERVER['DOCUMENT_ROOT'] . '/inc/config_inc.php' ;
		$server_connect = mysql_connect( $dbhost , $dbid , $dbpw ) ;
		$db_connect = mysql_select_db( $dbname , $server_connect ) ;
		mysql_set_charset('euckr');
		$now = date('Y-m-d H:i:s') ;
		$ip = getenv('REMOTE_ADDR') ;

		$result = "0000" ;
		if ( $ip == '210.122.73.58' ) {
			// KCP Å뺸 Å×½ºÆ® ¼­¹ö
		} else if ( $ip == '203.238.36.173' ) {
			// KCP Å뺸 ½Ç ¼­¹ö (1)
		} else if ( $ip == '203.238.36.178' ) {
			// KCP Å뺸 ½Ç ¼­¹ö (2)
		} else $result = "1111" ;

		if ( $result == "0000" ) {
			// get order info
			$query = " select * " .
						  " from tbl_order where tno = '{$tno}' " ; // orderScode='{$order_no}' " ;
			$execute = mysql_query($query) ;
			$tmpRs = mysql_fetch_assoc( $execute ) ;
			if ( empty($tmpRs['numid'])) {
				$result = "2222" ;
			} else { // 13Àº ÀºÇà °øµ¿¸ÁÀ» ÅëÇÑ Ãë¼Ò°Ç
				$actData = array (
								// other info
								'n_state'			=> ( $op_cd != '13' && $tmpRs['amount'] <= $ipgm_mnyx ? 'ÀԱݿϷá' : 'ÀԱݴë±â' ) ,
								'pay_price'		=> $ipgm_mnyx , // $total_mnyx
								'paydate'		=> $now ,
								'is_error'			=> 'N' ,
								'error_message'=> 'account:' . $account . '/noti_id:' . $noti_id . '/ipgm_time:' . $ipgm_time . '/total_mnyx:' . $total_mnyx ,
				) ;
				$condQuery = '';
				foreach ( $actData as $k=>$v ) {
					$condQuery .= ( empty($condQuery) ? "" : " , " ) . $k . "='{$v}' " ;
				}
				$query = " update tbl_order set {$condQuery} where orderScode='{$tmpRs[orderScode]}' " ;
				mysql_query($query);
			}
		}
    }
    /* ============================================================================== */


    /* ============================================================================== */
    /* =   04. result °ª ¼¼ÆÃ Ç챉                                                  = */
    /* ============================================================================== */
?>
<html><body><form><input type="hidden" name="result" value="<?=$result?>"></form></body></html>

Copyright © 2017 || Recoded By Mr.Bumblebee