'gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre','Dicembre'); $giorni = array('Domenica','Lunedì','Martedì','Mercoledì', 'Giovedì','Venerdì','Sabato'); list($sett,$giorno,$mese,$anno) = explode('-',date('w-d-n-Y',$UNIX)); return $giorni[$sett].' '.$giorno.' '.$mesi[$mese].' '.$anno; } function pdomake(){ $p= new PDO("sqlite:database.db"); $p->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); $p->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC); $p->setAttribute(PDO::ATTR_EMULATE_PREPARES,false); return $p; } function DOCTypeDescr($type){ $type=strtolower(trim($type)); switch($type){ case "pdf": return "Documento pdf"; case "word": return "Documento di Microsoft Word"; case "excel": return "Documento di Microsoft Excel"; case "ppt"; return "Documento di Microsoft Power Point"; } return "Documento di formato sconosciuto"; } function colorByTypeDOC($type){ $type=strtolower(trim($type)); switch($type){ case "pdf": return "red"; case "word": return "blue"; case "excel": return "green"; case "ppt"; return "yellow"; } return "gray"; } function size($path){ if(filter_var($path, FILTER_VALIDATE_URL)){ $ch = curl_init($path); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_NOBODY, TRUE); $data = curl_exec($ch); $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); curl_close($ch); return $size; } return @filesize($path)?:0; } function filename($path){ if(filter_var($path, FILTER_VALIDATE_URL)){ $ft = parse_url($path, PHP_URL_PATH); return basename($ft); } return basename($path); } function eur($i){ return "€ ".number_format($i, 2, ',', '\''); } function humanFileSize($size,$unit="") { if( (!$unit && $size >= 1<<30) || $unit == "GB") return number_format($size/(1<<30),2)."GB"; if( (!$unit && $size >= 1<<20) || $unit == "MB") return number_format($size/(1<<20),2)."MB"; if( (!$unit && $size >= 1<<10) || $unit == "KB") return number_format($size/(1<<10),2)."KB"; return number_format($size)." bytes"; } function linkM($link,$text){ if(empty($link) || empty($text)) return ""; return ''.htmlentities($text).''; } function titlePrn($title,$val,$head="h3"){ if(empty($title) || empty($val)) return ""; return "

<".$head.">".htmlentities($title)."
".htmlentities($val)."

"; } function thumbnailGen($url,$MAXheight=200,$MAXwidth=200,$alt="thumbnail"){ return '
'.htmlentities($alt).''; } function cats(){ return [ "documents"=>"Documenti", "transactions"=>"Contabilità", "questions"=>"Domande", "events"=>"Eventi", "feedbacks"=>"Feedbacks" ]; } function buildDoc($data){ $res=""; $res.=$data["htmlDescription"]; $res.=thumbnailGen($data["thumbnailUrl"])."
"; $res.="

".linkM($data["documentUrl"],"File")."

"; if(!empty($data["signatureUrl"])) $res.="

".linkM($data["signatureUrl"],"Firma digitale")."

"; $res.=titlePrn("Data di pubblicazione",ITDate(strtotime($data["publishedDate"]))); $res.=titlePrn("Data di creazione",ITDate(strtotime($data["createdDate"]))); $res.=titlePrn("Data di ultima modifica",ITDate(strtotime($data["lastEditedDate"]))); foreach ($data["tags"] as $v) { $res.=''.htmlentities($v).""; } $res.='
'.htmlentities($data["format"]["description"]).""; if(count($data["links"]["to"]) >0){ $res.='

Risorse collegate:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } if(count($data["links"]["from"]) >0){ $res.='

Fanno riferimento a questa risorsa:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } return pageBuild($data["title"],$res); } function eurC($i){ if($i>0) return '

'.eur($i).'

'; if($i<0) return '

'.eur($i).'

'; return '

'.eur($i).'

'; } function buildTransaction($data){ $res=""; $res.=$data["htmlDescription"]; $res.=thumbnailGen($data["thumbnailUrl"])."
"; $res.=titlePrn("Data di pianificazione",ITDate(strtotime($data["planned"]))); $res.=titlePrn("Data di esecuzione",ITDate(strtotime($data["executed"]))); $res.='

Importo: '.eurC($data["amount"]).'

'; $res.=titlePrn("Data di pubblicazione",ITDate(strtotime($data["publishedDate"]))); $res.=titlePrn("Data di creazione",ITDate(strtotime($data["createdDate"]))); $res.=titlePrn("Data di ultima modifica",ITDate(strtotime($data["lastEditedDate"]))); foreach ($data["tags"] as $v) { $res.=''.htmlentities($v).""; } $res.='
'.htmlentities($data["format"]["description"]).""; if(count($data["links"]["to"]) >0){ $res.='

Risorse collegate:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } if(count($data["links"]["from"]) >0){ $res.='

Fanno riferimento a questa risorsa:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } return pageBuild($data["title"],$res); } function buildEvents($data){ $res=""; $res.=$data["htmlDescription"]; $res.=thumbnailGen($data["thumbnailUrl"])."
"; $res.=titlePrn("Data di inizio",ITDate(strtotime($data["startDate"]))); $res.=titlePrn("Data di fine",ITDate(strtotime($data["endDate"]))); if($data["isAssembly"]){ $res.="

È un'assemblea

"; } $res.=titlePrn("Data di pubblicazione",ITDate(strtotime($data["publishedDate"]))); $res.=titlePrn("Data di creazione",ITDate(strtotime($data["createdDate"]))); $res.=titlePrn("Data di ultima modifica",ITDate(strtotime($data["lastEditedDate"]))); foreach ($data["tags"] as $v) { $res.=''.htmlentities($v).""; } $res.='
'.htmlentities($data["format"]["description"]).""; if(count($data["links"]["to"]) >0){ $res.='

Risorse collegate:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } if(count($data["participants"])){ $res.="

Partecipanti

"; } foreach ($data["participants"] as $v) { $res.=''.htmlentities($v).""; } if(count($data["links"]["from"]) >0){ $res.='

Fanno riferimento a questa risorsa:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } return pageBuild($data["title"],$res); } function buildFeedback($data){ $res=""; $res.=$data["htmlDescription"]."
"; $res.=thumbnailGen($data["thumbnailUrl"])."
"; $res.=titlePrn("Data di inizio",ITDate(strtotime($data["startDate"]))); $res.=titlePrn("Data di fine",ITDate(strtotime($data["endDate"]))); $res.=titlePrn("Data di pubblicazione dei risultati",ITDate(strtotime($data["publishResultsDate"]))); $res.=titlePrn("Data di pubblicazione",ITDate(strtotime($data["publishedDate"]))); $res.=titlePrn("Data di creazione",ITDate(strtotime($data["createdDate"]))); $res.=titlePrn("Data di ultima modifica",ITDate(strtotime($data["lastEditedDate"]))); foreach ($data["tags"] as $v) { $res.=''.htmlentities($v).""; } $res.='
'.htmlentities($data["format"]["description"]).""; if(count($data["links"]["to"]) >0){ $res.='

Risorse collegate:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } if(count($data["links"]["from"]) >0){ $res.='

Fanno riferimento a questa risorsa:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } return pageBuild($data["title"],$res); } function buildQuestions($data){ $res=""; $res.=htmlentities($data["questionText"])."
"; $res.=thumbnailGen($data["thumbnailUrl"])."
"; $res.="

".htmlentities($data["answerTitle"])."

"; $res.=htmlentities($data["answerText"]); $res.=titlePrn("Chiesta da",$data["asker"]); $res.=titlePrn("Risposta da",$data["replier"]); $res.=titlePrn("Data di ricezione",ITDate(strtotime($data["askDate"]))); $res.=titlePrn("Data di risposta",ITDate(strtotime($data["answerDate"]))); $res.=titlePrn("Data di pubblicazione",ITDate(strtotime($data["publishedDate"]))); foreach ($data["tags"] as $v) { $res.=''.htmlentities($v).""; } $res.='
'.htmlentities($data["format"]["description"]).""; if(count($data["links"]["to"]) >0){ $res.='

Risorse collegate:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } if(count($data["links"]["from"]) >0){ $res.='

Fanno riferimento a questa risorsa:

'; foreach(array_keys($data["links"]["to"]) as $category){ $res.="

".cats()[$category]."

"; foreach($data["links"]["to"][$category] as $el){ $res.='

'.htmlEntities($el["title"]).'

'; } $res.="
"; } } return pageBuild($data["questionTitle"],$res); } function pageMake($UID,$pdo){ $data=uid($UID,$pdo); if($data==(-1)|| empty($UID)){ return pageBuild("Errore","

La risorsa richiesta non è stata trovata

"); } switch($UID[0]){ case "d": return buildDoc($data[0]); break; case "t": return buildTransaction($data[0]); break; case "e": return buildEvents($data[0]); break; case "q": return buildQuestions($data[0]); break; case "f": return buildFeedback($data[0]); break; } } function pageBuild($title,$body){ ob_start(); ?> Lens - <?php echo htmlentities($title)?>

Lens


Home
"Documenti", "transactions"=>"Contabilità", "questions"=>"Domande", "events"=>"Eventi", "feedbacks"=>"Feedbacks" ]; $res=""; $res.="

Utilizzo

"; $res.="

Per risorsa

"; foreach(array_keys($data["usage"]["categories"]) as $k ){ $res.="

".htmlentities($lk[$k])."

"; $i=0; foreach($data["usage"]["categories"][$k] as $r){ if(!$r["title"]) continue; $res.=''.htmlentities($r["title"]).''; $i++; } if($i==0) $res.="Dati mancanti"; } $res.="

Per periodo di utilizzo

"; foreach(array_keys($data["usage"]["timePoints"]) as $k ){ $i=0; $res.="

".htmlentities(ITDate(strtotime($k)))."

"; foreach($data["usage"]["timePoints"][$k] as $r){ if(!$r["title"]) continue; $res.=''.htmlentities($r["title"]).''; $i++; } if($i==0) $res.="Dati mancanti"; } return pageBuild("Tag: ".$tag,$res); }