Subversion Repositories ALCASAR

Rev

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

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