-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/z_send.bk.240724/php/
File Upload :
Current File : /var/www/html/z_send.bk.240724/php/pop.sale_receipt.php

<?
	// http://soccerteam.kr/send/index.php?page=1&mode=receipt&numid=NjkIODIIOTAI&emem=cute_bagazi@hanmail.net&nmem=³ªÀºÁø
	// http://soccerteam.kr/send/index.php?page=1&mode=receipt&numid=NzAIODcIODII&emem=djawnwls@naver.com&nmem=¾öÁÖÁø
	if ( empty($total['numid']))	script_close( 'À߸øµÈ Á¢±ÙÀÔ´Ï´Ù.') ;

	$s_ordercode = ordNumber_decode ( $numid ) ;
	$s_query = array() ;
	if ( !empty($total['loginno'])) {
		$s_query[] = " real_no = '{$total[loginno]}' " ;
		$s_query[] = " real_id = '{$total[loginid]}' " ;
	} else {
		$s_query[] = " oname = '{$n_member_n}' " ;
		$s_query[] = " oemail = '{$n_member_e}' " ;
	}
	$s_query[] = " ( pay_type = 'B'  or pay_type = 'D' or (( pay_type = 'C' or pay_type = 'E' ) and n_state != 'ÀԱݴë±â' ) ) " ;
	$s_query[] = " numid = '{$s_ordercode}' " ;

	$query = " from tbl_{$config[ODR][1]} " ;
	$query.= " where " . implode ( "and" , $s_query )  ;
	$info = $exe->qry_fetch ( $query , " * , date_format(write_date,'%Y³â %m¿ù %dÀÏ') as userOrder_date_ex " ) ;
	if ( empty($info['numid'])) script_close( ' À¯È¿ÇÏÁö ¾ÊÀº Á¢±ÙÀÔ´Ï´Ù. ') ;
	if ( $info['n_state'] == 'ÀԱݴë±â' ) script_close( ' ÀԱݿϷá ÈÄ ¿µ¼öÁõÀ» Ãâ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. ') ;
	if ( $info['n_state'] == 'Ãë¼Ò' ) script_close( ' ¿µ¼öÁõÀ» Ãâ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù. ') ;
	if ( $info['n_state'] == '¹Ýǰ' ) script_close( ' ¿µ¼öÁõÀ» Ãâ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù. ') ;

	$skins = $skin->skin ( array (
											'frm' 		=> 'FORM' ,
											'rep'		=> 'REPEAT'
									    ) , $skinfile ) ;

	$info['ndate'] = $info['userOrder_date_ex'] ;

	$execute = $exe->qry_one( " from tbl_{$config[ODR][1]}_gs where orderScode = '{$info[orderScode]}' order by numid asc " , " * ") ;
	$frm_goods = '' ;
	$s_sumprice = 0 ; // ´©ÀûÇÕ
	$tmp_Rs = '' ;

	$freeprice_sum = 0 ;
	$icnt = 0 ;
	while ( $rs = $exe->fetch($execute)) {
		$icnt++ ;
		$frm_detail = '' ;
		$frm_sizes = '' ;
		$total_g_sumprice = 0 ;
		$topprice = 0 ;
		$botprice = 0 ;
		if ( $rs['formtype'] == 'M' ) {
			// »ç¿ëÀÚ ¼±ÅÃÁö
			$numberFont_title = '' ;
			$numberFont_p1 = 0 ;
			$numberFont_p2 = 0 ;
			$numberFont_p3 = 0 ;
			$numberFont_gubun = '' ;
			$use_initial = array() ;
			$pexe = $exe->qry_one(" from tbl_{$config[ODR][1]}_pos as opos left outer join tbl_{$config[OT1][1]} as opt on opos.p_idx = opt.numid where opos.gs_no = '{$rs[numid]}' order by pos asc " , " opos.* ") ;
			while ( $prs = $exe->fetch($pexe)) {
				if ( $prs['o_code'] == 'f' ) {
					switch ( $prs['p_code'] ) {
						case 'e' :
						case 's' :
						case 'p' :
							if ( intval($prs['pos']) < 13 ) $topprice += $prs['p_price1'] ;
							else $botprice += $prs['p_price1'] ;
							break ;
						case 'n' :
							$numberFont_title = $prs['p_title'] ;
							$numberFont_p1 = $prs['p_price1'] ;
							$numberFont_p2 = $prs['p_price2'] ;
							$numberFont_p3 = $prs['p_price3'] ;
							$numberFont_gubun = $prs['p_gubun'] ;
							break ;
						case 't' :
							$tnlen = mb_strlen(str_replace( ' ' , '' , $prs['p_tn'] ) , 'EUC_KR' );
							$opt_price = $rs['teamtype'] == 'O' ? $tnlen * $rs['team_o_price'] : $rs['team_f_price'] ;
							$opt_price += $prs['p_arch'] == 'Y' ? $rs['team_arch'] : 0 ; // arch
							if ( intval($prs['pos']) < 13 ) $topprice += $opt_price ;
							else $botprice += $opt_price ;
							break ;
						case 'i' :
							$use_initial[$prs['pos']] = $prs['p_arch'] == 'Y' ? 'Y' : 'N' ;
							break ;
					}
				} else if ( $prs['o_code'] == 'i' ) {
					$use_initial[$prs['pos']] = $prs['p_arch'] == 'Y' ? 'Y' : 'N' ;
				} else if ( $prs['o_code'] == 'n' ) {
					$numberFont_title = $prs['p_title'] ;
					$numberFont_p1 = $prs['p_price1'] ;
					$numberFont_p2 = $prs['p_price2'] ;
					$numberFont_p3 = $prs['p_price3'] ;
					$numberFont_gubun = $prs['p_gubun'] ;
				}
			}
			// ½ºÅ¸Å·
			$skexe = $exe->qry_one(" from tbl_{$config[ODR][1]}_stk where gs_no = '{$rs[numid]}' order by numid " , " nm , qry " ) ;
			$stocking_p = 0 ;
			while ( $skrs = $exe->fetch($skexe)) {
				$stocking_p += $rs['stocking_price'] * $skrs['qry'] ;
			}

			// »çÀÌÁî
			$sexe = $exe->qry_one(" from tbl_{$config[ODR][1]}_size where gs_no = '{$rs[numid]}' order by numid " ,
												  " seq, tsize, bsize, armtype, initialnm, numb, npos1, npos2, npos3 " ) ;
			while ( $srs = $exe->fetch($sexe)) {
				$initialp = 0 ;  // ÀÌ´Ï¼È ±âº»°¡
				$initial_p = 0 ; // ÀÌ´Ï¼È À§Ä¡ ÇÕ
				$psum = 0 ; // °³º° ÇÕ
				$numblen = strlen($srs['numb']) ;
				$numbp1 = $srs['npos1'] == 'Y' ? $numblen * $numberFont_p1 : 0 ;
				$numbp2 = $srs['npos2'] == 'Y' ? $numblen * $numberFont_p2 : 0 ;
				$numbp3 = $srs['npos3'] == 'Y' ? $numblen * $numberFont_p3 : 0 ;
				$numbsum = $numbp1 + $numbp2 + $numbp3 ;
				if (!empty($srs['initialnm'])) {
					$chkAllKr = input_initial_price($srs['initialnm']) ;
					if ( $chkAllKr ) $initialp = $numberFont_gubun == 'B' ? $rs['initial_kr_s'] : $rs['initial_kr_c'] ;
					else $initialp = $numberFont_gubun == 'B' ? $rs['initial_en_s'] : $rs['initial_en_c'] ;
					$initial_p += $use_initial['09'] == 'Y' ? $initialp + $rs['initial_arch'] : ( $use_initial['09'] == 'N' ? $initialp : 0 ) ;
					$initial_p += $use_initial['11'] == 'Y' ? $initialp + $rs['initial_arch'] : ( $use_initial['11'] == 'N' ? $initialp : 0 ) ;
				}

				$psum = empty($srs['tsize']) ? 0 : $topprice + $rs['topprice']  ;
				$psum += empty($srs['bsize']) ? 0 : $botprice + $rs['botprice']  ;
				$psum += $rs['g_price'] ;
				$psum += $srs['armtype'] == 'L' ? $rs['arm_l_price'] : $rs['arm_s_price'] ;
				$psum += $numbp1 + $numbp2 + $numbp3 ;
				$psum += $initial_p ;
				$total_g_sumprice += $psum ;
			}
			$total_g_sumprice += $stocking_p ;
		}
		else if ( $rs['formtype'] == 'T' ) {
			$n_qry = 0 ;
			$szexe = $exe->qry_one( " from tbl_{$config[ODR][1]}_stk as ctsk where gs_no = '{$rs[numid]}' order by numid asc " , " nm , qry " ) ;
			while ( $szrs = $exe->fetch($szexe)) {
				$n_qry += $szrs['qry'] ;
				$total_g_sumprice += $rs['g_price']*$szrs['qry'] ;
			}
			if ( $rs['tn_use'] == 'Y' ) {
				$tnlen = mb_strlen(str_replace( ' ' , '' , $rs['tn_text'] ) , 'EUC_KR' );
				$opt_price = $rs['teamtype'] == 'O' ? $tnlen * $rs['team_o_price'] : $rs['team_f_price'] ;
				$total_g_sumprice += $opt_price*$n_qry ;
				if ( $rs['tn_arch'] == 'Y' ) {
					$total_g_sumprice += $rs['team_arch'] * $n_qry ;
				}
			}
		}
		else if ( $rs['formtype'] == 'S' ) {
			$n_qry = 0 ;
			$szexe = $exe->qry_one( " from tbl_{$config[ODR][1]}_stk as ctsk where gs_no = '{$rs[numid]}' order by numid asc " , " nm , qry " ) ;
			while ( $szrs = $exe->fetch($szexe)) {
				$n_qry += $szrs['qry'] ;
				$total_g_sumprice += $rs['g_price']*$szrs['qry'] ;
			}
		}
		else if ( $rs['formtype'] == 'Q' ) {
			$total_g_sumprice += $rs['g_price']*$rs['totalqry'] ;
		}
		else if ( $rs['formtype'] == 'A' ) {
			$teamname = str_replace( ' ' , '' , $rs['Atype_tnm'] ) ;
			$team_price = 0 ;
			if ( !empty($teamname)) {
				for ( $i = 1 ; $i <= 5 ; $i++ ) {
					if ( substr( $rs['Atype_tpos'] , ($i-1) , 1 ) == 'Y' ) {
						$team_price +=  $rs['Atype_tpp' . $i] ;
					}
				}
			}
			// stocking
			$stocking_price = 0 ;
			$skrs = $exe->qry_fetch(" from tbl_{$config[ODR][1]}_stk where gs_no = '{$rs[numid]}' order by numid " , " nm , qry " ) ;
			if ( !empty($skrs['nm'])) {
				$stocking_price  = $rs['stocking_price'] ;
			}
			if ( $rs['Atype_nfonttype'] == 'C' || $rs['Atype_nfonttype'] == 'S' ) {
				$s_nf_pos1 = $rs['Atype_nfonttype'] == 'C' ?$rs['Atype_nfont1_c'] : $rs['Atype_nfont1_s'] ;
				$s_nf_pos2 = $rs['Atype_nfonttype'] == 'C' ?$rs['Atype_nfont2_c'] : $rs['Atype_nfont2_s'] ;
				$s_nf_pos3 = $rs['Atype_nfonttype'] == 'C' ?$rs['Atype_nfont3_c'] : $rs['Atype_nfont3_s'] ;
				$s_nf_initial = $rs['Atype_nfonttype'] == 'C' ?$rs['Atype_initial_c'] : $rs['Atype_initial_s'] ;
				$s_nf_arch = $rs['Atype_nfonttype'] == 'C' ?$rs['Atype_arch_c'] : $rs['Atype_arch_s'] ;
				$s_nf_arch = $rs['Atype_archtype'] == 'Y' ? $s_nf_arch : false ;  // ¼±ÅþÈÇßÀ¸¸é falt , ¾Æ´Ï¸é ±Ý¾×(0¿øµµ Æ÷ÇÔ)

				// ¹øÈ£, À̴ϼÈÀÌ ¸ðµÎ INPUT ŸÀÔÀ϶§
				// ¹øÈ£, ÀÌ´Ï¼È Áß 1°³ ÀÌ»ó ÀԷ½à ¹øÈ£,ÀÌ´Ï¼È ±Ý¾×Àº ¹«½Ã. ¾Æ·¡ ±Ý¾× Ãß°¡.
				$s_nf_initial = $rs['Atype_chartype2'] == 'A' ? $rs['Atype_charsprintprice_' . strtolower($rs['Atype_nfonttype'])] : $s_nf_initial ;
			} else {
				$s_nf_pos1 = 0 ;
				$s_nf_pos2 = 0 ;
				$s_nf_pos3 = 0 ;
				$s_nf_initial = 0 ;
				$s_nf_arch = false ;
			}
			// size
			$sexe = $exe->qry_one(" from tbl_{$config[ODR][1]}_size where gs_no = '{$rs[numid]}' order by numid " ,  " seq, tsize, armtype, initialnm, numb " ) ;
			$cnt = 0 ;
			$frm_sizeinfo_minSum = array() ;
			$numberinput_count = 0 ; // ±ÛÀÚ ¼ö
			$initialinput_count = 0 ; // ÀÔ·Â À¯/¹«
			while ( $srs = $exe->fetch($sexe)) {
				$psum = $rs['g_price']+$stocking_price+$team_price+$rs['arm_' . strtolower($srs['armtype']) . '_price'] ;
				$initial = str_replace( ' ' , '' , $srs['initialnm'] ) ;
				if ( $initial != '') {
					$psum += $s_nf_initial + $s_nf_arch ;
					$initialinput_count ++ ;
				}
				$numb = str_replace( ' ' , '' , $srs['numb'] ) ;
				if ( $numb != '' && strpos( $rs['Atype_np'] , 'Y' ) !== false ) {
					if ( $rs['Atype_chartype2'] == 'A' ) {
						if ( $initial == '' ) {
							$psum += $s_nf_initial ;
						} // À̴ϼÈÀÌ ÀÖÀ» ¶§´Â ÀÌ´Ï¼È ¶§ ±Ý¾× ¹× ¼ö·® üũ.
					} else {
						$nblen = mb_strlen($numb , 'EUC-KR') ;
						$psum += substr($rs['Atype_np'] , 0 , 1 ) == 'Y'  ? $s_nf_pos1 * $nblen: 0 ;
						$psum += substr($rs['Atype_np'] , 1 , 1 ) == 'Y'  ? $s_nf_pos2 * $nblen : 0 ;
						$psum += substr($rs['Atype_np'] , 2 , 1 ) == 'Y'  ? $s_nf_pos3 * $nblen : 0 ;
					}
					$numberinput_count += $nblen ;
				}
				$total_g_sumprice += $psum ;
				$cnt++ ;
				$frm_sizeinfo_minSum[] = array( 'sum1' => $psum ) ;
			}

			$free_count = intval($cnt/21) ;
			if ( $free_count > 0 ) {
				$frm_sizeinfo_minSum = array_msort($frm_sizeinfo_minSum, array('sum1'=>SORT_ASC));
				$free_price = 0 ;
				$fi = 0 ;
				foreach ( $frm_sizeinfo_minSum as $k=>$v) {
					$fi++ ;
					if ( $fi > $free_count ) break ;
					$free_price += $v['sum1'] ;
				}
				//$s_sumprice -=  $free_price ;
			}
		}
		$s_sumprice += $total_g_sumprice ;
		$freeprice_sum += $free_price ;
		$order_qry += $rs['totalqry'] ;

		$repeat .= str_foreach ( array(
			'qry'				=> $rs['totalqry'] ,
			'title'				=> $rs['title'] ,
			'price'				=> number_format($total_g_sumprice) , // $rs['g_price'] ,
			'sprice'			=> number_format($free_price*-1) ,
			'sum'				=> number_format( $total_g_sumprice - $free_price ) ,
			'class'				=> ( $icnt % 2 === 0 ?'td2' : '' )
		) , 'RS' , $skins['rep']) ;
	}

	$info['total_free'] = number_format($freeprice_sum*-1) ;
	$info['order_qry'] = number_format($order_qry) ;  // »óǰ´ç ÁÖ¹® ¼ö·® ÇÕ°è
	$info['sum_price'] = number_format($info['sum_price']) ;
	$info['send_price'] = number_format($info['send_price']) ;
	$info['order_point'] = number_format($info['order_point']) ;
	$info['result_price'] = number_format($info['result_price']) ;
	$info['pay_type'] = $define_shop['°áÁ¦¹æ¹ý'][$info['pay_type']] . ' ' . ( $info['pay_type'] == 'B' ? '[' . $info['bank_info'] . ']' : '' ) ;
	$info['pay_price'] = number_format($info['pay_price']) ;


	$info['repeat'] = $repeat ;

	$result = str_foreach( $info , 'INFO' , $skins['frm'] ) ;
?>

Copyright © 2017 || Recoded By Mr.Bumblebee