Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f7c6bd0

Browse files
author
nosolored
committedApr 16, 2014
Add mysqli connect
1 parent 8115af1 commit f7c6bd0

17 files changed

+784
-569
lines changed
 

‎.htaccess

+84-85
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,84 @@
1-
# mod_rewrite in use
2-
3-
# Redirecciona www a sin www
4-
5-
Options +FollowSymLinks
6-
7-
RewriteEngine On
8-
9-
RewriteBase /
10-
11-
12-
13-
Options +Indexes
14-
15-
AddType text/x-component .htc
16-
17-
18-
19-
RewriteCond %{REQUEST_FILENAME} !-f
20-
21-
RewriteCond %{REQUEST_FILENAME} !-d
22-
23-
RewriteCond %{REQUEST_URI} !^/index.php
24-
25-
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
26-
27-
RewriteRule (.*) index.php
28-
29-
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
30-
31-
32-
33-
## If you experience problems on your site block out the operations listed below
34-
35-
## This attempts to block the most common type of exploit `attempts` to Joomla!
36-
37-
#
38-
39-
# Block out any script trying to set a mosConfig value through the URL
40-
41-
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
42-
43-
# Block out any script trying to base64_encode crap to send via URL
44-
45-
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
46-
47-
# Block out any script that includes a <script> tag in URL
48-
49-
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
50-
51-
# Block out any script trying to set a PHP GLOBALS variable via URL
52-
53-
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
54-
55-
# Block out any script trying to modify a _REQUEST variable via URL
56-
57-
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
58-
59-
# Send all blocked request to homepage with 403 Forbidden error!
60-
61-
RewriteRule ^(.*)$ index.php [F,L]
62-
63-
#
64-
65-
########## End - Rewrite rules to block out some common exploits
66-
67-
68-
69-
# ErrorDocument 404 index.php
70-
71-
72-
73-
Options +Indexes
74-
75-
AddType text/x-component .htc
76-
77-
78-
79-
php_flag register_globals off
80-
81-
php_flag display_errors on
82-
83-
php_flag magic_quotes_gpc off
84-
85-
php_flag apc.cache_by_default off
1+
# mod_rewrite in use
2+
3+
# Redirecciona www a sin www
4+
5+
Options +FollowSymLinks
6+
7+
RewriteEngine On
8+
9+
RewriteBase /
10+
11+
12+
13+
Options +Indexes
14+
15+
AddType text/x-component .htc
16+
17+
18+
19+
RewriteCond %{REQUEST_FILENAME} !-f
20+
21+
RewriteCond %{REQUEST_FILENAME} !-d
22+
23+
RewriteCond %{REQUEST_URI} !^/index.php
24+
25+
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
26+
27+
RewriteRule (.*) index.php
28+
29+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
30+
31+
32+
33+
## If you experience problems on your site block out the operations listed below
34+
35+
## This attempts to block the most common type of exploit `attempts` to Joomla!
36+
37+
#
38+
39+
# Block out any script trying to set a mosConfig value through the URL
40+
41+
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
42+
43+
# Block out any script trying to base64_encode crap to send via URL
44+
45+
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
46+
47+
# Block out any script that includes a <script> tag in URL
48+
49+
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
50+
51+
# Block out any script trying to set a PHP GLOBALS variable via URL
52+
53+
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
54+
55+
# Block out any script trying to modify a _REQUEST variable via URL
56+
57+
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
58+
59+
# Send all blocked request to homepage with 403 Forbidden error!
60+
61+
RewriteRule ^(.*)$ index.php [F,L]
62+
63+
#
64+
65+
########## End - Rewrite rules to block out some common exploits
66+
67+
68+
69+
# ErrorDocument 404 index.php
70+
71+
72+
73+
Options +Indexes
74+
75+
AddType text/x-component .htc
76+
77+
78+
php_flag display_errors on
79+
php_flag display_startup_errors on
80+
php_value error_reporting 8191
81+
php_flag register_globals off
82+
php_flag magic_quotes_gpc off
83+
84+

‎cron.php

+42-42
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66

77
//ENVIO DE E-MAIL QUE ESTÁN PROXIMOS A LA FECHA DE RENOVACIÓN
88
$sql = "SELECT notice_renewal,sender FROM parametros";
9-
$result = mysql_query($sql,$link);
10-
$row = mysql_fetch_assoc($result);
9+
$result = $link->query($sql);
10+
$row = $result->fetch_assoc();
1111
$dias = $row['notice_renewal'];
1212
$sender = $row['sender'];
1313

14-
mysql_free_result($result);
14+
$result->free();
1515

1616
$limite = $dias*24*60*60;
1717

1818
$sql = "SELECT * FROM members WHERE (UNIX_TIMESTAMP(renewal) - UNIX_TIMESTAMP(NOW())) < ".$limite." AND email_renewal='0';";
1919
//echo $sql;
2020
//echo $limite;
21-
$result = mysql_query($sql,$link);
21+
$result = $link->query($sql);
2222
echo "<br><br>Begin of renewal notice";
23-
while($fila = mysql_fetch_assoc($result)){
23+
while($fila = $result->fetch_assoc()){
2424
$candado = false;
2525
$mensaje = '';
2626
$subject = '';
2727
echo "<br>Renewal notice for: ".$fila['email'];
2828
$language = datosreg($fila['language'],'language','language','cod');
2929
//Buscamos la plantilla que le corresponda
3030
$sql = "SELECT message, subject FROM messages WHERE type='renewal' AND language='".$language."'";
31-
$r_tmp = mysql_query($sql,$link);
31+
$r_tmp = $link->query($sql);
3232

33-
if(mysql_num_rows($r_tmp)>0){
34-
$f_tmp = mysql_fetch_assoc($r_tmp);
33+
if($r_tmp->num_rows>0){
34+
$f_tmp = $r_tmp->fetch_assoc();
3535
$message = $f_tmp['message'];
3636
$subject = $f_tmp['subject'];
3737
if(trim($message) == ''){
3838
$default_language = datosreg('1','language','language','vdefault');
3939
$sql = "SELECT message, subject FROM messages WHERE type='renewal' AND language='".$default_language."'";
40-
$r2_tmp = mysql_query($sql,$link);
41-
if(mysql_num_rows($r2_tmp)>0){
42-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
40+
$r2_tmp = $link->query($sql);
41+
if($r2_tmp->num_rows>0){
42+
$f2_tmp = $r2_tmp->fetch_assoc();
4343
$message = $f2_tmp['message'];
4444
$subject = $f2_tmp['subject'];
4545
if(trim($message) == ''){
@@ -60,9 +60,9 @@
6060
//buscamos mensaje por defecto
6161
$default_language = datosreg('1','language','language','vdefault');
6262
$sql = "SELECT message, subject FROM messages WHERE type='renewal' AND language='".$default_language."'";
63-
$r2_tmp = mysql_query($sql,$link);
64-
if(mysql_num_rows($r2_tmp)>0){
65-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
63+
$r2_tmp = $link->query($sql);
64+
if($r2_tmp->num_rows>0){
65+
$f2_tmp = $r2_tmp->fetch_assoc();
6666
$message = $f2_tmp['message'];
6767
$subject = $f2_tmp['subject'];
6868
if(trim($message) == ''){
@@ -79,8 +79,8 @@
7979

8080
if($candado){
8181
$sql = "DESCRIBE members";
82-
$r_campos = mysql_query($sql,$link);
83-
while($aux = mysql_fetch_assoc($r_campos)){
82+
$r_campos = $link->query($sql);
83+
while($aux = $r_campos->fetch_assoc()){
8484
if($aux['Field']=="renewal"){
8585
$message = str_replace("{{".$aux['Field']."}}", date("d/m/Y",strtotime($fila[$aux['Field']])), $message);
8686
}elseif($aux['Field']=="quota"){
@@ -111,8 +111,8 @@
111111
$mail->Subject = $subject;
112112
$mail->AddAddress($fila['email']);
113113
$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
114-
$r_resp = mysql_query($sql,$link);
115-
while($aux = mysql_fetch_assoc($r_resp)){
114+
$r_resp = $link->query($sql);
115+
while($aux = $r_resp->fetch_assoc()){
116116
//Copia a responsables
117117
$mail->AddBCC($aux['responsible']);
118118
}
@@ -125,7 +125,7 @@
125125
$mail->Send();
126126
//Actualizamos la tabla de miembros
127127
$sql = "UPDATE members SET email_renewal='1' WHERE cod='".$fila['cod']."';";
128-
mysql_query($sql,$link);
128+
$link->query($sql);
129129

130130
}else{
131131
//Notificamos al responsable
@@ -138,8 +138,8 @@
138138
$mail->Subject = "Problem to send renewal notice e-mail";
139139

140140
$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
141-
$r_resp = mysql_query($sql,$link);
142-
while($aux = mysql_fetch_assoc($r_resp)){
141+
$r_resp = $link->query($sql);
142+
while($aux = $r_resp->fetch_assoc()){
143143
//Copia a responsables
144144
$mail->AddAddress($aux['responsible']);
145145
}
@@ -154,33 +154,33 @@
154154
}
155155

156156
}
157-
mysql_free_result($result);
157+
$result->free();
158158
echo "<br>End of renewal notice";
159159
echo "<br><br>Begin of expiration notice";
160160
// ENVIO DE E-MAIL QUE HAN SIDO EXPIRADOS
161161

162162
$sql = "SELECT * FROM members WHERE (UNIX_TIMESTAMP(renewal) - UNIX_TIMESTAMP(NOW())) < 0 AND email_expired='0';";
163-
$result = mysql_query($sql,$link);
164-
while($fila = mysql_fetch_assoc($result)){
163+
$result = $link->query($sql);
164+
while($fila = $result->fetch_assoc()){
165165
$candado = false;
166166
$mensaje = '';
167167
$subject = '';
168168
echo "<br>Expiration notice for: ".$fila['email'];
169169
$language = datosreg($fila['language'],'language','language','cod');
170170
//Buscamos la plantilla que le corresponda
171171
$sql = "SELECT message, subject FROM messages WHERE type='expired' AND language='".$language."'";
172-
$r_tmp = mysql_query($sql,$link);
172+
$r_tmp = $link->query($sql);
173173

174-
if(mysql_num_rows($r_tmp)>0){
175-
$f_tmp = mysql_fetch_assoc($r_tmp);
174+
if($r_tmp->num_rows>0){
175+
$f_tmp = $r_tmp->fetch_assoc();
176176
$message = $f_tmp['message'];
177177
$subject = $f_tmp['subject'];
178178
if(trim($message) == ''){
179179
$default_language = datosreg('1','language','language','vdefault');
180180
$sql = "SELECT message, subject FROM messages WHERE type='expired' AND language='".$default_language."'";
181-
$r2_tmp = mysql_query($sql,$link);
182-
if(mysql_num_rows($r2_tmp)>0){
183-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
181+
$r2_tmp = $link->query($sql);
182+
if($r2_tmp->num_rows>0){
183+
$f2_tmp = $r2_tmp->fetch_assoc();
184184
$message = $f2_tmp['message'];
185185
$subject = $f2_tmp['subject'];
186186
if(trim($message) == ''){
@@ -201,9 +201,9 @@
201201
//buscamos mensaje por defecto
202202
$default_language = datosreg('1','language','language','vdefault');
203203
$sql = "SELECT message, subject FROM messages WHERE type='expired' AND language='".$default_language."'";
204-
$r2_tmp = mysql_query($sql,$link);
205-
if(mysql_num_rows($r2_tmp)>0){
206-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
204+
$r2_tmp = $link->query($sql);
205+
if($r2_tmp->num_rows>0){
206+
$f2_tmp = $r2_tmp->fetch_assoc();
207207
$message = $f2_tmp['message'];
208208
$subject = $f2_tmp['subject'];
209209
if(trim($message) == ''){
@@ -220,8 +220,8 @@
220220

221221
if($candado){
222222
$sql = "DESCRIBE members";
223-
$r_campos = mysql_query($sql,$link);
224-
while($aux = mysql_fetch_assoc($r_campos)){
223+
$r_campos = $link->query($sql);
224+
while($aux = $r_campos->fetch_assoc()){
225225
if($aux['Field']=="renewal"){
226226
$message = str_replace("{{".$aux['Field']."}}", date("d/m/Y",strtotime($fila[$aux['Field']])), $message);
227227
}elseif($aux['Field']=="quota"){
@@ -252,8 +252,8 @@
252252
$mail->Subject = $subject;
253253
$mail->AddAddress($fila['email']);
254254
$sql = "SELECT responsible FROM responsible WHERE area='expired';";
255-
$r_resp = mysql_query($sql,$link);
256-
while($aux = mysql_fetch_assoc($r_resp)){
255+
$r_resp = $link->query($sql);
256+
while($aux = $r_resp->fetch_assoc()){
257257
//Copia a responsables
258258
$mail->AddBCC($aux['responsible']);
259259
}
@@ -266,7 +266,7 @@
266266
$mail->Send();
267267
//Actualizamos la tabla de miembros
268268
$sql = "UPDATE members SET email_expired='1', status='2' WHERE cod='".$fila['cod']."';";
269-
mysql_query($sql,$link);
269+
$link->query($sql);
270270

271271
}else{
272272
//Notificamos al responsable
@@ -279,8 +279,8 @@
279279
$mail->Subject = "Problem to send expiration notice e-mail";
280280

281281
$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
282-
$r_resp = mysql_query($sql,$link);
283-
while($aux = mysql_fetch_assoc($r_resp)){
282+
$r_resp = $link->query($sql);
283+
while($aux = $r_resp->fetch_assoc()){
284284
//Copia a responsables
285285
$mail->AddAddress($aux['responsible']);
286286
}
@@ -295,7 +295,7 @@
295295
}
296296
}
297297
echo "<br>End of expiration notice";
298-
mysql_free_result($result);
299-
mysql_close($link);
298+
$result->free();
299+
$link->close();
300300

301301
?>

‎form_member.php

+49-54
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$link = conectar();
2525
reset ($_POST);
2626
while (list ($param, $val) = each ($_POST)) {
27-
$asignacion = "\$" . $param . "=mysql_real_escape_string(\$_POST['" . $param . "']);";
27+
$asignacion = "\$" . $param . "=$link->real_escape_string(\$_POST['" . $param . "']);";
2828
eval($asignacion);
2929
}
3030
$renewal = str_replace('/','-',$renewal);
@@ -35,14 +35,14 @@
3535
$vat = '';
3636
}
3737
$sql = "INSERT INTO members (name,surname,country,language,phone,email,renewal,quota,type,comment,status,date_arrival,institution,address,postal_code,vat) VALUES ('".$name."','".$surname."','".$country."','".$language."','".$phone."','".$email."','".date("Y-m-d",strtotime($renewal))."','".$quota."','".$type."','".$comment."','".$status."','".date("Y-m-d")."','".$institution."','".$address."','".$postal_code."','".$vat."');";
38-
$result = mysql_query($sql,$link);
38+
$result = $link->query($sql);
3939
if (!$result) {
40-
die('Invalid query: Problems to insert data into the member table ' . mysql_error());
40+
die('Invalid query: Problems to insert data into the member table ' . $link->error);
4141
}
4242

4343
$sql = "SELECT max(cod) FROM members;";
44-
$result = mysql_query($sql,$link);
45-
$tmp_result = mysql_fetch_assoc($result);
44+
$result = $link->query($sql);
45+
$tmp_result = $result->fetch_assoc();
4646
$cod_max = $tmp_result['max(cod)'];
4747

4848
/********************************************************************************************************/
@@ -51,18 +51,18 @@
5151
if($send_invoice =="YES"){
5252
$link = conectar2();
5353
$sql = "SELECT body, footer, show_signature FROM invoice WHERE cod='1';";
54-
$result_pdf = mysql_query($sql,$link);
55-
$aux = mysql_fetch_assoc($result_pdf);
54+
$result_pdf = $link->query($sql);
55+
$aux = $result_pdf->fetch_assoc();
5656
$message = $aux['body'];
5757
$footer = quitar_html($aux['footer']);
5858
$show_signature = ($aux['show_signature']=="YES")?(true):(false);
5959
$sql = "SELECT * FROM members WHERE cod='".$cod_max."';";
60-
$result_pdf = mysql_query($sql,$link);
61-
$fila = mysql_fetch_assoc($result_pdf);
60+
$result_pdf = $link->query($sql);
61+
$fila = $result_pdf->fetch_assoc();
6262
$sql = "DESCRIBE members";
63-
$r_campos = mysql_query($sql,$link);
63+
$r_campos = $link->query($sql);
6464
$message = quitar_html($message);
65-
while($aux = mysql_fetch_assoc($r_campos)){
65+
while($aux = $r_campos->fetch_assoc()){
6666
if($aux['Field']=="renewal"){
6767
$message = str_replace("{{".$aux['Field']."}}", date("d/m/Y",strtotime($fila[$aux['Field']])), $message);
6868
}elseif($aux['Field']=="quota"){
@@ -88,15 +88,15 @@
8888
//echo $message;
8989
$year = date("Y");
9090
$sql = "SELECT max(num_invoice) AS num_invoice FROM invoices WHERE year='".$year."';";
91-
$result = mysql_query($sql,$link);
92-
$aux_invoice = mysql_fetch_assoc($result);
91+
$result = $link->query($sql);
92+
$aux_invoice = $result->fetch_assoc();
9393
$num_invoice = ($aux_invoice['num_invoice']=='NULL')?('1'):($aux_invoice['num_invoice']+1);
9494
//$num_invoice = datosreg('1','parametros','num_invoice','cod');
9595

96-
$sql = "INSERT INTO invoices (num_invoice,year,cod_member,message,quota,date) VALUES ('".$num_invoice."','".$year."','".$cod_max."','".mysql_real_escape_string($message)."','".$fila['quota']."','".date("Y-m-d")."');";
97-
$result = mysql_query($sql,$link);
96+
$sql = "INSERT INTO invoices (num_invoice,year,cod_member,message,quota,date) VALUES ('".$num_invoice."','".$year."','".$cod_max."','".$link->real_escape_string($message)."','".$fila['quota']."','".date("Y-m-d")."');";
97+
$result = $link->query($sql);
9898
if (!$result) {
99-
die('Invalid query 1: ' . mysql_error());
99+
die('Invalid query 1: ' . $link->error);
100100
}
101101

102102
//Crear el pdf que se enviará.
@@ -160,26 +160,26 @@ function Footer(){
160160
$link = conectar();
161161
$sql = "SELECT * FROM members WHERE cod='".$cod_max."';";
162162
//echo $sql;
163-
$result_tmp = mysql_query($sql,$link);
164-
$fila = mysql_fetch_assoc($result_tmp);
163+
$result_tmp = $link->query($sql);
164+
$fila = $result_tmp->fetch_assoc();
165165

166166
//ENVIAR E-MAIL
167167
$cod_language = $language;
168168
$language = datosreg($cod_language,'language','language','cod');
169169
//Buscamos la plantilla que le corresponda
170170
$sql = "SELECT message, subject FROM messages WHERE type='welcome' AND language='".$language."'";
171-
$r_tmp = mysql_query($sql,$link);
171+
$r_tmp = $link->query($sql);
172172

173-
if(mysql_num_rows($r_tmp)>0){
174-
$f_tmp = mysql_fetch_assoc($r_tmp);
173+
if($r_tmp->num_rows>0){
174+
$f_tmp = $r_tmp->fetch_assoc();
175175
$message = $f_tmp['message'];
176176
$subject = $f_tmp['subject'];
177177
if(trim($message) == ''){
178178
$default_language = datosreg('1','language','language','vdefault');
179179
$sql = "SELECT message, subject FROM messages WHERE type='welcome' AND language='".$default_language."'";
180-
$r2_tmp = mysql_query($sql,$link);
181-
if(mysql_num_rows($r2_tmp)>0){
182-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
180+
$r2_tmp = $link->query($sql);
181+
if($r2_tmp->num_rows>0){
182+
$f2_tmp = $r2_tmp->fetch_assoc();
183183
$message = $f2_tmp['message'];
184184
$subject = $f2_tmp['subject'];
185185
if(trim($message) == ''){
@@ -200,9 +200,9 @@ function Footer(){
200200
//buscamos mensaje por defecto
201201
$default_language = datosreg('1','language','language','vdefault');
202202
$sql = "SELECT message, subject FROM messages WHERE type='welcome' AND language='".$default_language."'";
203-
$r2_tmp = mysql_query($sql,$link);
204-
if(mysql_num_rows($r2_tmp)>0){
205-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
203+
$r2_tmp = $link->query($sql);
204+
if($r2_tmp->num_rows>0){
205+
$f2_tmp = $r2_tmp->fetch_assoc();
206206
$message = $f2_tmp['message'];
207207
$subject = $f2_tmp['subject'];
208208
if(trim($message) == ''){
@@ -218,15 +218,15 @@ function Footer(){
218218
}
219219

220220
$sql = "SELECT sender FROM parametros";
221-
$result = mysql_query($sql,$link);
222-
$row_sender = mysql_fetch_assoc($result);
221+
$result = $link->query($sql);
222+
$row_sender = $result->fetch_assoc();
223223
$sender = $row_sender['sender'];
224224

225225

226226
if($candado){
227227
$sql = "DESCRIBE members";
228-
$r_campos = mysql_query($sql,$link);
229-
while($aux = mysql_fetch_assoc($r_campos)){
228+
$r_campos = $link->query($sql);
229+
while($aux = $r_campos->fetch_assoc()){
230230
if($aux['Field']=="renewal"){
231231
$message = str_replace("{{".$aux['Field']."}}", date("d/m/Y",strtotime($fila[$aux['Field']])), $message);
232232
}elseif($aux['Field']=="quota"){
@@ -257,8 +257,8 @@ function Footer(){
257257
$mail->Subject = $subject;
258258
$mail->AddAddress($email);
259259
/*$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
260-
$r_resp = mysql_query($sql,$link);
261-
while($aux = mysql_fetch_assoc($r_resp)){
260+
$r_resp = $link->query($sql);
261+
while($aux = $r_resp->fetch_assoc()){
262262
//Copia a responsables
263263
$mail->AddBCC($aux['responsible']);
264264
}
@@ -281,8 +281,8 @@ function Footer(){
281281
$mail->Subject = "Problem to send welcome message e-mail";
282282

283283
$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
284-
$r_resp = mysql_query($sql,$link);
285-
while($aux = mysql_fetch_assoc($r_resp)){
284+
$r_resp = $link->query($sql);
285+
while($aux = $r_resp->fetch_assoc()){
286286
//Copia a responsables
287287
$mail->AddAddress($aux['responsible']);
288288
}
@@ -344,12 +344,7 @@ function Footer(){
344344
<!--[if IE]> <link rel="stylesheet" type="text/css" media="all" href="css/ie.css"/> <script src="js/html5.js"></script> <![endif]-->
345345
<!--Upgrade MSIE5.5-7 to be compatible with MSIE8: http://ie7-js.googlecode.com/svn/version/2.1(beta3)/IE8.js -->
346346
<!--[if lt IE 8]> <script src="js/IE8.js"></script> <![endif]-->
347-
<script type="text/javascript">
348-
$(document).ready(function(){
349-
/* setup navigation, content boxes, etc... */
350-
Administry.setup();
351-
});
352-
</script>
347+
353348

354349
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
355350
<script type="text/javascript">
@@ -459,11 +454,11 @@ function Footer(){
459454
<?php
460455
$link = conectar();
461456
$sql = "SELECT * FROM country";
462-
$result = mysql_query($sql,$link);
463-
while($row = mysql_fetch_assoc($result)){
457+
$result = $link->query($sql);
458+
while($row = $result->fetch_assoc()){
464459
echo '<option value="'.$row['iso'].'">'.$row['printable_name'].'</option>';
465460
}
466-
mysql_free_result($result);
461+
$result->free();
467462
?>
468463
</select>
469464
</p>
@@ -475,11 +470,11 @@ function Footer(){
475470
<?php
476471
$link = conectar();
477472
$sql = "SELECT * FROM language WHERE active='1'";
478-
$result = mysql_query($sql,$link);
479-
while($row = mysql_fetch_assoc($result)){
473+
$result = $link->query($sql);
474+
while($row = $result->fetch_assoc()){
480475
echo '<option value="'.$row['cod'].'">'.$row['language'].'</option>';
481476
}
482-
mysql_free_result($result);
477+
$result->free();
483478
?>
484479
</select>
485480
</p>
@@ -497,7 +492,7 @@ function Footer(){
497492
<p>
498493
<label class="required" for="renewal">Renewal Date: (dd/mm/yyyy)</label>
499494
<br>
500-
<input id="renewal" class="hasDatepick" type="date" name="renewal" value="" placeholder="dd/mm/yyyy">
495+
<input id="renewal" type="text" name="renewal" value="" placeholder="dd/mm/yyyy">
501496
</p>
502497
<p>
503498
<label class="required" for="quota">Quota:</label>
@@ -516,11 +511,11 @@ function Footer(){
516511
<?php
517512
$link = conectar();
518513
$sql = "SELECT * FROM type_member";
519-
$result = mysql_query($sql,$link);
520-
while($row = mysql_fetch_assoc($result)){
514+
$result = $link->query($sql);
515+
while($row = $result->fetch_assoc()){
521516
echo '<option value="'.$row['cod'].'">'.$row['name'].'</option>';
522517
}
523-
mysql_free_result($result);
518+
$result->free();
524519
?>
525520
</select>
526521
</p>
@@ -554,11 +549,11 @@ function Footer(){
554549
<?php
555550
$link = conectar();
556551
$sql = "SELECT * FROM status";
557-
$result = mysql_query($sql,$link);
558-
while($row = mysql_fetch_assoc($result)){
552+
$result = $link->query($sql);
553+
while($row = $result->fetch_assoc()){
559554
echo '<option value="'.$row['cod'].'">'.$row['status'].'</option>';
560555
}
561-
mysql_free_result($result);
556+
$result->free();
562557
?>
563558
</select>
564559
</p>

‎funciones.php

+267-69
Large diffs are not rendered by default.

‎funciones/configuracion_invoice.php

+44-45
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$link = conectar();
1212
reset ($_REQUEST);
1313
while (list ($param, $val) = each ($_REQUEST)) {
14-
$asignacion = "\$" . $param . "=mysql_real_escape_string(\$_REQUEST['" . $param . "']);";
14+
$asignacion = "\$" . $param . "=$link->real_escape_string(\$_REQUEST['" . $param . "']);";
1515
eval($asignacion);
1616
}
1717

@@ -58,12 +58,12 @@
5858
$presql = "SELECT a.cod, a.num_invoice, a.year, a.date, b.name, b.surname, b.institution FROM invoices AS a, members AS b WHERE a.cod_member=b.cod AND".$filtro.";";
5959
//echo $presql;
6060

61-
$result = mysql_query($presql,$link);
61+
$result = $link->query($presql);
6262
if (!$result) {
63-
die('Invalid query: ' . mysql_error());
63+
die('Invalid query: ' . $link->error);
6464
}
6565

66-
$num_rows = mysql_num_rows($result);
66+
$num_rows = $result->num_rows;
6767
if($num_rows > 0){
6868
$contenido = '<br /><div align="center">';
6969
$contenido .= '<table class="stylized" width="100%">';
@@ -91,7 +91,7 @@
9191
<th class="option">Options</th>
9292
</tr>';
9393
$i = 0;
94-
while($row = mysql_fetch_assoc($result)){
94+
while($row = $result->fetch_assoc()){
9595
$i += 1;
9696
if($i%2==0){
9797
$contenido .= '<tr class="campo2">';
@@ -117,8 +117,8 @@
117117
}
118118
$contenido .= '</table></div>';
119119

120-
mysql_free_result($result);
121-
//mysql_free_result($result2);
120+
$result->free();
121+
122122
echo json_encode(array("status"=>"true","contenido"=>$contenido ));
123123
}else{
124124
echo json_encode(array("status"=>"false" ));
@@ -129,7 +129,7 @@
129129
$link = conectar();
130130
reset ($_REQUEST);
131131
while (list ($param, $val) = each ($_REQUEST)) {
132-
$asignacion = "\$" . $param . "=mysql_real_escape_string(\$_REQUEST['" . $param . "']);";
132+
$asignacion = "\$" . $param . "=$link->real_escape_string(\$_REQUEST['" . $param . "']);";
133133
eval($asignacion);
134134
}
135135

@@ -177,12 +177,12 @@
177177

178178
//echo $presql;
179179

180-
$result = mysql_query($presql,$link);
180+
$result = $link->query($presql);
181181
if (!$result) {
182-
die('Invalid query: ' . mysql_error());
182+
die('Invalid query: ' . $link->error);
183183
}
184184

185-
$num_rows = mysql_num_rows($result);
185+
$num_rows = $result->num_rows;
186186
if($num_rows > 0){
187187
$contenido = '<br /><div align="center">';
188188
$contenido .= '<table class="stylized" width="100%">';
@@ -210,7 +210,7 @@
210210
<th class="option">Options</th>
211211
</tr>';
212212
$i = 0;
213-
while($row = mysql_fetch_assoc($result)){
213+
while($row = $result->fetch_assoc()){
214214
$i += 1;
215215
if($i%2==0){
216216
$contenido .= '<tr class="campo2">';
@@ -236,8 +236,7 @@
236236
}
237237
$contenido .= '</table></div>';
238238

239-
mysql_free_result($result);
240-
//mysql_free_result($result2);
239+
$result->free();
241240
echo json_encode(array("status"=>"true","contenido"=>$contenido ));
242241
}else{
243242
echo json_encode(array("status"=>"false" ));
@@ -250,16 +249,16 @@
250249
$cod = substr($_REQUEST['cod'],7);
251250

252251
$sql = "SELECT * FROM invoices WHERE cod='".$cod."';";
253-
$result = mysql_query($sql,$link);
252+
$result = $link->query($sql);
254253
if (!$result) {
255254
echo json_encode(array("status"=>"false"));
256-
die('Invalid query: ' . mysql_error());
255+
die('Invalid query: ' . $link->error);
257256
}else{
258-
$aux = mysql_fetch_assoc($result);
257+
$aux = $result->fetch_assoc();
259258
$link = conectar2();
260259
$sql = "SELECT footer, show_signature FROM invoice WHERE cod='1';";
261-
$result = mysql_query($sql,$link);
262-
$tmp_invoice = mysql_fetch_assoc($result);
260+
$result = $link->query($sql);
261+
$tmp_invoice = $result->fetch_assoc();
263262

264263
$num_invoice = $aux['num_invoice'];
265264
$year = $aux['year'];
@@ -331,16 +330,16 @@ function Footer(){
331330
$cod = substr($_REQUEST['cod'],7);
332331

333332
$sql = "SELECT * FROM invoices WHERE cod='".$cod."';";
334-
$result = mysql_query($sql,$link);
333+
$result = $link->query($sql);
335334
if (!$result) {
336335
echo json_encode(array("status"=>"false"));
337-
die('Invalid query: ' . mysql_error());
336+
die('Invalid query: ' . $link->error);
338337
}else{
339-
$aux = mysql_fetch_assoc($result);
338+
$aux = $result->fetch_assoc();
340339
$link = conectar2();
341340
$sql = "SELECT footer, show_signature FROM invoice WHERE cod='1';";
342-
$result = mysql_query($sql,$link);
343-
$tmp_invoice = mysql_fetch_assoc($result);
341+
$result = $link->query($sql);
342+
$tmp_invoice = $result->fetch_assoc();
344343

345344
$num_invoice = $aux['num_invoice'];
346345
$year = $aux['year'];
@@ -407,27 +406,27 @@ function Footer(){
407406
//ENVIAR E-MAIL
408407
$link = conectar();
409408
$sql = "SELECT * FROM members WHERE cod='".$cod_member."';";
410-
$result = mysql_query($sql,$link);
409+
$result = $link->query($sql);
411410
if (!$result) {
412411
echo json_encode(array("status"=>"false"));
413-
die('Invalid query: ' . mysql_error());
412+
die('Invalid query: ' . $link->error);
414413
}
415-
$fila = mysql_fetch_assoc($result);
414+
$fila = $result->fetch_assoc();
416415
$language = datosreg($fila['language'],'language','language','cod');
417416
//Buscamos la plantilla que le corresponda
418417
$sql = "SELECT message, subject FROM messages WHERE type='invoice_forward' AND language='".$language."'";
419-
$r_tmp = mysql_query($sql,$link);
418+
$r_tmp = $link->query($sql);
420419

421-
if(mysql_num_rows($r_tmp)>0){
422-
$f_tmp = mysql_fetch_assoc($r_tmp);
420+
if($r_tmp->num_rows>0){
421+
$f_tmp = $r_tmp->fetch_assoc();
423422
$message = $f_tmp['message'];
424423
$subject = $f_tmp['subject'];
425424
if(trim($message) == ''){
426425
$default_language = datosreg('1','language','language','vdefault');
427426
$sql = "SELECT message, subject FROM messages WHERE type='invoice_forward' AND language='".$default_language."'";
428-
$r2_tmp = mysql_query($sql,$link);
429-
if(mysql_num_rows($r2_tmp)>0){
430-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
427+
$r2_tmp = $link->query($sql);
428+
if($r2_tmp->num_rows>0){
429+
$f2_tmp = $r2_tmp->fetch_assoc();
431430
$message = $f2_tmp['message'];
432431
$subject = $f2_tmp['subject'];
433432
if(trim($message) == ''){
@@ -448,9 +447,9 @@ function Footer(){
448447
//buscamos mensaje por defecto
449448
$default_language = datosreg('1','language','language','vdefault');
450449
$sql = "SELECT message, subject FROM messages WHERE type='invoice_forward' AND language='".$default_language."'";
451-
$r2_tmp = mysql_query($sql,$link);
452-
if(mysql_num_rows($r2_tmp)>0){
453-
$f2_tmp = mysql_fetch_assoc($r2_tmp);
450+
$r2_tmp = $link->query($sql);
451+
if($r2_tmp->num_rows>0){
452+
$f2_tmp = $r2_tmp->fetch_assoc();
454453
$message = $f2_tmp['message'];
455454
$subject = $f2_tmp['subject'];
456455
if(trim($message) == ''){
@@ -466,14 +465,14 @@ function Footer(){
466465
}
467466

468467
$sql = "SELECT sender FROM parametros";
469-
$result = mysql_query($sql,$link);
470-
$row_sender = mysql_fetch_assoc($result);
468+
$result = $link->query($sql);
469+
$row_sender = $result->fetch_assoc();
471470
$sender = $row_sender['sender'];
472471

473472
if($candado){
474473
$sql = "DESCRIBE members";
475-
$r_campos = mysql_query($sql,$link);
476-
while($aux = mysql_fetch_assoc($r_campos)){
474+
$r_campos = $link->query($sql);
475+
while($aux = $r_campos->fetch_assoc()){
477476
if($aux['Field']=="renewal"){
478477
$message = str_replace("{{".$aux['Field']."}}", date("d/m/Y",strtotime($fila[$aux['Field']])), $message);
479478
}elseif($aux['Field']=="quota"){
@@ -522,8 +521,8 @@ function Footer(){
522521
$mail->Subject = "Problem to send renewed notice e-mail";
523522

524523
$sql = "SELECT responsible FROM responsible WHERE area='renewal';";
525-
$r_resp = mysql_query($sql,$link);
526-
while($aux = mysql_fetch_assoc($r_resp)){
524+
$r_resp = $link->query($sql);
525+
while($aux = $r_resp->fetch_assoc()){
527526
//Copia a responsables
528527
$mail->AddAddress($aux['responsible']);
529528
}
@@ -547,14 +546,14 @@ function Footer(){
547546

548547
$presql = "DELETE FROM invoices WHERE cod ='".$cod."';";
549548

550-
$result = mysql_query($presql,$link);
549+
$result = $link->query($presql);
551550
if (!$result) {
552551
echo json_encode(array("status"=>"false"));
553-
die('Invalid query: ' . mysql_error());
552+
die('Invalid query: ' . $link->error);
554553
}
555554
echo json_encode(array("status"=>"true","cod"=>"invoice".$cod));
556555

557-
mysql_close($link);
556+
$link->close();
558557
}
559558

560559
?>

‎funciones/configuracion_searcher.php

+87-83
Large diffs are not rendered by default.

‎funciones/configuracion_setting.php

+91-91
Large diffs are not rendered by default.

‎funciones/configuracion_usuario.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,21 @@
158158
global $saltt;
159159

160160
$sql = "UPDATE users SET pass='".sha1($saltt.md5($pass))."' WHERE email='".$correo."';";
161-
$result2 = mysql_query($sql,$link);
161+
$result2 = $link->query($sql);
162162
if (!$result2) {
163-
die('Invalid query: ' . mysql_error());
163+
die('Invalid query: ' . $link->error);
164164
$contenido = "Error update password";
165165
echo json_encode(array("status"=>"false","contenido"=>$contenido ));
166166
}
167167

168168
$presql = "SELECT * FROM users WHERE email='".$correo."'";
169-
$result = mysql_query($presql,$link);
169+
$result = $link->query($presql);
170170
if (!$result) {
171-
die('Invalid query: ' . mysql_error());
171+
die('Invalid query: ' . $link->error);
172172
}
173-
$num_rows = mysql_num_rows($result);
173+
$num_rows = $result->num_rows;
174174
if($num_rows > 0){
175-
$row = mysql_fetch_assoc($result);
175+
$row = $result->fetch_assoc();
176176
//Mandar correo con nueva clave
177177
//Email para el usuario de confirmación de pedido
178178
$mail = new PHPMailer();

‎index.php

+21-22
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
}else{
2929
$link = conectar();
3030
$sql = "SELECT * FROM users WHERE cod='".$candado[1]."';";
31-
$result = mysql_query($sql,$link);
32-
if(mysql_num_rows($result)==0){
31+
$result = $link->query($sql);
32+
if($result->num_rows==0){
3333
$_SESSION['tipo']= 'invitado';
3434
header('Location: http://'.$_SERVER['SERVER_NAME'].'/login');
3535
}
@@ -261,16 +261,16 @@ function(data){
261261
<tbody>
262262
<?php
263263
$link = conectar();
264-
$result_num = mysql_query("SELECT count('cod') AS num FROM members",$link);
265-
$tmp = mysql_fetch_assoc($result_num);
264+
$result_num = $link->query("SELECT count('cod') AS num FROM members");
265+
$tmp = $result_num->fetch_assoc();
266266
$num_members = $tmp['num'];
267267
$estilo = array("progress-green","progress-blue","progress-red");
268268
$sql = "SELECT * FROM status";
269-
$result = mysql_query($sql,$link);
269+
$result = $link->query($sql);
270270
$i = 0;
271-
while ($tmp_status = mysql_fetch_assoc($result)){
272-
$result_num = mysql_query("SELECT count('cod') AS num FROM members WHERE status='".$tmp_status['cod']."'",$link);
273-
$tmp = mysql_fetch_assoc($result_num);
271+
while ($tmp_status = $result->fetch_assoc()){
272+
$result_num = $link->query("SELECT count('cod') AS num FROM members WHERE status='".$tmp_status['cod']."'");
273+
$tmp = $result_num->fetch_assoc();
274274
$num_status = $tmp['num'];
275275
echo '<tr>';
276276
echo '<td>'.$tmp_status['status'].'</td>';
@@ -305,8 +305,8 @@ function(data){
305305
<tbody>
306306
<?php
307307
$sql = "SELECT COUNT(*) AS cuenta, SUM(quota) AS suma FROM members WHERE date_arrival > '".date("Y-m")."-01'";
308-
$result = mysql_query($sql,$link);
309-
$aux = mysql_fetch_assoc($result);
308+
$result = $link->query($sql);
309+
$aux = $result->fetch_assoc();
310310
?>
311311
<tr>
312312
<td>New inscriptions this month</td>
@@ -317,8 +317,8 @@ function(data){
317317
</tr>
318318
<?php
319319
$sql = "SELECT COUNT(*) AS cuenta, SUM(quota) AS suma FROM members WHERE date_arrival > '".date("Y")."-01-01'";
320-
$result = mysql_query($sql,$link);
321-
$aux = mysql_fetch_assoc($result);
320+
$result = $link->query($sql);
321+
$aux = $result->fetch_assoc();
322322
?>
323323
<tr>
324324
<td>New inscriptions this year</td>
@@ -329,8 +329,8 @@ function(data){
329329
</tr>
330330
<?php
331331
$sql = "SELECT COUNT(*) AS cuenta, SUM(quota) AS suma FROM members WHERE mark_renewal > '".date("Y-m")."-01'";
332-
$result = mysql_query($sql,$link);
333-
$aux = mysql_fetch_assoc($result);
332+
$result = $link->query($sql);
333+
$aux = $result->fetch_assoc();
334334
?>
335335
<tr>
336336
<td>Renovations this month</td>
@@ -341,8 +341,8 @@ function(data){
341341
</tr>
342342
<?php
343343
$sql = "SELECT COUNT(*) AS cuenta, SUM(quota) AS suma FROM members WHERE mark_renewal > '".date("Y")."-01-01'";
344-
$result = mysql_query($sql,$link);
345-
$aux = mysql_fetch_assoc($result);
344+
$result = $link->query($sql);
345+
$aux = $result->fetch_assoc();
346346
?>
347347
<tr>
348348
<td>Renovations this year</td>
@@ -359,22 +359,22 @@ function(data){
359359

360360
<?php
361361
$sql = "SELECT * FROM members WHERE email_renewal='1';";
362-
$result = mysql_query($sql,$link);
362+
$result = $link->query($sql);
363363
?>
364364
<div class="colgroup leading">
365365
<div class="width6">
366366
<h4>
367367
Member renewal notice:
368-
<a href="#"><?php echo mysql_num_rows($result); ?></a>
368+
<a href="#"><?php echo $result->num_rows; ?></a>
369369
</h4>
370370
<hr>
371371
<?php
372-
if(mysql_num_rows($result)>0){
372+
if($result->num_rows>0){
373373
echo '<div id="result_searcher" align="center">';
374374
echo '<table class="stylized" width="100%">';
375375
echo '<tr><th>N</th><th class="name">Name</th><th class="surname">Surname</th><th class="email">E-mail</th><th class="renewal">Renewal</th><th class="option">Options</th></tr>';
376376
$i = 0;
377-
while($row = mysql_fetch_assoc($result)){
377+
while($row = $result->fetch_assoc()){
378378
$i += 1;
379379
if($i%2==0){
380380
echo '<tr class="campo2">';
@@ -394,8 +394,7 @@ function(data){
394394
echo '</tr>';
395395
}
396396
echo '</table></div>';
397-
398-
mysql_free_result($result);
397+
$result->free_result();
399398
}
400399
?>
401400
</div>

‎js/administry.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Administry.videoSupport = function (wrapper, videoURL, width, height) {
157157
}
158158

159159
// dateInput() - <input type="date"> support with fallback
160-
Administry.dateInput = function (e) {
160+
/*Administry.dateInput = function (e) {
161161
var i = document.createElement("input");
162162
i.setAttribute("type", "date");
163163
if (i.type == "text") {
@@ -166,6 +166,7 @@ Administry.dateInput = function (e) {
166166
$(e).datepick();
167167
}
168168
}
169+
*/
169170

170171
// expandableRows() - expandable table rows
171172
Administry.expandableRows = function () {

‎js/conf_searcher.js

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $(document).ready(function(){
1616
var alta_ini = $("#arrival_ini").attr("value").replace(/\//g, '-');
1717
var alta_fin = $("#arrival_fin").attr("value").replace(/\//g, '-');
1818
$("#result_searcher").html('<div class="center"><br /><img src="images/loadingAnimation.gif" alt="cargando" /></div>');
19+
$("#result_edit").html('');
1920
$.post("funciones/configuracion_searcher.php",{tab:"buscar",name:nombre,surname:apellidos,email:vemail,country:pais,phone:telefono,quota:vquota,type:tipo,status:estado,language:lenguaje,renewal_ini:renovacion_ini,renewal_fin:renovacion_fin,arrival_ini:alta_ini,arrival_fin:alta_fin},mostrarBusqueda, "json");
2021

2122
return false;
@@ -162,6 +163,7 @@ function Editarusuario()
162163
var vorden = "ASC";
163164
var vcampo = $(this).parent().attr("class");
164165
$("#result_searcher").html('<div class="center"><br /><img src="images/loadingAnimation.gif" alt="cargando" /></div>');
166+
$("#result_edit").html('');
165167
$.post("funciones/configuracion_searcher.php",{tab:"buscar_ordenado",name:nombre,surname:apellidos,email:vemail,country:pais,phone:telefono,quota:vquota,type:tipo,status:estado,language:lenguaje,renewal_ini:renovacion_ini,renewal_fin:renovacion_fin,arrival_ini:alta_ini,arrival_fin:alta_fin,orden:vorden,campo:vcampo},mostrarBusqueda, "json");
166168
e.preventDefault();
167169
e.stopPropagation();
@@ -184,6 +186,7 @@ function Editarusuario()
184186
var vorden = "DESC";
185187
var vcampo = $(this).parent().attr("class");
186188
$("#result_searcher").html('<div class="center"><br /><img src="images/loadingAnimation.gif" alt="cargando" /></div>');
189+
$("#result_edit").html('');
187190
$.post("funciones/configuracion_searcher.php",{tab:"buscar_ordenado",name:nombre,surname:apellidos,email:vemail,country:pais,phone:telefono,quota:vquota,type:tipo,status:estado,language:lenguaje,renewal_ini:renovacion_ini,renewal_fin:renovacion_fin,arrival_ini:alta_ini,arrival_fin:alta_fin,orden:vorden,campo:vcampo},mostrarBusqueda, "json");
188191
e.preventDefault();
189192
e.stopPropagation();

‎login.php

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
$_SESSION['tipo']= 'invitado';
1919
}
2020
*/
21+
//echo $_SERVER['SERVER_NAME'];
2122
if(isset($_POST['username']) && isset($_POST['password'])){
2223
if(login($_POST['username'],$_POST['password'],isset($_POST['loginkeeping']))==1){
2324
header('Location: http://'.$_SERVER['SERVER_NAME'].'/index.php');

‎logout.php

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
<?php
2-
session_start();
2+
require 'funciones.php';
3+
session_start();
4+
if(isset($_SESSION['codusuario'])){
5+
session_unset($_SESSION['codusuario']);
6+
session_unset($_SESSION['usuario']);
7+
session_unset($_SESSION['name']);
8+
session_unset($_SESSION['last_login']);
9+
session_unset($_SESSION['actual_login']);
10+
session_unset($_SESSION['last_ip']);
11+
session_unset($_SESSION['ip']);
12+
session_unset($_SESSION['email']);
313
session_destroy();
4-
setCookie("identificado",$cookie,time()-3600,'/'); //cookie 6min
5-
header('Location: http://'.$_SERVER['SERVER_NAME']);
14+
}
15+
setCookie("identificado",0,time()-2592000,'/'); //cookie 60min
16+
session_write_close();
17+
header('Location: http://'.$_SERVER['SERVER_NAME']);
618
?>

‎menu/right-menu.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
<?php
2222
$link = conectar();
2323
$sql = "SELECT * FROM links";
24-
$result_link = mysql_query($sql,$link);
25-
while($aux_link = mysql_fetch_assoc($result_link)){
24+
$result_link = $link->query($sql);
25+
while($aux_link = $result_link->fetch_assoc()){
2626
echo '<dl>';
2727
echo '<dt>'.$aux_link['title'].'</dt>';
2828
echo '<dd>';
2929
$enlace = (strpos($aux_link['enlace'],'http') === false)?('http://'.$aux_link['enlace']):($aux_link['enlace']);
3030
echo '<a href="'.$enlace.'">'.$aux_link['description'].'</a>';
3131
echo '</dd>';
3232
}
33-
mysql_free_result($result_link);
33+
$result_link->free();
3434
?>
3535
</dl>
3636
</section>

‎profile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ function(data){
133133
<section class="column width6 first">
134134
<?php
135135
$sql = "SELECT * FROM users WHERE cod='".$_SESSION['codusuario']."';";
136-
$result = mysql_query($sql,$link);
137-
$row = mysql_fetch_assoc($result);
136+
$result = $link->query($sql);
137+
$row = $result->fetch_assoc();
138138
echo '<h3>Form edit user</h3>';
139139
echo '<div class="box box-info">If the password is blank, will not change the current password</div>';
140140
echo '<form id="user_edit" action="#" method="post"><fieldset>';

‎searcher.php

+24-24
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@
140140
$link = conectar();
141141
$sql = "SELECT * FROM country";
142142
echo '<option value=""></option>';
143-
$result = mysql_query($sql,$link);
143+
$result = $link->query($sql);
144144
if(!$result){
145-
die('Invalid query: ' . mysql_error());
145+
die('Invalid query: ' . $link->error);
146146
}
147-
while($row = mysql_fetch_assoc($result)){
147+
while($row = $result->fetch_assoc()){
148148
echo '<option value="'.$row['iso'].'" style="max-width:200px">'.$row['name'].'</option>';
149149
}
150-
mysql_free_result($result);
151-
mysql_close($link);
150+
$result->free_result();
151+
$result->close();
152152
?>
153153
</select>
154154
Phone: <input type="text" name="phone" id="phone" size="17" />
@@ -160,32 +160,32 @@
160160
$link = conectar();
161161
$sql = "SELECT * FROM type_member";
162162
echo '<option value=""></option>';
163-
$result = mysql_query($sql,$link);
163+
$result = $link->query($sql);
164164
if(!$result){
165-
die('Invalid query: ' . mysql_error());
165+
die('Invalid query: ' . $link->error);
166166
}
167-
while($row = mysql_fetch_assoc($result)){
167+
while($row = $result->fetch_assoc()){
168168
echo '<option value="'.$row['cod'].'" style="max-width:200px">'.$row['name'].'</option>';
169169
}
170-
mysql_free_result($result);
171-
mysql_close($link);
170+
$result->free_result();
171+
$result->close();
172172
?>
173173
</select>
174174
Status:
175175
<select name="status" id="status">
176176
<?php
177177
$link = conectar();
178178
$sql = "SELECT * FROM status";
179-
$result = mysql_query($sql,$link);
179+
$result = $link->query($sql);
180180
if (!$result) {
181-
die('Invalid query2: ' . mysql_error());
181+
die('Invalid query2: ' . $link->error);
182182
}
183183
echo '<option value="" selected="selected"></option>';
184-
while($row = mysql_fetch_assoc($result)){
184+
while($row = $result->fetch_assoc()){
185185
echo '<option value="'.$row['cod'].'">'.$row['status'].'</option>';
186186
}
187-
mysql_free_result($result);
188-
mysql_close($link);
187+
$result->free_result();
188+
$result->close();
189189
?>
190190
</select>
191191
Language:
@@ -194,32 +194,32 @@
194194
echo '<option value="" selected="selected"></option>';
195195
$link = conectar();
196196
$sql = "SELECT * FROM language WHERE active='1' ORDER BY language ASC";
197-
$result = mysql_query($sql,$link);
197+
$result = $link->query($sql);
198198
if (!$result) {
199-
die('Invalid query2: ' . mysql_error());
199+
die('Invalid query2: ' . $link->error);
200200
}
201-
while($row = mysql_fetch_assoc($result)){
201+
while($row = $result->fetch_assoc()){
202202
echo '<option value="'.$row['cod'].'">'.$row['language'].'</option>';
203203
}
204-
mysql_free_result($result);
205-
mysql_close($link);
204+
$result->free_result();
205+
$result->close();
206206
?>
207207
</select>
208208
<br /><br />
209209
Date renewal between:
210-
<input type="date" name="renewal_ini" id="renewal_ini" placeholder="dd/mm/yyyy" />
210+
<input type="text" name="renewal_ini" id="renewal_ini" placeholder="dd/mm/yyyy" />
211211
&nbsp;&nbsp; to &nbsp;&nbsp;
212-
<input type="date" name="renewal_fin" id="renewal_fin" placeholder="dd/mm/yyyy" />
212+
<input type="text" name="renewal_fin" id="renewal_fin" placeholder="dd/mm/yyyy" />
213213
<?php
214214
if(Comprobariexplorer($_SERVER['HTTP_USER_AGENT'])){
215215
echo '&nbsp;&nbsp;(dd/mm/yyyy)';
216216
}
217217
?>
218218
<br /><br />
219219
&nbsp;&nbsp;Date arrival between: &nbsp;
220-
<input type="date" name="arrival_ini" id="arrival_ini" placeholder="dd/mm/yyyy" />
220+
<input type="text" name="arrival_ini" id="arrival_ini" placeholder="dd/mm/yyyy" />
221221
&nbsp;&nbsp; to &nbsp;&nbsp;
222-
<input type="date" name="arrival_fin" id="arrival_fin" placeholder="dd/mm/yyyy" />
222+
<input type="text" name="arrival_fin" id="arrival_fin" placeholder="dd/mm/yyyy" />
223223
<?php
224224
if(Comprobariexplorer($_SERVER['HTTP_USER_AGENT'])){
225225
echo '&nbsp;&nbsp;(dd/mm/yyyy)';

‎setting.php

+43-39
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
echo "</pre>";
2020
*/
2121
if(isset($_POST['sendform'])){
22-
$mbody = mysql_real_escape_string($_POST['mbody']);
23-
$mfooter = mysql_real_escape_string($_POST['footer']);
24-
$show = ($_POST['show_signature']=="YES")?("YES"):("NO");
2522
$link = conectar();
23+
$mbody = $link->real_escape_string($_POST['mbody']);
24+
$mfooter = $link->real_escape_string($_POST['footer']);
25+
$show = ($_POST['show_signature']=="YES")?("YES"):("NO");
26+
2627
$sql = "UPDATE invoice SET body='".$mbody."', footer='".$mfooter."', show_signature='".$show."' WHERE cod='1';";
27-
$result = mysql_query($sql,$link);
28+
$result = $link->query($sql);
2829

2930
//Gestion de imagenes
3031
/* =========================== Procedemos a subir los archivos =========================== */
@@ -205,11 +206,11 @@
205206
<?php
206207
$link = conectar();
207208
$sql = "SELECT * FROM language WHERE active='1'";
208-
$result = mysql_query($sql,$link);
209-
while($row = mysql_fetch_assoc($result)){
209+
$result = $link->query($sql);
210+
while($row = $result->fetch_assoc()){
210211
echo "<option id='".$row['cod']."'>".$row['language']."</option>";
211212
}
212-
mysql_free_result($result);
213+
$result->free_result();
213214
?>
214215
</select>
215216
<div id="result_message"></div>
@@ -220,8 +221,8 @@
220221
<form id="form_invoice" method="post" action="setting" enctype="multipart/form-data">
221222
<?php
222223
$sql = "SELECT * FROM invoice;";
223-
$result = mysql_query($sql,$link);
224-
$row = mysql_fetch_assoc($result);
224+
$result = $link->query($sql);
225+
$row = $result->fetch_assoc();
225226
echo '<h4>Header:</h4>';
226227
echo '<img src="images/pdf_invoices/logo.png" alt="logo header" /><br><br>';
227228
echo 'If you want to change the logo, select a new image: ';
@@ -236,10 +237,10 @@
236237
echo '</div>';
237238
echo '<div style="float:left;width:20%;text-align:center;">';
238239
$sql = "DESCRIBE members";
239-
$rs = mysql_query($sql,$link);
240+
$rs = $link->query($sql);
240241
echo "<br>";
241-
echo "<select id='field_invoice' size='".(mysql_num_rows($rs)-4)."'>";
242-
while($fila = mysql_fetch_assoc($rs)){
242+
echo "<select id='field_invoice' size='".($rs->num_rows-4)."'>";
243+
while($fila = $rs->fetch_assoc()){
243244
if($fila['Field']!='cod' && $fila['Field']!='mark_renewal' && $fila['Field']!='email_renewal' && $fila['Field']!='email_expired'){
244245
echo "<option value='".$fila['Field']."'>".$fila['Field']."</option>";
245246
}
@@ -270,15 +271,15 @@
270271
<?php
271272
$link = conectar();
272273
$sql = "SELECT * FROM links;";
273-
$result = mysql_query($sql,$link);
274-
if(mysql_affected_rows()<=0){
274+
$result = $link->query($sql);
275+
if($link->affected_rows<=0){
275276
//No hay registros
276277
echo 'No links';
277278
}else{
278279
//Mostrar la tabla
279280
echo '<table class="stylized" id="tbl_links" width="100%">';
280281
echo '<tr><th>Title</th><th>Description</th><th class="ta-center">Options</th></tr>';
281-
while($row = mysql_fetch_assoc($result)){
282+
while($row = $result->fetch_assoc()){
282283
echo '<tr><td>'.$row['title'].'</td>';
283284
echo '<td>'.$row['description'].'</td>';
284285
echo '<td id="link'.$row['cod'].'" class="ta-center">';
@@ -306,12 +307,12 @@
306307
<?php
307308
$link = conectar();
308309
$sql = "SELECT * FROM language WHERE active='0';";
309-
$result = mysql_query($sql,$link);
310+
$result = $link->query($sql);
310311
echo "<select id='lang_disp' size='10' style='width:100%'>";
311-
while($fila = mysql_fetch_assoc($result)){
312+
while($fila = $result->fetch_assoc()){
312313
echo "<option value='".$fila['cod']."'>".$fila['language']."</option>";
313314
}
314-
mysql_free_result($result);
315+
$result->free_result();
315316
echo "</select>";
316317
?>
317318
</td>
@@ -323,12 +324,12 @@
323324
<?php
324325
$link = conectar();
325326
$sql = "SELECT * FROM language WHERE active='1';";
326-
$result = mysql_query($sql,$link);
327+
$result = $link->query($sql);
327328
echo "<select id='lang_acti' size='10' style='width:100%'>";
328-
while($fila = mysql_fetch_assoc($result)){
329+
while($fila = $result->fetch_assoc()){
329330
echo "<option value='".$fila['cod']."'>".$fila['language']."</option>";
330331
}
331-
mysql_free_result($result);
332+
$result->free_result();
332333
echo "</select>";
333334
?>
334335
</td>
@@ -341,36 +342,39 @@
341342
<?php
342343
$link = conectar();
343344
$sql = "SELECT * FROM language WHERE active='1';";
344-
$result = mysql_query($sql,$link);
345-
while($fila = mysql_fetch_assoc($result)){
345+
$result = $link->query($sql);
346+
while($fila = $result->fetch_assoc()){
346347
if($fila['vdefault'] == '1'){
347348
echo "<option value='".$fila['cod']."' selected='selected'>".$fila['language']."</option>";
348349
}else{
349350
echo "<option value='".$fila['cod']."'>".$fila['language']."</option>";
350351
}
351352
}
352-
mysql_free_result($result);
353+
$result->free_result();
353354
?>
354355
</select>
355356
<div id="mslang" style="display:inline-block; margin: 0 0 0 15px;"></div>
356357
<br>
357358
<h4>Renewal Notice:</h4>
358359
<?php
359360
$sql = "SELECT notice_renewal FROM parametros;";
360-
$result = mysql_query($sql,$link);
361-
$valor = mysql_result($result,0);
361+
$result = $link->query($sql);
362+
$tmp_aux = $result->fetch_assoc();
363+
$valor = $tmp_aux['notice_renewal'];
364+
362365
echo '<input type="number" id="avisorenovacion" value="'.$valor.'" class="ta-center" style="width: 50px;"> days to send notification by e-mail.';
363-
mysql_free_result($result);
366+
$result->free_result();
364367
?>
365368
<br>
366369

367370
<h4>Sender's e-mail:</h4>
368371
<?php
369372
$sql = "SELECT sender FROM parametros;";
370-
$result = mysql_query($sql,$link);
371-
$valor = mysql_result($result,0);
373+
$result = $link->query($sql);
374+
$tmp_aux = $result->fetch_assoc();
375+
$valor = $tmp_aux['sender'];
372376
echo 'E-mail sender automated mails: <input type="text" id="senderemail" value="'.$valor.'" class="half">';
373-
mysql_free_result($result);
377+
$result->free_result();
374378
?>
375379
<br>
376380

@@ -379,17 +383,17 @@
379383
<?php
380384
$link = conectar();
381385
$sql = "SELECT * FROM responsible WHERE area='renewal'";
382-
$result = mysql_query($sql,$link);
386+
$result = $link->query($sql);
383387
echo '<div id="result_renewal" align="center">';
384-
if(mysql_affected_rows()<=0){
388+
if($link->affected_rows<=0){
385389
//No hay registros
386390
echo '<input type="text" id="emailresponsible_ren" > &nbsp;&nbsp;';
387391
echo '<input type="button" class="btn btn-blue" id="add_email_responsible_ren" value="Add e-mail">';
388392
}else{
389393
//Mostrar la tabla
390394
echo '<table class="stylized" id="resp_renewal_email" width="60%">';
391395
echo '<tr><th>E-mail</th><th class="ta-center">Options</th></tr>';
392-
while($row = mysql_fetch_assoc($result)){
396+
while($row = $result->fetch_assoc()){
393397
echo '<tr><td>'.$row['responsible'].'</td>';
394398
echo '<td id="resp'.$row['cod'].'" class="ta-center">';
395399
echo '<a href="#" title="Delete" class="icon-elim"><img src="images/delete.png" /></a>';
@@ -409,17 +413,17 @@
409413
<?php
410414
$link = conectar();
411415
$sql = "SELECT * FROM responsible WHERE area='expired'";
412-
$result = mysql_query($sql,$link);
416+
$result = $link->query($sql);
413417
echo '<div id="result_expired" align="center">';
414-
if(mysql_affected_rows()<=0){
418+
if($link->affected_rows<=0){
415419
//No hay registros
416420
echo '<input type="text" id="emailresponsible_exp" > &nbsp;&nbsp;';
417421
echo '<input type="button" class="btn btn-blue" id="add_email_responsible_exp" value="Add e-mail">';
418422
}else{
419423
//Mostrar la tabla
420424
echo '<table class="stylized" id="resp_expired_email" width="60%">';
421425
echo '<tr><th>E-mail</th><th class="ta-center">Options</th></tr>';
422-
while($row = mysql_fetch_assoc($result)){
426+
while($row = $result->fetch_assoc()){
423427
echo '<tr><td>'.$row['responsible'].'</td>';
424428
echo '<td id="resp'.$row['cod'].'" class="ta-center">';
425429
echo '<a href="#" title="Delete" class="icon-elim"><img src="images/delete.png" /></a>';
@@ -438,17 +442,17 @@
438442
<?php
439443
$link = conectar();
440444
$sql = "SELECT * FROM type_member;";
441-
$result = mysql_query($sql,$link);
445+
$result = $link->query($sql);
442446
echo '<div id="result_type" align="center">';
443-
if(mysql_affected_rows()<=0){
447+
if($link->affected_rows<=0){
444448
//No hay registros
445449
echo '<input type="text" id="typemembervalue" > &nbsp;&nbsp;';
446450
echo '<input type="button" class="btn btn-blue" id="add_new_type" value="Add type">';
447451
}else{
448452
//Mostrar la tabla
449453
echo '<table class="stylized" id="resp_type" width="60%">';
450454
echo '<tr><th>E-mail</th><th class="ta-center">Options</th></tr>';
451-
while($row = mysql_fetch_assoc($result)){
455+
while($row = $result->fetch_assoc()){
452456
echo '<tr><td>'.$row['name'].'</td>';
453457
echo '<td id="type'.$row['cod'].'" class="ta-center">';
454458
echo '<a href="#" title="Delete" class="icon-elim-type"><img src="images/delete.png" /></a>';

0 commit comments

Comments
 (0)
Please sign in to comment.