Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
103 righe
4.8 KiB
103 righe
4.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 10) { |
|
$error = false; |
|
$coda = $pdo->go("SELECT codice_ente, codice_pec, MIN(timestamp_creazione) AS data_inizio, count(codice) AS totale FROM b_coda GROUP BY codice_ente, codice_pec ORDER BY timestamp_creazione "); |
|
if ($coda->rowCount() > 0) { |
|
?> |
|
<button class="btn btn-primary mb-2" onclick="$('#wait').show(); $.ajax('/elabora_coda.php',{complete:function(){window.location.href=window.location.href}})"> |
|
<?= __("Elabora tutta la coda") ?> |
|
</button> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th><?= __("Indirizzo interessato") ?></th> |
|
<th width="200"><?= __("Data inizio coda") ?></th> |
|
<th width="100"><?= __("Messaggi") ?></th> |
|
<th width="200"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
while($oggetto = $coda->fetch(PDO::FETCH_ASSOC)) { |
|
$ente = "PIATTAFORMA GENERALE"; |
|
if (!empty($oggetto["codice_ente"])) { |
|
$ente = Ente::getInfoFromID($oggetto["codice_ente"])[0]["denominazione"]; |
|
$default = $indirizzo = Communicator::getDefaultAddress($oggetto["codice_ente"]); |
|
if (!empty($oggetto["codice_pec"])) { $indirizzo = Communicator::getPecAddress($oggetto["codice_pec"],$oggetto["codice_ente"]); } |
|
} else { |
|
$indirizzo = ""; |
|
switch($oggetto["codice_pec"]) { |
|
case -1: |
|
$indirizzo = $config["mittente_mail"]; |
|
break; |
|
case -2: |
|
$indirizzo = $config["mittente_newsletter"]; |
|
break; |
|
case -3: |
|
$indirizzo = $config["mittente_reset"]; |
|
break; |
|
} |
|
} |
|
$pathConnector = Ente::getTenantExtensionPath($oggetto["codice_ente"]) . DIRECTORY_SEPARATOR . "communicator.bridge.class.php"; |
|
$integrazione = file_exists($pathConnector); |
|
$diff = time() - strtotime($oggetto["data_inizio"]); |
|
$diff = floor($diff/60/60/24); |
|
$badge_bg = "badge-primary"; |
|
if ($diff > 0) { |
|
$badge_bg = "badge-warning"; |
|
if ($diff > 1) { |
|
$badge_bg = "badge-danger"; |
|
} |
|
} |
|
?> |
|
<tr> |
|
<td> |
|
<small><?= $ente ?></small><br> |
|
<strong><?= $indirizzo ?></strong> |
|
<?= ($integrazione) ? ("<br><span class='badge badge-success'>" . __("Integrazione") . "</span>") : "" ?> |
|
</td> |
|
<td class="text-center"> |
|
<strong><?= $oggetto["data_inizio"] ?></strong><br> |
|
<div class="badge <?= $badge_bg ?>"> |
|
<?= $diff ?> <?= __("Giorni"); ?> |
|
</div> |
|
</td> |
|
<td class="text-center"> |
|
<strong><?= $oggetto["totale"] ?></strong> |
|
</td> |
|
<td> |
|
<div class="btn-block btn-group-vertical"> |
|
<button class="btn btn-sm btn-info" onClick="showModalWithURL('/backend/gestione-coda/list.php?codice_ente=<?= $oggetto["codice_ente"] ?>&codice_pec=<?= $oggetto["codice_pec"] ?>');"> |
|
<span class="fa fa-list"></span> <?= __("Visualizza") ?> |
|
</button> |
|
<button class="btn btn-sm btn-danger" onClick="showModalWithURL('/backend/gestione-coda/force-coda.php?codice_ente=<?= $oggetto["codice_ente"] ?>&codice_pec=<?= $oggetto["codice_pec"] ?>');"> |
|
<span class="fa fa-forward"></span> <?= __("Forza smaltimento") ?> |
|
</button> |
|
<? if (!empty($oggetto["codice_ente"])) { ?> |
|
<button class="btn btn-sm btn-warning" onClick="showModalWithURL('/backend/gestione-coda/send-avviso.php?codice_ente=<?= $oggetto["codice_ente"] ?>&codice_pec=<?= $oggetto["codice_pec"] ?>');"> |
|
<span class="fa fa-paper-plane"></span> <?= __("Invia segnalazione") ?> |
|
</button> |
|
<? } ?> |
|
</div> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
<? |
|
} else { |
|
alertManager::printSuccessBox( __("Nessun messaggio in coda")); |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|