KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/home/queenjbs/yuchun/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/home/queenjbs/yuchun/store_order_proc.php
<?
include $_SERVER['DOCUMENT_ROOT']."/conf/conf_dir.php";


//exit;

//회원이 아니면 회원로그인
if($sessionIDX == "0" || $sessionIDX == ""){
		LoginCheck();
		exit;
}

if($mode == "order_proc" && $sessionIDX){
	//예약번호
	$nan = explode(' ',microtime());
	$_cartid = $initialCode.$nan_tmp.$nan[1] . substr($nan[0],2,3);

	$orderstep = "1"; //주문접수
	$o_email = trim($o_email);

	//결제체크 B10:무통장입금 , C10:카드결제 , A10 : 편의점결제
	$ckind = $PAY_METHOD;
	if($PAY_METHOD == "B10"){
		$ckind = 1; //무통장입금
		$bank ="三菱東京UFJ銀行";
		$buyfix = 0; //페이지 보이게
	}else if($ckind == "C10"){
		$ckind = 2; //카드결제
		$bank ="";
		$buyfix = 1; //페이지안보임 //결제완료시 1로 변환
	}else if($ckind == "A10"){
		$ckind = 3; //편의점결제
		$bank ="";
		$buyfix = 0; //페이지 보이게
	}
	

	//회원신청 $member_code_idx 1일때 신규 2일때 연장회원 insert 구문
	if($member_code_idx){
		$tmp_display="1"; //회원
		//회원신청 insert 구문
		$chkcode = Get_db("SELECT cash_no from user_cash where user_id = $sessionIDX and flag='A'");

		//$id  = strtolower($id);
		if(!$chkcode){
			$resultU = Get_dbres("SELECT userid,cash_chk,kana_name1 from user where id='$sessionIDX'");
			$rowU = mysql_fetch_array($resultU);
			$id = trim($rowU[userid]);

			$resultP = Get_dbres("SELECT hanja_name1,en_name1 from user_profiles where user_id='$sessionIDX'");
			$rowP = mysql_fetch_array($resultP);

            $query = "INSERT INTO user_cash
                        (user_id,cash_no,order_uid,userid,jcname,ccname,ecname,reg_date,flag)
                    VALUES
                        ('$sessionIDX','$_cartid','','$id','$rowU[kana_name1]','$rowP[hanja_name1]','$rowP[en_name1]',now(),'A')";

            $result = mysql_query($query,$db_con);
		}else{
			//카드결제시 에러 났을떄 생성되어 있는거 그대로 가져오기.
			$p_idx = Get_db("SELECT uid from shop_order where orderid = '$chkcode' ");
			echo $chkcode.",".$p_idx;
			exit;
		}

	}else{
		$tmp_display="0";//상품
		//상품한번만 살수 있게
		$resultQ = Get_dbres("SELECT A.uid,A.orderid,A.buyfix FROM shop_order A ,shop_ordergoods B WHERE A.uid = B.parent and B.goodsuid='$goodsuid' and B.mbruid='$sessionIDX' and A.orderstep < 6");
		$rowQ = mysql_fetch_array($resultQ);
		$uidChk = $rowQ[uid];
		$orderidChk =  $rowQ[orderid];
		$buyfixChk = $rowQ[buyfix]; // buyfix 1일때 카드결제 미완성된것임.정보값 있는걸로 보내줌.
		if($ckind == "1" && $uidChk) {//무통장일떄
			//고운씨가 여러개 살수있게 수정해달라고함.
			//echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
			//echo"<script>alert('既に予約しました.');location.href='/mypage_goods.php';</script>";
			//exit;
		}else if($ckind == "2" && $uidChk){//카드일떄
			if($buyfixChk== 1){
				//카드결제시 에러 났을떄 생성되어 있는거 그대로 가져오기.
				//include $_SERVER['DOCUMENT_ROOT']."/conf/conf_i.php";
				echo $orderidChk.",".$uidChk;
				exit;
			}else{
				//카드결제시 이미 상품있다면 팅기게함.
				//echo "kkk";
				//exit;
			}
		}

	}


	$query = "INSERT INTO `shop_order`
	(`uid`, `orderid`,`display`, `orderstep`, `price`, `chalin`, `tack`,`tack_after`,`tack_comp`, `goodsuid`,`mbruid`,
	`o_name`, `o_email`, `o_tel`, `o_zip`, `o_addr`, `r_name`, `r_email`,`r_tel`, `r_zip`, `r_addr`,
	`ckind`, `bank`, `b_name`, `buyfix`,`memo`, `d_regis`, `d_bank`, `d_tack`, `is_mobile`)

		VALUES

	(NULL, '$_cartid','$tmp_display', '$orderstep', '$total_price', '$cash_used_price','$deliradio','$tack_after','$tack_comp','$goodsuid','$sessionIDX',
	'$o_name', '$o_email','$o_tel','$o_zip','$o_addr','$r_name', '$r_email','$r_tel', '$r_zip', '$r_addr',
	'$ckind', '$bank', '$b_name', '$buyfix', '$memo','$date[totime]', '', '', '0')";
	

	$result = mysql_query($query,$db_con);
	//부모 idx 값 가져오기
	$p_idx = get_db("select uid from shop_order where mbruid='$sessionIDX' and orderid='$_cartid'");
	

	if($p_idx)
	{
		
		if($cash_used_price){//CASH 추가
			$querycash = "update user_event_cash set CS_TYPE='$_cartid',CS_PART='1',CS_PAY='$cash_used_price',CS_SHARE='0' where MEM_IDX= '$sessionIDX' and CS_PART='2'";
			$querycash_result = mysql_query($querycash,$db_con);
		}

	//상품등록 나중에 for문으로 등록
	//echo "<br><br>";
	$buycount = count($buynum);
	//echo "<br><br>";
		for($i=0;$i< $buycount ;$i++)
		{
			// option
			$sub_query = "INSERT INTO `shop_ordergoods`
			(`uid`, `parent`, `mbruid`, `orderstep`, `goodsuid`, `goodsname`, `options`, `buynum`, `price`,`d_regis`, `d_bank`, `d_tack`)
				VALUES
			(NULL, '$p_idx', '$sessionIDX', '$orderstep', '$goodsuid', '$optName[$i]', '$optNum[$i]', '$buynum[$i]', '$goodPrice[$i]','$date[totime]',  '', '')";
		//echo "$sub_query<br>";

		$result = mysql_query($sub_query,$db_con);

		}

	}

	$s_cart_id = get_session('ss_cart_id');

	//$queryupok = "update SHOP_CART set ct_status='1', ct_select_time = now() where od_id = '$s_cart_id' and ct_status='0' and ct_select='1'";
	//$queryupok_result = mysql_query($queryupok,$db_con);
	
	if($member_code_idx){
		//회원일때 업데이트
		$queryupok = "update user_cash set order_uid='$p_idx' where cash_no= '$_cartid' and userid='$id'";
		$queryupok_result = mysql_query($queryupok,$db_con);
	}

	// 기존자료 세션에서 제거
	set_session('ss_cart_direct', '');

mysql_close();
}else{
echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
echo "<script>alert('情報が正しくありません。再度入力してください。');document.location.href='./store.php?tmp_no=$goodsuid;</script>";
}
if($ckind == "2"){
	//카드결제일때 주문번호값
	echo $_cartid.",".$p_idx;
}elseif($member_code_idx){
	echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
	echo "<script>document.location.href='./mypage_members.php';</script>";
	//alert('銀行振込みに登録しました。');
}else{
	echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
	echo "<script>document.location.href='./mypage_goods.php';</script>";
	//alert('商品注文完了。');
}
?>

Anon7 - 2021