Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
class inaktive{
private $db;
private $config;
public function __construct(){
global $datenbank,$grundconfig;
$this->db = $datenbank;
$this->config = $grundconfig;
}
public function Suchen($zeit){
$aus = '
<table class="table table-striped" id="InaktiveSuchenTable">
<thead>
<tr>
<th>UID</th>
<th>Kontostand</th>
<th>Letzter Login</th>
</tr>
</thead>
<tbody>
';
foreach($this->db->get_results("SELECT uid,kontostand_a,last_active FROM ". PREFIX . KONTO ." WHERE last_active <= $zeit ") AS $res){
if($res->last_active == 0){ $datum = 'nie online';}else{ $datum = date("d.m.Y H:i",$res->last_active);}
$aus .= '
<tr>
<td>'. $res->uid .'</td>
<td>'. number_format($res->kontostand_a,2,',','.') .'</td>
<td>'. $datum .'</td>
</tr>
';
}
$aus .= '</tbody></table>';
return $aus;
}
public function Erinnern($zeit,$mail){
$i = 0;
foreach($this->db->get_results("SELECT uid FROM ". PREFIX . KONTO ." WHERE last_active <= $zeit ") AS $res){
$user = userinfo($res->uid);
$nachricht = ' Hallo '.$user->nickname.'<br>
Leider bist du seit Geraumer Zeit nicht mehr auf '.$this->config->seitenname.' Online gewesen.<br>
Um nicht vom System wegen inaktivität gelöscht zu werden,<br>
bitten wir dich das du dich kurz einmal auf '.$this->config->seitenname.' anmeldest<br>
und wenn du lust hast kannst du ja in zukunft auch noch aktive teilnehmen.<br>
<br>
MFG<br>
'.$this->config->seitenname.' ';
$mail->senden($user->emailadresse,'Inaktiver Account',$nachricht);
$i++;
}
return 'Es wurden '. $i .' Erinnerungen verschickt.';
}
public function Delete($zeit){
$i = 0;
foreach($this->db->get_results("SELECT uid FROM ". PREFIX . KONTO ." WHERE last_active <= $zeit ") AS $res){
$this->db->delete(PREFIX . KONTO, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . USER, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . WERBER, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . NICKP, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . EMAIL, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . BUCH_B, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . MK, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . MULTIK, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . RELOAD, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . BETTELB, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . NOTIZ, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . WERBUNG, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . CHAT, array("uid" => $res->uid),1);
$this->db->delete(PREFIX . NEWSK, array("uid" => $res->uid),1);
$i++;
}
return 'Es wurden '. $i .' Konten gelöscht.';
}
}
?>