2019-12-26 21:57:36 +01:00
< ? php
require ( 'include/glob.php' );
require ( 'include/muoribene.php' );
require ( 'include/sessionstart.php' );
2020-01-08 14:52:20 +01:00
2019-12-26 21:57:36 +01:00
require ( 'include/menu.php' );
2020-01-08 14:52:20 +01:00
$menu [ 'istanze' ][ 'href' ] = null ;
$menu [ 'istanze' ][ 'selected' ] = true ;
2019-12-26 21:57:36 +01:00
buildmenu ( $menu );
require ( 'include/myconn.php' );
2020-01-02 13:19:25 +01:00
2020-01-08 14:52:20 +01:00
$dbg = '' ;
use function mysqli_real_escape_string as myesc ;
2020-01-05 05:46:29 +01:00
// praticamente una macro
function hspech ( $str ) {
return ( htmlspecialchars ( $str , ENT_QUOTES | ENT_HTML5 , 'UTF-8' ));
}
2020-01-02 22:03:34 +01:00
function nully ( $val , $fem , $filter , $ntext = null ) {
2020-01-02 13:19:25 +01:00
if ( ! is_null ( $val )) {
if ( $filter == 'strip' ) {
2020-01-05 05:46:29 +01:00
return ( strip_tags ( $val , '<a><br><ol><ul><li><p><i><b><strong><em><small>' ));
} elseif ( $filter == 'htmlchars' ) {
return ( hspech ( $val ));
2020-01-02 22:03:34 +01:00
} 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' ) {
2020-01-05 05:46:29 +01:00
return ( '<img src="' . str_replace ( '"' , '\\"' , strip_tags ( $val )) . '">' );
2020-01-02 22:03:34 +01:00
} 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>' );
2020-01-02 13:19:25 +01:00
} else {
return ( $val );
}
} else {
2020-01-02 22:03:34 +01:00
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>' );
}
2020-01-02 13:19:25 +01:00
}
}
function booly ( $pre , $val , $nottoobad = false , $invcol = false ) {
if ( $val ) {
if ( ! $invcol ) {
$p = '<p class="good">' ;
} else {
if ( ! $nottoobad ) {
$p = '<p class="bad">' ;
} else {
$p = '<p class="neut">' ;
}
}
return ( $p . $pre . 'SI</p>' );
} else {
if ( ! $invcol ) {
if ( ! $nottoobad ) {
$p = '<p class="bad">' ;
} else {
$p = '<p class="neut">' ;
}
} else {
$p = '<p class="good">' ;
}
return ( $p . $pre . 'NO</p>' );
}
}
2020-01-08 14:52:20 +01:00
$dbg .= '<pre>' . print_r ( $_POST , 1 ) . '</pre>' ;
2020-01-13 17:16:33 +01:00
/*SELECT *, Instances.ID AS IID, GROUP_CONCAT(OrdOurLanguages.NameIt ORDER BY OrdInstOurLangs.Pos ASC SEPARATOR '; ') AS OrdOurLangs FROM Instances LEFT JOIN InstOurLangs ON InstOurLangs.InstID=Instances.ID LEFT JOIN Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID LEFT JOIN InstOurLangs AS OrdInstOurLangs ON OrdInstOurLangs.InstID=Instances.ID LEFT JOIN Languages AS OrdOurLanguages ON OrdOurLanguages.ID=OrdInstOurLangs.OurLangID WHERE OurLanguages.NameIT LIKE '%italiano%' GROUP BY IID LIMIT 50*/
2020-01-12 07:14:48 +01:00
2020-01-02 13:19:25 +01:00
$cols = array (
2020-01-20 21:23:02 +01:00
2020-01-12 07:14:48 +01:00
'Instances.New' => array ( 'field' => 'Instances.New' , 'name' => 'Nuova' , 'type' => 'bool' ),
'Instances.Good' => array ( 'field' => 'Instances.Good' , 'name' => 'Papabile' , 'type' => 'bool' ),
'Instances.Chosen' => array ( 'field' => 'Instances.Chosen' , 'name' => 'Scelta' , 'type' => 'bool' ),
'Instances.Visible' => array ( 'field' => 'Instances.Visible' , 'name' => 'Visibile' , 'type' => 'bool' ),
'Instances.Blacklisted' => array ( 'field' => 'Instances.Blacklisted' , 'name' => 'Blacklistata' , 'type' => 'bool' ),
'Instances.URI' => array ( 'field' => 'Instances.URI' , 'name' => 'URI' , 'type' => 'text' ),
'Instances.Title' => array ( 'field' => 'Instances.Title' , 'name' => 'Titolo' , 'type' => 'text' ),
'Instances.ShortDesc' => array ( 'field' => 'Instances.ShortDesc' , 'name' => 'Descrizione breve' , 'type' => 'text' ),
'Instances.LongDesc' => array ( 'field' => 'Instances.LongDesc' , 'name' => 'Descrizione lunga' , 'type' => 'text' ),
'Instances.OurDesc' => array ( 'field' => 'Instances.OurDesc' , 'name' => 'Descrizione nostra' , 'type' => 'text' ),
2020-01-20 21:23:02 +01:00
//--------------------------------
2020-01-13 17:16:33 +01:00
'Instances.LocalityID' => array ( 'field' => 'Instances.LocalityID' , 'name' => 'Località ⮞' , 'type' => 'join' , 'join' => array (), 'ord' => false ),
'Localities.Locality' => array ( 'field' => 'Localities.Locality' , 'name' => 'Località' , 'type' => 'joini' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' ), 'subtype' => 'text' ),
'Provinces.ID' => array ( 'field' => 'Provinces.ID' , 'name' => 'Provincia ⮞' , 'type' => 'join' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' ), 'ord' => false ),
'Provinces.Province' => array ( 'field' => 'Provinces.Province' , 'name' => 'Provincia' , 'type' => 'joini' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' ), 'subtype' => 'text' ),
'Regions.ID' => array ( 'field' => 'Regions.ID' , 'name' => 'Regione ⮞' , 'type' => 'join' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' , 'Regions ON Regions.ID=Provinces.RegionID' ), 'ord' => false ),
'Regions.Region' => array ( 'field' => 'Regions.Region' , 'name' => 'Regione' , 'type' => 'joini' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' , 'Regions ON Regions.ID=Provinces.RegionID' ), 'subtype' => 'text' ),
'States.ID' => array ( 'field' => 'States.ID' , 'name' => 'Stato ⮞' , 'type' => 'join' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' , 'Regions ON Regions.ID=Provinces.RegionID' , 'States ON States.ID=Regions.StateID' ), 'ord' => false ),
'States.State' => array ( 'field' => 'States.State' , 'name' => 'Stato' , 'type' => 'joini' , 'join' => array ( 'Localities ON Localities.ID=Instances.LocalityID' , 'Provinces ON Provinces.ID=Localities.ProvinceID' , 'Regions ON Regions.ID=Provinces.RegionID' , 'States ON States.ID=Regions.StateID' ), 'subtype' => 'text' ),
2020-01-12 07:14:48 +01:00
2020-01-20 21:23:02 +01:00
//--------------------------------
2020-01-12 07:14:48 +01:00
'Instances.Email' => array ( 'field' => 'Instances.Email' , 'name' => 'Email di contatto' , 'type' => 'text' ),
'Instances.Software' => array ( 'field' => 'Instances.Software' , 'name' => 'Software' , 'type' => 'text' ),
'Instances.Version' => array ( 'field' => 'Instances.Version' , 'name' => 'Versione' , 'type' => 'text' ),
'Instances.UserCount' => array ( 'field' => 'Instances.UserCount' , 'name' => 'Utenti' , 'type' => 'int' ),
'Instances.StatusCount' => array ( 'field' => 'Instances.StatusCount' , 'name' => 'Stati' , 'type' => 'int' ),
'Instances.DomainCount' => array ( 'field' => 'Instances.DomainCount' , 'name' => 'Istanze note' , 'type' => 'int' ),
'Instances.ActiveUsersMonth' => array ( 'field' => 'Instances.ActiveUsersMonth' , 'name' => 'Utenti attivi (mese)' , 'type' => 'int' ),
'Instances.ActiveUsersHalfYear' => array ( 'field' => 'Instances.ActiveUsersHalfYear' , 'name' => 'Utenti attivi (6 mesi)' , 'type' => 'int' ),
'Instances.Thumb' => array ( 'field' => 'Instances.Thumb' , 'name' => 'Logo' , 'type' => 'text' , 'search' => false , 'ord' => false ),
'Instances.RegOpen' => array ( 'field' => 'Instances.RegOpen' , 'name' => 'Registrazioni aperte' , 'type' => 'bool' ),
'Instances.RegReqApproval' => array ( 'field' => 'Instances.RegReqApproval' , 'name' => 'Approvazione registrazioni' , 'type' => 'bool' ),
'Instances.MaxTootChars' => array ( 'field' => 'Instances.MaxTootChars' , 'name' => 'Limite caratteri' , 'type' => 'int' ),
'Instances.AdmAccount' => array ( 'field' => 'Instances.AdmAccount' , 'name' => 'Account admin' , 'type' => 'text' ),
'Instances.AdmDisplayName' => array ( 'field' => 'Instances.AdmDisplayName' , 'name' => 'Nome account admin' , 'type' => 'text' ),
'Instances.AdmCreatedAt' => array ( 'field' => 'Instances.AdmCreatedAt' , 'name' => 'Data creazione account admin' , 'type' => 'time' ),
'Instances.AdmURL' => array ( 'field' => 'Instances.AdmURL' , 'name' => 'Pagina dell’ admin' , 'type' => 'text' , 'search' => false , 'ord' => false ),
'Instances.AdmAvatar' => array ( 'field' => 'Instances.AdmAvatar' , 'name' => 'Avatar admin' , 'type' => 'text' , 'search' => false , 'ord' => false ),
'Instances.AdmNote' => array ( 'field' => 'Instances.AdmNote' , 'name' => 'Note dell’ admin' , 'type' => 'text' ),
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstLangs' => array ( 'name' => 'Lingue dichiarate' , 'search' => false , 'ord' => false ),
'InstLangs.LangID' => array ( 'field' => 'InstLangs%.LangID' , 'name' => 'Una lingua dichiarata ⮞' , 'type' => 'join' , 'join' => array ( 'InstLangs AS InstLangs% ON InstLangs%.InstID=Instances.ID' ), 'ord' => false ),
'Languages.NameIT' => array ( 'field' => 'Languages%.NameIT' , 'name' => 'Una lingua dichiarata' , 'type' => 'joini' , 'join' => array ( 'InstLangs AS InstLangs% ON InstLangs%.InstID=Instances.ID' , 'Languages AS Languages% ON Languages%.ID=InstLangs%.LangID' ), 'subtype' => 'text' , 'ord' => true , 'ordname' => 'Lingue dichiarate' , 'ordjoin' => array ( 'InstLangs AS OrdInstLangs ON OrdInstLangs.InstID=Instances.ID' , 'Languages AS OrdLanguages ON OrdLanguages.ID=OrdInstLangs.LangID' ), 'ordselmore' => 'GROUP_CONCAT(OrdLanguages.NameIT ORDER BY OrdInstLangs.Pos ASC SEPARATOR \'\') AS xOrdLangs' , 'ordby' => 'xOrdLangs' ),
2020-01-27 17:26:37 +01:00
'InstLangs.LangID.First' => array ( 'field' => 'InstLangs.LangID' , 'name' => 'Lingua primaria dichiarata ⮞' , 'type' => 'join' , 'join' => array ( 'InstLangs AS InstLangs ON InstLangs.InstID=Instances.ID AND InstLangs.Pos=1' ), 'ord' => false ),
2020-01-20 21:23:02 +01:00
2020-01-27 17:26:37 +01:00
'Languages.NameIT.First' => array ( 'field' => 'Languages.NameIT' , 'name' => 'Lingua primaria dichiarata' , 'type' => 'joini' , 'join' => array ( 'InstLangs AS InstLangs ON InstLangs.InstID=Instances.ID AND InstLangs.Pos=1' , 'Languages AS Languages ON Languages.ID=InstLangs.LangID' ), 'subtype' => 'text' , 'ord' => false ),
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstOurLangs' => array ( 'name' => 'Lingue impostate da noi' , 'search' => false , 'ord' => false ),
'InstOurLangs.OurLangID' => array ( 'field' => 'InstOurLangs%.OurLangID' , 'name' => 'Una lingua impostata da noi ⮞' , 'type' => 'join' , 'join' => array ( 'InstOurLangs AS InstOurLangs% ON InstOurLangs%.InstID=Instances.ID' ), 'ord' => false ),
'OurLanguages.NameIT' => array ( 'field' => 'OurLanguages%.NameIT' , 'name' => 'Una lingua impostata da noi' , 'type' => 'joini' , 'join' => array ( 'InstOurLangs AS InstOurLangs% ON InstOurLangs%.InstID=Instances.ID' , 'Languages AS OurLanguages% ON OurLanguages%.ID=InstOurLangs%.OurLangID' ), 'subtype' => 'text' , 'ord' => true , 'ordname' => 'Lingue impostate da noi' , 'ordjoin' => array ( 'InstOurLangs AS OrdInstOurLangs ON OrdInstOurLangs.InstID=Instances.ID' , 'Languages AS OrdOurLanguages ON OrdOurLanguages.ID=OrdInstOurLangs.OurLangID' ), 'ordselmore' => 'GROUP_CONCAT(OrdOurLanguages.NameIT ORDER BY OrdInstOurLangs.Pos ASC SEPARATOR \'\') AS xOrdOurLangs' , 'ordby' => 'xOrdOurLangs' ),
2020-01-27 17:26:37 +01:00
'InstOurLangs.OurLangID.First' => array ( 'field' => 'InstOurLangs.OurLangID' , 'name' => 'Lingua primaria impostata da noi ⮞' , 'type' => 'join' , 'join' => array ( 'InstOurLangs AS InstOurLangs ON InstOurLangs.InstID=Instances.ID AND InstOurLangs.Pos=1' ), 'ord' => false ),
2020-01-20 21:23:02 +01:00
2020-01-27 17:26:37 +01:00
'OurLanguages.NameIT.First' => array ( 'field' => 'OurLanguages.NameIT' , 'name' => 'Lingua primaria impostata da noi' , 'type' => 'joini' , 'join' => array ( 'InstOurLangs AS InstOurLangs ON InstOurLangs.InstID=Instances.ID AND InstOurLangs.Pos=1' , 'Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID' ), 'subtype' => 'text' , 'ord' => false ),
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstFinancing' => array ( 'name' => 'Modalità di finanziamento' , 'search' => false , 'ord' => false ),
'InstFinancing.FinID' => array ( 'field' => 'InstFinancing%.FinID' , 'name' => 'Una modalità di finanziamento ⮞' , 'type' => 'join' , 'join' => array ( 'InstFinancing AS InstFinancing% ON InstFinancing%.InstID=Instances.ID' ), 'ord' => false ),
'Financing.Type' => array ( 'field' => 'Financing%.Type' , 'name' => 'Una modalità di finanziamento' , 'type' => 'joini' , 'join' => array ( 'InstFinancing AS InstFinancing% ON InstFinancing%.InstID=Instances.ID' , 'Financing AS Financing% ON Financing%.ID=InstFinancing%.FinID' ), 'subtype' => 'text' , 'ord' => true , 'ordname' => 'Modalità di finanziamento' , 'ordjoin' => array ( 'InstFinancing AS OrdInstFinancing ON OrdInstFinancing.InstID=Instances.ID' , 'Financing AS OrdFinancing ON OrdFinancing.ID=OrdInstFinancing.FinID' ), 'ordselmore' => 'GROUP_CONCAT(OrdFinancing.Type ORDER BY OrdInstFinancing.Pos ASC SEPARATOR \'\') AS xOrdFinancing' , 'ordby' => 'xOrdFinancing' ),
2020-01-27 17:26:37 +01:00
'InstFinancing.FinID.First' => array ( 'field' => 'InstFinancing.FinID' , 'name' => 'Modalità di finanziamento primaria ⮞' , 'type' => 'join' , 'join' => array ( 'InstFinancing AS InstFinancing ON InstFinancing.InstID=Instances.ID AND InstFinancing.Pos=1' ), 'ord' => false ),
2020-01-20 21:23:02 +01:00
2020-01-27 17:26:37 +01:00
'Financing.Type.First' => array ( 'field' => 'Financing.Type' , 'name' => 'Modalità di finanziamento primaria' , 'type' => 'joini' , 'join' => array ( 'InstFinancing AS InstFinancing ON InstFinancing.InstID=Instances.ID AND InstFinancing.Pos=1' , 'Financing AS Financing ON Financing.ID=InstFinancing.FinID' ), 'subtype' => 'text' , 'ord' => false ),
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstPolicies' => array ( 'name' => 'Restrizioni sui contenuti' , 'search' => false , 'ord' => false ),
'InstPolicies.PolID' => array ( 'field' => 'InstPolicies%.PolID' , 'name' => 'Una restrizione sui contenuti ⮞' , 'type' => 'join' , 'join' => array ( 'InstPolicies AS InstPolicies% ON InstPolicies%.InstID=Instances.ID' ), 'ord' => false ),
'Policies.Name' => array ( 'field' => 'Policies%.Name' , 'name' => 'Una restrizione sui contenuti' , 'type' => 'joini' , 'join' => array ( 'InstPolicies AS InstPolicies% ON InstPolicies%.InstID=Instances.ID' , 'Policies AS Policies% ON Policies%.ID=InstPolicies%.PolID' ), 'subtype' => 'text' , 'ord' => true , 'ordname' => 'Restrizioni sui contenuti' , 'ordjoin' => array ( 'InstPolicies AS OrdInstPolicies ON OrdInstPolicies.InstID=Instances.ID' , 'Policies AS OrdPolicies ON OrdPolicies.ID=OrdInstPolicies.PolID' ), 'ordselmore' => 'GROUP_CONCAT(OrdPolicies.Name ORDER BY OrdInstPolicies.Pos ASC SEPARATOR \'\') AS xOrdPolicies' , 'ordby' => 'xOrdPolicies' ),
2020-01-27 17:26:37 +01:00
'InstPolicies.PolID.First' => array ( 'field' => 'InstPolicies.PolID' , 'name' => 'Restrizione sui contenuti primaria ⮞' , 'type' => 'join' , 'join' => array ( 'InstPolicies AS InstPolicies ON InstPolicies.InstID=Instances.ID AND InstPolicies.Pos=1' ), 'ord' => false ),
2020-01-20 21:23:02 +01:00
2020-01-27 17:26:37 +01:00
'Policies.Name.First' => array ( 'field' => 'Policies.Name' , 'name' => 'Restrizione sui contenuti primaria' , 'type' => 'joini' , 'join' => array ( 'InstPolicies AS InstPolicies ON InstPolicies.InstID=Instances.ID AND InstPolicies.Pos=1' , 'Policies AS Policies ON Policies.ID=InstPolicies.PolID' ), 'subtype' => 'text' , 'ord' => false ),
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstTags' => array ( 'name' => 'Tags' , 'search' => false , 'ord' => false ),
2020-01-12 07:14:48 +01:00
2020-01-20 21:23:02 +01:00
'InstTags.TagID' => array ( 'field' => 'InstTags%.TagID' , 'name' => 'Una tag ⮞' , 'type' => 'join' , 'join' => array ( 'InstTags% ON InstTags%.InstID=Instances.ID' ), 'ord' => false ),
2020-01-12 07:14:48 +01:00
2020-01-20 21:23:02 +01:00
'Tags.Name' => array ( 'field' => 'Tags%.Name' , 'name' => 'Una tag' , 'type' => 'joini' , 'join' => array ( 'InstTags AS InstTags% ON InstTags%.InstID=Instances.ID' , 'Tags AS Tags% ON Tags%.ID=InstTags%.TagID' ), 'subtype' => 'text' , 'ord' => true , 'ordname' => 'Tags' , 'ordjoin' => array ( 'InstTags AS OrdInstTags ON OrdInstTags.InstID=Instances.ID' , 'Tags AS OrdTags ON OrdTags.ID=OrdInstTags.TagID' ), 'ordselmore' => 'GROUP_CONCAT(OrdTags.Name ORDER BY OrdInstTags.Pos ASC SEPARATOR \'\') AS xOrdTags' , 'ordby' => 'xOrdTags' ),
2020-01-12 07:14:48 +01:00
2020-01-27 17:26:37 +01:00
'InstTags.TagID.First' => array ( 'field' => 'InstTags.TagID' , 'name' => 'Tag primaria ⮞' , 'type' => 'join' , 'join' => array ( 'InstTags AS InstTags ON InstTags.InstID=Instances.ID AND InstTags.Pos=1' ), 'ord' => false ),
2020-01-12 07:14:48 +01:00
2020-01-27 17:26:37 +01:00
'Tags.Name.First' => array ( 'field' => 'Tags.Name' , 'name' => 'Tag primaria' , 'type' => 'joini' , 'join' => array ( 'InstTags AS InstTags ON InstTags.InstID=Instances.ID AND InstTags.Pos=1' , 'Tags AS Tags ON Tags.ID=InstTags.TagID' ), 'subtype' => 'text' , 'ord' => false ),
2020-01-18 07:48:06 +01:00
2020-01-20 21:23:02 +01:00
//--------------------------------
'InstActivity.Statuses.First' => array ( 'field' => 'InstActivity.Statuses' , 'name' => 'Stati ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity AS InstActivity ON InstActivity.InstID=Instances.ID AND InstActivity.Pos=1' ), 'subtype' => 'int' , 'ord' => true , 'ordjoin' => array ( 'InstActivity AS OrdInstActivity ON OrdInstActivity.InstID=Instances.ID AND OrdInstActivity.Pos=1' ), 'ordselmore' => 1 , 'ordby' => 'OrdInstActivity.Statuses' ),
'InstActivity.Logins.First' => array ( 'field' => 'InstActivity.Logins' , 'name' => 'Logins ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity AS InstActivity ON InstActivity.InstID=Instances.ID AND InstActivity.Pos=1' ), 'subtype' => 'int' , 'ord' => true , 'ordjoin' => array ( 'InstActivity AS OrdInstActivity ON OrdInstActivity.InstID=Instances.ID AND OrdInstActivity.Pos=1' ), 'ordselmore' => 1 , 'ordby' => 'OrdInstActivity.Logins' ),
'IntstActivity.Registrations.First' => array ( 'field' => 'InstActivity.Registrations' , 'name' => 'Registrazioni ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity AS InstActivity ON InstActivity.InstID=Instances.ID AND InstActivity.Pos=1' ), 'subtype' => 'int' , 'ord' => true , 'ordjoin' => array ( 'InstActivity AS OrdInstActivity ON OrdInstActivity.InstID=Instances.ID AND OrdInstActivity.Pos=1' ), 'ordselmore' => 1 , 'ordby' => 'OrdInstActivity.Registrations' ),
//--------------------------------
2020-01-18 07:48:06 +01:00
/* 'InstActivity.Statuses.AVG' => array ( 'field' => 'InstActivity.Statuses' , 'name' => 'Media stati ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity ON InstActivity.InstID=Instances.ID' ), 'subtype' => 'int' , 'ord' => true , 'ordjoin' => array ( 'InstActivity AS OrdInstActivity ON OrdInstActivity.InstID=Instances.ID' ), 'ordselmore' => 'AVG(InstActivity.Statuses) AS avgstatuses' ),
'InstActivity.Logins.AVG' => array ( 'field' => 'InstActivity.Logins' , 'name' => 'Logins ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity ON InstActivity.InstID=Instances.ID' ), 'subtype' => 'int' , 'wheremore' => 'InstActivity.Pos=1' , 'ord' => false ),
'IntstActivity.Registrations.AVG' => array ( 'field' => 'InstActivity.Registrations' , 'name' => 'Registrazioni ultima settimana' , 'type' => 'joini' , 'join' => array ( 'InstActivity ON InstActivity.InstID=Instances.ID' ), 'subtype' => 'int' , 'wheremore' => 'InstActivity.Pos=1' , 'ord' => false ), */
2020-01-08 14:52:20 +01:00
2020-01-02 13:19:25 +01:00
);
2020-01-08 14:52:20 +01:00
$types = array ( 'bool' , 'int' , 'time' , 'text' , 'join' , 'joini' );
2020-01-05 05:46:29 +01:00
$fieldselopts = '' ;
2020-01-11 20:05:15 +01:00
$ordfieldselopts = '' ;
2020-01-12 07:14:48 +01:00
foreach ( $cols as $key => $arr ) {
if ( ! array_key_exists ( 'search' , $arr ) || $arr [ 'search' ] == true ) {
if ( $arr [ 'type' ] == 'joini' ) {
$fieldselopts .= '<option value="' . $key . ':' . $arr [ 'type' ] . ':' . $arr [ 'subtype' ] . '">' . $arr [ 'name' ] . '</option>' ;
2020-01-11 20:05:15 +01:00
} else {
2020-01-12 07:14:48 +01:00
$fieldselopts .= '<option value="' . $key . ':' . $arr [ 'type' ] . ':null">' . $arr [ 'name' ] . '</option>' ;
2020-01-11 20:05:15 +01:00
}
}
2020-01-12 07:14:48 +01:00
if ( ! array_key_exists ( 'ord' , $arr ) || $arr [ 'ord' ] == true ) {
2020-01-20 21:23:02 +01:00
if ( ! array_key_exists ( 'ordname' , $arr ))
$name = $arr [ 'name' ];
else
$name = $arr [ 'ordname' ];
2020-01-12 07:14:48 +01:00
if ( $arr [ 'type' ] == 'joini' ) {
2020-01-20 21:23:02 +01:00
$ordfieldselopts .= '<option value="' . $key . ':' . $arr [ 'type' ] . ':' . $arr [ 'subtype' ] . '">' . $name . '</option>' ;
2020-01-11 20:05:15 +01:00
} else {
2020-01-20 21:23:02 +01:00
$ordfieldselopts .= '<option value="' . $key . ':' . $arr [ 'type' ] . ':null">' . $name . '</option>' ;
2020-01-11 20:05:15 +01:00
}
2020-01-08 14:52:20 +01:00
}
}
2020-01-12 07:14:48 +01:00
$pblocks = 0 ;
foreach ( $_POST as $key => $val )
if ( preg_match ( '/^openpar-\d+$/' , $key ) === 1 )
$pblocks ++ ;
2020-01-20 21:23:02 +01:00
$fi = 0 ;
$ji = 0 ;
$oi = 0 ;
2020-01-09 20:43:28 +01:00
$jsaddrows = '' ;
$jssetrows = '' ;
2020-01-13 17:16:33 +01:00
$jsordaddrows = '' ;
$jsordsetrows = '' ;
2020-01-08 16:06:09 +01:00
$sels = array ();
2020-01-08 14:52:20 +01:00
$joins = array ();
2020-01-18 07:48:06 +01:00
$havings = array ();
2020-01-08 14:52:20 +01:00
$where = '' ;
2020-01-13 17:16:33 +01:00
$order = '' ;
2020-01-08 14:52:20 +01:00
foreach ( $_POST as $key => $val ) {
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^openpar-\d+$/' , $key ) === 1 ) {
2020-01-20 21:23:02 +01:00
$fi ++ ;
2020-01-09 20:43:28 +01:00
if ( preg_match ( '/^\(+$/' , $val ) === 1 )
$where .= $val ;
2020-01-20 21:23:02 +01:00
$jsaddrows .= 'addrow(' . $fi . ',false);' . N ;
$jssetrows .= 'setrow(' . $fi . ',' . json_encode ( $val );
2020-01-09 20:43:28 +01:00
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^fieldsel-\d+$/' , $key ) === 1 && preg_match ( '/^(.+):(.+):(.+)$/' , $val , $buf ) === 1 ) {
2020-01-18 07:48:06 +01:00
$tagk = $buf [ 1 ];
2020-01-09 20:43:28 +01:00
$type = $buf [ 2 ];
$subtype = $buf [ 3 ];
2020-01-18 07:48:06 +01:00
if ( array_key_exists ( $tagk , $cols ) && in_array ( $type , $types )) {
2020-01-20 21:23:02 +01:00
if ( strpos ( $cols [ $tagk ][ 'field' ], '%' ) !== false )
$ji ++ ;
$where .= str_replace ( '%' , $ji , $cols [ $tagk ][ 'field' ]);
2020-01-09 20:43:28 +01:00
if ( $type == 'join' || $type == 'joini' ) {
2020-01-18 07:48:06 +01:00
foreach ( $cols [ $tagk ][ 'join' ] as $join ) {
2020-01-20 21:23:02 +01:00
$join = str_replace ( '%' , $ji , $join );
2020-01-08 14:52:20 +01:00
if ( ! in_array ( $join , $joins ))
$joins [] = $join ;
}
}
2020-01-18 07:48:06 +01:00
if ( array_key_exists ( 'havings' , $cols [ $tagk ]) && ! in_array ( $cols [ $tagk ][ 'havings' ], $havings ))
$havings [] = $cols [ $tagk ][ 'havings' ];
if ( array_key_exists ( 'selmore' , $cols [ $tagk ]) && ! in_array ( $cols [ $tagk ][ 'selmore' ], $sels ))
$sels [] = $cols [ $tagk ][ 'selmore' ];
2020-01-09 20:43:28 +01:00
$jssetrows .= ',' . json_encode ( $val );
2020-01-08 14:52:20 +01:00
} else {
2020-01-12 07:14:48 +01:00
muoribene ( $dbg . '<br>Dati POST corrotti.<br>Puoi <a href="instances.php">riprovare resettando i parametri</a> o <a href="index.php">tornare al login</a>.' , true );
2020-01-08 14:52:20 +01:00
}
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^condsel-\d+$/' , $key ) === 1 ) {
2020-01-08 14:52:20 +01:00
$where .= ' ' . $val . ' ' ;
$cond = $val ;
2020-01-09 20:43:28 +01:00
$jssetrows .= ',' . json_encode ( $val );
2020-01-11 20:05:15 +01:00
// nel caso qui sotto, valuesel e valueinp sono entrambi disabilitati (non ci sono in $_POST), quindi li riempio di introvabile e nulla
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^IS NULL|IS NOT NULL$/' , $val ) === 1 )
2020-01-11 20:05:15 +01:00
$jssetrows .= ',"NOMMITROVI!",""' ;
2020-01-08 14:52:20 +01:00
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^valuesel-\d+$/' , $key ) === 1 ) {
2020-01-08 14:52:20 +01:00
$where .= $val ;
2020-01-09 20:43:28 +01:00
$jssetrows .= ',' . json_encode ( $val );
$jssetrows .= ',""' ;
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^valueinp-\d+$/' , $key ) === 1 ) {
if ( preg_match ( '/^LIKE|NOT LIKE$/' , $cond ) === 1 )
2020-01-08 14:52:20 +01:00
$where .= '\'%' . myesc ( $link , $val ) . '%\'' ;
else
$where .= '\'' . myesc ( $link , $val ) . '\'' ;
2020-01-20 21:23:02 +01:00
$jssetrows .= ',"NOMMITROVI!"' ;
2020-01-09 20:43:28 +01:00
$jssetrows .= ',' . json_encode ( $val );
2020-01-08 14:52:20 +01:00
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^closepar-\d+$/' , $key ) === 1 ) {
2020-01-09 20:43:28 +01:00
if ( preg_match ( '/^\)+$/' , $val ) === 1 )
$where .= $val ;
$jssetrows .= ',' . json_encode ( $val );
}
2020-01-12 07:14:48 +01:00
if ( preg_match ( '/^andor-\d+$/' , $key ) === 1 && preg_match ( '/^AND|OR$/' , $val ) === 1 ) {
2020-01-20 21:23:02 +01:00
if ( $fi < $pblocks )
2020-01-09 20:43:28 +01:00
$where .= ' ' . $val . ' ' ;
$jssetrows .= ',' . json_encode ( $val ) . ');' . N ;
}
2020-01-13 17:16:33 +01:00
if ( preg_match ( '/^ordfieldsel-\d+$/' , $key ) === 1 && preg_match ( '/^(.+):(.+):(.+)$/' , $val , $buf ) === 1 ) {
2020-01-20 21:23:02 +01:00
$oi ++ ;
2020-01-18 07:48:06 +01:00
$tagk = $buf [ 1 ];
2020-01-13 17:16:33 +01:00
$type = $buf [ 2 ];
$subtype = $buf [ 3 ];
2020-01-18 07:48:06 +01:00
if ( array_key_exists ( $tagk , $cols ) && in_array ( $type , $types )) {
2020-01-20 21:23:02 +01:00
if ( $type == 'join' || $type == 'joini' ) {
if ( ! array_key_exists ( 'ordjoin' , $cols [ $tagk ])) {
2020-01-18 07:48:06 +01:00
foreach ( $cols [ $tagk ][ 'join' ] as $join )
2020-01-13 17:16:33 +01:00
if ( ! in_array ( $join , $joins ))
$joins [] = $join ;
2020-01-20 21:23:02 +01:00
} else {
foreach ( $cols [ $tagk ][ 'ordjoin' ] as $join )
if ( ! in_array ( $join , $joins ))
$joins [] = $join ;
2020-01-13 17:16:33 +01:00
}
2020-01-20 21:23:02 +01:00
}
if ( ! array_key_exists ( 'ordby' , $cols [ $tagk ])) {
$order .= $cols [ $tagk ][ 'field' ];
2020-01-13 17:16:33 +01:00
} else {
2020-01-18 07:48:06 +01:00
if ( ! in_array ( $cols [ $tagk ][ 'ordselmore' ], $sels ))
$sels [] = $cols [ $tagk ][ 'ordselmore' ];
$order .= $cols [ $tagk ][ 'ordby' ];
}
if ( array_key_exists ( 'havings' , $cols [ $tagk ]) && ! in_array ( $cols [ $tagk ][ 'havings' ], $havings ))
$havings [] = $cols [ $tagk ][ 'havings' ];
if ( array_key_exists ( 'selmore' , $cols [ $tagk ]) && ! in_array ( $cols [ $tagk ][ 'selmore' ], $sels ))
$sels [] = $cols [ $tagk ][ 'selmore' ];
2020-01-20 21:23:02 +01:00
$jsordaddrows .= 'ordaddrow(' . $oi . ',false);' . N ;
$jsordsetrows .= 'ordsetrow(' . $oi . ',' . json_encode ( $val );
2020-01-13 17:16:33 +01:00
} else {
muoribene ( $dbg . '<br>Dati POST corrotti.<br>Puoi <a href="instances.php">riprovare resettando i parametri</a> o <a href="index.php">tornare al login</a>.' , true );
}
}
if ( preg_match ( '/^ascdesc-\d+$/' , $key ) === 1 && preg_match ( '/^ASC|DESC$/' , $val ) === 1 ) {
$order .= ' ' . $val . ', ' ;
$jsordsetrows .= ',' . json_encode ( $val ) . ');' . N ;
}
2020-01-09 20:43:28 +01:00
}
if ( $jsaddrows != '' ) {
$jsaddrows .= 'document.getElementById("filbut").value="Rimuovi tutti i criteri di ricerca";' . N ;
$jsaddrows .= 'synctai();' . N ;
2020-01-05 05:46:29 +01:00
}
2020-01-13 17:16:33 +01:00
if ( $jsordaddrows != '' ) {
$jsordaddrows .= 'document.getElementById("ordbut").value="Rimuovi tutti i criteri di ordinamento";' . N ;
$jsordaddrows .= 'synctoi();' . N ;
}
2020-01-08 16:06:09 +01:00
if ( count ( $sels ) > 0 )
$sels = ', ' . implode ( ', ' , $sels );
else
$sels = '' ;
2020-01-08 14:52:20 +01:00
if ( $where != '' )
$where = 'WHERE ' . $where ;
2020-01-13 17:16:33 +01:00
if ( $order != '' )
$order = 'ORDER BY ' . substr ( $order , 0 , - 2 );
$dbg .= 'ORDER: ' . $order . '<br>' ;
2020-01-08 14:52:20 +01:00
if ( count ( $joins ) > 0 )
$joins = 'LEFT JOIN ' . implode ( ' LEFT JOIN ' , $joins );
else
$joins = '' ;
2020-01-18 07:48:06 +01:00
if ( count ( $havings ) > 0 )
$havings = 'HAVING ' . implode ( ' AND ' , $havings );
else
$havings = '' ;
2020-01-08 14:52:20 +01:00
2020-01-18 07:48:06 +01:00
$query = 'SELECT *, Instances.ID AS IID' . $sels . ' FROM Instances ' . $joins . ' ' . $where . ' GROUP BY IID ' . $havings . ' ' . $order . ' LIMIT 50' ;
2020-01-08 14:52:20 +01:00
$dbg .= 'QUERONA: ' . $query . '<br>' . N ;
2020-01-09 20:43:28 +01:00
$tini = microtime ( true );
2020-01-08 14:52:20 +01:00
$res = mysqli_query ( $link , $query )
2020-01-11 20:05:15 +01:00
or muoribene ( $dbg . '<br>' . $query . ': ' . mysqli_error ( $link ) . '<br>' . 'La query è fallita. <a href="instances.php">Resetta</a>.' , true );
2020-01-09 20:43:28 +01:00
$dbg .= 'Durata esecuzione query: ' . round ( microtime ( true ) - $tini , 4 ) . ' sec.<br>' . N ;
2020-01-05 05:46:29 +01:00
2019-12-26 21:57:36 +01:00
if ( mysqli_num_rows ( $res ) < 1 ) {
$out = '<p>Nessuna istanza da mostrare.</p>' . N ;
} else {
2020-01-05 05:46:29 +01:00
$out = '' ;
2019-12-26 21:57:36 +01:00
while ( $row = mysqli_fetch_assoc ( $res )) {
2020-01-05 05:46:29 +01:00
$out .= '<table class="bigtab">' . N ;
// $out.='<thead><tr><th class="tdattr">Attributi</th><th>Info</th></thead>'.N;
$out .= '<tbody>' . N ;
2020-01-08 14:52:20 +01:00
$out .= '<tr><td colspan="2" class="insthead">' . $row [ 'URI' ] . ' {' . $row [ 'IID' ] . '}</td></tr>' . N ;
2020-01-12 07:14:48 +01:00
$attr = booly ( $cols [ 'Instances.Blacklisted' ][ 'name' ] . ': ' , $row [ 'Blacklisted' ], false , true ) . N ;
$attr .= booly ( $cols [ 'Instances.New' ][ 'name' ] . ': ' , $row [ 'New' ], true ) . N ;
$attr .= booly ( $cols [ 'Instances.Good' ][ 'name' ] . ': ' , $row [ 'Good' ]) . N ;
$attr .= booly ( $cols [ 'Instances.Chosen' ][ 'name' ] . ': ' , $row [ 'Chosen' ]) . N ;
$attr .= booly ( $cols [ 'Instances.Visible' ][ 'name' ] . ': ' , $row [ 'Visible' ]) . N ;
/* $attr .= booly ( $cols [ 'Instances.RegOpen' ][ 'name' ] . ': ' , $row [ 'RegOpen' ]) . N ;
$attr .= booly ( $cols [ 'Instances.RegReqApproval' ][ 'name' ] . ': ' , $row [ 'RegReqApproval' ], true , true ) . N ; */
2020-01-05 05:46:29 +01:00
$sres = mysqli_query ( $link , 'SELECT * FROM InstChecks WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Time DESC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
$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 ;
mysqli_data_seek ( $sres , 0 );
$srow = mysqli_fetch_assoc ( $sres );
$attr .= '<div class="colsectcont">Ultimo check ' . strftime ( '%e %b %Y, %T' , $srow [ 'Time' ]) . ': ' . (( $srow [ 'Status' ]) ? '<span class="good">OK</span>' : '<span class="bad">KO</span>' ) . '</div>' ;
} else {
2020-01-11 00:51:02 +01:00
$attr .= '<div class="colsectheader">Percentuale di risposta ai nostri check</div>' . N ;
2020-01-05 05:46:29 +01:00
$attr .= '<div class="colsectcont nully">Non disponibile (?!?!?!)</div>' . N ;
}
$attr .= '<div class="colsectheader">Attività delle ultime 12 settimane</div>' . N ;
2020-01-02 22:03:34 +01:00
$sres = mysqli_query ( $link , 'SELECT SUM(Statuses) AS tstatuses, SUM(Logins) AS tlogins, SUM(Registrations) AS tregs FROM InstActivity WHERE InstID=' . $row [ 'IID' ])
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-02 22:03:34 +01:00
$tot = mysqli_fetch_assoc ( $sres );
$sres = mysqli_query ( $link , 'SELECT * FROM InstActivity WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Week DESC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-02 22:03:34 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
2020-01-05 05:46:29 +01:00
$attr .= '<div class="colsectcont">Stati: ' . $tot [ 'tstatuses' ] . '<br>Accessi: ' . $tot [ 'tlogins' ] . '<br>Registrazioni: ' . $tot [ 'tregs' ] . '</div>' . N ;
2020-01-02 22:03:34 +01:00
while ( $srow = mysqli_fetch_assoc ( $sres )) {
2020-01-11 00:51:02 +01:00
$attr .= '<div class="colsectcontb">' . strftime ( '%e %b %Y' , $srow [ 'Week' ]) . '</div>' . N ;
2020-01-02 22:03:34 +01:00
( $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 ;
}
2020-01-05 05:46:29 +01:00
} else {
$attr .= '<div class="colsectcont nully">Non disponibile</div>' . N ;
2020-01-02 22:03:34 +01:00
}
2020-01-05 05:46:29 +01:00
$attr .= '<div class="colsectheader">Hashtags più usati durante l’ ultima settimana</div>' . N ;
$sres = mysqli_query ( $link , 'SELECT * FROM InstTrends WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$attr .= '<div class="colsectcont"><ol>' . N ;
2020-01-02 22:03:34 +01:00
while ( $srow = mysqli_fetch_assoc ( $sres )) {
2020-01-05 05:46:29 +01:00
$attr .= '<li><a href="' . $srow [ 'URL' ] . '">' . hspech ( $srow [ 'Name' ]) . '</a></li>' . N ;
2020-01-02 22:03:34 +01:00
}
2020-01-05 05:46:29 +01:00
$attr .= '</ol></div>' . N ;
} else {
$attr .= '<div class="colsectcont nully">Non disponibili</div>' . N ;
2020-01-02 22:03:34 +01:00
}
$out .= '<tr><td class="tdattr">' . $attr . '</td><td>' . N ;
2020-01-12 07:14:48 +01:00
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.URI' ][ 'name' ] . ':</span> <a href="https://' . $row [ 'URI' ] . '" target="_blank">' . $row [ 'URI' ] . '</a></div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.Title' ][ 'name' ] . ':</span> ' . nully ( $row [ 'Title' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.Thumb' ][ 'name' ] . ':</span> ' . nully ( $row [ 'Thumb' ], true , 'image' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.ShortDesc' ][ 'name' ] . ':</span> ' . nully ( $row [ 'ShortDesc' ], true , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.LongDesc' ][ 'name' ] . ':</span> ' . nully ( $row [ 'LongDesc' ], true , 'strip' ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
// 'strip' o 'htmlent' per la descrizione nostra?
2020-01-12 07:14:48 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'Instances.OurDesc' ][ 'name' ] . ':</span> ' . nully ( $row [ 'OurDesc' ], true , 'strip' ) . '</div>' . N ;
2020-01-13 17:16:33 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'Localities.Locality' ][ 'name' ] . ':</span> ' ;
if ( ! is_null ( $row [ 'LocalityID' ])) {
$sres = mysqli_query ( $link , 'SELECT * FROM Localities LEFT JOIN Provinces ON Provinces.ID=Localities.ProvinceID LEFT JOIN Regions ON Regions.ID=Provinces.RegionID LEFT JOIN States ON States.ID=Regions.StateID WHERE Localities.ID=' . $row [ 'LocalityID' ])
2020-01-11 20:05:15 +01:00
or muoribene ( mysqli_error ( $link ), true );
$srow = mysqli_fetch_assoc ( $sres );
2020-01-13 17:16:33 +01:00
$out .= hspech ( $srow [ 'Locality' ]) . ' (' . $srow [ 'Province' ] . ', ' . $srow [ 'Region' ] . ', ' . $srow [ 'State' ] . ')</div>' . N ;
2020-01-11 20:05:15 +01:00
} else {
$out .= '<span class="nully">Non definita</span></div>' . N ;
}
2020-01-05 05:46:29 +01:00
$sres = mysqli_query ( $link , 'SELECT * FROM InstLangs LEFT JOIN Languages ON Languages.ID=LangID WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$i = 0 ;
$buf = array ();
while ( $srow = mysqli_fetch_assoc ( $sres )) {
$i ++ ;
2020-01-12 07:14:48 +01:00
$buf [] = $i . ': ' . hspech ( $srow [ 'Code' ] . ' [' . $srow [ 'NameIT' ] . ']' );
2020-01-05 05:46:29 +01:00
}
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="field">' . $cols [ 'InstLangs' ][ 'name' ] . ':</span> ' . implode ( '; ' , $buf ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="field">' . $cols [ 'InstLangs' ][ 'name' ] . ':</span> <span class="nully">Non definite</span></div>' . N ;
2020-01-05 05:46:29 +01:00
}
2020-01-08 14:52:20 +01:00
$sres = mysqli_query ( $link , 'SELECT * FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$i = 0 ;
$buf = array ();
while ( $srow = mysqli_fetch_assoc ( $sres )) {
$i ++ ;
2020-01-12 07:14:48 +01:00
$buf [] = $i . ': ' . hspech ( $srow [ 'Code' ] . ' [' . $srow [ 'NameIT' ] . ']' );
2020-01-05 05:46:29 +01:00
}
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstOurLangs' ][ 'name' ] . ':</span> ' . implode ( '; ' , $buf ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstOurLangs' ][ 'name' ] . ':</span> <span class="nully">Non definite</span></div>' . N ;
2020-01-05 05:46:29 +01:00
}
$sres = mysqli_query ( $link , 'SELECT * FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$i = 0 ;
$buf = array ();
while ( $srow = mysqli_fetch_assoc ( $sres )) {
$i ++ ;
2020-01-11 20:05:15 +01:00
$buf [] = $i . ': ' . hspech ( $srow [ 'Type' ]);
2020-01-05 05:46:29 +01:00
}
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstFinancing' ][ 'name' ] . ':</span> ' . implode ( '; ' , $buf ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstFinancing' ][ 'name' ] . ':</span> <span class="nully">Non definite</span></div>' . N ;
2020-01-05 05:46:29 +01:00
}
$sres = mysqli_query ( $link , 'SELECT * FROM InstPolicies LEFT JOIN Policies ON Policies.ID=PolID WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$i = 0 ;
$buf = array ();
while ( $srow = mysqli_fetch_assoc ( $sres )) {
$i ++ ;
$buf [] = $i . ': ' . hspech ( $srow [ 'Name' ]);
}
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstPolicies' ][ 'name' ] . ':</span> ' . implode ( '; ' , $buf ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstPolicies' ][ 'name' ] . ':</span> <span class="nully">Non definite</span></div>' . N ;
2020-01-05 05:46:29 +01:00
}
$sres = mysqli_query ( $link , 'SELECT * FROM InstTags LEFT JOIN Tags ON Tags.ID=TagID WHERE InstID=' . $row [ 'IID' ] . ' ORDER BY Pos ASC' )
2020-01-08 14:52:20 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-05 05:46:29 +01:00
if ( mysqli_num_rows ( $sres ) > 0 ) {
$i = 0 ;
$buf = array ();
while ( $srow = mysqli_fetch_assoc ( $sres )) {
$i ++ ;
$buf [] = $i . ': ' . hspech ( $srow [ 'Name' ]);
}
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstTags' ][ 'name' ] . ':</span> ' . implode ( '; ' , $buf ) . '</div>' . N ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-20 21:23:02 +01:00
$out .= '<div class="baloo"><span class="ourfield">' . $cols [ 'InstTags' ][ 'name' ] . ':</span> <span class="nully">Non definite</span></div>' . N ;
2020-01-05 05:46:29 +01:00
}
2020-01-12 07:14:48 +01:00
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.Email' ][ 'name' ] . ':</span> ' . nully ( $row [ 'Email' ], true , 'email' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.Software' ][ 'name' ] . ':</span> ' . nully ( $row [ 'Software' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.Version' ][ 'name' ] . ':</span> ' . nully ( $row [ 'Version' ], true , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.UserCount' ][ 'name' ] . ':</span> ' . nully ( $row [ 'UserCount' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.StatusCount' ][ 'name' ] . ':</span> ' . nully ( $row [ 'StatusCount' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.DomainCount' ][ 'name' ] . ':</span> ' . nully ( $row [ 'DomainCount' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.ActiveUsersMonth' ][ 'name' ] . ':</span> ' . nully ( $row [ 'ActiveUsersMonth' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.ActiveUsersHalfYear' ][ 'name' ] . ':</span> ' . nully ( $row [ 'ActiveUsersHalfYear' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.RegOpen' ][ 'name' ] . ':</span> ' . nully ( $row [ 'RegOpen' ], false , 'boolt' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.RegReqApproval' ][ 'name' ] . ':</span> ' . nully ( $row [ 'RegReqApproval' ], false , 'boolf' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.MaxTootChars' ][ 'name' ] . ':</span> ' . nully ( $row [ 'MaxTootChars' ], false , 'strip' , '500' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.AdmAccount' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmAccount' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.AdmDisplayName' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmDisplayName' ], false , 'strip' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.AdmCreatedAt' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmCreatedAt' ], true , 'timestamp' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.AdmURL' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmURL' ], true , 'url' ) . '</div>' . N ;
$out .= '<div class="baloo"><span class="field">' . $cols [ 'Instances.AdmAvatar' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmAvatar' ], false , 'image' ) . '</div>' . N ;
$out .= '<div><span class="field">' . $cols [ 'Instances.AdmNote' ][ 'name' ] . ':</span> ' . nully ( $row [ 'AdmNote' ], false , 'strip' ) . '</div>' . N ;
2020-01-02 22:03:34 +01:00
$out .= '</td></tr>' . N ;
2020-01-05 05:46:29 +01:00
$out .= '</tbody>' . N ;
$out .= '</table>' . N ;
2019-12-26 21:57:36 +01:00
}
2020-01-08 14:52:20 +01:00
$out .= '<div class="bigtabfoot"></div>' ;
2019-12-26 21:57:36 +01:00
}
2020-01-27 17:26:37 +01:00
$presid = 0 ;
if ( array_key_exists ( 'presets' , $_POST ) && preg_match ( '/^[0-9]+$/' , $_POST [ 'presets' ]) === 1 )
$presid = $_POST [ 'presets' ];
$presopts = '<option value="null"></option>' . N ;
$res = mysqli_query ( $link , 'SELECT * FROM Presets ORDER BY Name ASC' )
2020-01-20 21:23:02 +01:00
or muoribene ( mysqli_error ( $link ), true );
2020-01-27 17:26:37 +01:00
while ( $row = mysqli_fetch_assoc ( $res )) {
if ( $row [ 'ID' ] != $presid )
$presopts .= '<option value="' . $row [ 'ID' ] . '">' . hspech ( $row [ 'Name' ]) . '</option>' . N ;
else
$presopts .= '<option value="' . $row [ 'ID' ] . '" selected>' . hspech ( $row [ 'Name' ]) . '</option>' . N ;
}
2020-01-20 21:23:02 +01:00
2020-01-02 22:03:34 +01:00
mysqli_close ( $link );
2019-12-26 21:57:36 +01:00
?>
<! DOCTYPE HTML >
< html lang = " it " >
< head >
2020-01-05 05:46:29 +01:00
< title > Mastodon Startpage Admin - Istanze </ title >
2019-12-26 21:57:36 +01:00
< meta http - equiv = " Content-Type " content = " text/html; charset=utf-8 " >
< meta name = " description " content = " Admin pages for Mastodon Startpage " >
< meta name = " viewport " content = " width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no " >
< link rel = " icon " type = " image/png " href = " imgs/icona-32.png " sizes = " 32x32 " >
< link rel = " icon " type = " image/png " href = " imgs/icona-192.png " sizes = " 192x192 " >
< link rel = " icon " type = " image/png " href = " imgs/icona-512.png " sizes = " 512x512 " >
< link rel = " apple-touch-icon-precomposed " href = " imgs/icona-180.png " >
2020-01-08 14:52:20 +01:00
< script language = " JavaScript " src = " js/confirma.js?v=<?php echo( $cjrand ); ?> " ></ script >
2020-01-11 00:51:02 +01:00
< script language = " JavaScript " src = " js/alerta.js?v=<?php echo( $cjrand ); ?> " ></ script >
2019-12-26 21:57:36 +01:00
< link rel = " stylesheet " type = " text/css " href = " theme.css?v=<?php echo( $cjrand ); ?> " >
< script language = " JavaScript " >
<!--
function chulsh ( el , sh ) {
if ( sh )
2020-01-11 21:53:37 +01:00
el . querySelector ( 'ul' ) . style . display = 'block' ;
2019-12-26 21:57:36 +01:00
else
2020-01-11 21:53:37 +01:00
el . querySelector ( 'ul' ) . style . display = 'none' ;
2019-12-26 21:57:36 +01:00
}
function ulsh ( el , sh ) {
if ( sh )
2020-01-11 21:53:37 +01:00
el . style . display = 'block' ;
2019-12-26 21:57:36 +01:00
else
2020-01-11 21:53:37 +01:00
el . style . display = 'none' ;
2019-12-26 21:57:36 +01:00
}
function golang ( lang ) {
var loc = document . location . href ;
loc = loc . replace ( / #.*$/,'');
loc = loc . replace ( / \ / $ / , '' );
if ( document . documentElement . lang == 'en' ) {
if ( lang != 'en' )
document . location . href = loc + '/' + lang ;
} else {
if ( lang != 'en' )
document . location . href = loc . substr ( 0 , loc . length - 3 ) + '/' + lang ;
else
document . location . href = loc . substr ( 0 , loc . length - 3 );
}
}
2020-01-08 14:52:20 +01:00
function shideplancia () {
var plancia = document . getElementById ( 'plancia' );
2020-01-11 20:05:15 +01:00
var plctrl = document . getElementById ( 'plctrl' );
2020-01-08 14:52:20 +01:00
if ( plancia . style . display == 'block' ) {
plancia . style . display = 'none' ;
2020-01-11 20:05:15 +01:00
plctrl . innerHTML = 'Mostra plancia' ;
2020-01-08 14:52:20 +01:00
} else {
plancia . style . display = 'block' ;
2020-01-11 20:05:15 +01:00
plctrl . innerHTML = 'Nascondi plancia' ;
2020-01-08 14:52:20 +01:00
}
}
2020-01-05 05:46:29 +01:00
function truncsel ( el ) {
var sel = document . getElementById ( el ), len = sel . length , i = 0 ;
for ( i = len - 1 ; i >= 0 ; i -- )
sel . remove ( i );
}
function addselopt ( el , val , txt ) {
2020-01-08 14:52:20 +01:00
option = new Option ( txt , val );
2020-01-05 05:46:29 +01:00
el . add ( option );
}
function inpdisif ( index ) {
2020-01-11 21:53:37 +01:00
console . log ( 'inpdisif index: ' + index );
2020-01-08 14:52:20 +01:00
var source = document . getElementById ( 'condsel-' + index );
2020-01-08 16:06:09 +01:00
var inp = document . getElementById ( 'valueinp-' + index );
var sel = document . getElementById ( 'valuesel-' + index );
2020-01-05 05:46:29 +01:00
var conds = [ 'IS NULL' , 'IS NOT NULL' ];
if ( conds . includes ( source . value )) {
2020-01-08 16:06:09 +01:00
inp . disabled = true ;
sel . disabled = true ;
2020-01-05 05:46:29 +01:00
} else {
2020-01-08 16:06:09 +01:00
if ( inp . style . display != 'none' ) inp . disabled = false ;
if ( sel . style . display != 'none' ) sel . disabled = false ;
2020-01-05 05:46:29 +01:00
}
}
2020-01-09 20:43:28 +01:00
function popusels ( index , valselval ) {
2020-01-11 21:53:37 +01:00
console . log ( 'popusels index: ' + index );
2020-01-08 14:52:20 +01:00
var key = document . getElementById ( 'fieldsel-' + index ) . value ;
2020-01-11 20:05:15 +01:00
var type = key . replace ( /^.*: ( .* ) :.* $ / , '$1' );
var subtype = key . replace ( /^.*:.*: ( .* ) $ / , '$1' );
key = key . replace ( /^ ( .* ) :.*:.* $ / , '$1' );
2020-01-08 14:52:20 +01:00
var condsel = document . getElementById ( 'condsel-' + index );
var valsel = document . getElementById ( 'valuesel-' + index );
var valinp = document . getElementById ( 'valueinp-' + index );
2020-01-11 21:53:37 +01:00
condsel . setAttribute ( 'onchange' , 'inpdisif(' + index + ');' );
2020-01-08 14:52:20 +01:00
if ( type == 'joini' )
type = subtype ;
2020-01-05 05:46:29 +01:00
if ( type == 'bool' ) {
2020-01-08 14:52:20 +01:00
truncsel ( 'condsel-' + index );
2020-01-05 05:46:29 +01:00
addselopt ( condsel , 'IS' , 'è' );
2020-01-08 14:52:20 +01:00
truncsel ( 'valuesel-' + index );
2020-01-05 05:46:29 +01:00
addselopt ( valsel , 'TRUE' , 'vero' );
addselopt ( valsel , 'FALSE' , 'falso' );
2020-01-12 04:38:38 +01:00
addselopt ( valsel , 'NOT NULL' , 'definit@' );
addselopt ( valsel , 'NULL' , 'non definit@' );
2020-01-11 20:05:15 +01:00
if ( valselval !== false )
selind ( 'valuesel-' + index , valselval );
2020-01-11 21:53:37 +01:00
valinp . style . display = 'none' ;
2020-01-05 05:46:29 +01:00
valinp . disabled = true ;
2020-01-11 21:53:37 +01:00
valsel . style . display = 'block' ;
2020-01-05 05:46:29 +01:00
valsel . disabled = false ;
} else if ( type == 'text' ) {
2020-01-08 14:52:20 +01:00
truncsel ( 'condsel-' + index );
2020-01-05 05:46:29 +01:00
addselopt ( condsel , 'LIKE' , 'contiene' );
addselopt ( condsel , 'NOT LIKE' , 'non contiene' );
addselopt ( condsel , '=' , 'è uguale a' );
2020-01-12 04:38:38 +01:00
addselopt ( condsel , '!=' , 'è divers@ da' );
2020-01-08 16:06:09 +01:00
addselopt ( condsel , '>=' , 'è maggiore o uguale a' );
addselopt ( condsel , '<=' , 'è minore o uguale a' );
addselopt ( condsel , '>' , 'è maggiore di' );
addselopt ( condsel , '<' , 'è minore di' );
2020-01-12 04:38:38 +01:00
addselopt ( condsel , 'IS NOT NULL' , 'è definit@' );
addselopt ( condsel , 'IS NULL' , 'non è definit@' );
2020-01-11 21:53:37 +01:00
valsel . style . display = 'none' ;
2020-01-05 05:46:29 +01:00
valsel . disabled = true ;
2020-01-11 21:53:37 +01:00
valinp . style . display = 'block' ;
2020-01-05 05:46:29 +01:00
valinp . disabled = false ;
} else if ( type == 'int' || type == 'time' ) {
2020-01-08 14:52:20 +01:00
truncsel ( 'condsel-' + index );
2020-01-08 16:06:09 +01:00
addselopt ( condsel , '>=' , 'è maggiore o uguale a' );
addselopt ( condsel , '<=' , 'è minore o uguale a' );
addselopt ( condsel , '>' , 'è maggiore di' );
addselopt ( condsel , '<' , 'è minore di' );
addselopt ( condsel , '=' , 'è uguale a' );
2020-01-12 04:38:38 +01:00
addselopt ( condsel , '!=' , 'è divers@ da' );
addselopt ( condsel , 'IS NOT NULL' , 'è definit@' );
addselopt ( condsel , 'IS NULL' , 'non è definit@' );
2020-01-11 21:53:37 +01:00
valsel . style . display = 'none' ;
2020-01-05 05:46:29 +01:00
valsel . disabled = true ;
2020-01-11 21:53:37 +01:00
valinp . style . display = 'block' ;
2020-01-05 05:46:29 +01:00
valinp . disabled = false ;
2020-01-08 14:52:20 +01:00
} else if ( type == 'join' ) {
truncsel ( 'condsel-' + index );
2020-01-08 16:06:09 +01:00
addselopt ( condsel , '=' , 'è uguale a' );
2020-01-12 04:38:38 +01:00
addselopt ( condsel , '!=' , 'è divers@ da' );
addselopt ( condsel , 'IS NOT NULL' , 'è definit@' );
addselopt ( condsel , 'IS NULL' , 'non è definit@' );
2020-01-11 21:53:37 +01:00
valsel . style . display = 'block' ;
2020-01-08 14:52:20 +01:00
valsel . disabled = false ;
2020-01-11 21:53:37 +01:00
valinp . style . display = 'none' ;
2020-01-08 14:52:20 +01:00
valinp . disabled = true ;
truncsel ( 'valuesel-' + index );
2020-01-18 07:48:06 +01:00
pupwait ( true );
2020-01-09 20:43:28 +01:00
let xhr = new XMLHttpRequest ();
xhr . open ( 'GET' , 'instancesh.php?key=' + key );
xhr . responseType = 'json' ;
xhr . send ();
xhr . onload = function () {
let jarr = xhr . response ;
for ( i = 0 ; i < jarr . length ; i ++ )
addselopt ( valsel , jarr [ i ][ 0 ], jarr [ i ][ 1 ]);
console . log ( 'valsel pronto!' );
if ( valselval !== false )
selind ( 'valuesel-' + index , valselval );
2020-01-18 07:48:06 +01:00
pupwait ( false );
2020-01-09 20:43:28 +01:00
};
xhr . onerror = function () {
2020-01-27 17:26:37 +01:00
pupwait ( false );
alert ( 'La richiesta è fallita.' );
2020-01-09 20:43:28 +01:00
};
2020-01-05 05:46:29 +01:00
} else {
alert ( 'Attenziò: non so che farmene del tipo "' + type + '": diglielo, al programmatore.' );
}
}
2020-01-09 20:43:28 +01:00
function addrow ( index , refresh ) {
2020-01-08 14:52:20 +01:00
var table = document . getElementById ( 'planciafil' );
2020-01-05 05:46:29 +01:00
var newrow = table . insertRow ( index );
var newcell0 = newrow . insertCell ( 0 );
var newcell1 = newrow . insertCell ( 1 );
var newcell2 = newrow . insertCell ( 2 );
var newcell3 = newrow . insertCell ( 3 );
var newcell4 = newrow . insertCell ( 4 );
var newcell5 = newrow . insertCell ( 5 );
var newcell6 = newrow . insertCell ( 6 );
var newcell7 = newrow . insertCell ( 7 );
newcell0 . innerHTML = '<select class="openpar"><option value="null"></option><option value="(">(</option><option value="((">((</option><option value="(((">(((</option></select>' ;
newcell1 . innerHTML = '<select class="fieldsel"><?php echo($fieldselopts); ?></select>' ;
newcell2 . innerHTML = '<select class="condsel"></select>' ;
2020-01-08 14:52:20 +01:00
newcell3 . innerHTML = '<select class="valuesel" style="display:none;"></select><input type="text" class="valueinp" maxlength="256" style="display:none;">' ;
2020-01-05 05:46:29 +01:00
newcell4 . innerHTML = '<select class="closepar"><option value="null"></option><option value=")">)</option><option value="))">))</option><option value=")))">)))</option></select>' ;
newcell5 . innerHTML = '<select class="andor"><option value="AND">E</option><option value="OR">O</option></select>' ;
2020-01-20 21:23:02 +01:00
newcell6 . innerHTML = '<img class="plus" src="imgs/plus.svg" title="Aggiungi un criterio sotto questo">' ;
newcell6 . style . width = '22px' ;
newcell7 . innerHTML = '<img class="minus" src="imgs/minus.svg" title="Rimuovi questo criterio">' ;
newcell7 . style . width = '22px' ;
2020-01-09 20:43:28 +01:00
if ( refresh ) {
synctai ();
popusels ( index , false );
}
2020-01-05 05:46:29 +01:00
}
2020-01-13 17:16:33 +01:00
function ordaddrow ( index , refresh ) {
var table = document . getElementById ( 'planciaord' );
var newrow = table . insertRow ( index );
var newcell0 = newrow . insertCell ( 0 );
var newcell1 = newrow . insertCell ( 1 );
var newcell2 = newrow . insertCell ( 2 );
var newcell3 = newrow . insertCell ( 3 );
newcell0 . style . width = '97%' ;
newcell1 . style . width = '1%' ;
newcell2 . style . width = '1%' ;
newcell3 . style . width = '1%' ;
newcell0 . innerHTML = '<select class="ordfieldsel"><?php echo($ordfieldselopts); ?></select>' ;
newcell1 . innerHTML = '<select class="ascdesc"><option value="ASC">Crescente</option><option value="DESC">Decrescente</option></select>' ;
2020-01-20 21:23:02 +01:00
newcell2 . innerHTML = '<img class="plus" src="imgs/plus.svg" title="Aggiungi un criterio sotto questo">' ;
newcell3 . innerHTML = '<img class="minus" src="imgs/minus.svg" title="Rimuovi questo criterio">' ;
2020-01-13 17:16:33 +01:00
if ( refresh )
synctoi ();
}
2020-01-05 05:46:29 +01:00
function synctai () {
var i = 0 ;
2020-01-08 14:52:20 +01:00
var table = document . getElementById ( 'planciafil' );
2020-01-05 05:46:29 +01:00
var nodes = table . querySelectorAll ( '.minus' );
var cnodes = nodes . length ;
for ( i = 0 ; i < cnodes ; i ++ )
// +1 sempre per via della row iniziale
nodes [ i ] . setAttribute ( 'onclick' , 'remrow(' + ( i + 1 ) + ');' );
nodes = table . querySelectorAll ( '.plus' );
for ( i = 0 ; i < cnodes ; i ++ )
// +2 perché la devi aggiungere dopo la corrente
2020-01-09 20:43:28 +01:00
nodes [ i ] . setAttribute ( 'onclick' , 'addrow(' + ( i + 2 ) + ',true);' );
2020-01-05 05:46:29 +01:00
// da qui in poi faccio a scendere per non avere mai id e nomi duplicati
cnodes -- ;
nodes = table . querySelectorAll ( '.openpar' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'openpar-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'openpar-' + ( i + 1 ));
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.fieldsel' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'fieldsel-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'fieldsel-' + ( i + 1 ));
2020-01-09 20:43:28 +01:00
nodes [ i ] . setAttribute ( 'onchange' , 'popusels(' + ( i + 1 ) + ',false);' );
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.condsel' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'condsel-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'condsel-' + ( i + 1 ));
2020-01-11 21:53:37 +01:00
nodes [ i ] . setAttribute ( 'onchange' , 'inpdisif(' + ( i + 1 ) + ');' );
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.valuesel' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'valuesel-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'valuesel-' + ( i + 1 ));
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.valueinp' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'valueinp-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'valueinp-' + ( i + 1 ));
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.closepar' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'closepar-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'closepar-' + ( i + 1 ));
2020-01-05 05:46:29 +01:00
}
nodes = table . querySelectorAll ( '.andor' );
for ( i = cnodes ; i >- 1 ; i -- ) {
2020-01-08 14:52:20 +01:00
nodes [ i ] . setAttribute ( 'id' , 'andor-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'andor-' + ( i + 1 ));
2020-01-05 05:46:29 +01:00
nodes [ i ] . disabled = false ;
}
2020-01-08 14:52:20 +01:00
if ( cnodes >= 0 )
2020-01-05 05:46:29 +01:00
nodes [ cnodes ] . disabled = true ;
}
2020-01-13 17:16:33 +01:00
function synctoi () {
var i = 0 ;
var table = document . getElementById ( 'planciaord' );
var nodes = table . querySelectorAll ( '.minus' );
var cnodes = nodes . length ;
for ( i = 0 ; i < cnodes ; i ++ )
// +1 sempre per via della row iniziale
nodes [ i ] . setAttribute ( 'onclick' , 'ordremrow(' + ( i + 1 ) + ');' );
nodes = table . querySelectorAll ( '.plus' );
for ( i = 0 ; i < cnodes ; i ++ )
// +2 perché la devi aggiungere dopo la corrente
nodes [ i ] . setAttribute ( 'onclick' , 'ordaddrow(' + ( i + 2 ) + ',true);' );
// da qui in poi faccio a scendere per non avere mai id e nomi duplicati
cnodes -- ;
nodes = table . querySelectorAll ( '.ordfieldsel' );
for ( i = cnodes ; i >- 1 ; i -- ) {
nodes [ i ] . setAttribute ( 'id' , 'ordfieldsel-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'ordfieldsel-' + ( i + 1 ));
}
nodes = table . querySelectorAll ( '.ascdesc' );
for ( i = cnodes ; i >- 1 ; i -- ) {
nodes [ i ] . setAttribute ( 'id' , 'ascdesc-' + ( i + 1 ));
nodes [ i ] . setAttribute ( 'name' , 'ascdesc-' + ( i + 1 ));
}
}
2020-01-09 20:43:28 +01:00
function selind ( id , val ) {
var el = document . getElementById ( id ), i = 0 , found = false ;
while ( ! found && i < el . length ) {
if ( el [ i ] . value == val ) {
el . selectedIndex = i ;
found = true ;
}
i ++ ;
}
if ( ! found )
2020-01-11 20:05:15 +01:00
console . log ( '"' + val + '" non è stato trovato in "' + id + '"' );
2020-01-09 20:43:28 +01:00
}
function setrow ( index , openparv , fieldselv , condselv , valueselv , valueinpv , closeparv , andorv ) {
selind ( 'openpar-' + index , openparv );
selind ( 'fieldsel-' + index , fieldselv );
popusels ( index , valueselv );
selind ( 'condsel-' + index , condselv );
// selind('valuesel-'+index,valueselv);
document . getElementById ( 'valueinp-' + index ) . value = valueinpv ;
2020-01-11 20:05:15 +01:00
if ( condselv == 'IS NULL' || condselv == 'IS NOT NULL' ) {
document . getElementById ( 'valueinp-' + index ) . disabled = true ;
document . getElementById ( 'valuesel-' + index ) . disabled = true ;
}
2020-01-09 20:43:28 +01:00
selind ( 'closepar-' + index , closeparv );
selind ( 'andor-' + index , andorv );
}
2020-01-13 17:16:33 +01:00
function ordsetrow ( index , ordfieldselv , ascdescv ) {
selind ( 'ordfieldsel-' + index , ordfieldselv );
selind ( 'ascdesc-' + index , ascdescv );
}
2020-01-05 05:46:29 +01:00
function remrow ( index ) {
2020-01-08 14:52:20 +01:00
var table = document . getElementById ( 'planciafil' );
2020-01-05 05:46:29 +01:00
table . deleteRow ( index );
synctai ();
2020-01-08 14:52:20 +01:00
if ( table . rows . length < 2 )
document . getElementById ( 'filbut' ) . value = 'Aggiungi criteri di ricerca' ;
}
2020-01-13 17:16:33 +01:00
function ordremrow ( index ) {
var table = document . getElementById ( 'planciaord' );
table . deleteRow ( index );
synctoi ();
if ( table . rows . length < 2 )
document . getElementById ( 'ordbut' ) . value = 'Aggiungi criteri di ordinamento' ;
}
2020-01-08 14:52:20 +01:00
function truncfil () {
var table = document . getElementById ( 'planciafil' );
while ( table . rows . length > 1 )
remrow ( 1 );
}
2020-01-13 17:16:33 +01:00
function truncord () {
var table = document . getElementById ( 'planciaord' );
while ( table . rows . length > 1 )
ordremrow ( 1 );
}
2020-01-08 14:52:20 +01:00
function manfil () {
var filbut = document . getElementById ( 'filbut' );
var table = document . getElementById ( 'planciafil' );
var crows = table . rows . length ;
if ( crows < 2 ) {
2020-01-09 20:43:28 +01:00
addrow ( 1 , true );
2020-01-08 14:52:20 +01:00
filbut . value = 'Rimuovi tutti i criteri di ricerca' ;
} else {
2020-01-13 17:16:33 +01:00
confirma ( '<p>Confermi di voler rimuovere tutti i criteri di ricerca?</p>' , 'truncfil();filbut.value=\'Aggiungi criteri di ricerca\'' );
}
}
function manord () {
var ordbut = document . getElementById ( 'ordbut' );
var table = document . getElementById ( 'planciaord' );
var crows = table . rows . length ;
if ( crows < 2 ) {
ordaddrow ( 1 , true );
ordbut . value = 'Rimuovi tutti i criteri di ordinamento' ;
} else {
confirma ( '<p>Confermi di voler rimuovere tutti i criteri di ordinamento?</p>' , 'truncord();ordbut.value=\'Aggiungi criteri di ordinamento\'' );
2020-01-08 14:52:20 +01:00
}
}
2020-01-11 00:51:02 +01:00
function ckpar () {
var i = 0 ;
2020-01-09 20:43:28 +01:00
var table = document . getElementById ( 'planciafil' );
2020-01-11 00:51:02 +01:00
var nodes = table . querySelectorAll ( '.openpar' );
var cnodes = nodes . length ;
var opars = [];
var cpars = [];
for ( i = 0 ; i < cnodes ; i ++ )
opars . push ( nodes [ i ] . value );
nodes = table . querySelectorAll ( '.closepar' );
for ( i = 0 ; i < cnodes ; i ++ )
cpars . push ( nodes [ i ] . value );
var spars = '' ;
for ( i = 0 ; i < cnodes ; i ++ ) {
if ( opars [ i ] != 'null' ) spars += opars [ i ];
if ( cpars [ i ] != 'null' ) spars += cpars [ i ];
}
var opq = 0 , cpq = 0 , ok = true ;
for ( i = 0 ; i < spars . length ; i ++ ) {
if ( spars [ i ] == '(' ) {
opq ++ ;
} else if ( spars [ i ] == ')' ) {
cpq ++ ;
}
if ( cpq > opq )
break ;
}
if ( opq != cpq )
ok = false ;
console . log ( i + '/' + spars . length + ': ' + ok );
return ok ;
}
function ckf () {
var emsg = '' ;
if ( ! ckpar ()) emsg += 'Qualcosa non va con le parentesi!<br>\n' ;
2020-01-11 20:05:15 +01:00
// emsg+='Comunque NO!<br>\n';
2020-01-11 00:51:02 +01:00
if ( emsg == '' ) {
var table = document . getElementById ( 'planciafil' );
var crows = table . rows . length ;
2020-01-11 20:05:15 +01:00
if ( crows > 1 )
document . getElementById ( 'andor-' + ( crows - 1 )) . disabled = false ;
2020-01-11 00:51:02 +01:00
document . getElementById ( 'f' ) . submit ();
} else {
2020-01-13 17:16:33 +01:00
alerta ( '<p>' + emsg + '</p>' );
2020-01-11 00:51:02 +01:00
}
2020-01-05 05:46:29 +01:00
}
2020-01-18 07:48:06 +01:00
function pupwait ( on ) {
var pup = document . getElementById ( 'popup' ), inpup = document . getElementById ( 'inpopup' );
if ( on ) {
if ( pup . style . display != 'table' ) {
inpup . innerHTML = '<div class="waitbub"><img src="imgs/loading.gif"><br> <br>Caricamento in corso...</div>' ;
pup . style . display = 'table' ;
} else {
console . log ( 'Sto già aspettando...' );
}
} else {
inpup . innerHTML = '<div id="popupcont">...</div>' ;
pup . style . display = 'none' ;
}
}
2020-01-20 21:23:02 +01:00
//function setrow(index,openparv,fieldselv,condselv,valueselv,valueinpv,closeparv,andorv)
2020-01-27 17:26:37 +01:00
function loadpres () {
let pres = document . getElementById ( 'presets' );
if ( pres . value != 'null' ) {
pupwait ( true );
let formdata = new FormData ();
formdata . append ( 'act' , 'load' );
formdata . append ( 'pid' , pres . value );
let xhr = new XMLHttpRequest ();
xhr . open ( 'POST' , 'loadsavepres.php' );
xhr . responseType = 'json' ;
xhr . send ( formdata );
xhr . onload = function () {
let jarr = xhr . response ;
truncfil ();
for ( i = 0 ; i < jarr [ 'f' ] . length ; i ++ ) {
console . log ( jarr [ 'f' ][ i ]);
addrow ( i + 1 , false );
}
synctai ();
for ( i = 0 ; i < jarr [ 'f' ] . length ; i ++ ) {
setrow ( i + 1 , jarr [ 'f' ][ i ][ 'OpenPar' ], jarr [ 'f' ][ i ][ 'Field' ], jarr [ 'f' ][ i ][ 'Cond' ], jarr [ 'f' ][ i ][ 'ValueSel' ], jarr [ 'f' ][ i ][ 'ValueInp' ], jarr [ 'f' ][ i ][ 'ClosePar' ], jarr [ 'f' ][ i ][ 'AndOr' ]);
}
if ( jarr [ 'f' ] . length > 0 )
document . getElementById ( 'filbut' ) . value = 'Rimuovi tutti i criteri di ricerca' ;
truncord ();
for ( i = 0 ; i < jarr [ 'o' ] . length ; i ++ ) {
console . log ( jarr [ 'o' ][ i ]);
ordaddrow ( i + 1 , false );
}
synctoi ();
for ( i = 0 ; i < jarr [ 'o' ] . length ; i ++ ) {
ordsetrow ( i + 1 , jarr [ 'o' ][ i ][ 'Field' ], jarr [ 'o' ][ i ][ 'Sort' ]);
}
if ( jarr [ 'o' ] . length > 0 )
document . getElementById ( 'ordbut' ) . value = 'Rimuovi tutti i criteri di ordinamento' ;
pupwait ( false );
};
xhr . onerror = function () {
pupwait ( false );
alert ( 'La richiesta è fallita.' );
};
} else {
alerta ( '<p>Non hai selezionato alcun preset ;)</p>' );
}
2020-01-20 21:23:02 +01:00
}
2020-01-27 17:26:37 +01:00
function savepres ( txt , asnew ) {
2020-01-20 21:23:02 +01:00
pupwait ( true );
2020-01-27 17:26:37 +01:00
let pres = document . getElementById ( 'presets' );
2020-01-20 21:23:02 +01:00
let formdata = new FormData ( document . forms . f );
2020-01-27 17:26:37 +01:00
formdata . append ( 'act' , 'save' );
formdata . append ( 'txt' , txt );
if ( ! asnew )
formdata . append ( 'pid' , pres . value );
2020-01-20 21:23:02 +01:00
let xhr = new XMLHttpRequest ();
xhr . open ( 'POST' , 'loadsavepres.php' );
xhr . responseType = 'json' ;
xhr . send ( formdata );
xhr . onload = function () {
console . log ( xhr . response );
2020-01-27 17:26:37 +01:00
if ( ! asnew ) {
pres . options [ pres . selectedIndex ] . text = txt ;
} else {
let jarr = xhr . response ;
pres . add ( new Option ( txt , jarr [ 'pid' ]));
pres . selectedIndex = pres . options . length - 1 ;
}
2020-01-20 21:23:02 +01:00
pupwait ( false );
};
xhr . onerror = function () {
2020-01-27 17:26:37 +01:00
pupwait ( false );
alert ( 'La richiesta è fallita.' );
2020-01-20 21:23:02 +01:00
};
}
2020-01-27 17:26:37 +01:00
function pupsavepres ( asnew ) {
var pres = document . getElementById ( 'presets' );
if ( pres . value != 'null' || asnew ) {
var pup = document . getElementById ( 'popup' ), inpup = document . getElementById ( 'inpopup' );
var prestext = pres . options [ pres . selectedIndex ] . text ;
var pre = '<p>Se vuoi puoi modificare il nome del preset che stai per sovrascrivere</p>' ;
if ( asnew ) pre = '<p>Dai un nuovo nome al nuovo preset che stai per salvare</p>' ;
inpup . innerHTML = '<div class="loadsavepresbub">' + pre + '<input type="text" maxlength="256" value="' + prestext . replace ( / " /g,'"')+' " id = " presname " >< input type = " button " value = " Salva " onClick = " ckpresname('+asnew+'); " >< input type = " button " value = " Annulla " onClick = " pupoff(); " >< div id = " ckmsg " ></ div ></ div > ' ;
pup . style . display = 'table' ;
} else {
alerta ( '<p>Non hai selezionato alcun preset ;)</p>' );
}
}
function ckpresname ( asnew ) {
var pres = document . getElementById ( 'presets' );
var presname = document . getElementById ( 'presname' ) . value ;
var ckmsg = document . getElementById ( 'ckmsg' );
var ok = true ;
var i ;
if ( presname . trim == '' ) {
presname = '' ;
ok = false ;
ckmsg . innerHTML = 'Non puoi salvare un preset senza nome' ;
}
if ( ! asnew ) {
for ( i = 0 ; i < pres . options . length ; i ++ ) {
if ( i != pres . selectedIndex && presname == pres . options [ i ] . text ) {
ok = false ;
ckmsg . innerHTML = '<p>Esiste già un altro preset con questo nome</p>' ;
break ;
}
}
} else {
for ( i = 0 ; i < pres . options . length ; i ++ ) {
if ( presname == pres . options [ i ] . text ) {
ok = false ;
ckmsg . innerHTML = '<p>Esiste già un preset con questo nome</p>' ;
break ;
}
}
}
if ( ok ) {
pupoff ();
savepres ( presname , asnew );
}
}
function pupoff () {
var pup = document . getElementById ( 'popup' ), inpup = document . getElementById ( 'inpopup' );
inpup . innerHTML = '<div id="popupcont">...</div>' ;
pup . style . display = 'none' ;
}
2020-01-20 21:23:02 +01:00
2019-12-26 21:57:36 +01:00
//-->
</ script >
</ head >
2020-01-11 00:51:02 +01:00
< body >
2019-12-26 21:57:36 +01:00
< nav >
< div id = " hmenu " >
< ul >
< ? php echo ( $menuout ); ?>
</ ul >
2020-01-11 20:05:15 +01:00
< div id = " rightdiv " >
< div id = " plctrl " class = " rlinks " onclick = " shideplancia(); " > Mostra plancia </ div >
< div id = " logout " class = " rlinks " >< a href = " logout.php " > Esci </ a ></ div >
2019-12-26 21:57:36 +01:00
</ div >
</ nav >
2020-01-08 14:52:20 +01:00
< div id = " popup " >
< div id = " inpopup " >
< div id = " popupcont " >
...
</ div >
</ div >
</ div >
2020-01-27 17:26:37 +01:00
<!--
2019-12-26 21:57:36 +01:00
< div id = " footer " >
< form action = " edinst.php " name = " addinst " method = " post " >
< table >< tr >< td > Aggiungi un’ istanza :</ td >< td >< input type = " text " name = " URI " maxlength = " 512 " ></ td >< td >< input type = " button " value = " Vai " onClick = " ckaif(); " ></ td ></ tr ></ table >
</ form >
</ div >
2020-01-27 17:26:37 +01:00
-->
2020-01-05 05:46:29 +01:00
2020-01-08 14:52:20 +01:00
< div id = " debug " >
< ? php echo ( $dbg ); ?>
</ div >
2020-01-05 05:46:29 +01:00
2020-01-08 14:52:20 +01:00
< div id = " plancia " >
2020-01-20 21:23:02 +01:00
< form method = " post " id = " f " onsubmit = " ckf(); " >
2020-01-08 14:52:20 +01:00
< table id = " planciafil " class = " planciatab " >
< tr >< td colspan = " 8 " >< input type = " button " id = " filbut " value = " Aggiungi criteri di ricerca " class = " ctrlbut " onclick = " manfil(); " ></ td ></ tr >
2020-01-05 05:46:29 +01:00
</ table >
2020-01-08 14:52:20 +01:00
< table id = " planciaord " class = " planciatab " >
2020-01-13 17:16:33 +01:00
< tr >< td colspan = " 4 " >< input type = " button " id = " ordbut " value = " Aggiungi criteri di ordinamento " class = " ctrlbut " onclick = " manord(); " ></ td ></ tr >
2020-01-08 14:52:20 +01:00
</ table >
2020-01-27 17:26:37 +01:00
< table class = " planciatab " >< tr >< td style = " width:1% " > Preset : </ td >< td style = " width:95% " >< select name = " presets " id = " presets " class = " presets " >< ? php echo ( $presopts ); ?> </select></td><td style="width:1%"><img src="imgs/carica.svg" class="lilbut" onclick="loadpres();" title="Carica i criteri dal preset selezionato"></td><td style="width:1%"><img src="imgs/salva.svg" class="lilbut" onclick="pupsavepres(false);" title="Salva i criteri impostati nel preset selezionato sovrascrivendolo"></td><td style="width:1%"><img src="imgs/salvacome.svg" class="lilbut" onclick="pupsavepres(true);" title="Salva i criteri impostati come nuovo preset ..."></td><td style="width:1%"><img src="imgs/minus.svg" class="lilbut" onclick="rempres();" title="Elimina il preset selezionato"></td></tr></table>
2020-01-08 14:52:20 +01:00
< table id = " planciaothers " class = " planciatab " >
< tr >< td >< input type = " button " id = " subbut " value = " Applica " class = " ctrlbut " onclick = " ckf(); " ></ td ></ tr >
</ table >
2020-01-05 05:46:29 +01:00
</ form >
2020-01-20 21:23:02 +01:00
</ div >
2020-01-05 05:46:29 +01:00
2020-01-09 20:43:28 +01:00
< script language = " JavaScript " >
<!--
< ? php
echo ( $jsaddrows );
echo ( $jssetrows );
2020-01-13 17:16:33 +01:00
echo ( $jsordaddrows );
echo ( $jsordsetrows );
2020-01-09 20:43:28 +01:00
?>
//-->
</ script >
< div id = " fullscreen " >
< div id = " middlerow " >
2020-01-05 05:46:29 +01:00
< ? php echo ( $out ); ?>
</ div >
</ div >
2019-12-26 21:57:36 +01:00
</ body >
</ html >