-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/zbk_admin.220809/php/goods/
File Upload :
Current File : /var/www/html/zbk_admin.220809/php/goods/act.insert.php

<?
// check
if ( empty($_POST['title'])) script_re ( $total['cmnall'] . '&mode=write' , ' »óǰ¸íÀÌ µî·ÏµÇÁö ¾Ê¾Ò½À´Ï´Ù. ') ;

$salestate = $_POST['salestate'] ;
if (!( $salestate == '1' || $salestate == '2' || $salestate == '3' || $salestate == '4' || $salestate == '5' )) $salestate = '1' ;

// common
$action = array(
	'keycode'			=> $total['code'] ,
	'write_date'		=> $total['now'] ,
	'ip'						=> $total['ip'] ,
	'title'					=> str_convert($_POST['title']) ,
	'g_normalp'		=> ( is_numeric($_POST['g_normalp'])? intval($_POST['g_normalp']) : 0 ) ,
	'g_price'				=> ( is_numeric($_POST['g_price']) && $_POST['formtype'] != 'M'  ? intval($_POST['g_price']) : 0 ) ,
	'g_brand'			=> $exe->qry_fetch(" from tbl_{$total[table]}_brand where numid = '{$_POST[g_brand]}' " , " numid" , "numid" ) ,
	'g_maker'			=> str_convert($_POST['g_maker']) ,
	'g_matter'			=> str_convert($_POST['g_matter']) ,
	'g_origin'			=> str_convert($_POST['g_origin']) ,
	'g_point'				=> ( $_POST['g_point'] != 'Y' ? 'N' : 'Y' ) ,
	'sendinfo'			=> ( $_POST['sendinfo'] != 'Y' ? 'N' : 'Y' ) ,
	'sizeinfo'				=> ( $_POST['sizeinfo'] != 'Y' ? 'N' : 'Y' ) ,
	'searchkeyword'=> $_POST['searchkeyword'] ,
	'mainview'			=> implode(',' , $_POST['mainview']) ,
	'selecticons'		=> implode(',' , $_POST['selecticons']) ,
	'salestate'			=> $salestate ,
	'openstate'			=> ( $_POST['openstate'] != 'Y' ? 'N' : 'Y' ) ,
	'soldoutinfo'		=> str_convert($_POST['soldoutinfo']) ,
	#'imglist'
	#'imgdetail'
	'g_memo'			=> str_convert($_POST['g_memo']) ,
	'contents'			=> str_convert($_POST['contents']) ,
	#'attachfile'
	'seq'					=> ( is_numeric($_POST['seq']) ? intval($_POST['seq']) : 0 ) ,
	'min_qry'			=> ( is_numeric($_POST['min_qry']) ? intval($_POST['min_qry']) : 0 )
) ;

$formtype = $_POST['formtype'] ;
switch ($formtype) {
	case 'A' :
		$stocking_sale = $_POST['A_stocking_sale'] ;
		if (!( $stocking_sale == 'Y' || $stocking_sale == 'N' )) $stocking_sale = 'N' ;
		$opt_action = array(
			'Atype_botaddprice'	=> intval($_POST['A_botaddprice']) ,		// ÇÏÀÇ Ãß°¡±Ý¾×
			'selectsizes'		=> implode(',' , $_POST['A_size']) ,
			'arm_l_check' 	=> ( $_POST['A_armL'] == 'Y' ? 'Y' : 'N' ) ,
			'arm_l_price' 		=> ( is_numeric($_POST['A_armLp']) ? intval($_POST['A_armLp']) : 0 ) ,
			'arm_s_check'	=> ( $_POST['A_armS'] == 'Y' ? 'Y' : 'N' ) ,
			'arm_s_price'		=> ( is_numeric($_POST['A_armSp']) ? intval($_POST['A_armSp']) : 0 ) ,
			'stocking_sale'	=> $stocking_sale ,
			'stocking_price'	=> ( is_numeric($_POST['A_stocking_price']) && $stocking_sale == 'Y' ? intval($_POST['A_stocking_price']) : 0 ) ,
			'stocking_options'	=> ( $stocking_sale == 'Y' ? str_convert($_POST['A_stocking_options']) : '' ) ,
			'attach_nfontfile'	=> file_upload( $_FILES['A_attachnfont']['tmp_name'] , $_FILES['A_attachnfont']['name'] , 'files/' . $total['options']['Anfont_dir'] ) ,
			'printposset1'		=> ( $_POST['A_printposset1'] == 'Y' ? 'Y' : 'N' ) ,
			'printposset2'		=> ( $_POST['A_printposset2'] == 'Y' ? 'Y' : 'N' ) ,
			'printposset3'		=> ( $_POST['A_printposset3'] == 'Y' ? 'Y' : 'N' ) ,
			// ADD 14.03 -> modify column name and add column
			'nfont1_c'		=> ( is_numeric($_POST['A_numberfontprice1_c']) ? intval($_POST['A_numberfontprice1_c']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(¾Õ) ±Ý¾×
			'nfont2_c'		=> ( is_numeric($_POST['A_numberfontprice2_c']) ? intval($_POST['A_numberfontprice2_c']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(µî) ±Ý¾×
			'nfont3_c'		=> ( is_numeric($_POST['A_numberfontprice3_c']) ? intval($_POST['A_numberfontprice3_c']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(¹ÙÁö) ±Ý¾×
			'initial_c'		=> ( is_numeric($_POST['A_initialprice_c']) ? intval($_POST['A_initialprice_c']) : 0 ) ,  									// À̴ϼÈ/À̸§ ±Ý¾×
			'arch_c'			=> ( is_numeric($_POST['A_archprice_c']) ? intval($_POST['A_archprice_c']) : 0 ) ,  									// ¾ÆÄ¡
			'attach_nfont2file'	=> file_upload( $_FILES['A_attachnfont2']['tmp_name'] , $_FILES['A_attachnfont2']['name'] , 'files/' . $total['options']['Anfont_dir'] ) ,
			'nfont1_s'		=> ( is_numeric($_POST['A_numberfontprice1_s']) ? intval($_POST['A_numberfontprice1_s']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(¾Õ) ±Ý¾×
			'nfont2_s'		=> ( is_numeric($_POST['A_numberfontprice2_s']) ? intval($_POST['A_numberfontprice2_s']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(µî) ±Ý¾×
			'nfont3_s'		=> ( is_numeric($_POST['A_numberfontprice3_s']) ? intval($_POST['A_numberfontprice3_s']) : 0 ) ,  		// ¹øÈ£¼­Ã¼(¹ÙÁö) ±Ý¾×
			'initial_s'		=> ( is_numeric($_POST['A_initialprice_s']) ? intval($_POST['A_initialprice_s']) : 0 ) ,  									// À̴ϼÈ/À̸§ ±Ý¾×
			'arch_s'			=> ( is_numeric($_POST['A_archprice_s']) ? intval($_POST['A_archprice_s']) : 0 ) ,  									// ¾ÆÄ¡
			// ADD 17.06
			'Atype_charptype'	=> ( $_POST['A_charptype'] == 'INPUT' ? 'INPUT' : 'CHAR' ) ,
			'Atype_charitype'	=> ( $_POST['A_charitype'] == 'INPUT' ? 'INPUT' : 'CHAR' ) ,
			// ADD 19.03
			'Atype_botorderset'	=> $_POST['A_botorderset'] == 'Y' ? 'Y' : 'N' ,
			'Atype_botsetoptions'	=> str_convert($_POST['A_botsetoptions'] ) ,
			'useservicetype'	=> $_POST['A_useservicetype'] == 'Y' ? 'Y' : 'N',
			// ADD 19.06
			'charsprintprice_c'		=> is_numeric($_POST['A_charsprintprice_c']) ? intval($_POST['A_charsprintprice_c']) : 0 ,
			'charsprintprice_s'		=> is_numeric($_POST['A_charsprintprice_s']) ? intval($_POST['A_charsprintprice_s']) : 0 ,
			// ADD 20.09
			'charsprintptype_c'		=> $_POST['A_charsprintptype_c'] == 'Y' ? 'Y' : 'N' ,
			'charsprintptype_s'		=> $_POST['A_charsprintptype_s'] == 'Y' ? 'Y' : 'N' ,
		) ;
		break ;
	case 'M' :
		$stocking_sale = $_POST['M_stocking_sale'] ;
		if (!( $stocking_sale == 'Y' || $stocking_sale == 'N' || $stocking_sale == 'C' )) $stocking_sale = 'N' ;
		$opt_action = array(
			'topstate'			=> ( $_POST['M_topstate'] == 'Y' ? 'Y' : 'N' ) ,
			'topprice'			=> ( is_numeric($_POST['M_topprice']) ? intval($_POST['M_topprice']) : 0 ) ,
			'botstate'			=> ( $_POST['M_botstate'] == 'Y' ? 'Y' : 'N' ) ,
			'botprice'			=> ( is_numeric($_POST['M_botprice']) ? intval($_POST['M_botprice']) : 0 ) ,
			'selectsizes'		=> implode(',' , $_POST['M_size']) ,
			'arm_l_check' 	=> ( $_POST['M_armL'] == 'Y' ? 'Y' : 'N' ) ,
			'arm_l_price' 		=> ( is_numeric($_POST['M_armLp']) ? intval($_POST['M_armLp']) : 0 ) ,
			'arm_s_check'	=> ( $_POST['M_armS'] == 'Y' ? 'Y' : 'N' ) ,
			'arm_s_price'		=> ( is_numeric($_POST['M_armSp']) ? intval($_POST['M_armSp']) : 0 ) ,
			'teamtype'			=> ( $_POST['M_tntype'] == 'O' ? 'O' : 'F' ) , // O : ÀÚ´ç , F : °íÁ¤
			'team_o_price'	=> ( is_numeric($_POST['M_tntypeOprice']) ? intval($_POST['M_tntypeOprice']) : 0 ) ,
			'team_f_price'	=> ( is_numeric($_POST['M_tntypeFprice']) ? intval($_POST['M_tntypeFprice']) : 0 ) ,
			'team_arch'		=> ( is_numeric($_POST['M_teamarch']) ? intval($_POST['M_teamarch']) : 0 ) ,
			'initial_kr_c'		=> ( is_numeric($_POST['M_initial_kr_c']) ? intval($_POST['M_initial_kr_c']) : 0 ) ,
			'initial_kr_s'		=> ( is_numeric($_POST['M_initial_kr_s']) ? intval($_POST['M_initial_kr_s']) : 0 ) ,
			'initial_en_c'		=> ( is_numeric($_POST['M_initial_en_c']) ? intval($_POST['M_initial_en_c']) : 0 ) ,
			'initial_en_s'		=> ( is_numeric($_POST['M_initial_en_s']) ? intval($_POST['M_initial_en_s']) : 0 ) ,
			'initial_arch'		=> ( is_numeric($_POST['M_initial_arch']) ? intval($_POST['M_initial_arch']) : 0 ) ,
			'stocking_sale'	=> $stocking_sale ,
			'stocking_price'	=> ( is_numeric($_POST['M_stocking_price']) && $stocking_sale == 'Y' ? intval($_POST['M_stocking_price']) : 0 ) ,
			'stocking_options'	=> ( $stocking_sale == 'Y' ? str_convert($_POST['M_stocking_options']) : '' )   ,
			'printposset1'	=> ( $_POST['M_printposset1'] == 'Y' ? 'Y' : 'N' ) ,
			'printposset2'	=> ( $_POST['M_printposset2'] == 'Y' ? 'Y' : 'N' ) ,
			'printposset3'	=> ( $_POST['M_printposset3'] == 'Y' ? 'Y' : 'N' )  ,
			'printpos1no'	=> ( $_POST['M_printpos1no'] == 'Y' ? 'Y' : 'N' ) ,
			'printpos1text'	=> $_POST['M_printpos1text'] ,
			'useservicetype'	=> $_POST['M_useservicetype'] == 'Y' ? 'Y' : 'N' ,
		) ;
		$pos = '' ;
		// 'd', 'f', 'e', 's', 'p', 'n', 't', 'i'
		for ( $i = 1 ; $i <= 14 ; $i++ ) {
			$pos = str_pad( $i , 2 , '0' , STR_PAD_LEFT) ;
			if ( $_POST['M_' . $pos . 'state'] != 'Y' )
				$opt_action['p' . $pos] = 'd' ;
			elseif ( $_POST['M_' . $pos . 'sale'] == 'FR' )
				$opt_action['p' . $pos] = 'f' ;
			else {
				$opt_action['p' . $pos] = adSelect_option_conf($pos, $_POST['M_' . $pos . 'code']) ;
				if ( $opt_action['p' . $pos] == 'e' || $opt_action['p' . $pos] == 's' || $opt_action['p' . $pos] == 'p' || $opt_action['p' . $pos] == 'n' )
					$opt_action['p' . $pos . '_no'] = $_POST['M_' . $pos . 'num'] ;
			}
		}
		break ;
	case 'T' :
		$opt_action = array(
			'selectsizes'		=> str_convert($_POST['T_size']) ,
			'teamtype'			=> ( $_POST['T_tntype'] == 'O' ? 'O' : 'F' ) , // O : ÀÚ´ç , F : °íÁ¤
			'team_o_price'	=> ( is_numeric($_POST['T_tntypeOprice']) ? intval($_POST['T_tntypeOprice']) : 0 ) ,
			'team_f_price'	=> ( is_numeric($_POST['T_tntypeFprice']) ? intval($_POST['T_tntypeFprice']) : 0 ) ,
			'team_arch'		=> ( is_numeric($_POST['T_teamarch']) ? intval($_POST['T_teamarch']) : 0 ) ,
			'team_ustate'		=> ( $_POST['T_tnposition'] == 'FX' ? 'N' : 'Y' ) // N : »ç¿ë¾ÈÇÔ , Y : ÁÖ¹®ÀÚ¼±Åð¡´É
		) ;
		break ;
	case 'S' :
		$opt_action = array(
			'selectsizes'		=> str_convert($_POST['S_size']) ,
			'color_options'	=> str_convert($_POST['S_option'])
		) ;
		break ;
	case 'Q' :
		$opt_action = array(
			'color_options'	=> str_convert($_POST['Q_option'])
		) ;
		break ;
	default :
		script_re ( $total['cmnall'] . '&mode=write' , ' À¯È¿ÇÏÁö ¾Ê´Â Æû ¾ç½ÄÀÌ ¼±ÅõǾú½À´Ï´Ù. ') ;
		break ;
}
$action['formtype'] = $formtype  ;
$action = array_merge( $action , $opt_action) ;
$numid = $exe->qry_insert($action , "tbl_{$total[table]}_item") ;
if ( empty($numid)) script_re ( $total['cmnall'] . '&mode=write' , ' µî·Ï¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. ') ;

// upload image
if ( !empty($_FILES['file1']['name'])) {
/*
    // ¿øº» À̹ÌÁö¸¦ ¿Ã¸®´Â °ÍÀ¸·Î ¼öÁ¤
	$simg = new resizeimageV2 ;
	$simg->option_fixed = 'N' ;
	$simg->width = $total['options']['list_w'] ;
	$simg->height = $total['options']['list_h'] ;
	$simg->upload_dir = 'files/' . $total['options']['list_dir'] ;
	$simg->resize( $_FILES['file1'] ) ;
	$imglist = $simg->result_file_name ;
 */
	$imglist = file_upload( $_FILES['file1']['tmp_name'] , $_FILES['file1']['name'] , 'files/' . $total['options']['list_dir'] ) ;
}

if ( !empty($_FILES['file2']['name'])) {
	$imgdetail = file_upload( $_FILES['file2']['tmp_name'] , $_FILES['file2']['name'] , 'files/' . $total['options']['view_dir'] ) ;
}
// attach files
if ( $total['options']['file'] == 'on' ) {
	$exe->qry_update( " parent_numid = '{$numid}' , temp_code = null " , "tbl_{$info_file[table]}" , " keycode='{$total[code]}' and temp_code='{$_POST[temp_code]}' " ) ;
	$attachfile_count = mysql_affected_rows() ;
}

$exe->qry_update( array( 'imglist' => $imglist , 'imgdetail' => $imgdetail , 'attachfile' => $attachfile_count ) , "tbl_{$total[table]}_item" , " numid = '{$numid}' ") ;
// set category
$cateArr = array() ;
foreach ( $multiple_categories as $k=>$v) {
	$v = str_replace(' ' , '' , $v ) ;
	$vs = explode(',' , $v) ;
	$cateArr[] = "( {$numid} , {$k} , '{$vs[0]}' , '{$vs[1]}' , '{$vs[2]}' )" ;
}
if ( count($cateArr) > 0 ) {
	$exe->qry_query(" insert into tbl_{$total[table]}_itemc ( goods_no , seq , c1_no , c2_no , c3_no ) values " . implode(',' , $cateArr)) ;
}

script_re ( $total['cmnall'] , ' µî·Ï¿Ï·á' ) ;

?>

Copyright © 2017 || Recoded By Mr.Bumblebee