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.
447 righe
23 KiB
447 righe
23 KiB
<!doctype html> |
|
<?php |
|
include '../../lib/api.php'; |
|
|
|
if (!Utils::isStatoSportelloPreparazione(true)) { |
|
Utils::RedirectTo(HTTP_PRIVATE_SECTION . 'info.php'); |
|
} |
|
|
|
define('WS_MODULE', 'documenti_bando'); |
|
|
|
//$LoggedAccount->checkAuthShowDomandaPage($id_domanda); |
|
$state = Utils::getFieldsState(Utils::isStatoSportelloPresentazione()); |
|
|
|
$istanza = Domanda::loadDomandaFromAccount(); |
|
//Utils::print_array($LoggedAccount);exit(); |
|
if(intval($istanza->STATO) == ANNULLATA){ |
|
Utils::RedirectTo(HTTP_PRIVATE_SECTION . 'dashboard.php'); |
|
} |
|
?> |
|
<html lang="en"> |
|
<? include_once ROOT . 'layout/head.php'; ?> |
|
<body> |
|
<? |
|
include_once ROOT . 'layout/header.php'; |
|
?> |
|
<main role="main"> |
|
<header class="masthead masthead-page"> |
|
<div class="container"> |
|
<div class="row "> |
|
<div class="col-lg-12 p-3"> |
|
<h6><?= TEXT_ASSESSORATO_BANDO ?></h6> |
|
<h6><?= TEXT_DESCRIZIONE_BANDO ?></h6> |
|
<? |
|
$txtBenvenuto = ($LoggedAccount->Anagrafica->SESSO == "M" ? "Benvenuto Sig." : "Benvenuta Sig.ra"); |
|
$contenuto = $txtBenvenuto . ' <b>' . $LoggedAccount->Anagrafica->COGNOME . ' ' . $LoggedAccount->Anagrafica->NOME . '</b>'; |
|
?> |
|
<h3 class="mb-2"><?= $contenuto ?></h3> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
include_once ROOT . 'layout/header_svg.php'; |
|
?> |
|
</header> |
|
<div class="container"> |
|
<? include_once ROOT . 'layout/loader.php'; ?> |
|
<div class="row"> |
|
<div class="col-sm-12 p-3"> |
|
<nav aria-label="breadcrumb"> |
|
<ol class="breadcrumb"> |
|
<li class="breadcrumb-item"><a href="javascript:goBack()">Pagina iniziale</a></li> |
|
<li class="breadcrumb-item active" aria-current="page">Sezione allegati</li> |
|
</ol> |
|
</nav> |
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12 p-3"> |
|
<h3>Sezione allegati</h3> |
|
<small>Sezione dedicata ai documenti da allegare alla domanda</small> |
|
</div> |
|
</div> |
|
<hr> |
|
<div class="row"> |
|
<div class="col-lg-12 p-3"> |
|
<div class="card"> |
|
<div class="card-header bg-primary text-white"> |
|
<!--<div class="btn-toolbar justify-content-between">--> |
|
<div class="btn-group"> |
|
<i class="fas fa-school"></i> |
|
Documenti da allegare |
|
</div> |
|
</div> |
|
<div class="card-body"> |
|
<ul> |
|
<li>Per allegare i documenti: cliccare sul pulsante "Allega" (per lo specifico documento) e dal popup di upload allegare il file.</li> |
|
<li>E' necessario allegare tutti i file obbligatori per potere presentare la domanda.</li> |
|
<li>Si consiglia di scansionare i documenti da caricare in modalità <u>bianco e nero</u> con una risoluzione massima di <u>300dpi</u> per ridurre le dimensioni stesse del file.</li> |
|
<li>La dimensione massima ammessa per i file è di <?= MAX_SIZE_FILE_TEXT ?> MB (Megabyte)</li> |
|
</ul> |
|
<table id="lista_allegati" class="table table-striped table-bordered" style="width:100%"> |
|
<thead> |
|
<tr> |
|
<th><? /* PRIORITA */ ?></th> |
|
<th><? /* ID */ ?></th> |
|
<th><? /* ID_DOMANDA */ ?></th> |
|
<th><? /* ID_DOCUMENTO */ ?></th> |
|
<th>Documento</th> |
|
<th>Tipo <i>(formato accettato)</i></th> |
|
<th>Stato</th> |
|
<th>Operazioni</th> |
|
</tr> |
|
</thead> |
|
<tfoot> |
|
<tr> |
|
<td colspan="8"> |
|
<? if ($state['stato'] === 0) { ?> |
|
<h5><div class="text-danger" id="msg_allegati"></div></h5> |
|
<? } |
|
?> |
|
</td> |
|
</tr> |
|
</tfoot> |
|
</table> |
|
</div> |
|
<div class="card-footer text-right"> |
|
<button type="button" id="btn-dashboard" class="btn btn-md btn-primary" onclick="goBack()"><i class="fas fa-tachometer-alt"></i> Torna alla pagina iniziale</button> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<? /* MODAL (ALLEGATI) */ ?> |
|
<div class="modal fade" id="allegatiModal" tabindex="-1" role="dialog" aria-labelledby="allegatiModalLabel" aria-hidden="true"> |
|
<div class="modal-dialog" role="document" style="max-width: 70%;" > |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title" id="allegatiModalLabel">Allega documento</h5> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<form id="form-allegati" action="javascript:saveAllegatoNewVersion()" > |
|
<div class="modal-body"> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<p><i>Selezionare il file che si desidera caricare a sistema.<br> <b>Formati allegati ammessi: (.<span id="ext_file_ammessa"></span>)</b></i></p> |
|
|
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<input type="hidden" name="ID_DOCUMENTO" id="id_documento" > |
|
<input type="hidden" name="ID_DOMANDA" id="id_domanda"> |
|
<input type="hidden" name="ID" id="id_allegato"> |
|
<input type="hidden" name="module" id="module"> |
|
<input type="hidden" name="action" id="action"> |
|
<input class="form-control" type="file" id="documento" name="documento" required> |
|
|
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12 text-center"> |
|
<small class="text-primary"> <i>Attenzione dimensione massima del file <?= MAX_SIZE_FILE_TEXT ?> MB (Megabyte)</i> |
|
</small> |
|
|
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<div class="mb-3"> |
|
<textarea class="form-control" id="note" name="NOTE" maxlength="<?= LUNGHEZZA_INDIRIZZO ?>" placeholder="Aggiungi un descrizione"></textarea> |
|
<p class="text-center"><small class="text-primary"> <i>Attenzione il limite massimo di caratteri è <?= LUNGHEZZA_INDIRIZZO ?></i> |
|
</small></p> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<span class="text-danger"><b>* I campi contrassegnati con l'asterisco sono dati obbligatori</b></span><br> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button> |
|
<button type="submit" class="btn btn-primary" >Salva</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="modal fade" id="uploadAllegato3" tabindex="-1" role="dialog" aria-labelledby="uploadAllegato3Label" aria-hidden="true"> |
|
<div class="modal-dialog" role="document" style="max-width: 70%;" > |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title" id="exampleModalLabel">Allega Certificazione del revisore</h5> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<form id="form-allegato3" action="javascript:salvaAllegato3()" > |
|
<div class="modal-body"> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<i>Allegare la certificazione del revisore <b>firmato digitalmente</b>.<br> <span class="small bold">Formati allegati ammessi: .p7m</span></i> |
|
</div> |
|
</div> |
|
<br> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<input class="form-control" type="file" id="allegato3" name="allegato3" required> |
|
<input type="hidden" name="id_domanda" id="all3_ID_DOMANDA" value="<?= $domanda->ID ?>"> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button> |
|
<button type="submit" class="btn btn-primary" >Salva</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="modal fade" id="uploadAllegato2" tabindex="-1" role="dialog" aria-labelledby="uploadAllegato2Label" aria-hidden="true"> |
|
<div class="modal-dialog" role="document" style="max-width: 70%;" > |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title" id="exampleModalLabel">Allega domanda e richiesta contributo</h5> |
|
<!--Domanda e Rich. Contrib--> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<form id="form-allegato2" action="javascript:salvaAllegato2()" > |
|
<div class="modal-body"> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<i>Allegare domanda e richiesta contributo <b>firmato digitalmente</b>.<br> <span class="small bold">Formati allegati ammessi: .p7m</span></i><br> |
|
</div> |
|
</div> |
|
<br> |
|
<div class="row"> |
|
<div class="col-sm-12"> |
|
<input class="form-control" type="file" id="allegato2" name="allegato2" required> |
|
<input type="hidden" name="id_domanda" id="all2_ID_DOMANDA" value="<?= $domanda->ID ?>"> |
|
</div> |
|
</div> |
|
<br><br> |
|
<div class="row"> |
|
<div class="col-sm-12 text-center"> |
|
<h5>Cliccando sul pulsante "Salva" la fase di preparazione risulterà completata e non sarà più possibile effettuare modifiche per questa domanda.</h5> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="modal-footer"> |
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button> |
|
<button type="submit" class="btn btn-primary" >Salva</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
</main> |
|
<? include_once ROOT . 'layout/footer.php'; ?> |
|
</body> |
|
<script> |
|
$(document).ready(function () { |
|
|
|
listAllegati(); |
|
|
|
}); |
|
|
|
function goBack() { |
|
$.redirect(HTTP_PRIVATE_SECTION + "dashboard.php"); |
|
} |
|
|
|
function listAllegati(reload) { |
|
|
|
var dt = $("#lista_allegati"); |
|
if (!reload) { |
|
dtAllegati = dt.DataTable({ |
|
'processing': true, |
|
'serverSide': true, |
|
'paging': false, |
|
'serverMethod': 'post', |
|
"dom": '', |
|
//"order": [[0, 'ASC']], |
|
'ajax': { |
|
'url': WS_CALL, // + '?module=istituto&action=list_istituti' |
|
'data': { |
|
'module': 'domanda', |
|
'action': 'listAllegati', |
|
'tipo': '', |
|
'length': 30 |
|
} |
|
}, |
|
'columnDefs': [ |
|
{'width': '120px', 'targets': 5}, |
|
{'width': '100px', 'targets': 6}, |
|
{'width': '180px', 'targets': 7} |
|
], |
|
'columns': [ |
|
{data: 'PRIORITA', "visible": false}, |
|
{data: 'ID', "visible": false}, |
|
{data: 'ID_DOMANDA', "visible": false}, |
|
{data: 'ID_DOCUMENTO', "visible": false}, |
|
{data: 'DOCUMENTO', orderable: false}, |
|
{data: 'TIPO', orderable: false}, |
|
{data: 'STATO', orderable: false}, |
|
{data: 'OP', orderable: false} |
|
//{data: 'OP', "visible": !readOnly, orderable: false} |
|
], |
|
'initComplete': function (settings, json) { |
|
checkRenderRequest(json); |
|
} |
|
}); |
|
} else { |
|
dt.DataTable().ajax.reload(function (json) { |
|
checkRenderRequest(json); |
|
}); |
|
} |
|
} |
|
|
|
function checkRenderRequest(json) { |
|
|
|
$("#msg_allegati").empty(); |
|
var txtMsg = document.createElement('span'); |
|
txtMsg.setAttribute('id', 'num-doc-obl'); |
|
$("#msg_allegati").append(txtMsg); |
|
$("#num-doc-obl").html(json.msg_allegati); |
|
if (json.allAllegatiCompleti) { |
|
renderConfirmRequest(); |
|
} else { |
|
resetConfirmRequest(); |
|
} |
|
} |
|
|
|
function renderConfirmRequest() { |
|
$("#confirm-request").html('<a class="btn btn-success btn-sm text-white" onclick="presenta()"><i class="fas fa-paper-plane"></i> Conferma Preparazione Istanza</a>'); |
|
} |
|
|
|
function resetConfirmRequest() { |
|
$("#confirm-request").empty(); |
|
} |
|
|
|
function assegnaValue(id_documento, obbligatorio, ext, id_allegato) { |
|
$('#id_documento').val(id_documento); |
|
$('#id_domanda').val(id_domanda); |
|
$('#id_allegato').val(id_allegato); |
|
$('#documento').val('');//reset |
|
$('#note').val('');//reset |
|
$('#ext_file_ammessa').empty(); |
|
$('#ext_file_ammessa').append(ext); |
|
|
|
if (obbligatorio == 0) { |
|
$('#note').attr('required', true); |
|
} else { |
|
$('#note').attr('required', false); |
|
} |
|
} |
|
|
|
function saveAllegatoNewVersion() { |
|
var file = document.getElementById("documento"); |
|
|
|
var maxsize = (MAX_SIZE_FILE_UPLOAD); |
|
var dimensionetrovata = file.files[0].size; |
|
if (dimensionetrovata > maxsize) { |
|
functionSwall('error', "La dimensione del file allegato eccede i limiti massimi previsti", ""); |
|
} else { |
|
$('#loader').show(); |
|
var form = document.getElementById('form-allegati'); |
|
var formInvio = new FormData(form); |
|
formInvio.set('module', 'domanda'); |
|
formInvio.set('action', 'saveAllegato'); |
|
formInvio.append('id_domanda', id_domanda); |
|
postdata(WS_CALL, formInvio, function (response) { |
|
$('#loader').hide(); |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
$('#loader').hide(); |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
if (result.value) { |
|
$('#allegatiModal').modal('toggle'); |
|
listAllegati(true); |
|
} |
|
}); |
|
} else { |
|
$('#loader').hide(); |
|
functionSwall('error', risp.erroreDescrizione, ""); |
|
} |
|
}); |
|
} |
|
} |
|
|
|
|
|
function deleteAllegato(id) { |
|
var object = { |
|
module: 'domanda', |
|
action: 'deleteAllegato', |
|
id: id |
|
}; |
|
Swal.fire({ |
|
title: "Attenzione", |
|
text: "Sei sicuro di voler proseguire con l'operazione selezionata?", |
|
type: 'warning', |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: 'Procedi', |
|
cancelButtonText: 'Annulla' |
|
}).then((result) => { |
|
if (result.value) { |
|
$('#loader').show(); |
|
postdataClassic(WS_CALL, object, function (response) { |
|
var risp = jQuery.parseJSON(response); |
|
if (risp.esito === 1) { |
|
$('#loader').hide(); |
|
Swal.fire({ |
|
type: 'success', |
|
title: 'OK', |
|
text: "Operazione completata con successo", |
|
showCancelButton: false, |
|
confirmButtonColor: '#3085d6', |
|
confirmButtonText: 'OK', |
|
allowOutsideClick: false |
|
}).then((result) => { |
|
if (result.value) { |
|
listAllegati(true); |
|
} |
|
}); |
|
} else { |
|
$('#loader').hide(); |
|
functionSwall('error', risp.erroreDescrizione, ""); |
|
} |
|
}); |
|
} |
|
}); |
|
} |
|
|
|
function openStreamer(id) { |
|
var object = { |
|
id: id, |
|
module: 'streamerFile', |
|
action: 'download' |
|
}; |
|
$.redirect(WS_CALL, object, "POST"); |
|
} |
|
|
|
</script> |
|
</html>
|