|
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/admin/ |
Upload File : |
<?include $_SERVER['DOCUMENT_ROOT']."/conf/conf_dir.php";?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?
//user_cash를 가지고 `shop_order`에 넣기,(카드결제로인해)order_uid=0
$QUERY_silde = "SELECT * FROM user_cash";
$result= mysql_query($QUERY_silde,$db_con);
$i=1;
//inning 이 1이면 4800 ,2이면 38000, 없다면 3800
while ($row = mysql_fetch_array($result)) {
$_cartid = $row[cash_no];
$tmp_display =1;
if($row[flag]=="A"){
$orderstep = 1;
}else{
$orderstep = 2;
}
if($row[inning]=="1"){
if($row[admin_date] >= "2021-09-08"){
$total_price = 3800;
}else{
$total_price = 4800;
}
$goodsuid = 1;
$optName = "新規入会";
}elseif($row[inning]=="2"){
//1회차와 비교하여 시작일과 2회차 시작일이 같으면 연장 다르면 신규로 지정한다.
$tmp_date1 = Get_db("SELECT startdate FROM user_cash where user_id='$row[user_id]' and flag='D' and inning='1'");
$date_array = explode("-", $tmp_date1);
$tmp_sum_y = $date_array[0]+1;
$tmp_date2 = $tmp_sum_y."-".$date_array[1]."-".$date_array[2];
//echo "== $row[startdate]<br>";
if($tmp_date1 == $row[startdate] || $tmp_date2 == $row[startdate]){
$total_price = 3800;
$goodsuid = 2;
$optName = "ファンクラブ更新";
}else{
//2회차인데 신규
if($row[admin_date] >= "2021-09-08"){
$total_price = 3800;
}else{
$total_price = 4800;
}
$goodsuid = 1;
$optName = "新規入会";
}
}elseif($row[inning]=="3"){
//2회차와 비교하여 시작일과 3회차 시작일이 같으면 연장 다르면 신규로 지정한다.
$tmp_date = Get_db("SELECT startdate FROM user_cash where user_id='$row[user_id]' and flag='D' and inning='2'");
if($tmp_date == $row[startdate]){
//연장회원찾기
$total_price = 3800;
$goodsuid = 2;
$optName = "ファンクラブ更新";
}else{
//3회차인데 신규
if($row[admin_date] >= "2021-09-08"){
$total_price = 3800;
}else{
$total_price = 4800;
}
$goodsuid = 1;
$optName = "新規入会";
}
}else{
//신규로 들어오신분들 이벤트로 3800엔
$total_price = 3800;
$goodsuid = 1;
$optName = "新規入会";
}
$deliradio=0;
$tack_after=0;
$tack_comp="";
$userIdx = $row[user_id];
$o_name = $row[jcname];
$o_email ="";
$o_tel ="";
$o_zip ="";
$o_addr ="";
$r_name = $row[jcname];
$r_email ="";
$r_tel ="";
$r_zip ="";
$r_addr ="";
$ckind = 1;
$bank = "三菱東京UFJ銀行";
$b_name="";
$buyfix =0;
$memo="";
$d_regis = str_replace('-','',$row[reg_date])."000000";
$str = array("-"," ",":");
$d_bank = str_replace($str, "", $row[admin_date]);
$query = "INSERT INTO `shop_order`
(`uid`, `orderid`,`display`, `orderstep`, `price`, `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','$deliradio','$tack_after','$tack_comp','$goodsuid','$userIdx',
'$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', '', '0')";
echo $i."<br>";
//echo "$query<br>";
$results = mysql_query($query,$db_con);
//부모 idx 값 가져오기
$p_idx = get_db("select uid from shop_order where mbruid='$userIdx' and orderid='$_cartid' order by uid desc");
$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', '$userIdx', '$orderstep', '$goodsuid', '$optName', '1', '1', '$total_price','$row[reg_date]', '', '')";
//echo "$sub_query<br><br>";
$results1 = mysql_query($sub_query,$db_con);
$queryupok = "update user_cash set order_uid='$p_idx' where id=$row[id]";
$queryupok_result = mysql_query($queryupok,$db_con);
$i++;
}
?>