/home/mjc1/public_html/manage/pointProcess.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?
    
@session_start();
    include(
"./_common.php");

    
/*$admin_info = admin_member_info();
    if($admin_info['psn_auth']=='0' || substr($admin_info['psn_rwed'],1,1)=='0'){
        echo "<script>alert('ÇØ´ç ÃæÀü±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');window.history.go(-1);</script>"; exit;
    }*/

    //20130829 ¼öÁ¤
    
if (!isset($pg)) $pg "";
    if (!isset(
$mode)) $mode "";
    if (!isset(
$SearchMdiv)) $SearchMdiv "";
    if (!isset(
$SearchMup)) $SearchMup "";
    if (!isset(
$SearchMper)) $SearchMper "";
    if (!isset(
$searchCode)) $searchCode "";
    if (!isset(
$SearchMsw1)) $SearchMsw1 "";
    if (!isset(
$keyword)) $keyword "";
    if (!isset(
$SortCnt)) $SortCnt "";

    if(
trim($pointid)==''){
        
parent.Msg("ÃæÀüÇÒ ID°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); exit;
    }

    
$expire_date $_REQUEST['expire_date'];

    if(
$expire_date!='' && $Mmoney=='550000'){
        
$point 0;
    }

    
$reg_date date('Y-m-d H:i:s',time());
    
        include(
"../manage/category/common.php");

        
$userQry " select Mid, Mcompany, companyNum, Mtel1, Mhp from member where Mid = '$pointid'";
        
$resultuser  =   mysql_query($userQry);
        
$rowuser   =    mysql_fetch_array($resultuser);
        
print_r($rowuser);

        
mysql_close();
        
$Mid $rowuser['Mid'];
        
$Mcompany $rowuser['Mcompany'];
        
$companyNum $rowuser['companyNum'];
        
$Mtel1 $rowuser['Mtel1'];
        
$Mhp $rowuser['Mhp'];

        if(
$rowuser['Mid'] == $pointid){    //À¥¾ÆÀ̵ð Ã¼Å©

            
include("../manage/category/pointcommon.php");


            
$idqry    "select * from customers where id = '$pointid'";

            
$resultid  =   mysql_query($idqry);
            
$rowid    =    mysql_fetch_array($resultid);

            if(
$Mmoney=='550000'){
                
$sql "select * from cust_cash where id = '{$pointid}'";
                
$resultid  =   mysql_query($sql);
                
$expid    =    mysql_fetch_array($resultid);
                
//echo $expid['expire_date']." ".$expire_date;
                
if($expid['expire_date']>date("Y-m-d")){
                    
$expire_date date("Y-m-d",strtotime("1 year {$expid['expire_date']}"));
                    echo 
"aaaa";
                }

                
$sql "update cust_cash set expire_date = '$expire_date' where id = '$pointid' ";
                
//echo $sql;
                
$res mysql_query($sql,$dbcon2);
                
//print_r($res);
                
                
$bigopoint .= "(±âÁ¸¸¸·á:{$expid['expire_date']}~¼³Á¤¸¸·á:{$expire_date})";
                
//_pr($bigopoint); exit;
            
}

            
$companyNum2 str_replace("-","",$companyNum);
            
$point2 str_replace(",","",$point);

            
//Æ÷ÀÎÆ® ¾ÆÀ̵𰡠ÀÖÀ¸¸é ÃæÀü
                
if($Mmoney=='Á÷Á¢ÀÔ·Â'){ $Mmoney2 $i_point; } else { $Mmoney2 $Mmoney; }
                if(
$rowid['id'] == $pointid){        
                
$pupdateQry  =   "INSERT INTO cash_fill values ('','$pointid','$reg_date','$point2','','$Mmoney2','$bigopoint','$adminName','0')";    //±âÁ¸È¸¿ø Æ÷ÀÎÆ® ÃæÀü
                
mysql_query($pupdateQry);

                if(
$Mmoney=='550000'){
                    
//include("../manage/category/pointcommon2.php"); pointcommon2 »ç¿ë¾ÈÇÔ
                    
$sql "update cust_cash set expire_date = '$expire_date' where id = '$pointid' ";
                    
//echo $sql;
                    //$res = mysql_query($sql,$dbcon2);
                    
$res mysql_query($sql);
                    
print_r($res);
                }
        
                
?>

                <script>
                parent.Msg("ÃæÀüÀÌ ¿Ï·á µÇ¾ú½À´Ï´Ù.");
                parent.location.href = "point.php?pg=<?=$pg;?>&mode=<?=$mode;?>&SearchMdiv=<?=$SearchMdiv;?>&SearchMup=<?=$SearchMup;?>&SearchMper=<?=$SearchMper;?>&searchCode=<?=$searchCode;?>&keyword=<?=$keyword;?>&SearchMsw1=<?=$SearchMsw1;?>&SortCnt=<?=$SortCnt;?>&txtdate=<?=$txtdate;?>&txtdate2=<?=$txtdate2;?>";
                </script>

                <?
//Æ÷ÀÎÆ® ID°¡ ¾øÀ» °æ¿ì »ý¼ºÈÄ ÃæÀü    
                
} ELSE {        
        
                
$companyNum str_replace("-","",$companyNum);
                
$newinsertQry  =   "INSERT INTO customers values ('$pointid','$Mcompany','$companyNum2','$Mtel1','$Mhp','','$reg_date','$adminName','')";    //ȸ¿øµî·Ï
                
print_r($newinsertQry); 
                
mysql_query($newinsertQry);
                
                if(
$Mmoney=='550000'){
                    
//include("../manage/category/pointcommon2.php");  pointcommon2 »ç¿ë¾ÈÇÔ
                    
$sql "update cust_cash set expire_date = '$expire_date' where id = '$pointid' ";
                    
//echo $sql;
                    //$res = mysql_query($sql,$dbcon2);
                    
$res mysql_query($sql);
                    
print_r($res);

                    
$sql "select * from cust_cash where id = '{$pointid}'";
                    
$resultid  =   mysql_query($sql);
                    
$expid    =    mysql_fetch_array($resultid);
                    
$bigopoint .= "(±âÁ¸¸¸·á:{$expid['expire_date']}~¼³Á¤¸¸·á:{$expire_date})";
                }

                if(
$Mmoney=='Á÷Á¢ÀÔ·Â'){ $Mmoney2 $i_point; } else { $Mmoney2 $Mmoney; }
                
$newpupdateQry  =   "INSERT INTO cash_fill values ('','$pointid','$reg_date','$point2','','$Mmoney2','$bigopoint','$adminName','0')";    //Æ÷ÀÎÆ®ÃæÀü
                
                
mysql_query($newpupdateQry);


                
mysql_close();
                
                
?>        
                <script>
                parent.Msg("Æ÷ÀÎÆ®È¸¿ø µî·Ï ÈÄ ÃæÀüÀÌ ¿Ï·á µÇ¾ú½À´Ï´Ù.");
                //parent.Msg("<?=$pointid?><?=$Mcompany?><?=$Mcompany?><?=$companyNum?><?=$Mtel1?><?=$Mhp?><?=$reg_date?><?=$adminName?>");
                parent.location.href = "point.php?pg=<?=$pg;?>&mode=<?=$mode;?>&SearchMdiv=<?=$SearchMdiv;?>&SearchMup=<?=$SearchMup;?>&SearchMper=<?=$SearchMper;?>&searchCode=<?=$searchCode;?>&keyword=<?=$keyword;?>&SearchMsw1=<?=$SearchMsw1;?>&SortCnt=<?=$SortCnt;?>&txtdate=<?=$txtdate;?>&txtdate2=<?=$txtdate2;?>";
                </script>        
        
<?        
    

        
auth_access_log("WRITE");

        } ELSE {    
//À¥¾ÆÀ̵𰡠¾øÀ»°æ¿ì °æ°í ¸Þ½ÃÁö
?>
        <script>
        parent.Msg("¾ÆÀ̵𸦠´Ù½Ã È®ÀÎÇÏ¿© ÁֽʽÿÀ.");
        parent.location.href = "point.php?pg=<?=$pg;?>&mode=<?=$mode;?>&SearchMdiv=<?=$SearchMdiv;?>&SearchMup=<?=$SearchMup;?>&SearchMper=<?=$SearchMper;?>&searchCode=<?=$searchCode;?>&keyword=<?=$keyword;?>&SearchMsw1=<?=$SearchMsw1;?>&SortCnt=<?=$SortCnt;?>&txtdate=<?=$txtdate;?>&txtdate2=<?=$txtdate2;?>";
        </script>
<?
    
}
?>