Subversion Repositories ALCASAR

Rev

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

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