-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/z_send.bk.240724/php/
File Upload :
Current File : //var/www/html/z_send.bk.240724/php/skn.view.php

<?

	if ( empty($total['numid']))	script_re ( '/' , 'À߸øµÈ Á¢±ÙÀÔ´Ï´Ù.') ;

	$title_type['navi'] = '<b>ÁÖ¹®¼­º¸±â</b>' ;

	$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[] = " real_no = 0 " ;
		$s_query[] = " oname = '{$n_member_n}' " ;
		$s_query[] = " oemail = '{$n_member_e}' " ;
	}
	$s_query[] = " ( pay_type = 'B' or pay_type = 'D' or ( pay_type = 'E' and account is not null ) or ( pay_type = 'C' 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 , " * " ) ;
	if ( empty($info['numid'])) script_re( '/' , ' À¯È¿ÇÏÁö ¾ÊÀº Á¢±ÙÀÔ´Ï´Ù. ') ;
	$binfo = $info ;

	$skins = $skin->skin ( array (
											'frm' 		=> 'FORM' ,
											'mfrm'	=> 'M GOODS' , 	'mopt' => 'M OPTION DETAIL' ,		'msize' => 'M OPTION SIZE' ,
											'tfrm'		=> 'T GOODS' , 	'topt' => 'T OPTION DETAIL' ,
											'afrm'		=> 'A GOODS' , 	'aopt' => 'A OPTION DETAIL' ,		'asize' => 'A OPTION SIZE' ,
											'nfrm'		=> 'N GOODS'
									    ) , $skinfile ) ;


	$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 = '' ;

	$total['btn_popmessage'] = 'false' ;
	$total['cmnnb__t2'] = $total['cmnnb'] . ( empty($total['loginno']) ? '&emem=' . $n_member_e . '&nmem=' . $n_member_n : '' ) ;
	$total['btn_list'] = '<a href="' . $total['cmnall'] . ( empty($total['loginno']) ? '&emem=' . $n_member_e . '&nmem=' . $n_member_n : '' ) . '">' . $button['btn_list'] . '</a>' ;
	if ( $info['n_state'] == 'ÀԱݴë±â' && $info['pay_type'] == 'B' ) {
		$total['btn_popmessage'] = 'true' ;
		$total['btn_cancel'] = '<a href="' . $total['cmnall'] . ( empty($total['loginno']) ? '&emem=' . $n_member_e . '&nmem=' . $n_member_n : '' ) . '&numid=' . $total['numid'] . '&mode=cancel">' . $button['btn_order_cancel'] . '</a>' ;
	} else	$total['btn_cancel'] = '' ;

	while ( $rs = $exe->fetch($execute)) {
		$frm_detail = '' ;
		$frm_sizes = '' ;
		$total_g_sumprice = 0 ;
		$topprice = 0 ;
		$botprice = 0 ;
		if ( $rs['formtype'] == 'M' ) {
			if ( $rs['totalqry'] > 0 && $rs['g_price'] > 0 )  // ±âº»°¡°¡ ÀÖ´Ù¸é..
				$frm_detail.= str_foreach( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '±âº»ÆÇ¸Å°¡' ,
																	'qry'					=> $rs['totalqry'] ,
																	'price'				=> number_format($rs['g_price']) ,
																	'sum_price'		=> number_format($rs['g_price'] * $rs['totalqry']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
			if ( $rs['top_qry'] > 0 )
				$frm_detail.= str_foreach( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '»óÀÇ' ,
																	'qry'					=> $rs['top_qry'] ,
																	'price'				=> number_format($rs['topprice']) ,
																	'sum_price'		=> number_format($rs['topprice'] * $rs['top_qry']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
			if ( $rs['bot_qry'] > 0 )
				$frm_detail.= str_foreach( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> 'ÇÏÀÇ' ,
																	'qry'					=> $rs['bot_qry'] ,
																	'price'				=> number_format($rs['botprice']) ,
																	'sum_price'		=> number_format($rs['botprice'] * $rs['bot_qry']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
			if ( $rs['armL'] > 0 && $rs['arm_l_price'] > 0 )
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '¼Ò¸Å:±äÆÈ' ,
																	'qry'					=> $rs['armL'] ,
																	'price'				=> number_format($rs['arm_l_price']) ,
																	'sum_price'		=> number_format($rs['arm_l_price'] * $rs['armL']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
			if ( $rs['armS'] > 0 && $rs['arm_s_price'] > 0 )
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '¼Ò¸Å:¹ÝÆÈ' ,
																	'qry'					=> $rs['armS'] ,
																	'price'				=> number_format($rs['arm_s_price']) ,
																	'sum_price'		=> number_format($rs['arm_s_price'] * $rs['armS']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
			// »ç¿ëÀÚ ¼±ÅÃÁö
			$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' :
							$frm_detail.= str_foreach( array(
																	'title'				=> $position_seq_title[$prs['pos']] ,
																	'code'				=> $options_code_title[$prs['p_code']] ,
																	'qry'					=> ( intval($prs['pos']) < 13 ? $rs['top_qry'] : $rs['bot_qry']) ,
																	'price'				=> number_format($prs['p_price1']) ,
																	'sum_price'		=> number_format(( intval($prs['pos']) < 13 ? $rs['top_qry'] : $rs['bot_qry']) * $prs['p_price1']) ,
																	'etcmemo'			=> $prs['p_title']
							) , 'RS' , $skins['mopt'] ) ;
							if ( intval($prs['pos']) < 13 ) $topprice += $prs['p_price1'] ;
							else $botprice += $prs['p_price1'] ;
							break ;
						case 'n' :
							$frm_detail.= str_foreach( array(
																	'title'				=> $position_seq_title[$prs['pos']] ,
																	'code'				=> $options_code_title[$prs['p_code']] ,
																	'qry'					=> '' ,
																	'price'				=> '' ,
																	'sum_price'		=> '' ,
																	'etcmemo'			=> $prs['p_title']
							) , 'RS' , $skins['mopt'] ) ;
							$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
							$frm_detail.= str_foreach( array(
																	'title'				=> $position_seq_title[$prs['pos']] ,
																	'code'				=> $options_code_title[$prs['p_code']] . ($prs['p_arch'] == 'Y' ? '(¾ÆÄ¡Çü)' : '' ) ,
																	'qry'					=> ( intval($prs['pos']) < 13 ? $rs['top_qry'] : $rs['bot_qry']) ,
																	'price'				=> number_format($opt_price) ,
																	'sum_price'		=> number_format(( intval($prs['pos']) < 13 ? $rs['top_qry'] : $rs['bot_qry']) * $opt_price) ,
																	'etcmemo'			=> $prs['p_tn']
							) , 'RS' , $skins['mopt'] ) ;
							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' ;
							$frm_detail.= str_foreach( array(
																	'title'				=> $position_seq_title[$prs['pos']] ,
																	'code'				=> $options_code_title[$prs['p_code']] . ($prs['p_arch'] == 'Y' ? '(¾ÆÄ¡Çü)' : '' ) ,
																	'qry'					=> '' ,
																	'price'				=> '' ,
																	'sum_price'		=> '' ,
																	'etcmemo'			=> ''
							) , 'RS' , $skins['mopt'] ) ;
							break ;
					}
				} else if ( $prs['o_code'] == 'i' ) {
					$use_initial[$prs['pos']] = $prs['p_arch'] == 'Y' ? 'Y' : 'N' ;
					$frm_detail.= str_foreach( array(
															'title'				=> $position_seq_title[$prs['pos']] ,
															'code'				=> $options_code_title[$prs['p_code']] . ($prs['p_arch'] == 'Y' ? '(¾ÆÄ¡Çü)' : '' ) ,
															'qry'					=> '' ,
															'price'				=> '' ,
															'sum_price'		=> '' ,
															'etcmemo'			=> ''
					) , 'RS' , $skins['mopt'] ) ;
				} 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)) {
				$frm_detail.= str_foreach( array(
																	'title'				=> '½ºÅ¸Å·' ,
																	'code'				=> $skrs['nm'] ,
																	'qry'					=> $skrs['qry'] ,
																	'price'				=> number_format($rs['stocking_price']) ,
																	'sum_price'		=> number_format($rs['stocking_price'] * $skrs['qry']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['mopt']) ;
				$stocking_p += $rs['stocking_price'] * $skrs['qry'] ;
			}

			// »çÀÌÁî
			$sexe = $exe->qry_one(" from tbl_{$config[ODR][1]}_size where gs_no = '{$rs[numid]}' order by seq , 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 ($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 ;
				$s_sumprice += $psum ;
				$frm_sizes.= str_foreach( array(
					'tsize'				=> ( empty($srs['tsize']) ? '' : $options_sizename_atype[$srs['tsize']]) ,
					'bsize'				=> ( empty($srs['bsize']) ? '' : $options_sizename_atype[$srs['bsize']]) ,
					'armtype'			=> ( empty($srs['tsize']) ? '' : $top_armtype_tit[$srs['armtype']]) ,
					'initial'				=> $srs['initialnm'] ,
					'numb'				=> $srs['numb'] ,
					'numbp1'			=> ( $srs['npos1'] == 'Y' ? number_format($numbp1) : '' ) ,
					'numbp2'			=> ( $srs['npos2'] == 'Y' ? number_format($numbp2) : '' ) ,
					'numbp3'			=> ( $srs['npos3'] == 'Y' ? number_format($numbp3) : '' ) ,
					'numb_p'			=> ( $numbsum > 0 ? number_format($numbsum) : '' ) ,
					'initial_p'			=> ( $initial_p > 0 ? number_format($initial_p) : '' ) ,
					'sum1'				=> number_format($psum) ,
					'sum2'				=> number_format($s_sumprice)
				) , 'RS' , $skins['msize'] ) ;
			}
			$s_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)) {
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> $szrs['nm'] ,
																	'qry'					=> $szrs['qry'] ,
																	'price'				=> number_format($rs['g_price'])  ,
																	'sum_price'		=> number_format($rs['g_price']*$szrs['qry']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['topt']) ;
				$n_qry += $szrs['qry'] ;
				$s_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'] ;
				$frm_detail.= str_foreach ( array(
																	'title'				=> '¿É¼Ç' ,
																	'code'				=> 'ÆÀ¸í' ,
																	'qry'					=> $n_qry ,
																	'price'				=> number_format($opt_price)  ,
																	'sum_price'		=> number_format($opt_price*$n_qry) ,
																	'etcmemo'			=> $rs['tn_text']
															   ) , 'RS' , $skins['topt']) ;
				$s_sumprice += $opt_price*$n_qry ;
				if ( $rs['tn_arch'] == 'Y' ) {
					$frm_detail.= str_foreach ( array(
																		'title'				=> '¿É¼Ç' ,
																		'code'				=> '¾ÆÄ¡Çü' ,
																		'qry'					=> $n_qry ,
																		'price'				=> number_format($rs['team_arch'])  ,
																		'sum_price'		=> number_format($rs['team_arch']*$n_qry) ,
																		'etcmemo'			=> ''
																   ) , 'RS' , $skins['topt']) ;
					$s_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)) {
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> $szrs['nm'] ,
																	'qry'					=> $szrs['qry'] ,
																	'price'				=> number_format($rs['g_price'])  ,
																	'sum_price'		=> number_format($rs['g_price']*$szrs['qry']) ,
																	'etcmemo'			=> $rs['cr_opt']
															   ) , 'RS' , $skins['topt']) ;
				$n_qry += $szrs['qry'] ;
				$s_sumprice += $rs['g_price']*$szrs['qry'] ;
			}
		}
		else if ( $rs['formtype'] == 'Q' ) {
			$frm_detail.= str_foreach ( array(
																'title'				=> '»óǰ' ,
																'code'				=> $rs['cr_opt'] ,
																'qry'					=> $rs['totalqry'] ,
																'price'				=> number_format($rs['g_price'])  ,
																'sum_price'		=> number_format($rs['g_price']*$rs['totalqry']) ,
																'etcmemo'			=> ''
														   ) , 'RS' , $skins['topt']) ;
			$s_sumprice += $rs['g_price']*$rs['totalqry'] ;
		}
		else if ( $rs['formtype'] == 'A' ) {
			$frm_detail.= str_foreach ( array(
																'title'				=> '»óǰ' ,
																'code'				=> '±âº»ÆÇ¸Å°¡' ,
																'qry'				=> $rs['totalqry'] ,
																'price'				=> number_format($rs['g_price']) ,
																'sum_price'	=> number_format($rs['g_price'] * $rs['totalqry']) ,
																'etcmemo'	=> ''
														   ) , 'RS' , $skins['aopt']) ;
			if ( $rs['armL'] > 0 && $rs['arm_l_price'] > 0 )
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '¼Ò¸Å:±äÆÈ' ,
																	'qry'					=> $rs['armL'] ,
																	'price'				=> number_format($rs['arm_l_price']) ,
																	'sum_price'		=> number_format($rs['arm_l_price'] * $rs['armL']) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['aopt']) ;
			if ( $rs['armS'] > 0 && $rs['arm_s_price'] > 0 )
				$frm_detail.= str_foreach ( array(
																	'title'				=> '»óǰ' ,
																	'code'				=> '¼Ò¸Å:¹ÝÆÈ' ,
																	'qry'				=> $rs['armS'] ,
																	'price'				=> number_format($rs['arm_s_price']) ,
																	'sum_price'	=> number_format($rs['arm_s_price'] * $rs['armS']) ,
																	'etcmemo'	=> ''
															   ) , 'RS' , $skins['aopt']) ;
			$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] ;
						$frm_detail.= str_foreach ( array(
																			'title'				=> 'ÆÀ¸í' ,
																			'code'				=> $rs['Atype_tnm'] ,
																			'qry'				=> $rs['totalqry'],
																			'price'				=> number_format($rs['Atype_tpp' . $i]) ,
																			'sum_price'	=> number_format($rs['Atype_tpp' . $i]*$rs['totalqry']) ,
																			'etcmemo'	=> $shop_Atype_tposn[$i]
																	   ) , 'RS' , $skins['aopt']) ;
					}
				}
			}
			// 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'] ;
				$frm_detail.= str_foreach ( array(
																	'title'				=> '½ºÅ¸Å·' ,
																	'code'				=> $skrs['nm'],
																	'qry'				=> intval($rs['totalqry']) ,
																	'price'				=> number_format($stocking_price) ,
																	'sum_price'		=> number_format($stocking_price*intval($rs['totalqry'])) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['aopt']) ;
			}
			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 seq , numid " ,
												  " seq, tsize, bsize, armtype, initialnm, numb , npos1 , npos2 , npos3 " ) ;
			$cnt = 0 ;
			$frm_sizeinfo_minSum = array() ;
			$numberinput_count = array( 0 , 0 , 0 ) ; // ±ÛÀÚ ¼ö
			$initialinput_count = 0 ; // ÀÔ·Â À¯/¹«
			$numberinitialinput_count = 0 ;
			$botcount = 0 ;
			while ( $srs = $exe->fetch($sexe)) {
				$psum = $rs['g_price']+$stocking_price+$team_price+$rs['arm_' . strtolower($srs['armtype']) . '_price'] ;
				$psum += $srs['bsize'] > 0 ? $rs['Atype_orderbotprice'] : 0 ;
				$botcount += $srs['bsize'] > 0 ? 1 : 0 ;
				$initial = str_replace( ' ' , '' , $srs['initialnm'] ) ;
				$initial_p = 0 ;
				if ( $initial != '') {
					$initial_p = ( $s_nf_initial * ( $rs['Atype_inchartype'] == 'INPUT' ? 1 : mb_strlen($initial , 'EUC-KR') )) + $s_nf_arch ;
					$psum += $initial_p ;
					$initialinput_count += $rs['Atype_inchartype'] == 'INPUT' ? 1 : mb_strlen($initial , 'EUC-KR') ;

					$numberinitialinput_count += $rs['Atype_chartype2'] == 'A' ? 1 : 0 ;
				}
				$numbp1 = 0 ;
				$numbp2 = 0 ;
				$numbp3 = 0 ;
				$numb_p = 0 ;
				$numb = str_replace( ' ' , '' , $srs['numb'] ) ;
				if ( $numb != '' ) {
					$nblen = mb_strlen($numb , 'EUC-KR') ;
					if ( $srs['npos1'] != 'Y' && $srs['npos1'] != 'N' ) {
						$srs['npos1'] = substr($rs['Atype_np'],0,1) == 'Y' ? 'Y' : 'N' ;
						$srs['npos2'] = substr($rs['Atype_np'],1,1) == 'Y' ? 'Y' : 'N' ;
						$srs['npos3'] = substr($rs['Atype_np'],2,1) == 'Y' ? 'Y' : 'N' ;
					}

					if ( $rs['Atype_chartype2'] == 'A' ) {
						if ( $initial == '' ) {
							$numberinitialinput_count += $rs['Atype_chartype2'] == 'A' ? 1 : 0 ;
							$initial_p = $s_nf_initial ;
							$psum += $s_nf_initial ;
						} // À̴ϼÈÀÌ ÀÖÀ» ¶§´Â ÀÌ´Ï¼È ¶§ ±Ý¾× ¹× ¼ö·® üũ.
					} else {
						$numbp1 += $srs['npos1'] == 'Y'  ? $s_nf_pos1 * ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
						$numbp2 += $srs['npos2'] == 'Y'  ? $s_nf_pos2 * ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
						$numbp3 += $srs['npos3'] == 'Y'  ? $s_nf_pos3 * ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
						$numb_p = $numbp1+ $numbp2 + $numbp3 ;
						$psum += $numb_p ;
					}
					$numberinput_count[0] += $srs['npos1'] == 'Y'  ? ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
					$numberinput_count[1] += $srs['npos2'] == 'Y'  ? ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
					$numberinput_count[2] += $srs['npos3'] == 'Y'  ? ( $rs['Atype_nochartype'] == 'INPUT' ? 1 : $nblen ) : 0 ;
				}
				$s_sumprice += $psum ;
				$frm_sizes .= str_foreach( array(
															 	'tsize'				=> $options_sizename[$srs['tsize']] ,
															 	'bsize'				=> $options_sizename[$srs['bsize']] ,
															 	'armtype'		=> $top_armtype_tit[$srs['armtype']] ,
															 	'initial'			=> $srs['initialnm'] ,
															 	'numb'			=> $srs['numb'] ,
																'numbp1'			=> $rs['Atype_chartype2'] == 'A' ? ( $srs['npos1'] == 'Y' ? '¼±ÅÃ' : '-' ) : ( empty($numbp1) ? '' : number_format($numbp1) ) ,
																'numbp2'			=> $rs['Atype_chartype2'] == 'A' ? ( $srs['npos2'] == 'Y' ? '¼±ÅÃ' : '-' ) : ( empty($numbp2) ? '' : number_format($numbp2) ) ,
																'numbp3'			=> $rs['Atype_chartype2'] == 'A' ? ( $srs['npos3'] == 'Y' ? '¼±ÅÃ' : '-' ) : ( empty($numbp3) ? '' : number_format($numbp3) ) ,
																'numb_p'			=> $rs['Atype_chartype2'] == 'A' ? '-' : ( empty($numb_p) ? '' : number_format($numb_p) ) ,
																'initial_p'			=> empty($initial_p) ? '' : number_format($initial_p)  ,
															 	'sum1'			=> number_format( $psum ) ,
															 	'sum2'			=> number_format( $s_sumprice ) ,
															 ) , 'RS' , $skins['asize']) ;
				$cnt++ ;
				$frm_sizeinfo_minSum[] = array( 'sum1' => $psum ) ;
			}

			if ( $botcount > 0  )
				$frm_detail .= str_foreach( array(
					'title'				=> 'ÇÏÀǿɼÇ' ,
					'code'				=> ( $rs['Atype_orderbottype'] == 'Y' ? '±¸¸Å' : ( $rs['Atype_orderbottype'] == 'N' ? 'ºñ±¸¸Å' : '¼±ÅþøÀ½' )) ,
					'qry'				=> $botcount ,
					'price'				=> number_format($rs['Atype_orderbotprice']) ,
					'sum_price'	=> number_format($rs['Atype_orderbotprice']*$botcount) ,
					'etcmemo'		=> $rs['Atype_orderbotoption']
				) , 'RS' , $skins['aopt'] ) ;

			if ( $numberinput_count[0] > 0 )
				$frm_detail .= str_foreach( array(
					'title'				=> '¹øÈ£À§Ä¡' ,
					'code'				=> '¾Õ¹øÈ£' ,
					'qry'				=> $numberinput_count[0] ,
					'price'				=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos1) ,
					'sum_price'	=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos1*$numberinput_count[0]) ,
					'etcmemo'		=> ''
				) , 'RS' , $skins['aopt'] ) ;
			if ( $numberinput_count[1] > 0 )
				$frm_detail .= str_foreach( array(
					'title'				=> '¹øÈ£À§Ä¡' ,
					'code'				=> 'µî¹øÈ£' ,
					'qry'				=> $numberinput_count[1] ,
					'price'				=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos2) ,
					'sum_price'	=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos2*$numberinput_count[1]) ,
					'etcmemo'		=> ''
				) , 'RS' , $skins['aopt'] ) ;
			if ( $numberinput_count[2] > 0 )
				$frm_detail .= str_foreach( array(
					'title'				=> '¹øÈ£À§Ä¡' ,
					'code'				=> '¹ÙÁö¹øÈ£' ,
					'qry'				=> $numberinput_count[2] ,
					'price'				=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos3) ,
					'sum_price'	=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_pos3*$numberinput_count[2]) ,
					'etcmemo'		=> ''
				) , 'RS' , $skins['aopt'] ) ;
			if ( $initialinput_count > 0 )
				$frm_detail .= str_foreach( array(
					'title'				=> '¿É¼Ç' ,
					'code'				=> 'À̴ϼÈ' ,
					'qry'				=> $initialinput_count ,
					'price'				=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format($s_nf_initial + $s_nf_arch) ,
					'sum_price'	=> $rs['Atype_chartype2'] == 'A' ? '-' : number_format(($s_nf_initial + $s_nf_arch)*$initialinput_count) ,
					'etcmemo'		=> ( $s_nf_arch !== false ? '¾ÆÄ¡Çü (' . number_format($s_nf_arch) . '¿ø)' : '' )
				) , 'RS' , $skins['aopt'] ) ;
			if ( $rs['Atype_chartype2'] == 'A' && $numberinitialinput_count > 0  )
				$frm_detail .= str_foreach( array(
					'title'				=> '¿É¼ÇÇÕ°è' ,
					'code'				=> '¹øÈ£, À̴ϼÈ' ,
					'qry'				=> $numberinitialinput_count ,
					'price'				=> number_format($s_nf_initial) ,
					'sum_price'	=> number_format(($s_nf_initial*$numberinitialinput_count)+($s_nf_arch*$initialinput_count)) ,
					'etcmemo'		=> ( $rs['Atype_nfonttype'] == 'C' ? 'ÀϹݼ­Ã¼' : 'Ư¼ö¼­Ã¼' ) . ( $s_nf_arch !== false ? '¾ÆÄ¡Çü (' . number_format($s_nf_arch) . '¿ø)' : '' )
				) , 'RS' , $skins['aopt'] ) ;

			$free_count = intval($cnt/1000) ;
			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 ;
				$frm_detail.= str_foreach ( array(
																	'title'				=> '¼­ºñ½º' ,
																	'code'				=> '¹«·áÀ̺¥Æ®',
																	'qry'				=> intval($free_count) ,
																	'price'				=> '' ,
																	'sum_price'		=> number_format($free_price) ,
																	'etcmemo'		=> ''
															   ) , 'RS' , $skins['aopt']) ;
			}
		}
		$file_contents = '' ;
		for ( $i = 1 ; $i <= 4 ; $i++ ) {
			$file_contents .= ( !empty($rs['file' . $i]) ? '<div><img src="/img/board_icon/disket.gif" align="absmiddle"> <a href="?mode=down&numid=' . $total['numid'] . '&gn=' . $rs['numid'] . '&seq=' . $i . '">´Ù¿î·Îµå : ' . $rs['file' . $i] . '</a></div>' : '' ) ;
		}
		$frm_goods.= str_foreach ( array(
			'title'					=> $rs['title'] ,
			'frm_detail'			=> $frm_detail ,
			'file'						=> $file_contents ,
			'Atype_memo'	=> str_mode( $rs['Atype_memo'] , 'TEXT' ) ,
			'contents'				=> str_mode( $rs['contents'] , 'TEXT' ) ,
			'MAtype_hopedate'		=> $rs['MAtype_hopedate'] ,
			'MAtype_eventdate'		=> $rs['MAtype_eventdate'] ,
			'MAtype_payintype'		=> ( $rs['MAtype_payintype'] == 'A' ? '¼±ºÒ' : ( $rs['MAtype_payintype'] == 'B' ? 'ÈÄºÒ <div style="margin-top:5px;">
					<table style="border-top:1px solid #999;">
						<tr>
							<th style="width:15%;background-color:#999">ÀԱݿ¹Á¤ÀÏ</th><td style="width:15%">' . $rs['MAtype_payindate'] . '</td>
							<th style="width:15%;background-color:#999">ÁÖ¹®ÀÚ ¿¬¶ôó</th><td style="width:15%">' . $rs['hoooption_hp'] . '</td>
							<th style="width:15%;background-color:#999">Çгâ/¹Ý</th><td style="width:15%">' . $rs['hoooption_schooly'] . 'Çгâ ' . $rs['hoooption_classname'] . '¹Ý</td>
						</tr>
						<tr>
							<th style="background-color:#999">Çб³¸í</th><td>' . $rs['hoooption_schoolname'] . '</td>
							<th style="background-color:#999">´ãÀÓ¼±»ý´Ô ¼ºÇÔ</th><td>' . $rs['hoooption_teachername'] . '</td>
							<th style="background-color:#999">´ãÀÓ¼±»ý´Ô ¿¬¶ôó</th><td>' . $rs['hoooption_teacherhp'] . '</td>
						</tr>
					</table>
				</div>' : '' )) ,
			'MAtype_gifttext'		=> ( !empty($rs['MAtype_giftno']) ? '<tr><th class="t">»çÀºÇ°</th><td class="c" colspan="5" align="left">' . nl2br($rs['MAtype_gifttext']) . '</td></tr>' : '' ) ,
			'frm_sizes'			=> $frm_sizes ,
			'total_g_sumprice'	=> number_format($s_sumprice)
		) , 'RS' , ( $rs['formtype'] == 'M' ? $skins['mfrm'] : ( $rs['formtype'] == 'A' ? $skins['afrm'] : $skins['tfrm'] ) )) ;

		$order_qry += $rs['totalqry'] ;
	}

	$info['frm_point'] = '' ;
	if ( $info['use_point'] == 'Y' ) {
		$info['frm_point'] .= '
				<tr>
				  <td class="contentstyle" height="25" >»ç¿ëÆ÷ÀÎÆ® : </td><td align="right" class="contentstyle" > ' . number_format($info['point_price']*-1) . '¿ø</td>
				</tr>
		' ;
	}

	$info['btn_cardcp'] = 'none' ;
	if ( !empty($info['tno']) && $info['pay_type'] == 'C' ) $info['btn_cardcp'] = '' ;

	$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_type'] == 'E' && $info['n_state'] == 'ÀԱݴë±â' ? '<br />' . $info['bankname'] . ' ' . $info['account'] . ' (¿¹±ÝÁÖ ' . $info['depositor'] . ')' : '' ) ) ;
	$info['pay_price'] = number_format($info['pay_price']) ;

	$info['frm_goods'] = $frm_goods ;

	$info['link-estimate-1'] = mk_estimate_viewlink( 1 ,'order' , $info['orderScode'] ,$info['numid'] ) ;
	$info['link-estimate-2'] = mk_estimate_viewlink( 2 ,'order' , $info['orderScode'] ,$info['numid'] ) ;

	$total['btn-estimate-3'] = '' ;
	if ( $binfo['pay_type'] == 'B' && in_array( $binfo['n_state'] , array( 'ÀԱݿϷá' , '»óǰÁغñÁß' , '¹è¼Û´ë±â' , '¹è¼ÛÁß' , '¹è¼Û¿Ï·á' )) !== false ) {
		$total['btn-estimate-3'] = '<input type="button" class="buttonM btn_blue" value="ÀÔ±ÝÇ¥  ¿¢¼¿ ´Ù¿î·Îµå" onclick=" location.href = \'' . mk_estimate_viewlink( 3 ,'user' , $info['orderScode'] ,$info['numid'] ) . '&type=excel\' ; "/>' ;
	}
	if ( $binfo['pay_type'] == 'D' ) {
		$info['pay_type-d-form'] = '<tr><th>&nbsp;</th><td class="style1"><table>
									<colgroup>
										<col width="10%"></col>
										<col width="30%"></col>
										<col width="45%"></col>
										<col width="15%"></col>
									</colgroup>' ;
			if ( $binfo['pay_d_type'] == '1' ) {
				$info['pay_type-d-form'] .= '<tr><td>1</td><td> Ä«µå</td><td>' . number_Format( $binfo['pay_d_p1'] ) . '¿ø</td><td><a class="buttonM btn_blue" href="/product/?mode=detailView&numid=' . $binfo['pay_d_item1'] . '" target="_blank" style="width: 80px;">°³ÀΰáÁ¦Ã¢</a></td></tr>'  ;
				$info['pay_type-d-form'] .= '<tr><td>2</td><td> Ä«µå</td><td>' . number_Format( $binfo['pay_d_p2'] ) . '¿ø</td><td><a class="buttonM btn_blue" href="/product/?mode=detailView&numid=' . $binfo['pay_d_item2'] . '" target="_blank" style="width: 80px;">°³ÀΰáÁ¦Ã¢</a></td></tr>'  ;
			} else if ( $binfo['pay_d_type'] == '2' ) {
				$info['pay_type-d-form'] .= '<tr><td>1</td><td> Ä«µå</td><td>' . number_Format( $binfo['pay_d_p1'] ) . '¿ø</td><td><a class="buttonM btn_blue" href="/product/?mode=detailView&numid=' . $binfo['pay_d_item1'] . '" style="width: 80px;">°³ÀΰáÁ¦Ã¢</a></td></tr>'  ;
				$info['pay_type-d-form'] .= '<tr><td>2</td><td> Çö±Ý</td><td>' . number_Format( $binfo['pay_d_p2'] ) . '¿ø</td><td>&nbsp;</td></tr>'  ;
			} else if ( $binfo['pay_d_type'] == '3' ) {
				$info['pay_type-d-form'] .= '<tr><td>1</td><td> Çö±Ý</td><td>' . number_Format( $binfo['pay_d_p1'] ) . '¿ø</td><td>&nbsp;</td></tr>'  ;
				$info['pay_type-d-form'] .= '<tr><td>2</td><td> Çö±Ý</td><td>' . number_Format( $binfo['pay_d_p2'] ) . '¿ø</td><td>&nbsp;</td></tr>'  ;
			}
		$info['pay_type-d-form'] .= '</table></td></tr>' ;
	}

	// Çö±Ý¿µ¼öÁõ ºÒ·¯¿À±â
	$info['btn_cashcp'] = 'none' ;
	$cash_info = $exe->qry_fetch(" from tbl_{$config[CS1][1]} where ordr_no = '{$binfo[numid]}' " , " numid , cash_no , ordr_idxx , amt_tot " );
	if ( !empty($cash_info['numid']) && !empty($cash_info['cash_no'])) {
		$info['btn_cashcp'] = '' ;
		$info['cash-no'] = $cash_info['cash_no'] ;
		$info['cash-code'] = $cash_info['ordr_idxx'] ;
		$info['cash-price'] = $cash_info['amt_tot'] ;
		//$info['cash-no'] = '23746114479068' ;			// ÃÖÇý½Â
		//$info['cash-code'] = '202304261682480685' ;
		//$info['cash-price'] = '493500' ;
	}

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

Copyright © 2017 || Recoded By Mr.Bumblebee