From 85488740926dd4dd06d44a1f389e657ab5441df0 Mon Sep 17 00:00:00 2001 From: Daniel Intrieri <119604034+Twindrillss@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:11:24 +0100 Subject: [PATCH] Create funzioni.php --- funzioni.php | 498 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 498 insertions(+) create mode 100644 funzioni.php diff --git a/funzioni.php b/funzioni.php new file mode 100644 index 0000000..8f2edde --- /dev/null +++ b/funzioni.php @@ -0,0 +1,498 @@ +prefix}listapdf"; +$datacorrenteunix = strtotime(date('Y-m-d')); + +$query = "SELECT * FROM {$wpdb->prefix}listapdf"; + +$results = $wpdb->get_results($query); + + +$controllo = false; + +foreach ($results as $result) { + +$dataconfrontoiniziounix = strtotime($result->data_partenza); +$dataconfrontofineunix = strtotime($result->data_fine); + + +if ($datacorrenteunix <= $dataconfrontofineunix){ + if ($datacorrenteunix >= $dataconfrontoiniziounix){ + $controllo = true; + $nomefileprescelto = $result->nome_file; + $urlfileprescelto = $result->url_completo; + } +} + + + +} + +if ($controllo){ + $urlcomp = get_home_url().'/wp-content/plugins/ieimenupdf/menu/'; + + + $finalurl = $urlcomp.$urlfileprescelto; + + if (!is_string($etichetta)){ + $contenutohtml = generahtmlmodal($finalurl); + } else { + $contenutohtml = generahtmlmodalridotto($finalurl,$etichetta); + } + return array("nome"=>$nomefileprescelto, "url"=>$finalurl,'html'=>$contenutohtml,'controllo'=>$controllo); +} else { + return array ('controllo'=>$controllo); +} + + +} + + +function generacssmodal (){ + + return ' + +'; + +} + +function generajsmodal() { + + + return ' + + + + + + '; + +} + +function generahtmlmodal($filepdf){ + +return ' +