<?php
/***************************************************
Webspell - Controll your Trialmember
© 2011 www.xtreme-designs.de
***************************************************/
/***************************************************
-------------------Change here----------------------
***************************************************/
$trial_days = 14;
$squadid = 3;
/***************************************************
----------------Don't change here-------------------
***************************************************/
// Datenabfrage und Ausgabe
$abfrage = "
SELECT u.registerdate, u.nickname
FROM ".PREFIX."user u
LEFT JOIN ".PREFIX."squads_members s
ON s.userID=u.userID
WHERE s.squadID='$squadid'
ORDER BY u.registerdate ASC";
$ergebnis = mysql_query($abfrage);
$rang = 1;
echo '
<table width="100%">
<tr>
<tr width="5%" bgcolor="#E2E2E2"><b>Trialmemberkontrolle</b></tr>
</tr>
<td width="5%" bgcolor="#E2E2E2"><b>Rang</b></td>
<td width="35%" bgcolor="#E2E2E2"><b>Spielername</b></td>
<td width="30%" bgcolor="#E2E2E2"><b>Registriert am</b></td>
<td width="30%" bgcolor="#E2E2E2"><b>Trialzeit</b></td>
</table>
';
while($row = mysql_fetch_object($ergebnis))
{
$name = $row->nickname;
$register_am = date("d.m.Y H:i", $row->registerdate);
$zwischen = time() - $row->registerdate;
$trialzeit = round($zwischen/(3600*24));
$trialzeit_noch = $trial_days - $trialzeit;
if ($trialzeit_noch <= 0)
{
$nochtrialzeit = "Ist jetzt Vollmember";
}
elseif ($trialzeit_noch == 1)
{
$nochtrialzeit = "noch <b>1</b> Tag";
}
else
{
$nochtrialzeit = "noch <b>$trialzeit_noch</b> Tage";
}
echo '
<table width="100%">
<tr>
<td width="5%" bgcolor="#E2E2E2">'.$rang++.'</td>
<td width="35%" bgcolor="#E2E2E2">'.$name.'</td>
<td width="30%" bgcolor="#E2E2E2">'.$register_am.'</td>
<td width="30%" bgcolor="#E2E2E2">'.$nochtrialzeit.'</td>
</tr>
</table>
';
}
?> |