forked from Netrvin/CFPMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domains.php
153 lines (134 loc) · 4.4 KB
/
domains.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
<?php
include_once("cf.class.php");
CF::is_login();
$r=CF::user_lookup();
include_once("header.php");
?>
<div style="margin-top:25px" class="mdui-container">
<div class="mdui-row">
<div class="mdui-col-xs-12 mdui-col-sm-12 mdui-col-md-10 mdui-col-offset-md-1">
<div class="mdui-container mdui-typo">
<div style="float:left">
<a href="./">Cloudflare Partners :
<?=SITE_NAME?>
</a> >
<span>域名管理</span>
<br />
<br />
</div>
<div style="float:right">
<?=$_SESSION["email"]?>.
<a href="./">登出</a>
</div>
</div>
<div class="mdui-card mdui-shadow-5">
<div class="mdui-card-content">
<div class="mdui-container mdui-typo">
<button mdui-dialog="{target: '#add_domain'}" style="display:inline" class="mdui-btn mdui-ripple mdui-shadow-4">添加域名</button>
<?php if (($r["result"]=="success")&&(!empty($r["response"]["hosted_zones"]))): ?>
<br />
<br />
<div class="mdui-table-fluid">
<table class="mdui-table">
<thead>
<tr>
<th>域名</th>
<th class="mdui-table-col-numeric"></th>
<th class="mdui-table-col-numeric"></th>
</tr>
</thead>
<tbody>
<?php
foreach ($r["response"]["hosted_zones"] as $value) {
$output.='
<tr>
<td>'.$value.'</td>
<td><a href="manage_domain.php?domain='.$value.'">管理</a></td>
<td><a href="" onclick="javascript:delete_domain(\''.$value.'\');return false;">删除</a></td>
</tr>
';
}
echo $output;
?>
</tbody>
</table>
</div>
<?php elseif ($r["result"]=="error"): ?>
<p>查询失败:
<?=$r["msg"];?>
<?php else: ?>
<p>无域名,赶紧添加一个吧!</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mdui-dialog" id="add_domain">
<div class="mdui-dialog-title">添加域名</div>
<form method="post" action="add_domain.php" autocomplete="off">
<div class="mdui-dialog-content">
<div class="mdui-textfield mdui-textfield-floating-label">
<label class="mdui-textfield-label">域名</label>
<input class="mdui-textfield-input" name="domain" required />
</div>
</div>
<div class="mdui-dialog-actions">
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
<input type="submit" class="mdui-btn mdui-ripple" value="添加" />
</div>
</form>
</div>
<div class="mdui-dialog" id="delete_domain">
<div class="mdui-dialog-title">删除域名</div>
<form method="post" action="delete_domain.php" autocomplete="off">
<div class="mdui-dialog-content">
<input type="hidden" value="" name="domain" id="delete_domainname1" /> 你确定要删除域名
<strong>
<span id="delete_domainname2"></span>
</strong>吗?
</div>
<div class="mdui-dialog-actions">
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
<input type="submit" class="mdui-btn mdui-ripple" value="确定" />
</div>
</form>
</div>
<div class="mdui-dialog" id="msg_dialog">
<div class="mdui-dialog-content">
<?php
if (!empty($_SESSION["msg"])){
echo $_SESSION["msg"];
}
?>
</div>
<div class="mdui-dialog-actions">
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
</div>
</div>
<script>
function delete_domain(domain) {
document.getElementById("delete_domainname2").innerHTML = domain;
document.getElementById("delete_domainname1").value = domain;
var inst = new mdui.Dialog("#delete_domain", {
history: false
});
inst.open();
}
</script>
<?php
$msg_script=<<<SCRIPT
<script>
var inst = new mdui.Dialog("#msg_dialog",{
history: false
});
inst.open();
</script>
SCRIPT;
if (!empty($_SESSION["msg"])){
echo $msg_script;
unset($_SESSION["msg"]);
}
include_once("footer.php");
?>