/home/mjc1/public_html/manage/pointdeleteProcess.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?
    
@session_start();
    @
extract($_REQUEST);
    @
extract($_SESSION);
    include(
"../manage/category/pointcommon.php");
    
$reg_date date('Y-m-d H:i:s',time());
    
if(
$exCode == "alldel"){
    for (
$i 0$i count$orderForm ); $i++) { 
        
$idqry    "select * from cash_fill where idx = '$orderForm[$i]'";

        
$resultid  =   mysql_query($idqry);
        
$rowid    =    mysql_fetch_array($resultid);
        
$Opoint $rowid['addpoint'];
        
$Oprice $rowid['price'];
        
$Oid $rowid['cust_id'];

        if (
$Opoint "0" && $Oprice "0"){

        
$Opoint str_replace("-","",$Opoint);    //¸¶À̳ʽºÀÏ °æ¿ì ¾ç¼ö·Î º¯È¯
        
$Oprice str_replace("-","",$Oprice);
        
$comment "[$orderForm[$i]]ÃæÀüº¹±¸";
        }

        else {

        
$Opoint "-$Opoint";
        
$Oprice "-$Oprice";
        
$comment "[$orderForm[$i]]ÃæÀüÃë¼Ò";
        }

        if(
$rowid['idx'] == "$orderForm[$i]"){        //ÇØ´ç³»¿ª Æ÷ÀÎÆ® °¡Á®¿Í¼­ ¸¶À̳ʽº Ã³¸®

        
$pinsertQry  =   "INSERT INTO cash_fill (cust_id, rgst_dtm, addpoint, price, bigo, rgster_nm, delkey) values ('$Oid','$reg_date','$Opoint','$Oprice','$comment','$adminName','0')"//»èÁ¦³»¿ª insert

        
$pupdateQry  =   "UPDATE cash_fill SET delkey = '1' where idx = '$orderForm[$i]'";    //±âÁ¸ÀÚ·á »èÁ¦¿©ºÎ Update
        
        
if($rowid['addpoint']=='0' && $rowid['price']=='550000'){ // 1³â¾àÁ¤ Ãë¼ÒÀϰæ¿ì ¸¸±âÀÏÀÚ -365ÀϠó¸®
            
$sql "select * from cust_cash where id = '{$rowid['cust_id']}' ";
            
$res mysql_query($sql);
            
$cinfo mysql_fetch_array($res);

            
$v strtotime($cinfo['expire_date']);
            
$new_date date("Y-m-d",strtotime("-1 year",$v));

            
$sql "update cust_cash set expire_date = '{$new_date}' where id = '{$rowid['cust_id']}' ";
            
mysql_query($sql);
        }

        
mysql_query($pinsertQry);
        
mysql_query($pupdateQry);
        }
    }
        
mysql_close();
        
?>
<script>
parent.Msg("Æ÷ÀÎÆ®ÃæÀü Ãë¼Ò°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù.");
parent.location.href = "pointdetail.php?uid=<?=$Oid?>&pg=<?=$pg;?>&mode=<?=$mode;?>&SearchMdiv=<?=$SearchMdiv;?>&SearchMup=<?=$SearchMup;?>&SearchMper=<?=$SearchMper;?>&searchCode=<?=$searchCode;?>&keyword=<?=$keyword;?>&SearchMsw1=<?=$SearchMsw1;?>&SortCnt=<?=$SortCnt;?>&txtdate=<?=$txtdate;?>&txtdate2=<?=$txtdate2;?>";
</script>
<?
        
}
     else {
?>
<script>
parent.Msg("ÇØ´ç³»¿ªÀ» È®ÀÎÇØ ÁÖ¼¼¿ä.");
parent.location.href = "pointdetail.php?uid=<?=$Oid?>&pg=<?=$pg;?>&mode=<?=$mode;?>&SearchMdiv=<?=$SearchMdiv;?>&SearchMup=<?=$SearchMup;?>&SearchMper=<?=$SearchMper;?>&searchCode=<?=$searchCode;?>&keyword=<?=$keyword;?>&SearchMsw1=<?=$SearchMsw1;?>&SortCnt=<?=$SortCnt;?>&txtdate=<?=$txtdate;?>&txtdate2=<?=$txtdate2;?>";
</script>
<?
    
    
}
?>