Skip to content

Commit f29a8be

Browse files
author
nosolored
committed
Modification table records
Se limita la información mostrada a miembros que tienen su cuenta caducada hace una semana y que va a caducar en menos de tres semanas. Se añade la opción de ejecutar el cron manualmente insertando un enlace en la cabecera de la tabla.
1 parent 4418cdf commit f29a8be

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

images/cron.png

1.67 KB
Loading

index.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -358,21 +358,22 @@ function(data){
358358

359359

360360
<?php
361-
$sql = "SELECT * FROM members WHERE email_renewal='1' ORDER BY renewal ASC;";
361+
$sql = "SELECT * FROM members WHERE renewal > DATE_SUB(NOW(), INTERVAL 1 WEEK) AND renewal < DATE_SUB(NOW(),INTERVAL -3 WEEK) ORDER BY renewal ASC";
362362
$result = $link->query($sql);
363363
?>
364364
<div class="colgroup leading">
365365
<div class="width6">
366-
<h4>
367-
Member renewal notice:
366+
<h4 style="display:inline-block; margin-bottom:0;">
367+
Members with next expiration date:
368368
<a href="#"><?php echo $result->num_rows; ?></a>
369369
</h4>
370+
<a style="float:right" href="cron.php" title="Execute cron"><img src="images/cron.png" style="margin-top:10px" alt="cron"></a>
370371
<hr>
371372
<?php
372373
if($result->num_rows>0){
373374
echo '<div id="result_searcher" align="center">';
374375
echo '<table class="stylized" width="100%">';
375-
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>';
376+
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=ta-center">Renewal notice</th><th class="option">Options</th></tr>';
376377
$i = 0;
377378
while($row = $result->fetch_assoc()){
378379
$i += 1;
@@ -386,6 +387,12 @@ function(data){
386387
echo '<td>'.htmlspecialchars($row['surname']).'</td>';
387388
echo '<td>'.htmlspecialchars($row['email']).'</td>';
388389
echo '<td class="ta-center">'.date("d/m/Y",strtotime($row['renewal'])).'</td>';
390+
391+
if($row['email_renewal'] == '1'){
392+
echo '<td class="ta-center" style="background:#A5DF00;"><strong>Yes</strong></td>';
393+
}else{
394+
echo '<td class="ta-center" style="background:#F5D0A9;"><strong>No</strong></td>';
395+
}
389396
echo '<td id="member'.$row['cod'].'" class="options-width">';
390397
echo '<a href="renovar-user.php?cod='.$row['cod'].'" title="Renewal" class="renovar"><img src="images/update.png" /></a>&nbsp;';
391398
echo '<a href="edit-user.php?cod='.$row['cod'].'" title="Edit '.$row['usuario'].'" class="icon-1 info-tooltip"><img src="images/note_edit.png" /></a>&nbsp;';

0 commit comments

Comments
 (0)