diff --git a/web/admin/dafa.txt b/web/admin/dafa.txt index 94d3af4..edc2204 100644 --- a/web/admin/dafa.txt +++ b/web/admin/dafa.txt @@ -1,2 +1,9 @@ -- ripristinare le colonne descrittive in Languages: una per la locale impostata (it), una per en, una per fr, una per sp... +- dafa +? dafa? +* fatto +~ più o meno + +* ripristinare le colonne descrittive in Languages: una per la locale impostata (it), una per en, una per fr, una per sp... * instancesh.php: ritornare di tutte solo quelle che effettivamente sono usate, magari con un count tra () +* instances.php: definito/non definito non vengono riprodotte bene dalla plancia dopo post +? quando si seleziona definito/non definito, oltre a disabilitare il campo valsel/valinp, farlo sparire proprio? assegnargli un css che da disabilitato lo fa diventare tuttonero? tipo diff --git a/web/admin/instances.php b/web/admin/instances.php index 65fa3b6..9d4e922 100644 --- a/web/admin/instances.php +++ b/web/admin/instances.php @@ -100,7 +100,7 @@ $cols=array( 'LongDesc'=>array('name'=>'Descrizione lunga','type'=>'text'), 'OurDesc'=>array('name'=>'Descrizione nostra','type'=>'text'), - 'PlaceID'=>array('name'=>'[Località]','type'=>'join','join'=>array()), + 'PlaceID'=>array('name'=>'[Località]','type'=>'join','join'=>array(),'ord'=>false), 'Places.Locality'=>array('name'=>'Località','type'=>'joini','join'=>array('Places ON Places.ID=Instances.PlaceID'),'subtype'=>'text'), 'Email'=>array('name'=>'Email di contatto','type'=>'text'), @@ -111,86 +111,68 @@ $cols=array( 'DomainCount'=>array('name'=>'Istanze note','type'=>'int'), 'ActiveUsersMonth'=>array('name'=>'Utenti attivi (mese)','type'=>'int'), 'ActiveUsersHalfYear'=>array('name'=>'Utenti attivi (6 mesi)','type'=>'int'), - 'Thumb'=>array('name'=>'Logo','type'=>'text'), + 'Thumb'=>array('name'=>'Logo','type'=>'text','search'=>false,'ord'=>false), 'RegOpen'=>array('name'=>'Registrazioni aperte','type'=>'bool'), 'RegReqApproval'=>array('name'=>'Approvazione registrazioni','type'=>'bool'), 'MaxTootChars'=>array('name'=>'Limite caratteri','type'=>'int'), 'AdmAccount'=>array('name'=>'Account admin','type'=>'text'), 'AdmDisplayName'=>array('name'=>'Nome account admin','type'=>'text'), 'AdmCreatedAt'=>array('name'=>'Data creazione account admin','type'=>'time'), - 'AdmURL'=>array('name'=>'Pagina dell’admin','type'=>'text'), - 'AdmAvatar'=>array('name'=>'Avatar admin','type'=>'text'), + 'AdmURL'=>array('name'=>'Pagina dell’admin','type'=>'text','ord'=>false), + 'AdmAvatar'=>array('name'=>'Avatar admin','type'=>'text','search'=>false,'ord'=>false), 'AdmNote'=>array('name'=>'Note dell’admin','type'=>'text'), - 'LangID'=>array('name'=>'[Lingue dichiarate]','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID')), - 'Languages.Code'=>array('name'=>'Lingue dichiarate','type'=>'joini','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID','Languages ON Languages.ID=InstLangs.LangID'),'subtype'=>'text'), + 'LangID'=>array('name'=>'[Lingue dichiarate]','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'ord'=>false), + 'Languages.Code'=>array('name'=>'Lingue dichiarate','type'=>'joini','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID','Languages ON Languages.ID=InstLangs.LangID'),'subtype'=>'text','ord'=>false), + 'InstLangs.LangID'=>array('name'=>'[Lingua primaria dichiarata]','type'=>'join','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID'),'wheremore'=>'AND InstLangs.Pos=1','ord'=>false), + 'Languages.NameIT'=>array('name'=>'Lingua primaria dichiarata','type'=>'joini','join'=>array('InstLangs ON InstLangs.InstID=Instances.ID','Languages ON Languages.ID=InstLangs.LangID'),'subtype'=>'text','wheremore'=>'AND InstLangs.Pos=1'), - 'OurLangID'=>array('name'=>'[Lingue impostate da noi]','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID')), - 'OurLanguages.Code'=>array('name'=>'Lingue impostate da noi','type'=>'joini','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID','Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID'),'subtype'=>'text'), + 'OurLangID'=>array('name'=>'[Lingue impostate da noi]','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'ord'=>false), + 'OurLanguages.Code'=>array('name'=>'Lingue impostate da noi','type'=>'joini','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID','Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID'),'subtype'=>'text','ord'=>false), + 'InstOurLangs.OurLangID'=>array('name'=>'[Lingua primaria impostata da noi]','type'=>'join','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID'),'wheremore'=>'AND InstOurLangs.Pos=1','ord'=>false), + 'OurLanguages.NameIT'=>array('name'=>'Lingua primaria impostata da noi','type'=>'joini','join'=>array('InstOurLangs ON InstOurLangs.InstID=Instances.ID','Languages AS OurLanguages ON OurLanguages.ID=InstOurLangs.OurLangID'),'subtype'=>'text','wheremore'=>'AND InstOurLangs.Pos=1'), - 'FinID'=>array('name'=>'[Modalità di finanziamento]','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instnces.ID')), - 'Financing.Type'=>array('name'=>'Modalità di finanziamento','type'=>'joini','join'=>array('InstFinancing ON InstFinancing.InstID=Instnces.ID','Financing ON Financing.ID=InstFinancing.FinID'),'subtype'=>'text'), + 'FinID'=>array('name'=>'[Modalità di finanziamento]','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'ord'=>false), + 'Financing.Type'=>array('name'=>'Modalità di finanziamento','type'=>'joini','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID','Financing ON Financing.ID=InstFinancing.FinID'),'subtype'=>'text'), + 'InstFinancing.FinID'=>array('name'=>'[Modalità di finanziamento primaria]','type'=>'join','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID'),'wheremore'=>'AND InstFinancing.Pos=1','ord'=>false), + 'XFinancing.Type'=>array('name'=>'Modalità di finanziamento primaria','type'=>'joini','join'=>array('InstFinancing ON InstFinancing.InstID=Instances.ID','Financing AS XFinancing ON XFinancing.ID=InstFinancing.FinID'),'subtype'=>'text','wheremore'=>'AND InstFinancing.Pos=1'), - 'PolID'=>array('name'=>'[Restrizioni sui contenuti]','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID')), + 'PolID'=>array('name'=>'[Restrizioni sui contenuti]','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'ord'=>false), 'Policies.Name'=>array('name'=>'Restrizioni sui contenuti','type'=>'joini','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID','Policies ON Policies.ID=InstPolicies.PolID'),'subtype'=>'text'), + 'InstPolicies.PolID'=>array('name'=>'[Restrizione sui contenuti primaria]','type'=>'join','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID'),'wheremore'=>'AND InstPolicies.Pos=1','ord'=>false), + 'XPolicies.Name'=>array('name'=>'Restrizione sui contenuti primaria','type'=>'joini','join'=>array('InstPolicies ON InstPolicies.InstID=Instances.ID','Policies AS XPolicies ON XPolicies.ID=InstPolicies.PolID'),'subtype'=>'text','wheremore'=>'AND InstPolicies.Pos=1'), - 'TagID'=>array('name'=>'[Tags]','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID')), - 'Tags.Name'=>array('name'=>'Tags','type'=>'join','joini'=>array('InstTags ON InstTags.InstID=Instances.ID','Tags ON Tags.ID=InstTags.TagID'),'subtype'=>'text'), + 'TagID'=>array('name'=>'[Tags]','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'ord'=>false), + 'Tags.Name'=>array('name'=>'Tags','type'=>'joini','join'=>array('InstTags ON InstTags.InstID=Instances.ID','Tags ON Tags.ID=InstTags.TagID'),'subtype'=>'text'), + 'InstTags.TagID'=>array('name'=>'[Tag primaria]','type'=>'join','join'=>array('InstTags ON InstTags.InstID=Instances.ID'),'wheremore'=>'AND InstTags.Pos=1','ord'=>false), + 'XTags.Name'=>array('name'=>'Tag primaria','type'=>'joini','join'=>array('InstTags ON InstTags.InstID=Instances.ID','Tags AS XTags ON XTags.ID=InstTags.TagID'),'subtype'=>'text','wheremore'=>'AND InstTags.Pos=1'), - /*'Statuses'=>array('name'=>'Stati ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','select'=>'MAX(Week) AS maxweek'), - 'Logins'=>array('name'=>'Logins ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','select'=>'MAX(Week) AS maxweek'), - 'Registrations'=>array('name'=>'Registrazioni ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','select'=>'MAX(Week) AS maxweek'),*/ + /*'Statuses'=>array('name'=>'Stati ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','selmore'=>'MAX(Week) AS maxweek'), + 'Logins'=>array('name'=>'Logins ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','selmore'=>'MAX(Week) AS maxweek'), + 'Registrations'=>array('name'=>'Registrazioni ultima settimana','type'=>'joini','join'=>array('InstActivity ON InstActivity.InstID=Instances.ID'),'subtype'=>'int','selmore'=>'MAX(Week) AS maxweek'),*/ ); $types=array('bool','int','time','text','join','joini'); $fieldselopts=''; +$ordfieldselopts=''; foreach ($cols as $key=>$val) { - if ($val['type']=='joini') { - $fieldselopts.=''; - } else { - $fieldselopts.=''; + if (!array_key_exists('search',$val)) { + if ($val['type']=='joini') { + $fieldselopts.=''; + } else { + $fieldselopts.=''; + } + } + if (!array_key_exists('ord',$val)) { + if ($val['type']=='joini') { + $ordfieldselopts.=''; + } else { + $ordfieldselopts.=''; + } } } -/* -[openpar-1] => null -[fieldsel-1] => New§bool -[condsel-1] => IS -[valuesel-1] => TRUE -[closepar-1] => null -[andor-1] => AND -[openpar-2] => ( -[fieldsel-2] => URI§text -[condsel-2] => LIKE -[valueinp-2] => bida -[closepar-2] => null -[andor-2] => OR -[openpar-3] => null -[fieldsel-3] => URI§text -[condsel-3] => IS NULL -[closepar-3] => ) -[andor-3] => AND -[openpar-4] => null -[fieldsel-4] => PlaceID§join -[condsel-4] => = -[valuesel-4] => 1 -[closepar-4] => null -[andor-4] => AND -[openpar-5] => null -[fieldsel-5] => UserCount§int -[condsel-5] => >= -[valueinp-5] => 123 -[closepar-5] => null -[andor-5] => AND -[openpar-6] => null -[fieldsel-6] => LangID§join -[condsel-6] => = -[valuesel-6] => 20 -[closepar-6] => null -[andor-6] => AND -*/ - $i=0; $jsaddrows=''; $jssetrows=''; @@ -206,19 +188,21 @@ foreach ($_POST as $key=>$val) { $jsaddrows.='addrow('.$i.',false);'.N; $jssetrows.='setrow('.$i.','.json_encode($val); } - if (preg_match('/^fieldsel-\d+/',$key)===1 && preg_match('/^(.+)§(.+)§(.+)$/',$val,$buf)===1) { + if (preg_match('/^fieldsel-\d+/',$key)===1 && preg_match('/^(.+):(.+):(.+)$/',$val,$buf)===1) { $col=$buf[1]; $type=$buf[2]; $subtype=$buf[3]; if (array_key_exists($col,$cols) && in_array($type,$types)) { + if (array_key_exists('wheremore',$cols[$col])) + $where.='('; $where.=$col; if ($type=='join' || $type=='joini') { foreach ($cols[$col]['join'] as $join) { if (!in_array($join,$joins)) $joins[]=$join; } - if ($type=='joini' && array_key_exists('select',$cols[$col]) && !in_array($cols[$col]['select'],$sels)) - $sels[]=$cols[$col]['select']; + if (array_key_exists('selmore',$cols[$col]) && !in_array($cols[$col]['selmore'],$sels)) + $sels[]=$cols[$col]['selmore']; } $jssetrows.=','.json_encode($val); } else { @@ -229,9 +213,14 @@ foreach ($_POST as $key=>$val) { $where.=' '.$val.' '; $cond=$val; $jssetrows.=','.json_encode($val); +// nel caso qui sotto, valuesel e valueinp sono entrambi disabilitati (non ci sono in $_POST), quindi li riempio di introvabile e nulla + if (preg_match('/^(IS NULL|IS NOT NULL)$/',$val)===1) + $jssetrows.=',"NOMMITROVI!",""'; } if (preg_match('/^valuesel-\d+/',$key)===1) { $where.=$val; + if (array_key_exists('wheremore',$cols[$col])) + $where.=' '.$cols[$col]['wheremore'].')'; $jssetrows.=','.json_encode($val); $jssetrows.=',""'; } @@ -240,7 +229,9 @@ foreach ($_POST as $key=>$val) { $where.='\'%'.myesc($link,$val).'%\''; else $where.='\''.myesc($link,$val).'\''; - $jssetrows.=',""'; + if (array_key_exists('wheremore',$cols[$col])) + $where.=' '.$cols[$col]['wheremore'].')'; + $jssetrows.=',"NOMMITROVIHODETTO!"'; $jssetrows.=','.json_encode($val); } if (preg_match('/^closepar-\d+/',$key)===1) { @@ -274,7 +265,7 @@ $query='SELECT *, Instances.ID AS IID'.$sels.' FROM Instances '.$joins.' '.$wher $dbg.='QUERONA: '.$query.'
'.N; $tini=microtime(true); $res=mysqli_query($link,$query) - or muoribene($dbg.'
'.$query.': '.mysqli_error($link),true); + or muoribene($dbg.'
'.$query.': '.mysqli_error($link).'
'.'La query è fallita. Resetta.',true); $dbg.='Durata esecuzione query: '.round(microtime(true)-$tini,4).' sec.
'.N; if (mysqli_num_rows($res)<1) { @@ -352,7 +343,15 @@ if (mysqli_num_rows($res)<1) { $out.='
'.$cols['LongDesc']['name'].': '.nully($row['LongDesc'],true,'strip').'
'.N; // 'strip' o 'htmlent' per la descrizione nostra? $out.='
'.$cols['OurDesc']['name'].': '.nully($row['OurDesc'],true,'strip').'
'.N; - $out.='
'.$cols['PlaceID']['name'].': '.nully($row['PlaceID'],true,'strip').'
'.N; + $out.='
'.$cols['Places.Locality']['name'].': '; + if (!is_null($row['PlaceID'])) { + $sres=mysqli_query($link,'SELECT * FROM Places WHERE Places.ID='.$row['PlaceID']) + or muoribene(mysqli_error($link),true); + $srow=mysqli_fetch_assoc($sres); + $out.=hspech($srow['Locality']).'
'.N; + } else { + $out.='Non definita'.N; + } $sres=mysqli_query($link,'SELECT * FROM InstLangs LEFT JOIN Languages ON Languages.ID=LangID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC') or muoribene(mysqli_error($link),true); if (mysqli_num_rows($sres)>0) { @@ -362,9 +361,9 @@ if (mysqli_num_rows($res)<1) { $i++; $buf[]=$i.': '.hspech($srow['Code'].' ['.ucfirst(locale_get_display_name($srow['Code'])).']'); } - $out.='
'.$cols['LangID']['name'].': '.implode('; ',$buf).'
'.N; + $out.='
'.$cols['Languages.Code']['name'].': '.implode('; ',$buf).'
'.N; } else { - $out.='
'.$cols['LangID']['name'].': Non definite
'.N; + $out.='
'.$cols['Languages.Code']['name'].': Non definite
'.N; } $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); @@ -375,9 +374,9 @@ if (mysqli_num_rows($res)<1) { $i++; $buf[]=$i.': '.hspech($srow['Code'].' ['.ucfirst(locale_get_display_name($srow['Code'],'it')).']'); } - $out.='
'.$cols['OurLangID']['name'].': '.implode('; ',$buf).'
'.N; + $out.='
'.$cols['OurLanguages.Code']['name'].': '.implode('; ',$buf).'
'.N; } else { - $out.='
'.$cols['OurLangID']['name'].': Non definite
'.N; + $out.='
'.$cols['OurLanguages.Code']['name'].': Non definite
'.N; } $sres=mysqli_query($link,'SELECT * FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC') or muoribene(mysqli_error($link),true); @@ -386,11 +385,11 @@ if (mysqli_num_rows($res)<1) { $buf=array(); while ($srow=mysqli_fetch_assoc($sres)) { $i++; - $buf[]=$i.': '.hspech($srow['Type']).' ('.hspech($row['Details']).')'; + $buf[]=$i.': '.hspech($srow['Type']); } - $out.='
'.$cols['FinID']['name'].': '.implode('; ',$buf).'
'.N; + $out.='
'.$cols['Financing.Type']['name'].': '.implode('; ',$buf).'
'.N; } else { - $out.='
'.$cols['FinID']['name'].': Non definite
'.N; + $out.='
'.$cols['Financing.Type']['name'].': Non definite
'.N; } $sres=mysqli_query($link,'SELECT * FROM InstPolicies LEFT JOIN Policies ON Policies.ID=PolID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC') or muoribene(mysqli_error($link),true); @@ -401,9 +400,9 @@ if (mysqli_num_rows($res)<1) { $i++; $buf[]=$i.': '.hspech($srow['Name']); } - $out.='
'.$cols['PolID']['name'].': '.implode('; ',$buf).'
'.N; + $out.='
'.$cols['Policies.Name']['name'].': '.implode('; ',$buf).'
'.N; } else { - $out.='
'.$cols['PolID']['name'].': Non definite
'.N; + $out.='
'.$cols['Policies.Name']['name'].': Non definite
'.N; } $sres=mysqli_query($link,'SELECT * FROM InstTags LEFT JOIN Tags ON Tags.ID=TagID WHERE InstID='.$row['IID'].' ORDER BY Pos ASC') or muoribene(mysqli_error($link),true); @@ -414,9 +413,9 @@ if (mysqli_num_rows($res)<1) { $i++; $buf[]=$i.': '.hspech($srow['Name']); } - $out.='
'.$cols['TagID']['name'].': '.implode('; ',$buf).'
'.N; + $out.='
'.$cols['Tags.Name']['name'].': '.implode('; ',$buf).'
'.N; } else { - $out.='
'.$cols['TagID']['name'].': Non definite
'.N; + $out.='
'.$cols['Tags.Name']['name'].': Non definite
'.N; } $out.='
'.$cols['Email']['name'].': '.nully($row['Email'],true,'email').'
'.N; $out.='
'.$cols['Software']['name'].': '.nully($row['Software'],false,'strip').'
'.N; @@ -490,13 +489,13 @@ function golang(lang) { function shideplancia() { var plancia=document.getElementById('plancia'); - var rightdiv=document.getElementById('rightdiv'); + var plctrl=document.getElementById('plctrl'); if (plancia.style.display=='block') { plancia.style.display='none'; - rightdiv.innerHTML='Mostra plancia'; + plctrl.innerHTML='Mostra plancia'; } else { plancia.style.display='block'; - rightdiv.innerHTML='Nascondi plancia'; + plctrl.innerHTML='Nascondi plancia'; } } @@ -525,9 +524,9 @@ function inpdisif(index) { function popusels(index,valselval) { console.log('Index: '+index); var key=document.getElementById('fieldsel-'+index).value; - var type=key.replace(/^.*§(.*)§.*$/,'$1'); - var subtype=key.replace(/^.*§.*§(.*)$/,'$1'); - key=key.replace(/^(.*)§.*§.*$/,'$1'); + var type=key.replace(/^.*:(.*):.*$/,'$1'); + var subtype=key.replace(/^.*:.*:(.*)$/,'$1'); + key=key.replace(/^(.*):.*:.*$/,'$1'); var condsel=document.getElementById('condsel-'+index); var valsel=document.getElementById('valuesel-'+index); var valinp=document.getElementById('valueinp-'+index); @@ -541,6 +540,8 @@ function popusels(index,valselval) { addselopt(valsel,'FALSE','falso'); addselopt(valsel,'NOT NULL','definito'); addselopt(valsel,'NULL','non definito'); + if (valselval!==false) + selind('valuesel-'+index,valselval); valinp.style='display:none'; valinp.disabled=true; valsel.style='display:block'; @@ -697,7 +698,7 @@ function selind(id,val) { i++; } if (!found) - console.log(val+' non è stato trovato in '+id); + console.log('"'+val+'" non è stato trovato in "'+id+'"'); } function setrow(index,openparv,fieldselv,condselv,valueselv,valueinpv,closeparv,andorv) { selind('openpar-'+index,openparv); @@ -706,6 +707,10 @@ function setrow(index,openparv,fieldselv,condselv,valueselv,valueinpv,closeparv, selind('condsel-'+index,condselv); // selind('valuesel-'+index,valueselv); document.getElementById('valueinp-'+index).value=valueinpv; + if (condselv=='IS NULL' || condselv=='IS NOT NULL') { + document.getElementById('valueinp-'+index).disabled=true; + document.getElementById('valuesel-'+index).disabled=true; + } selind('closepar-'+index,closeparv); selind('andor-'+index,andorv); } @@ -767,11 +772,12 @@ function ckpar() { function ckf() { var emsg=''; if (!ckpar()) emsg+='Qualcosa non va con le parentesi!
\n'; - emsg+='Comunque NO!
\n'; +// emsg+='Comunque NO!
\n'; if (emsg=='') { var table=document.getElementById('planciafil'); var crows=table.rows.length; - document.getElementById('andor-'+(crows-1)).disabled=false; + if (crows>1) + document.getElementById('andor-'+(crows-1)).disabled=false; document.getElementById('f').submit(); } else { alerta(emsg); @@ -787,7 +793,9 @@ function ckf() { -
Mostra plancia
+
+ +
diff --git a/web/admin/instancesh.php b/web/admin/instancesh.php index 987d555..757c6f6 100644 --- a/web/admin/instancesh.php +++ b/web/admin/instancesh.php @@ -7,12 +7,28 @@ require('include/muoribene.php'); require('include/sessionstart.php'); $cols=array( - 'PlaceID'=>array('select'=>'SELECT Places.ID AS Pid, CONCAT(Locality,\' (\',COUNT(Places.ID),\')\') AS Txt FROM Instances LEFT JOIN Places ON Places.ID=PlaceID WHERE PlaceID IS NOT NULL ORDER BY Locality ASC','optcol'=>'Pid','txtcol'=>'Txt'), + + 'PlaceID'=>array('select'=>'SELECT Places.ID AS Pid, CONCAT(Locality,\' (\',COUNT(Places.ID),\')\') AS Txt FROM Instances LEFT JOIN Places ON Places.ID=PlaceID WHERE PlaceID IS NOT NULL GROUP BY Pid ORDER BY Locality ASC','optcol'=>'Pid','txtcol'=>'Txt'), + 'LangID'=>array('select'=>'SELECT Languages.ID AS Lid, CONCAT(Code, \' [\', NameIT, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstLangs LEFT JOIN Languages ON Languages.ID=LangID GROUP BY Languages.ID ORDER BY Code ASC','optcol'=>'Lid','txtcol'=>'Txt'), + + 'InstLangs.LangID'=>array('select'=>'SELECT Languages.ID AS Lid, CONCAT(Code, \' [\', NameIT, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstLangs LEFT JOIN Languages ON Languages.ID=LangID WHERE InstLangs.Pos=1 GROUP BY Languages.ID ORDER BY Code ASC','optcol'=>'Lid','txtcol'=>'Txt'), + 'OurLangID'=>array('select'=>'SELECT Languages.ID AS Lid, CONCAT(Code, \' [\', NameIT, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID GROUP BY Languages.ID ORDER BY Code ASC','optcol'=>'Lid','txtcol'=>'Txt'), - 'FinID'=>array('select'=>'SELECT Financing.ID AS Fid, CONCAT(Type,\' (\',COUNT(Financing.ID),\')\') AS Txt FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID GROUP BY Financing.ID ORDER BY Type ASC ','optcol'=>'Fid','txtcol'=>'Txt'), + + 'InstOurLangs.OurLangID'=>array('select'=>'SELECT Languages.ID AS Lid, CONCAT(Code, \' [\', NameIT, \'] (\', COUNT(Languages.ID), \')\') AS Txt FROM InstOurLangs LEFT JOIN Languages ON Languages.ID=OurLangID WHERE InstOurLangs.Pos=1 GROUP BY Languages.ID ORDER BY Code ASC','optcol'=>'Lid','txtcol'=>'Txt'), + + 'FinID'=>array('select'=>'SELECT Financing.ID AS Fid, CONCAT(Type,\' (\',COUNT(Financing.ID),\')\') AS Txt FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID GROUP BY Financing.ID ORDER BY Type ASC','optcol'=>'Fid','txtcol'=>'Txt'), + + 'InstFinancing.FinID'=>array('select'=>'SELECT Financing.ID AS Fid, CONCAT(Type,\' (\',COUNT(Financing.ID),\')\') AS Txt FROM InstFinancing LEFT JOIN Financing ON Financing.ID=FinID WHERE InstFinancing.Pos=1 GROUP BY Financing.ID ORDER BY Type ASC ','optcol'=>'Fid','txtcol'=>'Txt'), + 'PolID'=>array('select'=>'SELECT Policies.ID AS Pid, CONCAT(Name,\' (\',COUNT(Policies.ID),\')\') AS Txt FROM InstPolicies LEFT JOIN Policies ON Policies.ID=PolID GROUP BY Policies.ID ORDER BY Name ASC','optcol'=>'Pid','txtcol'=>'Txt'), + + 'InstPolicies.PolID'=>array('select'=>'SELECT Policies.ID AS Pid, CONCAT(Name,\' (\',COUNT(Policies.ID),\')\') AS Txt FROM InstPolicies LEFT JOIN Policies ON Policies.ID=PolID WHERE InstPolicies.Pos=1 GROUP BY Policies.ID ORDER BY Name ASC','optcol'=>'Pid','txtcol'=>'Txt'), + 'TagID'=>array('select'=>'SELECT Tags.ID AS Tid, CONCAT(Name,\' (\',COUNT(Tags.ID),\')\') AS Txt FROM InstTags LEFT JOIN Tags ON Tags.ID=TagID GROUP BY (Tags.ID) ORDER BY Name ASC','optcol'=>'Tid','txtcol'=>'Txt'), + + 'InstTags.TagID'=>array('select'=>'SELECT Tags.ID AS Tid, CONCAT(Name,\' (\',COUNT(Tags.ID),\')\') AS Txt FROM InstTags LEFT JOIN Tags ON Tags.ID=TagID WHERE InstTags.Pos=1 GROUP BY (Tags.ID) ORDER BY Name ASC','optcol'=>'Tid','txtcol'=>'Txt'), ); if (array_key_exists('key',$_GET) && array_key_exists($_GET['key'],$cols)) { diff --git a/web/admin/logout.php b/web/admin/logout.php new file mode 100644 index 0000000..292a181 --- /dev/null +++ b/web/admin/logout.php @@ -0,0 +1,9 @@ + diff --git a/web/admin/theme.css b/web/admin/theme.css index 373ea53..4be26c3 100644 --- a/web/admin/theme.css +++ b/web/admin/theme.css @@ -293,21 +293,6 @@ input { z-index: 1; /*display: none;*/ } -#hmenu #rightdiv { - position: absolute; - top: 0; - right: 0; - color: #78b1e2; - height: 32px; - line-height: 32px; - vertical-align: middle; - padding-right: 10px; - padding-left: 10px; -} -#hmenu #rightdiv:hover { - cursor: pointer; - background-color: rgba(255,255,255,0.10); -} #hmenu ul { list-style-type: none; margin: 0; @@ -369,6 +354,29 @@ input { text-decoration: none; } +#rightdiv { + position: absolute; + top: 0; + right: 0; + color: #78b1e2; + height: 32px; + line-height: 32px; + vertical-align: middle; +} +.rlinks { + float: left; + padding-left: 10px; + padding-right: 10px; + text-align: center; +} +.rlinks a { + color: #78b1e2; +} +.rlinks:hover { + cursor: pointer; + background-color: rgba(255,255,255,0.10); +} + #plancia { position: fixed; left: 50%; diff --git a/web/admin/zzz-materiali/mastostart.sql b/web/admin/zzz-materiali/mastostart.sql index d47e4b9..411eda7 100644 --- a/web/admin/zzz-materiali/mastostart.sql +++ b/web/admin/zzz-materiali/mastostart.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: localhost --- Creato il: Gen 11, 2020 alle 00:49 +-- Creato il: Gen 11, 2020 alle 19:59 -- Versione del server: 10.4.11-MariaDB -- Versione PHP: 7.4.1 @@ -161,7 +161,6 @@ CREATE TABLE `InstLangs` ( -- CREATE TABLE `InstOurLangs` ( - `ID` bigint(20) UNSIGNED NOT NULL, `InstID` bigint(20) UNSIGNED NOT NULL, `OurLangID` int(10) UNSIGNED NOT NULL, `Pos` tinyint(3) UNSIGNED NOT NULL @@ -332,12 +331,6 @@ ALTER TABLE `Financing` ALTER TABLE `Instances` ADD PRIMARY KEY (`ID`); --- --- Indici per le tabelle `InstOurLangs` --- -ALTER TABLE `InstOurLangs` - ADD PRIMARY KEY (`ID`); - -- -- Indici per le tabelle `Languages` -- @@ -414,12 +407,6 @@ ALTER TABLE `Financing` ALTER TABLE `Instances` MODIFY `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT per la tabella `InstOurLangs` --- -ALTER TABLE `InstOurLangs` - MODIFY `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; - -- -- AUTO_INCREMENT per la tabella `Languages` --