-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig.php
244 lines (204 loc) · 7.62 KB
/
config.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?php
/**
*
* =======================================
* ###################################
* PortabilidadeCelular
*
* @package ChipCerto ChanDongle
* @author Adilson Leffa Magnus.
* @copyright Copyright (C) 2005 - 2016 MagnusSolution. All rights reserved.
* ###################################
*
* This software is released under the terms of the GNU Lesser General Public License v2.1
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
*
* =======================================
* Magnusbilling.com <info@portabilidadecelular.com>
* 14/07/2016
*/
?><html>
<head>
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ChipCerto</title>
<link rel="stylesheet" type="text/css" href="style/default.css?0">
<style type="text/css">
.visible{
display:block;
}
</style>
<script lang="javascript" src="script/dynamic.js"></script>
<script lang="javascript">
if (document.getElementById){
document.write('<style type="text/css">\n');
document.write('.invisible{display:none;}\n');
document.write('</style>\n');
}
</script>
</head>
<?php include 'access.php';?>
<body>
<table id="mainframe" height="100%" cellSpacing="0" cellPadding="0" width="768" border="0">
<tr>
<td width="314" class="banner" height="124">
<img height="134" src="images/title.jpg" width="312" border="0">
</td>
<td class="banner" height="124" valign="bottom" width="454">
<table cellSpacing="0" cellPadding="0" width="100%" height="100%"border="0">
<tr>
<td colspan="3" height="100" valign="bottom">
<span class="subtitle">ChipCerto</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colSpan="2">
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0">
<tr>
<td vAlign="top" width="196" class="sidebar">
<script lang="javascript" src="script/ajaxroutine.js"></script>
<script lang="javascript">
function URLencode(sStr) {
return escape(sStr).
replace(/\+/g, '%2B').
replace(/\"/g,'%22').
replace(/\'/g, '%27').
replace(/\//g,'%2F');
}
function show_all_config_pages()
{
if (document.getElementById){
var i=0;
var id="config_page";
var max=11
for(i=0; i<max; i++){
if(document.getElementById(id+"_"+i+"_div")){
document.getElementById(id+"_"+i+"_div").style.display="block"
}
}
}
}
var the_config_form=false
function process_config_form()
{
var myajax=ajaxpack.ajaxobj;
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200){
window.alert("Configuration saved!")
}
else {
//window.alert("Cannot save configuration, error code: " + myajax.status)
the_config_form.disabled = false
the_config_form.submit()
}
if(the_config_form){
the_config_form.disabled = false
if(document.getElementById("mainframe")){
document.getElementById("mainframe").style.cursor="";
}
}
}
}
function ajax_post_config_form(theform, url)
{
var poststr="";
var i
for(i=0; i<theform.elements.length; i++){
var elem = theform.elements[i]
if(elem.name!=""){
switch(elem.type){
case "radio":
if(elem.checked){
poststr+=elem.name+"="+URLencode(elem.value)+"&"
}
break;
case "checkbox":
if(elem.checked){
poststr+=elem.name+"="+"on"+"&"
}
break;
default:
poststr+=elem.name+"="+URLencode(elem.value)+"&";
}
}
}
poststr+="ajax_request=true";
ajaxpack.postAjaxRequest(url, poststr, process_config_form, "application/x-www-form-urlencoded");
}
function save_config()
{
var theform
theform=document.forms["config_form"]
theform.submit()
}
</script>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td colspan="2" align="left" height="15"></td>
</tr>
<tr>
<td width="20"></td>
<td align="left" height="40">
<a href="status.php"><div class="title5">Status</div></a></td>
</tr>
<tr>
<td width="20"></td>
<td align="left" height="40"><a href="config.php?type=preference"><div class="title4">Configurations</div></a></td>
</tr>
<tr>
<td width="20"></td>
<td align="right" height="40" valign="top">
<table border="0" width="82%" cellspacing="0" cellpadding="0" height="40">
<tr>
<td height="30"><a href="config.php?type=calling"><div id="calling" class="title3">Basic VoIP</div></a></td>
</tr>
<tr>
<td height="30"><a href="config.php?type=dongle"><div id="ata_in_setting" class="title3">Dongles</div></a></td>
</tr>
<tr>
<td height="30"><a href="config.php?type=ata_setting"><div id="ata_setting" class="title3">Call Out</div></a></td>
</tr>
<tr>
<td height="30"><a href="config.php?type=ata_in_setting"><div id="ata_in_setting" class="title3">Call In</div></a></td>
</tr>
<tr>
<td height="30"><a href="config.php?type=portabilidade"><div id="ata_in_setting" class="title3">Portabilidade</div></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="20"></td>
<td height="40"><a href="tools.php"><div class="title5">Tools</div></a></td>
</tr>
</table>
<script lang="javascript">
document.getElementById('preference').className="title4";
</script>
</td>
<td width="828" vAlign="top" class="content">
<?php
if (!$_GET['type'] || $_GET['type'] == 'calling') {
include 'basicVoIP.php';
}else if (!$_GET['type'] || $_GET['type'] == 'ata_setting') {
include 'callOut.php';
}else if (!$_GET['type'] || $_GET['type'] == 'portabilidade') {
include 'portabilidade.php';
}else if (!$_GET['type'] || $_GET['type'] == 'dongle') {
include 'dongle.php';
}else if (!$_GET['type'] || $_GET['type'] == 'ata_in_setting') {
include 'callIn.php';
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>