|
@@ -8,17 +8,43 @@ buildmenu($menu);
|
|
|
|
|
|
require('include/myconn.php');
|
|
|
|
|
|
-function nully($val,$filter='') {
|
|
|
+function nully($val,$fem,$filter,$ntext=null) {
|
|
|
if (!is_null($val)) {
|
|
|
if ($filter=='strip') {
|
|
|
return(strip_tags($val,'<a><br><ol><ul><li>'));
|
|
|
} elseif ($filter=='htmlent') {
|
|
|
return(htmlentities($val));
|
|
|
+ } elseif ($filter=='timestamp') {
|
|
|
+ return(strftime('%a %d %b %Y, %T',$val));
|
|
|
+ } elseif ($filter=='email') {
|
|
|
+ return('<a href="mailto:'.strip_tags($val).'">'.strip_tags($val).'</a>');
|
|
|
+ } elseif ($filter=='url') {
|
|
|
+ return('<a href="'.strip_tags($val).'" target="_blank">'.strip_tags($val).'</a>');
|
|
|
+ } elseif ($filter=='image') {
|
|
|
+ return('<img src="'.str_replace('"','\\"',strip_tags($val)).'" width="294">');
|
|
|
+ } elseif ($filter=='boolt') {
|
|
|
+ if ($val)
|
|
|
+ return('<span class="good">Si</span>');
|
|
|
+ else
|
|
|
+ return('<span class="bad">No</span>');
|
|
|
+ } elseif ($filter=='boolf') {
|
|
|
+ if ($val)
|
|
|
+ return('<span class="bad">Si</span>');
|
|
|
+ else
|
|
|
+ return('<span class="good">No</span>');
|
|
|
} else {
|
|
|
return($val);
|
|
|
}
|
|
|
} else {
|
|
|
- return('<span class="nully">Non definito</span>');
|
|
|
+ if (is_null($ntext)) {
|
|
|
+ if ($fem)
|
|
|
+ return('<span class="nully">Non definita</span>');
|
|
|
+ else
|
|
|
+ return('<span class="nully">Non definito</span>');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return('<span class="nully">'.$ntext.'</span>');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -68,36 +94,98 @@ $cols=array(
|
|
|
'DomainCount'=>array('name'=>'Istanze note','type'=>'number'),
|
|
|
'ActiveUsersMonth'=>array('name'=>'Utenti attivi (mese)','type'=>'number'),
|
|
|
'ActiveUsersHalfYear'=>array('name'=>'Utenti attivi (6 mesi)','type'=>'number'),
|
|
|
- 'Thumb'=>array('name'=>'Logo','type'=>'image'),
|
|
|
+ 'Thumb'=>array('name'=>'Logo','type'=>'text'),
|
|
|
'RegOpen'=>array('name'=>'Registrazioni aperte','type'=>'bool'),
|
|
|
'RegReqApproval'=>array('name'=>'Approvazione registrazioni','type'=>'bool'),
|
|
|
- 'MaxTootChars'=>array('Name'=>'Limite caratteri','type'=>'number'),
|
|
|
-
|
|
|
+ 'MaxTootChars'=>array('name'=>'Limite caratteri','type'=>'number'),
|
|
|
+ 'AdmAccount'=>array('name'=>'Account admin','type'=>'text'),
|
|
|
+ 'AdmDisplayName'=>array('name'=>'Nome account admin','type'=>'text'),
|
|
|
+ 'AdmCreatedAt'=>array('name'=>'Data creazione account admin','type'=>'timestamp'),
|
|
|
+ 'AdmURL'=>array('name'=>'Pagina dell’admin','text'),
|
|
|
+ 'AdmAvatar'=>array('name'=>'Avatar admin','text'),
|
|
|
+ 'AdmNote'=>array('name'=>'Note dell’admin','text')
|
|
|
);
|
|
|
|
|
|
-$res=mysqli_query($link,'SELECT * FROM Instances LEFT JOIN Places ON Places.ID=PlaceID ORDER BY URI ASC')
|
|
|
+$res=mysqli_query($link,'SELECT *, Instances.ID AS IID FROM Instances LEFT JOIN Places ON Places.ID=PlaceID ORDER BY URI ASC LIMIT 50')
|
|
|
or muoribene(mysqli_error($link),false);
|
|
|
-mysqli_close($link);
|
|
|
if (mysqli_num_rows($res)<1) {
|
|
|
$out='<p>Nessuna istanza da mostrare.</p>'.N;
|
|
|
} else {
|
|
|
$out='<table id="bigtab">'.N;
|
|
|
- $out.='<thead><tr><th class="tdattr">Attributi</th><th>'.$cols['URI']['name'].'</th><th>'.$cols['Title']['name'].'</th><th>'.$cols['OurDesc']['name'].'</th><th>'.$cols['ShortDesc']['name'].'</th><th>'.$cols['LongDesc']['name'].'</th></tr></thead>'.N;
|
|
|
+// $out.='<thead><tr><th class="tdattr">Attributi</th><th>Info</th></thead>'.N;
|
|
|
$out.='<tbody>'.N;
|
|
|
while ($row=mysqli_fetch_assoc($res)) {
|
|
|
+ $out.='<tr><td colspan="2" class="insthead">'.$row['URI'].'</td></tr>'.N;
|
|
|
$attr=booly($cols['Blacklisted']['name'].': ',$row['Blacklisted'],false,true).N;
|
|
|
$attr.=booly($cols['New']['name'].': ',$row['New'],true).N;
|
|
|
$attr.=booly($cols['Good']['name'].': ',$row['Good']).N;
|
|
|
$attr.=booly($cols['Chosen']['name'].': ',$row['Chosen']).N;
|
|
|
$attr.=booly($cols['Visible']['name'].': ',$row['Visible']).N;
|
|
|
- $attr.=booly($cols['RegOpen']['name'].': ',$row['RegOpen']).N;
|
|
|
- $attr.=booly($cols['RegReqApproval']['name'].': ',$row['RegReqApproval'],true,true).N;
|
|
|
- $out.='<tr><td class="tdattr">'.$attr.'</td><td><a href="https://'.$row['URI'].'" target="_blank">'.$row['URI'].'</a></td><td>'.nully($row['Title'],'strip').'</td><td>'.nully($row['OurDesc'],'htmlent').'</td><td>'.nully($row['ShortDesc'],'strip').'</td><td>'.nully($row['LongDesc'],'strip').'</td></tr>'.N;
|
|
|
+/* $attr.=booly($cols['RegOpen']['name'].': ',$row['RegOpen']).N;
|
|
|
+ $attr.=booly($cols['RegReqApproval']['name'].': ',$row['RegReqApproval'],true,true).N;*/
|
|
|
+ $sres=mysqli_query($link,'SELECT SUM(Statuses) AS tstatuses, SUM(Logins) AS tlogins, SUM(Registrations) AS tregs FROM InstActivity WHERE InstID='.$row['IID'])
|
|
|
+ or muoribene(mysqli_error($link),false);
|
|
|
+ $tot=mysqli_fetch_assoc($sres);
|
|
|
+ $sres=mysqli_query($link,'SELECT * FROM InstActivity WHERE InstID='.$row['IID'].' ORDER BY Week DESC')
|
|
|
+ or muoribene(mysqli_error($link),false);
|
|
|
+ if (mysqli_num_rows($sres)>0) {
|
|
|
+ $attr.='<div class="colsectheader">Attività delle ultime 12 settimane</div>'.N;
|
|
|
+ $attr.='<div class="colsectcont">Totale stati: '.$tot['tstatuses'].'<br>Totale accessi: '.$tot['tlogins'].'<br>Totale registrazioni: '.$tot['tregs'].'</div>'.N;
|
|
|
+ while ($srow=mysqli_fetch_assoc($sres)) {
|
|
|
+ $attr.='<div class="colsectcont">–––– '.strftime('%a %d %b %Y',$srow['Week']).' ––––</div>'.N;
|
|
|
+ ($tot['tstatuses']==0) ? $width=0 : $width=str_replace(',','.',100/$tot['tstatuses']*$srow['Statuses']);
|
|
|
+ $attr.='<div class="percstatuses" style="width:'.$width.'%;">'.$srow['Statuses'].' stati</div>'.N;
|
|
|
+ ($tot['tlogins']==0) ? $width=0 : $width=str_replace(',','.',100/$tot['tlogins']*$srow['Logins']);
|
|
|
+ $attr.='<div class="perclogins" style="width:'.$width.'%;">'.$srow['Logins'].' accessi</div>'.N;
|
|
|
+ ($tot['tregs']==0) ? $width=0 : $width=str_replace(',','.',100/$tot['tregs']*$srow['Registrations']);
|
|
|
+ $attr.='<div class="percregs" style="width:'.$width.'%;">'.$srow['Registrations'].' registrazioni</div>'.N;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $sres=mysqli_query($link,'SELECT * FROM InstChecks WHERE InstID='.$row['IID'].' ORDER BY Time DESC')
|
|
|
+ or muoribene(mysqli_error($link),false);
|
|
|
+ $csres=mysqli_num_rows($sres);
|
|
|
+ if ($csres>0) {
|
|
|
+ $bene=0;
|
|
|
+ while ($srow=mysqli_fetch_assoc($sres)) {
|
|
|
+ if ($srow['Status']==1)
|
|
|
+ $bene++;
|
|
|
+ }
|
|
|
+ $width=str_replace(',','.',100/$csres*$bene);
|
|
|
+ $attr.='<div class="colsectheader">Percentuale di risposta ai nostri check: '.round($width,1).'%</div>';
|
|
|
+ $attr.='<div class="percbg"><div class="percfg" style="width:'.$width.'%;"></div></div>'.N;
|
|
|
+ }
|
|
|
+ $out.='<tr><td class="tdattr">'.$attr.'</td><td>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['URI']['name'].':</span> <a href="https://'.$row['URI'].'" target="_blank">'.$row['URI'].'</a></p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['Title']['name'].':</span> '.nully($row['Title'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['OurDesc']['name'].':</span> '.nully($row['OurDesc'],true,'htmlent').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['ShortDesc']['name'].':</span> '.nully($row['ShortDesc'],true,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['LongDesc']['name'].':</span> '.nully($row['LongDesc'],true,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['PlaceID']['name'].':</span> '.nully($row['PlaceID'],true,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['Email']['name'].':</span> '.nully($row['Email'],true,'email').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['Software']['name'].':</span> '.nully($row['Software'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['Version']['name'].':</span> '.nully($row['Version'],true,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['UserCount']['name'].':</span> '.nully($row['UserCount'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['StatusCount']['name'].':</span> '.nully($row['StatusCount'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['DomainCount']['name'].':</span> '.nully($row['DomainCount'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['ActiveUsersMonth']['name'].':</span> '.nully($row['ActiveUsersMonth'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['ActiveUsersHalfYear']['name'].':</span> '.nully($row['ActiveUsersHalfYear'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['Thumb']['name'].':</span> '.nully($row['Thumb'],true,'image').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['RegOpen']['name'].':</span> '.nully($row['RegOpen'],false,'boolt').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['RegReqApproval']['name'].':</span> '.nully($row['RegReqApproval'],false,'boolf').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['MaxTootChars']['name'].':</span> '.nully($row['MaxTootChars'],false,'strip','500').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['AdmAccount']['name'].':</span> '.nully($row['AdmAccount'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['AdmDisplayName']['name'].':</span> '.nully($row['AdmDisplayName'],false,'strip').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['AdmCreatedAt']['name'].':</span> '.nully($row['AdmCreatedAt'],true,'timestamp').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['AdmURL']['name'].':</span> '.nully($row['AdmURL'],true,'url').'</p>'.N;
|
|
|
+ $out.='<p><span class="field">'.$cols['AdmAvatar']['name'].':</span> '.nully($row['AdmAvatar'],true,'image').'</p>'.N;
|
|
|
+ $out.='<p style="border: none; margin: 0; padding: 0;"><span class="field">'.$cols['AdmNote']['name'].':</span> '.nully($row['AdmNote'],false,'strip').'</p>'.N;
|
|
|
+ $out.='</td></tr>'.N;
|
|
|
}
|
|
|
$out.='</tbody>'.N;
|
|
|
$out.='</table>'.N;
|
|
|
}
|
|
|
|
|
|
+mysqli_close($link);
|
|
|
|
|
|
?>
|
|
|
<!DOCTYPE HTML>
|