Subversion Repositories ALCASAR

Rev

Rev 2542 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2542 Rev 2550
1
<?php
1
<?php
2
# $Id: autoregistration.php 2542 2018-05-04 17:12:28Z rexy $
2
# $Id: autoregistration.php 2550 2018-05-06 22:15:20Z rexy $
3
 
-
 
4
# Test if 3G/4G key is plugged 
-
 
5
$exec_com=exec("lsusb | grep -i 067b: | cut -d ' ' -f6"); // converter "USB to UART" PL2303 (several USB-serial cables, Wavecom GSM Modem)
-
 
6
$exec_com2=exec("lsusb | grep -i 12d1: | cut -d ' ' -f6"); // Huawei Technologies (E220/E230/E270/E870
-
 
7
$gammu_smsd_port=exec("cat /etc/gammu_smsd_conf| grep port | cut -d ' ' -f3"); // Gammu_smsd listen port 
-
 
8
$model='';
-
 
9
if(!empty($exec_com) || !empty($exec_com2)){
-
 
10
	$status_key="true";
-
 
11
	if(!empty($exec_com)) $model='Wavecom';
-
 
12
	if(!empty($exec_com2)) $model='Huawei';
-
 
13
	exec("ls /dev/ttyUSB*",$openned_ports); // list of ports openned by the modem 
-
 
14
	}
-
 
15
else {
-
 
16
	$status_key="false";
-
 
17
}
-
 
18
 
-
 
19
$script="/usr/local/bin/alcasar-sms.sh";
-
 
20
 
3
 
21
#Define
4
#Define
22
$gammu_puk = "";
5
$gammu_puk = "";
23
$gammu_simfail = "";
6
$gammu_simfail = "";
24
$gammu_simsecu = "";
7
$gammu_simsecu = "";
25
$gammu_writeerror = "";
8
$gammu_writeerror = "";
26
$gammu_timeout = "";
9
$gammu_timeout = "";
27
$error_pin = "";
10
$error_pin = "";
28
$error_time_account = "";
11
$error_time_account = "";
29
$error_nb_essais = "";
12
$error_nb_essais = "";
30
$error_time_perm = "";
13
$error_time_perm = "";
31
$error_num_alcasar = "";
14
$error_num_alcasar = "";
32
$country_filter="";
15
$country_filter="";
-
 
16
$find_key="false";
-
 
17
$status_key="false";
-
 
18
$script="/usr/local/bin/alcasar-sms.sh";
-
 
19
 
-
 
20
# Test if a modem is plugged on serial-usb port
-
 
21
$open_port=exec("ls /dev/ttyUSB*",$openned_ports); // list of USB-Serial ports openned by a modem
-
 
22
if (!empty($open_port))
-
 
23
{
-
 
24
	$find_key="true";
-
 
25
	$vendor=exec("udevadm info -n $openned_ports[1] | grep 'MODEL=' | cut -d'=' -f2");
-
 
26
	$model=exec("udevadm info -n $openned_ports[1] | grep 'MODEL_FROM_DATABASE=' | cut -d'=' -f2");
-
 
27
	$gammu_smsd_port=exec("cat /etc/gammu_smsd_conf| grep port | cut -d ' ' -f3"); // Gammu_smsd listen port
-
 
28
	while ( list(,$row) = each($openned_ports))
-
 
29
	{
-
 
30
		if ( "$row" == "$gammu_smsd_port" ) // is gammu listen on an openned port ?
-
 
31
		{
-
 
32
			$status_key="true";
-
 
33
		}
-
 
34
	}
-
 
35
}	
-
 
36
$gammu_pid=exec("sudo $script --pidof");
-
 
37
if (( $status_key == "false") || ($find_key == "false"))
-
 
38
{	# close gammu if it's started
-
 
39
	if ($gammu_pid!="")
-
 
40
	{
-
 
41
		echo "on ferme";
-
 
42
		exec("sudo $script stop");
-
 
43
		sleep(8);
-
 
44
		header('Location: autoregistration.php');
-
 
45
		exit();
-
 
46
	}
-
 
47
}
33
 
48
 
34
# Choice of language
49
# Choice of language
35
$Language = 'en';
50
$Language = 'en';
36
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
51
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
37
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
52
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
38
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
53
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
39
if($Language == 'fr'){
54
if($Language == 'fr'){
40
	$l_title = "Auto enregistrement (SMS)";
55
	$l_title = "Auto enregistrement (SMS)";
41
	$l_conf = "Configuration";
56
	$l_conf = "Configuration";
42
	$l_conf_actu = "Configuration actuelle";
57
	$l_conf_actu = "Configuration actuelle";
43
	$l_pin = "Code PIN";
58
	$l_pin = "Code PIN";
44
	$l_num_alcasar = "Numero de téléphone du MODEM GSM";
59
	$l_num_alcasar = "Numero de téléphone du MODEM GSM";
45
	$l_ban_temp = "Nombre d'essais avant le blocage";
60
	$l_ban_temp = "Nombre d'essais avant le blocage";
46
	$l_time_account = "Durée pour une session créée";
61
	$l_time_account = "Durée de validité des comptes crées";
47
	$l_time_perm = "Durée du blocage (en jours)";
62
	$l_time_perm = "Durée du blocage (en jours)";
48
	$l_status_gammu = "Etat du service";
63
	$l_status_gammu = "Etat du service";
49
	$l_start = "Démarrer";
64
	$l_start = "Démarrer";
50
	$l_status_device = "Status de votre MODEM GSM (clé 2G/3G/4G)";
65
	$l_status_device = "Status de votre MODEM GSM (clé 2G/3G/4G)";
51
	$l_key_diseable = "Aucun périphérique détecté";
66
	$l_key_diseable = "Aucun périphérique détecté";
52
	$l_key_enable_1 = "Un MODEM GSM '<b>".$model."</b>' est connecté à la vitesse de ";
67
	$l_key_enable_1 = "Un MODEM GSM '<b>".$vendor."(".$model.")</b>' est connecté à la vitesse de ";
53
	$l_key_enable_2 = "Il a ouvert les ports suivants : ";
68
	$l_key_enable_2 = "Il a ouvert les ports suivants : ";
54
	$l_key_enable_3 = "ALCASAR le gère actuellement sur le port : <b>".$gammu_smsd_port."</b>";
-
 
55
	$l_force_signal = "Force du signal";
69
	$l_force_signal = "Force du signal";
56
	$l_imei_device = "IMEI du périphérique";
70
	$l_imei_device = "IMEI du périphérique";
57
	$l_sms_received = "Nombre de SMS reçu";
71
	$l_sms_received = "Nombre de SMS reçu";
58
	$l_stop = "Arrêter";
72
	$l_stop = "Arrêter";
59
	$l_gammu_on="Le service est démarré";
73
	$l_gammu_on="Le service est démarré";
60
	$l_gammu_off="Le service est arrêté";
74
	$l_gammu_off="Le service est arrêté";
61
	$l_edit = "Modifier";
75
	$l_edit = "Modifier";
62
	$l_error_label_empty = "Le champ est vide";
76
	$l_error_label_empty = "Le champ est vide";
63
	$l_error_label_num = "Ce n'est pas un PIN valide";
77
	$l_error_label_num = "Ce n'est pas un PIN valide";
64
	$l_error_label_num2 = "Ce n'est pas un nombre";
78
	$l_error_label_num2 = "Ce n'est pas un nombre";
65
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
79
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
66
	$l_error_writefail = "Le service ne parvient pas à discuter avec le port du MODEM GSM (ttyUSB0).";
80
	$l_error_writefail = "Le service ne parvient pas à discuter avec le port du MODEM GSM (ttyUSB0).";
67
	$l_error_timeoutfail = "Impossible de se connecter au MODEM GSM (vérifiez la vitesse de connexion)";
81
	$l_error_timeoutfail = "Impossible de se connecter au MODEM GSM (vérifiez la vitesse de connexion)";
68
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est-elle présente?";
82
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est-elle présente?";
69
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
83
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
70
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
84
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
71
	$l_autorefresh = "Rafraichissement : 30 sec";
85
	$l_autorefresh = "Rafraichissement : 30 sec";
72
	$l_days = "jours ";
86
	$l_days = "jours ";
73
	$l_num_block="Liste des numéros bloqués";
87
	$l_num_block="Liste des numéros bloqués";
74
	$l_num_num="Numéro";
88
	$l_num_num="Numéro";
75
	$l_num_raison="Raison";
89
	$l_num_raison="Raison";
76
	$l_num_expiration="Date d'expiration";
90
	$l_num_expiration="Date d'expiration";
77
	$l_num_action="Action";
91
	$l_num_action="Action";
78
	$l_num_exist="Un compte a été créé";
92
	$l_num_exist="Un compte a été créé";
79
	$l_num_flood="Le nombre d'essais maximum a été dépassé";
93
	$l_num_flood="Le nombre d'essais maximum a été dépassé";
80
	$l_num_unlock="Effacer";
94
	$l_num_unlock="Effacer";
81
	$l_country_enable="Activer";
95
	$l_country_enable="Activer";
82
	$l_country_disable="Désactiver";
96
	$l_country_disable="Désactiver";
83
	$l_service_status_img_ok="Démarré";
97
	$l_service_status_img_ok="Démarré";
84
	$l_service_status_img_ko="Arrété";
98
	$l_service_status_img_ko="Arrété";
85
	$l_connect_speed="Modifier la vitesse de connexion : ";
99
	$l_connect_speed="Modifier la vitesse de connexion : ";
86
	$l_connect_port="Modifier le port de connexion : ";
100
	$l_connect_port="Port de connexion";
87
	$l_tab_first = "premier";
101
	$l_tab_first = "premier";
88
	$l_tab_last = "dernier";
102
	$l_tab_last = "dernier";
89
	$l_tab_next = "suivant";
103
	$l_tab_next = "suivant";
90
	$l_tab_prev = "précédent";
104
	$l_tab_prev = "précédent";
91
	$l_tab_search = "Recherche :";
105
	$l_tab_search = "Recherche :";
92
	$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_";
106
	$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_";
93
	$l_tab_info = "Montrer _MENU_ résultats par page";
107
	$l_tab_info = "Montrer _MENU_ résultats par page";
94
	$l_tab_infoempty = "Aucun résultat";
108
	$l_tab_infoempty = "Aucun résultat";
95
	$l_country_filter = "Filtrage en cours : ";
109
	$l_country_filter = "Filtrage en cours : ";
96
	$l_country_filtering = " Filtrage par pays";
110
	$l_country_filtering = " Filtrage par pays";
97
	$l_country_filtering_plus = " Filtrage par pays avancé";
111
	$l_country_filtering_plus = " Filtrage par pays avancé";
98
	$l_phone_ban = " Numéro de téléphone bloqués";
112
	$l_phone_ban = " Numéro de téléphone bloqués";
99
	$l_country_france_ena = "Autorise les numéros français";
113
	$l_country_france_ena = "Autorise les numéros français";
100
	$l_country_ue_ena = "Autorise les numéros européens";
114
	$l_country_ue_ena = "Autorise les numéros européens";
101
	$l_country_all_ena = "Autorise tous les pays";
115
	$l_country_all_ena = "Autorise tous les pays";
102
	$l_country_advanced_ena = "Autorisation personnalisée";
116
	$l_country_advanced_ena = "Autorisation personnalisée";
103
	$l_advance = "Avancé";
117
	$l_advance = "Avancé";
104
}
118
}
105
else {
119
else {
106
	$l_title = "Auto registration (SMS)";
120
	$l_title = "Auto registration (SMS)";
107
	$l_conf = "Configuration";
121
	$l_conf = "Configuration";
108
	$l_conf_actu = "Current configuration";
122
	$l_conf_actu = "Current configuration";
109
	$l_pin = "PIN password";
123
	$l_pin = "PIN password";
110
	$l_num_alcasar = "Phone number of the GSM MODEM";
124
	$l_num_alcasar = "Phone number of the GSM MODEM";
111
	$l_ban_temp = "Max number of try before a permanent ban"; 
125
	$l_ban_temp = "Max number of try before a permanent ban"; 
112
	$l_time_account = "Time for a new session";
126
	$l_time_account = "Validity period of new account";
113
	$l_time_perm = "Duration of a ban (for example, after X try)";
127
	$l_time_perm = "Duration of a ban (for example, after X try)";
114
	$l_status_gammu = "Service status";
128
	$l_status_gammu = "Service status";
115
	$l_start = "Start";
129
	$l_start = "Start";
116
	$l_status_device = "Status of your GSM MODEM (2G/3G/4G key)";
130
	$l_status_device = "Status of your GSM MODEM (2G/3G/4G key)";
117
	$l_key_diseable = "No device detected";
131
	$l_key_diseable = "No device detected";
118
	$l_key_enable_1 = "A GSM MODEM '<b>".$model."</b>' is connected at the speed of ";
132
	$l_key_enable_1 = "A GSM MODEM '<b>".$vendor."(".$model.")</b>' is connected at the speed of ";
119
	$l_key_enable_2 = "It has openned the following ports : ";
133
	$l_key_enable_2 = "It has openned the following ports : ";
120
	$l_key_enable_3 = "ALCASAR manage it actually on port : <b>".$gammu_smsd_port."</b>";
-
 
121
	$l_force_signal = "Signal strength";
134
	$l_force_signal = "Signal strength";
122
	$l_imei_device = "Device IMEI";
135
	$l_imei_device = "Device IMEI";
123
	$l_sms_received = "Number of SMS received";
136
	$l_sms_received = "Number of SMS received";
124
	$l_stop = "Stop";
137
	$l_stop = "Stop";
125
	$l_gammu_on="The service is running";
138
	$l_gammu_on="The service is running";
126
	$l_gammu_off="The service is down";
139
	$l_gammu_off="The service is down";
127
	$l_edit = "Modify";
140
	$l_edit = "Modify";
128
	$l_error_label_empty = "Field empty";
141
	$l_error_label_empty = "Field empty";
129
	$l_error_label_num = "It's not a valid PIN password";
142
	$l_error_label_num = "It's not a valid PIN password";
130
	$l_error_label_num2 = "It's not a number";
143
	$l_error_label_num2 = "It's not a number";
131
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
144
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
132
	$l_error_writefail = "Can not communicate with the GSM MODEM port (ttyUSB0).";
145
	$l_error_writefail = "Can not communicate with the GSM MODEM port (ttyUSB0).";
133
	$l_error_timeoutfail = "Can not connect to the GSM MODEM (verify the connection speed).";
146
	$l_error_timeoutfail = "Can not connect to the GSM MODEM (verify the connection speed).";
134
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
147
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
135
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
148
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
136
				The Sim card must be blocked. Please read the documentation.";
149
				The Sim card must be blocked. Please read the documentation.";
137
	$l_autorefresh = "Refresh : 30 sec";
150
	$l_autorefresh = "Refresh : 30 sec";
138
	$l_days = "days ";
151
	$l_days = "days ";
139
	$l_num_block="List of blocked phone";
152
	$l_num_block="List of blocked phone";
140
	$l_num_num="Phone number";
153
	$l_num_num="Phone number";
141
	$l_num_raison="Reason";
154
	$l_num_raison="Reason";
142
	$l_num_expiration="Expiration date";
155
	$l_num_expiration="Expiration date";
143
	$l_num_action="Action";
156
	$l_num_action="Action";
144
	$l_num_exist="An account has been created";
157
	$l_num_exist="An account has been created";
145
	$l_num_flood="The number of try has been reached";
158
	$l_num_flood="The number of try has been reached";
146
	$l_num_unlock="Erase";
159
	$l_num_unlock="Erase";
147
	$l_country_enable="Enable";
160
	$l_country_enable="Enable";
148
	$l_country_disable="Disable";
161
	$l_country_disable="Disable";
149
	$l_service_status_img_ok="Running";
162
	$l_service_status_img_ok="Running";
150
	$l_service_status_img_ko="Stopped";
163
	$l_service_status_img_ko="Stopped";
151
	$l_connect_speed="Modify the connection speed : ";
164
	$l_connect_speed="Modify the connection speed : ";
152
	$l_connect_port="Modify the connection port : ";
165
	$l_connect_port="Connection port";
153
	$l_tab_first = "first";
166
	$l_tab_first = "first";
154
	$l_tab_last = "last";
167
	$l_tab_last = "last";
155
	$l_tab_next = "next";
168
	$l_tab_next = "next";
156
	$l_tab_prev = "previous";
169
	$l_tab_prev = "previous";
157
	$l_tab_search = "Search :";
170
	$l_tab_search = "Search :";
158
	$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :";
171
	$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :";
159
	$l_tab_info = "Show _MENU_ entries";
172
	$l_tab_info = "Show _MENU_ entries";
160
	$l_tab_infoempty = "No matching records found";
173
	$l_tab_infoempty = "No matching records found";
161
	$l_country_filter = "Current filtering : ";
174
	$l_country_filter = "Current filtering : ";
162
	$l_country_filtering = " Country filtering";
175
	$l_country_filtering = " Country filtering";
163
	$l_country_filtering_plus = " Country filtering advanced";
176
	$l_country_filtering_plus = " Country filtering advanced";
164
	$l_phone_ban = " Phone Number banned";
177
	$l_phone_ban = " Phone Number banned";
165
	$l_country_france_ena = "Authorize the french numbers";
178
	$l_country_france_ena = "Authorize the french numbers";
166
	$l_country_ue_ena = "Authorize european numbers";
179
	$l_country_ue_ena = "Authorize european numbers";
167
	$l_country_all_ena = "Authorize all countries";
180
	$l_country_all_ena = "Authorize all countries";
168
	$l_country_advanced_ena = "Advanced Authorization";
181
	$l_country_advanced_ena = "Advanced Authorization";
169
	$l_advance = "Advanced";
182
	$l_advance = "Advanced";
170
}
183
}
171
?>
184
?>
172
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
185
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
173
<HTML><!-- written by Rexy -->
186
<HTML><!-- written by Rexy -->
174
<head>
187
<head>
175
<!--<META HTTP-EQUIV="Refresh" CONTENT="30">-->
188
<!--<META HTTP-EQUIV="Refresh" CONTENT="30">-->
176
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
189
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
177
<title>Auto enregistrement</title>
190
<title>Auto enregistrement</title>
178
<link rel="stylesheet" href="/css/style.css">
191
<link rel="stylesheet" href="/css/style.css">
179
<!-- DataTables CSS -->
192
<!-- DataTables CSS -->
180
<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.css">
193
<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.css">
181
<!-- jQuery -->
194
<!-- jQuery -->
182
<script type="text/javascript" charset="utf8" src="/js/jquery.min.js"></script>
195
<script type="text/javascript" charset="utf8" src="/js/jquery.min.js"></script>
183
<!-- DataTables -->
196
<!-- DataTables -->
184
<script type="text/javascript" charset="utf8" src="/js/jquery.dataTables.js"></script>
197
<script type="text/javascript" charset="utf8" src="/js/jquery.dataTables.js"></script>
185
<script type="text/javascript">
198
<script type="text/javascript">
186
function timedRefresh(timeoutPeriod) {
199
function timedRefresh(timeoutPeriod) {
187
    var interval = setInterval(refreshPage, timeoutPeriod);
200
    var interval = setInterval(refreshPage, timeoutPeriod);
188
}
201
}
189
 
202
 
190
function refreshPage() {
203
function refreshPage() {
191
    if ($("input[name=autoRefreshCheckboxes]").is(":checked")) {
204
    if ($("input[name=autoRefreshCheckboxes]").is(":checked")) {
192
        location.reload(true);
205
        location.reload(true);
193
    }
206
    }
194
}
207
}
195
 
208
 
196
$(document).ready( function () {
209
$(document).ready( function () {
197
 
210
 
198
    	$('#table_id').DataTable({
211
    	$('#table_id').DataTable({
199
		"language": {
212
		"language": {
200
			"paginate": {
213
			"paginate": {
201
			"sFirst": "<?php echo $l_tab_first; ?>",
214
			"sFirst": "<?php echo $l_tab_first; ?>",
202
			"sLast": "<?php echo $l_tab_last; ?>",
215
			"sLast": "<?php echo $l_tab_last; ?>",
203
			"sPrevious": "<?php echo $l_tab_prev; ?>",
216
			"sPrevious": "<?php echo $l_tab_prev; ?>",
204
			"sNext": "<?php echo $l_tab_next; ?>"
217
			"sNext": "<?php echo $l_tab_next; ?>"
205
			},
218
			},
206
            "lengthMenu": "<?php echo $l_tab_info; ?>",
219
            "lengthMenu": "<?php echo $l_tab_info; ?>",
207
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
220
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
208
            "info": "<?php echo $l_tab_pmenu; ?>",
221
            "info": "<?php echo $l_tab_pmenu; ?>",
209
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
222
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
210
			"sSearch": "<?php echo $l_tab_search; ?>"
223
			"sSearch": "<?php echo $l_tab_search; ?>"
211
        }
224
        }
212
	});
225
	});
213
 
226
 
214
	$('#table_country').DataTable({
227
	$('#table_country').DataTable({
215
		"language": {
228
		"language": {
216
			"paginate": {
229
			"paginate": {
217
			"sFirst": "<?php echo $l_tab_first; ?>",
230
			"sFirst": "<?php echo $l_tab_first; ?>",
218
			"sLast": "<?php echo $l_tab_last; ?>",
231
			"sLast": "<?php echo $l_tab_last; ?>",
219
			"sPrevious": "<?php echo $l_tab_prev; ?>",
232
			"sPrevious": "<?php echo $l_tab_prev; ?>",
220
			"sNext": "<?php echo $l_tab_next; ?>"
233
			"sNext": "<?php echo $l_tab_next; ?>"
221
			},
234
			},
222
            "lengthMenu": "<?php echo $l_tab_info; ?>",
235
            "lengthMenu": "<?php echo $l_tab_info; ?>",
223
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
236
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
224
            "info": "<?php echo $l_tab_pmenu; ?>",
237
            "info": "<?php echo $l_tab_pmenu; ?>",
225
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
238
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
226
			"sSearch": "<?php echo $l_tab_search; ?>"
239
			"sSearch": "<?php echo $l_tab_search; ?>"
227
        }
240
        }
228
	});
241
	});
229
	$(".showhide-div_country").slideUp("slow");	
242
	$(".showhide-div_country").slideUp("slow");
230
	$(".showhide-div_ban").slideUp("slow");
243
	$(".showhide-div_ban").slideUp("slow");
231
	$(".showhide-div_country_plus").slideUp("slow");
244
	$(".showhide-div_country_plus").slideUp("slow");
232
	$(".showhide-but_country").on("click", function(){
245
	$(".showhide-but_country").on("click", function(){
233
	    $(".showhide-div_country").slideToggle("slow");
246
	    $(".showhide-div_country").slideToggle("slow");
234
	});
247
	});
235
	$(".showhide-but_country_plus").on("click", function(){
248
	$(".showhide-but_country_plus").on("click", function(){
236
	    $(".showhide-div_country_plus").slideToggle("slow");
249
	    $(".showhide-div_country_plus").slideToggle("slow");
237
	});
250
	});
238
	$(".showhide-but_ban").on("click", function(){
251
	$(".showhide-but_ban").on("click", function(){
239
	    $(".showhide-div_ban").slideToggle("slow");
252
	    $(".showhide-div_ban").slideToggle("slow");
240
	});
253
	});
241
} );
254
} );
242
</script>
255
</script>
243
</head>
256
</head>
244
<body onload="JavaScript:timedRefresh(30000);">
257
<body onload="JavaScript:timedRefresh(30000);">
245
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
258
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
246
<?php
259
<?php
247
echo "
260
echo "
248
	<tr>
261
	<tr>
249
		<th>$l_title</th>
262
		<th>$l_title</th>
250
	</tr>
263
	</tr>
251
	<tr bgcolor=\"#FFCC66\">
264
	<tr bgcolor=\"#FFCC66\">
252
		<td><img src=\"/images/pix.gif\" width=\"1\" height=\"2\"></td>
265
		<td><img src=\"/images/pix.gif\" width=\"1\" height=\"2\"></td>
253
	</tr>
266
	</tr>
254
	</TABLE>
267
	</TABLE>
255
	<br />
268
	<br>
256
	<input type='checkbox' checked='checked' name='autoRefreshCheckboxes' >".$l_autorefresh."
269
	<input type='checkbox' checked='checked' name='autoRefreshCheckboxes' >".$l_autorefresh."
257
	";
270
	";
258
?>
271
?>
259
<center>
272
<center>
260
<br /><br />
273
<br>
261
<form form="GET" action="./autoregistration.php">
274
<form form="GET" action="./autoregistration.php">
262
<table border=1 width=100%>
275
<table border=1 width=100%>
263
<tr>
276
<tr>
264
<td colspan=2><h3><center><?php echo $l_status_device ?></center></h3></td>
277
<td colspan=2><h3><center><?php echo $l_status_device ?></center></h3></td>
265
</tr>
278
</tr>
266
 
-
 
267
<tr>
279
<tr>
268
<?php
280
<?php
269
if($status_key=="true")
281
if($find_key=="true")
270
{
282
{
271
	if(isset($_GET['config_submit'])){
283
	if(isset($_GET['config_submit'])){
272
		switch ($_GET['speed']) {
284
		switch ($_GET['speed']) {
273
		case "at":
285
		case "at":
274
			exec("sudo $script --replace_connect  ");
286
			exec("sudo $script --replace_connect  ");
275
			break;
287
			break;
276
		case "9600":
288
		case "9600":
277
			exec("sudo $script --replace_connect 9600");
289
			exec("sudo $script --replace_connect 9600");
278
			break;
290
			break;
279
		case "19200":
291
		case "19200":
280
			exec("sudo $script --replace_connect 19200");
292
			exec("sudo $script --replace_connect 19200");
281
			break;
293
			break;
282
		case "115200":
294
		case "115200":
283
			exec("sudo $script --replace_connect 115200");
295
			exec("sudo $script --replace_connect 115200");
284
			break;
296
			break;
285
		}	
297
		}	
286
	}
298
	}
287
	$current_connect = exec("sudo $script --connect");
299
	$current_speed = exec("sudo $script --connect");
288
	echo '<td width="50%">'.$l_key_enable_1."<b>".str_replace("at","",$current_connect).' Bauds</b>';
300
	echo '	<td width="50%">'.$l_key_enable_1."<b>".str_replace("at","",$current_speed).' Bauds</b>';
289
	echo '		<td align="right">	'.$l_connect_speed.'
-
 
290
				<select name="speed">
-
 
291
					<option value="at"></option>
-
 
292
					<option value="9600">9600 Bauds</option>
-
 
293
					<option value="19200">19200 Bauds</option>
-
 
294
					<option value="115200">115200 Bauds</option>
-
 
295
				</select>
-
 
296
				<input type="submit" name="config_submit"> 
-
 
297
			</td></tr>';
-
 
298
	echo '<tr><td width="50%">'.$l_key_enable_2.'<b>';
-
 
299
	while ( list(,$row) = each($openned_ports))
-
 
300
	{
-
 
301
		echo $row." ";
-
 
302
	}
-
 
303
	echo '</b><br>'.$l_key_enable_3.'</td>';
301
	echo '<br>'.$l_key_enable_2.'<b>';
304
	echo '		<td align="right">	'.$l_connect_port.'
-
 
305
				<select name="port">';
-
 
306
	reset ($openned_ports);
302
	reset ($openned_ports);
307
	while ( list(,$row) = each($openned_ports))
303
	while ( list(,$row) = each($openned_ports))
308
	{
304
	{
309
		echo '<option value="'.$row.'">'.$row.'</option>';
-
 
310
		echo $row." ";
305
		echo $row." ";
311
	}
306
	}
-
 
307
	echo '</b></td>';
-
 
308
	echo '
-
 
309
	<td align="right">	'.$l_connect_speed.'
-
 
310
			<select name="speed">
-
 
311
				<option value="at"></option>
-
 
312
				<option value="9600">9600 Bauds</option>
-
 
313
				<option value="19200">19200 Bauds</option>
-
 
314
				<option value="115200">115200 Bauds</option>
312
	echo '			</select>
315
			</select>
313
				<input type="submit" name="config_submit"> 
316
			<input type="submit" name="config_submit">
314
			</td>';
317
	</td>';
315
}
318
}
316
else
319
else
317
{
320
{
318
	echo "<td>$l_key_diseable</td>";
321
	echo "<td>$l_key_diseable</td>";
319
}
322
}
320
?>
323
?>
321
</tr>
324
</tr>
322
</table>
325
</table>
323
</form>
326
</form>
324
</center>
327
</center>
325
<br /><br />
328
<br>
326
 
-
 
327
<?php
329
<?php
328
 
330
 
329
#Test if gammu is started
-
 
330
$gammu_pid=exec("sudo $script --pidof");
-
 
331
if ($status_key=="false")
-
 
332
{
-
 
333
	if ($gammu_pid!="")
-
 
334
	{
-
 
335
		exec("sudo $script stop");
-
 
336
		sleep(8);
-
 
337
		header('Location: autoregistration.php');
-
 
338
		exit();
-
 
339
	}
-
 
340
}
-
 
341
 
-
 
342
if ($status_key=="true")
331
if ($find_key=="true")
343
{
332
{
344
	#Nom du fichier de log lorsque gammu est démarré
333
	#Nom du fichier de log lorsque gammu est démarré
345
	#$file_log = "gammu-smsd.log";
334
	#$file_log = "gammu-smsd.log";
346
 
335
 
347
	#Recuperation du code PIN actuel
336
	#Recuperation du code PIN actuel
348
	$current_pin = exec("sudo $script --pin");	
337
	$current_pin = exec("sudo $script --pin");	
349
	
338
	
350
	#Recuperation du nombre de try avant le ban perm
339
	#Recuperation du nombre de try avant le ban perm
351
	$current_try_ban = exec("sudo $script --try_ban");	
340
	$current_try_ban = exec("sudo $script --try_ban");
352
 
341
 
353
	#Recuperation de la durée d'une session créée
342
	#Recuperation de la durée d'une session créée
354
	$current_time_account = exec("sudo $script --time_account");	
343
	$current_time_account = exec("sudo $script --time_account");
355
 
344
 
356
	#Recuperation de la durée dun ban perm (après flood)
345
	#Recuperation de la durée dun ban perm (après flood)
357
	$current_time_perm = exec("sudo $script --time_perm");	
346
	$current_time_perm = exec("sudo $script --time_perm");
358
 
347
 
359
	#Detection neméro de tel
348
	#Detection neméro de tel
360
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
349
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
361
	
350
	
362
	#Detection problème avec la SIM
351
	#Detection problème avec la SIM
363
	$current_simfail = exec("sudo $script --last_nosim");
352
	$current_simfail = exec("sudo $script --last_nosim");
364
 
353
 
365
	#Recuperation de la dernière ligne de START
354
	#Recuperation de la dernière ligne de START
366
	$current_last_start = exec("sudo $script --last_start");
355
	$current_last_start = exec("sudo $script --last_start");
367
 
356
 
368
	#Recuperarion de la dernière ligne de STOP
357
	#Recuperarion de la dernière ligne de STOP
369
	$current_last_stop = exec("sudo $script --last_stop");
358
	$current_last_stop = exec("sudo $script --last_stop");
370
 
359
 
371
	#Recuperation de la dernière ligne de SECURITYERROR
360
	#Recuperation de la dernière ligne de SECURITYERROR
372
	$current_last_secu = exec("sudo $script --last_secu");
361
	$current_last_secu = exec("sudo $script --last_secu");
373
 
362
 
374
	#Recuperation de la dernière ligne de DEVICEWRITEERROR
363
	#Recuperation de la dernière ligne de DEVICEWRITEERROR
375
	$current_last_write = exec("sudo $script --last_writeerror");
364
	$current_last_write = exec("sudo $script --last_writeerror");
376
 
365
 
377
	#Recuperation de la dernière ligne de TIMEOUT
366
	#Recuperation de la dernière ligne de TIMEOUT
378
	$current_last_timeout = exec("sudo $script --last_timeout");
367
	$current_last_timeout = exec("sudo $script --last_timeout");
379
	
368
	
380
	# Test si le service est lancé
369
	# Test si le service est lancé
381
	if ($gammu_pid=="")
370
	if ($gammu_pid=="")
382
	{
371
	{
383
		$force_signal = "-";
372
		$force_signal = "-";
384
		$imei_device = "-";
373
		$imei_device = "-";
385
		$sms_received = "-";
374
		$sms_received = "-";
386
 
375
 
387
		$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>";	
376
		$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>";
388
		$gammu_status_on="";
377
		$gammu_status_on="";
389
		$gammu_status_off="disabled";
378
		$gammu_status_off="disabled";
390
 
379
 
391
		if($current_last_secu!="")
380
		if($current_last_secu!="")
392
		{
381
		{
393
			if(($current_last_secu > $current_last_start) && ($current_last_secu < $current_last_stop))
382
			if(($current_last_secu > $current_last_start) && ($current_last_secu < $current_last_stop))
394
			{
383
			{
395
				$gammu_simsecu="<tr><td colspan=7><font color=red>$l_error_simsecu_l</font></td></tr>";	
384
				$gammu_simsecu="<tr><td colspan=7><font color=red>$l_error_simsecu_l</font></td></tr>";
396
			}
385
			}
397
		}
386
		}
398
	} else {
387
	} else {
399
		# Recuperation de la force du signal et IMEI et nombre de sms reçu
388
		# Recuperation de la force du signal et IMEI et nombre de sms reçu
400
		$val_force_signal = exec("sudo $script --signal_device");
389
		$val_force_signal = exec("sudo $script --signal_device");
401
		$imei_device = exec("sudo $script --imei_device");
390
		$imei_device = exec("sudo $script --imei_device");
402
		$sms_received = exec("sudo $script --sms_received");
391
		$sms_received = exec("sudo $script --sms_received");
403
 
392
 
404
		if ($val_force_signal < 21) {
393
		if ($val_force_signal < 21) {
405
			$force_signal = "<img src=\"/images/signal_0.png\">  --  ".$val_force_signal." %";
394
			$force_signal = "<img src=\"/images/signal_0.png\">  --  ".$val_force_signal." %";
406
		} elseif ($val_force_signal < 41) {
395
		} elseif ($val_force_signal < 41) {
407
			$force_signal = "<img src=\"/images/signal_20.png\">  --  ".$val_force_signal." %";
396
			$force_signal = "<img src=\"/images/signal_20.png\">  --  ".$val_force_signal." %";
408
 
397
 
409
		} elseif ($val_force_signal < 61) {
398
		} elseif ($val_force_signal < 61) {
410
			$force_signal = "<img src=\"/images/signal_40.png\">  --  ".$val_force_signal." %";
399
			$force_signal = "<img src=\"/images/signal_40.png\">  --  ".$val_force_signal." %";
411
 
400
 
412
		} elseif ($val_force_signal < 81) {
401
		} elseif ($val_force_signal < 81) {
413
			$force_signal = "<img src=\"/images/signal_60.png\">  --  ".$val_force_signal." %";
402
			$force_signal = "<img src=\"/images/signal_60.png\">  --  ".$val_force_signal." %";
414
 
403
 
415
		} elseif ($val_force_signal < 101) {
404
		} elseif ($val_force_signal < 101) {
416
			$force_signal = "<img src=\"/images/signal_80.png\">  --  ".$val_force_signal." %";
405
			$force_signal = "<img src=\"/images/signal_80.png\">  --  ".$val_force_signal." %";
417
 
406
 
418
		}
407
		}
419
 
408
 
420
 
-
 
421
 
-
 
422
 
-
 
423
 
-
 
424
		$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>";	
409
		$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>";
425
				
-
 
426
		
-
 
427
		if($current_last_timeout!=""){
410
		if($current_last_timeout!=""){
428
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
411
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
429
			{
412
			{
430
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";	
413
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";
431
			}
414
			}
432
		}
415
		}
433
		
416
		
434
		if($current_last_secu!="")
417
		if($current_last_secu!="")
435
		{
418
		{
436
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
419
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
437
			{
420
			{
438
				exec("sudo $script --stop");
421
				exec("sudo $script --stop");
439
			}
422
			}
440
		}
423
		}
441
		
424
		
442
		if($current_last_write!=""){
425
		if($current_last_write!=""){
443
			if(($current_last_write > $current_last_start) && ($current_last_write > $current_last_stop))
426
			if(($current_last_write > $current_last_start) && ($current_last_write > $current_last_stop))
444
			{
427
			{
445
				$gammu_writeerror="<tr><td colspan=7><font color=red>$l_error_writefail</font></td></tr>";	
428
				$gammu_writeerror="<tr><td colspan=7><font color=red>$l_error_writefail</font></td></tr>";
446
			}
429
			}
447
		}
430
		}
448
		
431
		
449
		if($current_simfail!="")
432
		if($current_simfail!="")
450
		{
433
		{
451
			if(($current_simfail > $current_last_start) && ($current_simfail > $current_last_stop))
434
			if(($current_simfail > $current_last_start) && ($current_simfail > $current_last_stop))
452
			{
435
			{
453
				$gammu_simfail="<tr><td colspan=7><font color=red>$l_error_simfail</font></td></tr>";
436
				$gammu_simfail="<tr><td colspan=7><font color=red>$l_error_simfail</font></td></tr>";
454
			}
437
			}
455
		}
438
		}
456
		$gammu_status_on="disabled";
439
		$gammu_status_on="disabled";
457
		$gammu_status_off="";
440
		$gammu_status_off="";
458
	}
441
	}
459
 
442
 
460
 
443
 
461
	#Lancement et arret de gammu-smsd 3*7sec
444
	#Lancement et arret de gammu-smsd 3*7sec
462
	if(isset($_GET["start"])){
445
	if(isset($_GET["start"])){
463
		$gammu_1=exec("sudo $script --start");
446
		$gammu_1=exec("sudo $script --start");
464
		sleep(7);
447
		sleep(7);
465
		
-
 
466
		if($current_last_secu!="")
448
		if($current_last_secu!="")
467
		{
449
		{
468
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
450
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
469
			{
451
			{
470
				exec("sudo $script --stop");
452
				exec("sudo $script --stop");
471
			}
453
			}
472
		}
454
		}
473
		
-
 
474
		sleep(7);
455
		sleep(7);
475
		if($current_last_secu!="")
456
		if($current_last_secu!="")
476
		{
457
		{
477
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
458
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
478
			{
459
			{
479
				exec("sudo $script --stop");
460
				exec("sudo $script --stop");
480
			}
461
			}
481
		}
462
		}
482
		
-
 
483
		sleep(7);	
463
		sleep(7);	
484
		if($current_last_secu!="")
464
		if($current_last_secu!="")
485
		{
465
		{
486
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
466
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
487
			{
467
			{
488
				exec("sudo $script --stop");
468
				exec("sudo $script --stop");
489
			}
469
			}
490
		}
470
		}
491
		
-
 
492
		
-
 
493
		
-
 
494
		header('Location: autoregistration.php');
471
		header('Location: autoregistration.php');
495
		exit();
472
		exit();
496
	}
473
	}
497
 
474
 
498
	if(isset($_GET["stop"])){
475
	if(isset($_GET["stop"])){
499
		exec("sudo $script --stop");
476
		exec("sudo $script --stop");
500
		sleep(8);
477
		sleep(8);
501
		header('Location: autoregistration.php');
478
		header('Location: autoregistration.php');
502
		exit();
479
		exit();
503
	}
480
	}
504
 
481
 
505
 
482
 
506
	#Edition du NUMERO de telephone
483
	#Edition du NUMERO de telephone
507
	if(isset($_GET["b_num_alcasar"])){
484
	if(isset($_GET["b_num_alcasar"])){
508
		$num = $_GET["num_alcasar"];
485
		$num = $_GET["num_alcasar"];
509
		$error_num_alcasar = "";
486
		$error_num_alcasar = "";
510
		if($num !="")
487
		if($num !="")
511
		{
488
		{
512
			if(preg_match('#^\+#',$num))
489
			if(preg_match('#^\+#',$num))
513
			{
490
			{
514
				exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num));
491
				exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num));
515
				header('Location: autoregistration.php');
492
				header('Location: autoregistration.php');
516
				exit();
493
				exit();
517
			}
494
			}
518
			else
495
			else
519
			{
496
			{
520
				$error_num_alcasar=$l_error_label_num3;
497
				$error_num_alcasar=$l_error_label_num3;
521
			}
498
			}
522
		}
499
		}
523
		else
500
		else
524
		{
501
		{
525
			$error_num_alcasar=$l_error_label_empty;
502
			$error_num_alcasar=$l_error_label_empty;
526
		}
503
		}
527
	}
504
	}
528
	
505
	
529
	#Edition du code PIN
506
	#Edition du code PIN
530
	if(isset($_GET["b_pin"])){
507
	if(isset($_GET["b_pin"])){
531
		$pin = $_GET["pin"];
508
		$pin = $_GET["pin"];
532
		$error_pin = "";
509
		$error_pin = "";
533
		if($pin !="")
510
		if($pin !="")
534
		{
511
		{
535
			if(is_numeric($pin))
512
			if(is_numeric($pin))
536
			{
513
			{
537
				exec("sudo $script --replace_pin ".escapeshellarg($pin));
514
				exec("sudo $script --replace_pin ".escapeshellarg($pin));
538
				header('Location: autoregistration.php');
515
				header('Location: autoregistration.php');
539
				exit();
516
				exit();
540
			}
517
			}
541
			else
518
			else
542
			{
519
			{
543
				$error_pin=$l_error_label_num;			
520
				$error_pin=$l_error_label_num;
544
			}
521
			}
545
		}
522
		}
546
		else
523
		else
547
		{
524
		{
548
			$error_pin=$l_error_label_empty;
525
			$error_pin=$l_error_label_empty;
549
		}
526
		}
550
	}
527
	}
551
	
528
	
552
	
529
	
553
	#Edition du nombre d'essais avant le ban perm
530
	#Edition du nombre d'essais avant le ban perm
554
	if(isset($_GET["b_ban_temp"])){
531
	if(isset($_GET["b_ban_temp"])){
555
		$nb_ban_temp = $_GET["nb_essais"];
532
		$nb_ban_temp = $_GET["nb_essais"];
556
		$error_nb_essais = "";
533
		$error_nb_essais = "";
557
		if($nb_ban_temp !="")
534
		if($nb_ban_temp !="")
558
		{
535
		{
559
			if(is_numeric($nb_ban_temp))
536
			if(is_numeric($nb_ban_temp))
560
			{
537
			{
561
				exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp));
538
				exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp));
562
				header('Location: autoregistration.php');
539
				header('Location: autoregistration.php');
563
				exit();
540
				exit();
564
			}
541
			}
565
			else
542
			else
566
			{
543
			{
567
				$error_nb_essais=$l_error_label_num2;			
544
				$error_nb_essais=$l_error_label_num2;			
568
			}
545
			}
569
		}
546
		}
570
		else
547
		else
571
		{
548
		{
572
			$error_nb_essais=$l_error_label_empty;
549
			$error_nb_essais=$l_error_label_empty;
573
		}
550
		}
574
	}
551
	}
575
 
552
 
576
 
553
 
577
	#Edition de la durée pour un compte créé
554
	#Edition de la durée pour un compte créé
578
	if(isset($_GET["b_time_account"])){
555
	if(isset($_GET["b_time_account"])){
579
		$time_account = $_GET["time_account"];
556
		$time_account = $_GET["time_account"];
580
		$error_time_account = "";
557
		$error_time_account = "";
581
		if($time_account !="")
558
		if($time_account !="")
582
		{
559
		{
583
			if(is_numeric($time_account))
560
			if(is_numeric($time_account))
584
			{
561
			{
585
				exec("sudo $script --replace_time_account ".escapeshellarg($time_account));
562
				exec("sudo $script --replace_time_account ".escapeshellarg($time_account));
586
				header('Location: autoregistration.php');
563
				header('Location: autoregistration.php');
587
				exit();
564
				exit();
588
			}
565
			}
589
			else
566
			else
590
			{
567
			{
591
				$error_time_account=$l_error_label_num2;
568
				$error_time_account=$l_error_label_num2;
592
			}
569
			}
593
		}
570
		}
594
		else
571
		else
595
		{
572
		{
596
			$error_time_account=$l_error_label_empty;
573
			$error_time_account=$l_error_label_empty;
597
		}
574
		}
598
	}
575
	}
599
 
576
 
600
	#Edition de la durée d'un ban perm (après flood)
577
	#Edition de la durée d'un ban perm (après flood)
601
	if(isset($_GET["b_time_perm"])){
578
	if(isset($_GET["b_time_perm"])){
602
		$time_perm = $_GET["time_perm"];
579
		$time_perm = $_GET["time_perm"];
603
		$error_time_perm = "";
580
		$error_time_perm = "";
604
		if($time_perm !="")
581
		if($time_perm !="")
605
		{
582
		{
606
			if(is_numeric($time_perm))
583
			if(is_numeric($time_perm))
607
			{
584
			{
608
				exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm));
585
				exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm));
609
				header('Location: autoregistration.php');
586
				header('Location: autoregistration.php');
610
				exit();
587
				exit();
611
			}
588
			}
612
			else
589
			else
613
			{
590
			{
614
				$error_time_perm=$l_error_label_num2;
591
				$error_time_perm=$l_error_label_num2;
615
			}
592
			}
616
		}
593
		}
617
		else
594
		else
618
		{
595
		{
619
			$error_time_perm=$l_error_label_empty;
596
			$error_time_perm=$l_error_label_empty;
620
		}
597
		}
621
	}
598
	}
622
 
599
 
623
	# Suppression d'un numero bloqué
600
	# Suppression d'un numero bloqué
624
	if(isset($_GET['num_select'])){
601
	if(isset($_GET['num_select'])){
625
		$numero=$_GET['num_select'];
602
		$numero=$_GET['num_select'];
626
 
603
 
627
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1");
604
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1");
628
		if (!empty($add_mac)) {
605
		if (!empty($add_mac)) {
629
			exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
606
			exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
630
		}
607
		}
631
 
608
 
632
		exec("sudo $script --unlock_num $numero");
609
		exec("sudo $script --unlock_num $numero");
633
		header('Location: autoregistration.php');
610
		header('Location: autoregistration.php');
634
		exit();
611
		exit();
635
	}
612
	}
636
 
613
 
637
	# Edition etat pays
614
	# Edition etat pays
638
	if(isset($_GET['country_select'])){
615
	if(isset($_GET['country_select'])){
639
		$country=utf8_decode($_GET['country_select']);
616
		$country=utf8_decode($_GET['country_select']);
640
		exec("sudo $script --change_country ".escapeshellarg($country));
617
		exec("sudo $script --change_country ".escapeshellarg($country));
641
		exec("sudo $script --change_country_filter advance");
618
		exec("sudo $script --change_country_filter advance");
642
		header('Location: autoregistration.php');
619
		header('Location: autoregistration.php');
643
		exit();
620
		exit();
644
	}
621
	}
645
 
622
 
646
	if(isset($_GET['b_france_enable'])){
623
	if(isset($_GET['b_france_enable'])){
647
		exec("sudo $script --change_country_dis_all");
624
		exec("sudo $script --change_country_dis_all");
648
		exec("sudo $script --change_country France");
625
		exec("sudo $script --change_country France");
649
		exec("sudo $script --change_country_filter fr");
626
		exec("sudo $script --change_country_filter fr");
650
		header('Location: autoregistration.php');
627
		header('Location: autoregistration.php');
651
		exit();
628
		exit();
652
	}
629
	}
653
 
630
 
654
	if(isset($_GET['b_ue_enable'])){
631
	if(isset($_GET['b_ue_enable'])){
655
		exec("sudo $script --change_country_dis_all");
632
		exec("sudo $script --change_country_dis_all");
656
		$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede");
633
		$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede");
657
		foreach ($array_ue as $pays){
634
		foreach ($array_ue as $pays){
658
			exec("sudo $script --change_country ".escapeshellarg($pays));
635
			exec("sudo $script --change_country ".escapeshellarg($pays));
659
		}
636
		}
660
		
637
		
661
		exec("sudo $script --change_country_filter ue");
638
		exec("sudo $script --change_country_filter ue");
662
		header('Location: autoregistration.php');
639
		header('Location: autoregistration.php');
663
		exit();
640
		exit();
664
	}
641
	}
665
 
642
 
666
	if(isset($_GET["b_country_enable"])){
643
	if(isset($_GET["b_country_enable"])){
667
		exec("sudo $script --change_country_ena_all");		
644
		exec("sudo $script --change_country_ena_all");
668
		exec("sudo $script --change_country_filter all");
645
		exec("sudo $script --change_country_filter all");
669
		header('Location: autoregistration.php');
646
		header('Location: autoregistration.php');
670
		exit();
647
		exit();
671
	}
648
	}
672
 
649
 
673
	if(isset($_GET["b_country_disable"])){
650
	if(isset($_GET["b_country_disable"])){
674
		exec("sudo $script --change_country_dis_all");
651
		exec("sudo $script --change_country_dis_all");
675
		header('Location: autoregistration.php');
652
		header('Location: autoregistration.php');
676
		exit();
653
		exit();
677
	}
654
	}
678
 
-
 
679
 
655
	
680
	#Si une clé 3g est plugué
-
 
681
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
656
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
682
			
-
 
683
		<table border=1>
-
 
684
		<tr>
-
 
685
			<td colspan=4><b>$l_status_gammu</b></td>
-
 
686
			<td><b><center>$l_force_signal</center></b></td>
-
 
687
			<td><b><center>$l_imei_device</center></b></td> 
-
 
688
			<td><b><center>$l_sms_received</center></b></td> 
-
 
689
		</tr>
-
 
690
		<tr>
-
 
691
			$gammu
-
 
692
			<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>		
-
 
693
			<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
-
 
694
			<td><center>$force_signal</center></td>
-
 
695
			<td><center>$imei_device</center></td>
-
 
696
			<td><center>$sms_received</center></td>
-
 
697
		</tr>
-
 
698
		$gammu_puk
-
 
699
		$gammu_simfail
-
 
700
		$gammu_simsecu
-
 
701
		$gammu_timeout
-
 
702
		$gammu_writeerror
-
 
703
		</table>
-
 
704
	<br /><br />
-
 
705
		
-
 
706
		<table border=1>
657
		<table border=1>
707
		<tr>
658
		<tr>
708
		<td colspan=3><b>$l_conf</b></td>
659
		<td colspan=3><b>$l_conf</b></td>
709
		<td><b>$l_conf_actu</b></td>
660
		<td><b>$l_conf_actu</b></td>
710
		</tr>
661
		</tr>
-
 
662
		<tr>
-
 
663
		<td> $l_connect_port </td><td><select name=\"port\">'";
-
 
664
		reset ($openned_ports);
-
 
665
		while ( list(,$row) = each($openned_ports))
-
 
666
		{
-
 
667
			echo '<option value="'.$row.'">'.$row.'</option>';
-
 
668
			echo $row." ";
711
		
669
		}
-
 
670
	echo "</select></td>
-
 
671
		<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td>
-
 
672
		<td><center><font color=\"green\">$gammu_smsd_port</font></center></td>
-
 
673
		</tr>
712
		<tr>
674
		<tr>
713
		<td> $l_num_alcasar </td><td><input type=text name='num_alcasar' maxlength=\"20\"></td>
675
		<td> $l_num_alcasar </td><td><input type=text name='num_alcasar' maxlength=\"20\"></td>
714
		<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td>
676
		<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td>
715
		<td><center><font color=\"green\">$current_num_alcasar</font></center></td>
677
		<td><center><font color=\"green\">$current_num_alcasar</font></center></td>
716
		</tr>
678
		</tr>
717
		<tr><td colspan=\"4\"><font color=red><b>$error_num_alcasar</b></font></td></tr>
679
		<tr><td colspan=\"4\"><font color=red><b>$error_num_alcasar</b></font></td></tr>
718
		
-
 
719
		<tr>		
680
		<tr>		
720
		<td> $l_pin </td><td><input type=text name='pin' maxlength=\"8\"></td>
681
		<td> $l_pin </td><td><input type=text name='pin' maxlength=\"8\"></td>
721
		<td><button type=\"submit\" name=\"b_pin\" $gammu_status_on>$l_edit</button></td>
682
		<td><button type=\"submit\" name=\"b_pin\" $gammu_status_on>$l_edit</button></td>
722
		<td><center><font color=\"green\">$current_pin</font></center></td>
683
		<td><center><font color=\"green\">$current_pin</font></center></td>
723
		</tr>
684
		</tr>
724
		<tr><td colspan=\"4\"><font color=red><b>$error_pin</b></font></td></tr>
685
		<tr><td colspan=\"4\"><font color=red><b>$error_pin</b></font></td></tr>
725
		
-
 
726
		<tr>
686
		<tr>
727
		<td> $l_time_account </td><td><input type=text name='time_account'> $l_days </td>
687
		<td> $l_time_account </td><td><input type=text name='time_account'> $l_days </td>
728
		<td><button type=\"submit\" name=\"b_time_account\" $gammu_status_on>$l_edit</button></td>	
688
		<td><button type=\"submit\" name=\"b_time_account\" $gammu_status_on>$l_edit</button></td>
729
		<td><center><font color=\"blue\">$current_time_account</font></center></td>
689
		<td><center><font color=\"blue\">$current_time_account</font></center></td>
730
		</tr>
690
		</tr>
731
		<tr><td colspan=\"4\"><font color=red><b>$error_time_account</b></font></td></tr>
691
		<tr><td colspan=\"4\"><font color=red><b>$error_time_account</b></font></td></tr>
732
		
-
 
733
		<tr>
692
		<tr>
734
		<td> $l_ban_temp </td><td><input type=text name='nb_essais'></td>	
693
		<td> $l_ban_temp </td><td><input type=text name='nb_essais'></td>
735
		<td><button type=\"submit\" name=\"b_ban_temp\" $gammu_status_on>$l_edit</button></td>	
694
		<td><button type=\"submit\" name=\"b_ban_temp\" $gammu_status_on>$l_edit</button></td>
736
		<td><center><font color=\"orange\">$current_try_ban</font></center></td>
695
		<td><center><font color=\"orange\">$current_try_ban</font></center></td>
737
		</tr>
696
		</tr>
738
		<tr><td colspan=\"4\"><font color=red><b>$error_nb_essais</b></font></td></tr>
697
		<tr><td colspan=\"4\"><font color=red><b>$error_nb_essais</b></font></td></tr>
739
		
-
 
740
		<tr>
698
		<tr>
741
		<td>$l_time_perm</td><td><input type=text name='time_perm'> $l_days</td>
699
		<td>$l_time_perm</td><td><input type=text name='time_perm'> $l_days</td>
742
		<td><button type=\"submit\" name=\"b_time_perm\" $gammu_status_on>$l_edit</button></td>	
700
		<td><button type=\"submit\" name=\"b_time_perm\" $gammu_status_on>$l_edit</button></td>
743
		<td><center><font color=\"orange\">$current_time_perm</font></center></td>
701
		<td><center><font color=\"orange\">$current_time_perm</font></center></td>
744
		</tr>
702
		</tr>
745
		<tr><td colspan=\"4\"><font color=red><b>$error_time_perm</b></font></td></tr>
703
		<tr><td colspan=\"4\"><font color=red><b>$error_time_perm</b></font></td></tr>
746
		</table>
704
		</table>
-
 
705
		<br>
-
 
706
		<table border=1>
-
 
707
		<tr>
-
 
708
			<td colspan=4><b>$l_status_gammu</b></td>
-
 
709
			<td><b><center>$l_force_signal</center></b></td>
-
 
710
			<td><b><center>$l_imei_device</center></b></td>
-
 
711
			<td><b><center>$l_sms_received</center></b></td>
-
 
712
		</tr>
-
 
713
		<tr>
-
 
714
			$gammu
-
 
715
			<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>
-
 
716
			<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
-
 
717
			<td><center>$force_signal</center></td>
-
 
718
			<td><center>$imei_device</center></td>
-
 
719
			<td><center>$sms_received</center></td>
-
 
720
		</tr>
-
 
721
		$gammu_puk
-
 
722
		$gammu_simfail
-
 
723
		$gammu_simsecu
-
 
724
		$gammu_timeout
-
 
725
		$gammu_writeerror
-
 
726
		</table>
747
		</form>";
727
		</form>";
748
 
-
 
749
	
728
	
750
	require('/etc/freeradius-web/config.php');
729
	require('/etc/freeradius-web/config.php');
751
 
730
 
752
	if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
731
	if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
753
		include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
732
		include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
754
	else{
733
	else{
755
		echo "<b>Could not include SQL library</b>\n";
734
		echo "<b>Could not include SQL library</b>\n";
756
		exit();
735
		exit();
757
	}
736
	}
758
 
737
 
759
	$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu");
738
	$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu");
760
 
739
 
761
	if(mysqli_connect_errno())
740
	if(mysqli_connect_errno())
762
	{
741
	{
763
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
742
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
764
	}
743
	}
765
 
744
 
766
 
745
 
767
	# Country table
746
	# Country table
768
 
747
 
769
?>
748
?>
770
 
749
 
771
	<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
750
	<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
772
		 <span class="showhide-but_country"><?php echo "<strong>$l_country_filtering<strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
751
		 <span class="showhide-but_country"><?php echo "<strong>$l_country_filtering<strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
773
 
752
 
774
		<div class="showhide-div_country">
753
		<div class="showhide-div_country">
775
		<br />
754
		<br />
776
			<table width=100% style="background: #BDBDBD;">
755
			<table width=100% style="background: #BDBDBD;">
777
			<tr>
756
			<tr>
778
				<?php 
757
				<?php 
779
					$result_country_filter = mysqli_query($con, "SELECT id FROM SMS_country WHERE name = 'FILTRAGE'");
758
					$result_country_filter = mysqli_query($con, "SELECT id FROM SMS_country WHERE name = 'FILTRAGE'");
780
					$row = mysqli_fetch_array($result_country_filter);
759
					$row = mysqli_fetch_array($result_country_filter);
781
 
760
 
782
					if($row['id'] == "advance") {
761
					if($row['id'] == "advance") {
783
						$country_filter = $l_country_advanced_ena;
762
						$country_filter = $l_country_advanced_ena;
784
					} elseif($row['id'] == "ue") {
763
					} elseif($row['id'] == "ue") {
785
						$country_filter = $l_country_ue_ena;
764
						$country_filter = $l_country_ue_ena;
786
					} elseif($row['id'] == "fr") {
765
					} elseif($row['id'] == "fr") {
787
						$country_filter = $l_country_france_ena;
766
						$country_filter = $l_country_france_ena;
788
					} elseif($row['id'] == "all") {
767
					} elseif($row['id'] == "all") {
789
						$country_filter = $l_country_all_ena;
768
						$country_filter = $l_country_all_ena;
790
					} else {
769
					} else {
791
						$country_filter = "Err.";
770
						$country_filter = "Err.";
792
					}
771
					}
793
				?>
772
				?>
794
				<td colspan="3" align="center"><strong><?php echo $l_country_filter; ?></strong><font size="3" color="red"><?php echo $country_filter; ?></font></td>
773
				<td colspan="3" align="center"><strong><?php echo $l_country_filter; ?></strong><font size="3" color="red"><?php echo $country_filter; ?></font></td>
795
			</tr>
774
			</tr>
796
			<tr>
775
			<tr>
797
				<form action="autoregistration.php" methode="POST">
776
				<form action="autoregistration.php" methode="POST">
798
					<td align="center" width=33%><button type="submit" name="b_france_enable"><?php echo "$l_country_france_ena" ?></button></td>
777
					<td align="center" width=33%><button type="submit" name="b_france_enable"><?php echo "$l_country_france_ena" ?></button></td>
799
					<td align="center" width=34%><button type="submit" name="b_ue_enable"><?php echo "$l_country_ue_ena" ?></button></td>
778
					<td align="center" width=34%><button type="submit" name="b_ue_enable"><?php echo "$l_country_ue_ena" ?></button></td>
800
					<td align="center" width=33%><button type="submit" name="b_country_enable"><?php echo "$l_country_all_ena" ?></button></td>
779
					<td align="center" width=33%><button type="submit" name="b_country_enable"><?php echo "$l_country_all_ena" ?></button></td>
801
				</form>
780
				</form>
802
			</tr>	
781
			</tr>	
803
			</table>
782
			</table>
804
			<div style="border-radius: 5px; background: #D8D8D8; margin: 15px;">
783
			<div style="border-radius: 5px; background: #D8D8D8; margin: 15px;">
805
			<span class="showhide-but_country_plus"><?php echo "<strong>$l_country_filtering_plus<strong>" ?> <img src="/images/down2.gif" width="15" height="15"></span>
784
			<span class="showhide-but_country_plus"><?php echo "<strong>$l_country_filtering_plus<strong>" ?> <img src="/images/down2.gif" width="15" height="15"></span>
806
				<div class="showhide-div_country_plus">
785
				<div class="showhide-div_country_plus">
807
				<table id="table_country" class="display">
786
				<table id="table_country" class="display">
808
					<thead>
787
					<thead>
809
						<tr>
788
						<tr>
810
							<th><b><font color="black">Pays</font></b></th>
789
							<th><b><font color="black">Pays</font></b></th>
811
							<th><b><font color="black">code</font></b></th>
790
							<th><b><font color="black">code</font></b></th>
812
							<th><b><font color="black">Etat</font></b></th>
791
							<th><b><font color="black">Etat</font></b></th>
813
						</tr>
792
						</tr>
814
					</thead>
793
					</thead>
815
					<tbody>
794
					<tbody>
816
						<?php 
795
						<?php 
817
 
796
 
818
						$result_country = mysqli_query($con, "SELECT * FROM SMS_country WHERE name != 'FILTRAGE'");
797
						$result_country = mysqli_query($con, "SELECT * FROM SMS_country WHERE name != 'FILTRAGE'");
819
						while($row = mysqli_fetch_array($result_country))
798
						while($row = mysqli_fetch_array($result_country))
820
						{
799
						{
821
						echo "	
800
						echo "	
822
						<tr>
801
						<tr>
823
						<form action=\"autoregistration.php\" methode=\"POST\">
802
						<form action=\"autoregistration.php\" methode=\"POST\">
824
						<td>
803
						<td>
825
							<input type=\"hidden\" name=\"country_select\" value=\"" .$row['name']."\">	
804
							<input type=\"hidden\" name=\"country_select\" value=\"" .$row['name']."\">	
826
							".$row['name']."
805
							".$row['name']."
827
						</td>
806
						</td>
828
						<td>".$row['id']."</td>
807
						<td>".$row['id']."</td>
829
						";
808
						";
830
			
809
			
831
						if($row['status']=='0')
810
						if($row['status']=='0')
832
						{
811
						{
833
							echo "<td><input type='image' src=\"/images/state_error.gif\" width=\"15\" height=\"15\"></td>";
812
							echo "<td><input type='image' src=\"/images/state_error.gif\" width=\"15\" height=\"15\"></td>";
834
						}
813
						}
835
						if($row['status']=='1')
814
						if($row['status']=='1')
836
						{
815
						{
837
							echo "<td><input type='image' src=\"/images/state_ok.gif\" width=\"15\" height=\"15\"></td>";
816
							echo "<td><input type='image' src=\"/images/state_ok.gif\" width=\"15\" height=\"15\"></td>";
838
						}
817
						}
839
						echo "	</form>
818
						echo "	</form>
840
							</tr>
819
							</tr>
841
							";
820
							";
842
						}
821
						}
843
						?>
822
						?>
844
					</tbody>
823
					</tbody>
845
				</table>
824
				</table>
846
				</div>
825
				</div>
847
			</div>
826
			</div>
848
		</div>	
827
		</div>	
849
	</div>
828
	</div>
850
<?php 
829
<?php 
851
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
830
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
852
 
831
 
853
?>
832
?>
854
 
833
 
855
<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
834
<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
856
		<span class="showhide-but_ban"><?php echo "<strong>$l_phone_ban</strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
835
		<span class="showhide-but_ban"><?php echo "<strong>$l_phone_ban</strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
857
 
836
 
858
		<div class="showhide-div_ban">
837
		<div class="showhide-div_ban">
859
	
838
	
860
			<table id="table_id" class="display">
839
			<table id="table_id" class="display">
861
				<thead>
840
				<thead>
862
					<tr>
841
					<tr>
863
						<th><b><font color="black"><?php echo $l_num_num; ?></font></b></th>
842
						<th><b><font color="black"><?php echo $l_num_num; ?></font></b></th>
864
						<th><b><font color="black"><?php echo $l_num_raison; ?></font></b></th>
843
						<th><b><font color="black"><?php echo $l_num_raison; ?></font></b></th>
865
						<th><b><font color="black"><?php echo $l_num_expiration; ?></font></b></th>
844
						<th><b><font color="black"><?php echo $l_num_expiration; ?></font></b></th>
866
						<th><b><font color="black">Action</font></b></th>
845
						<th><b><font color="black">Action</font></b></th>
867
					</tr>
846
					</tr>
868
				</thead>
847
				</thead>
869
				<tbody>
848
				<tbody>
870
					<?php 
849
					<?php 
871
					while($row = mysqli_fetch_array($result))
850
					while($row = mysqli_fetch_array($result))
872
					{
851
					{
873
					echo "	
852
					echo "	
874
						<tr>
853
						<tr>
875
						<form action=\"autoregistration.php\" methode=\"POST\">
854
						<form action=\"autoregistration.php\" methode=\"POST\">
876
						<td>
855
						<td>
877
							<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
856
							<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
878
							".$row['SenderNumber']."
857
							".$row['SenderNumber']."
879
						</td>";
858
						</td>";
880
		
859
		
881
					if($row['Perm']=='0')
860
					if($row['Perm']=='0')
882
					{
861
					{
883
						echo "<td>$l_num_exist</td>";
862
						echo "<td>$l_num_exist</td>";
884
					}
863
					}
885
					if($row['Perm']=='1')
864
					if($row['Perm']=='1')
886
					{
865
					{
887
						echo "<td>$l_num_flood</td>";
866
						echo "<td>$l_num_flood</td>";
888
					}
867
					}
889
					echo "	<td>" . $row['Expiration']. "</td>
868
					echo "	<td>" . $row['Expiration']. "</td>
890
							<td>
869
							<td>
891
								<input type='submit' value='".$l_num_unlock."'>
870
								<input type='submit' value='".$l_num_unlock."'>
892
							</td>
871
							</td>
893
							</form>
872
							</form>
894
						</tr>
873
						</tr>
895
						";
874
						";
896
					}
875
					}
897
					?>
876
					?>
898
				</tbody>
877
				</tbody>
899
			</table>
878
			</table>
900
		</div>
879
		</div>
901
	</div>
880
	</div>
902
<?php
881
<?php
903
	mysqli_close($con);
882
	mysqli_close($con);
904
	}
883
	}
905
?>
884
?>
906
</html>
885
</html>
907
 
886