/home/mjc1/public_html/html/freetalkpay/index.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
$freetalkpay 
"Y";
include_once(
"./_common.php");
include_once(
"./xpay.inc.php");
header("Content-type:text/html;charset=utf-8"); 

define('G5_MOBILE_AGENT',   'phone|samsung|lgtel|mobile|[^A]skt|nokia|blackberry|android|sony');
function 
is_mobile()
{
    return 
preg_match('/'.G5_MOBILE_AGENT.'/i'$_SERVER['HTTP_USER_AGENT']);
}

$sql "select * from users a inner join service b on a.id = b.users_id where a.id = '{$id}';";
$res mysql_query($sql,$connect_free);
$info mysql_fetch_array($res);
if(
$info['code']==''){
    
//echo "<script>alert('해당되는 유저가 존재하지 않습니다.'); window.history.go(-1);</script>"; exit;
}

$od_id "FREETALK-{$id}-".time();

if(
is_mobile()){
    
$xpay_url "/xpaym/payreq_crossplatform.php";
} else {
    
$xpay_url "/xpay/payreq_crossplatform.php";
}

?><!DOCTYPE html>
<html>
<head>
<title>프리톡 기간 연장 결제</title>
<?php if(is_mobile()){ ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes" />
<?php }?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./css/main.css"/>
<script src='./js/jquery-3.2.1.min.js'></script>
<script src='./js/common.js'></script>
<script src='./js/jqueryui/jquery-ui.min.js'></script>
</head>

<body style='margin:0px; padding:0px;'>
<div id="card_wrap">
    <div class="card_logo">
        <h2><img src="./img/login_logo.png" style="width:250px;height:auto;"></h2>
    </div><!--id_pw_logo-->
    <div id="card_table">
            <h4>프리톡 기간 연장 결제</h4>
        <div class="card_tab_content" id="tab1">
            <!--기간연장-->
            <div class="card_form">
                <!--아이디-->
                <div class="form-group">
                    <span style="float:left;margin-right:10px;">아이디:</span>
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <?php echo $id;?>
                        </div>
                    </div>
                </div>
                <!--기간연장-->
                <div class="form-group">
                    <span style="float:left;margin-right:10px;">기간연장:</span>
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <select name="ext_month" id="ext_month">
                                <option value="1">1개월</option>
                                <option value="2">2개월</option>
                                <option value="3">3개월</option>
                                <option value="4">4개월</option>
                                <option value="5">4개월</option>
                                <option value="6">6개월</option>
                                <option value="7">7개월</option>
                                <option value="8">8개월</option>
                                <option value="9">9개월</option>
                                <option value="10">10개월</option>
                                <option value="11">11개월</option>
                                <option value="12">12개월</option>
                            </select>                                   
                        </div>
                    </div>
                </div>
                <!--결제금액-->
                <div class="form-group">
                    <span style="float:left;margin-right:10px;">결제금액:</span>
                    <div class="card_input_box">
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class='pay_price'><?php echo number_format($price);?></span>
                            </div>
                        </div>
                    </div>
                </div>
                <!--아이디
                <div class="form-group">
                    <label for="site_name" class="card_label">아이디 : </label>
                    <div class="card_input_box">
                        <div class="input-group">
                            <div class="input-group-prepend" style="padding-right: 10px;padding-top:8px;">
                                <?php echo $id;?>
                            </div>
                        </div>
                    </div>
                </div>-->
                <!--기간연장
                <div class="form-group row">
                    <label for="tel" class="card_label">기간연장: </label>
                    <div class="card_input_box">
                        <div class="input-group">
                            <div class="input-group-prepend" style="padding-right: 10px">
                                <select name="ext_month" id="ext_month">
                                    <option value="1">1개월</option>
                                    <option value="2">2개월</option>
                                    <option value="3">3개월</option>
                                    <option value="4">4개월</option>
                                    <option value="5">4개월</option>
                                    <option value="6">6개월</option>
                                    <option value="7">7개월</option>
                                    <option value="8">8개월</option>
                                    <option value="9">9개월</option>
                                    <option value="10">10개월</option>
                                    <option value="11">11개월</option>
                                    <option value="12">12개월</option>
                                </select>                                   
                            </div>
                        </div>
                    </div>
                </div>-->
                <!--
                <div class="form-group row">
                    <label for="tel" class="card_label">결제금액 : </label>
                    <div class="card_input_box">
                        <div class="input-group">
                            <div class="input-group-prepend" style="padding-right: 10px;padding-top:8px;">
                                <span class='pay_price'><?php echo number_format($price);?></span>
                            </div>
                        </div>
                    </div>
                </div>-->
            </div><!--card_form-->
            <button id="btn_pw">결제하기</button>
        </div><!--card_tab_content-->
    </div><!--card_table-->        
</div><!--card_wrap-->
<script>
$(function(){
    $("#ext_month").change(function(){
        $v =$(this).val();
        $v = parseInt($v)*<?php echo $price;?>;
        $(".pay_price").text(number_format($v+""));
    });

    $("#btn_pw").click(function(){
<?php if(is_mobile()){  ?>
    alert('현재는 pc에서만 결제 가능합니다. pc에서 결제하새주시기 바랍니다.');
<?php } else {?>
        $v =$("#ext_month option:selected").val();
        if(confirm('정말로 프리톡 '+$v+'개월 기간연장 하시겠습니까?')){
            $vp = $(".pay_price").text();
            $.get("<?php echo $xpay_url;?>?od_id=<?php echo $od_id;?>&id=<?php echo $id;?>&ext_month="+$v+"&pay_price="+$vp,function(rtn){ // $pay_url은 common.php에 있음
                $("#modal_member_box").html(rtn);
            });
        }
<?php ?>
    });
})

</script>
<div id="modal_member_box" title="거래처수정" style="display:none;width:0px; height:0px; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
</body>
</html>
<?php
//_pr($_SESSION);
?>