Example #1
0
	*/
	width: 400px;
	height: 400px;
	position: 30px 30px;
	visibility: visible;
	background-color: white;
	/* calc((100% - 400px) / 2) calc((100% - 400px) / 2); */
}
</style>
</head>
<body>

<p>
<?php 
include_once 'PiazzoleService.php';
getCompagniaArciere(23);
$ciccio = getAllowedExt();
$pluto = "jpg";
//echo $ciccio[0] . "<br/>";
if (in_array($pluto, $ciccio)) {
    echo "Ho trovato PLUTO<br/><br/><br/>";
} else {
    echo "Nulla da segnalare<br/><br/><br/>";
}
$pieces = getClassificaCompagnia('04ARCH');
getPodio('CAM', 'SI');
$ext = getAllowedExt();
echo join(";", $ext);
$ciccio = getElencoFotoDaAssociare();
echo "Ci sono " . count($ciccio) . " file";
echo "GIANFRANCO";
Example #2
0
/**
 * La funzione abbinaArciereFoto si occupa di gestire l'abbinamento di una foto al relativo arciere
 * nTessera -> tessera da abbinare
 * nomeFoto -> nome del file della foto che andrà abbinata a nTessera
 * restituisce -> error: esito. message: descrizione dell'eventuale errore
 * 	error = 0 -> Abbinamento terminato con successo;
 * 	error != 0 -> - Errore
 * */
function abbinaArciereFoto($nTessera, $nomeFoto)
{
    if (DEBUG) {
        error_log("abbinaArciereFoto - \$nTessera --> {$nTessera}");
        error_log("abbinaArciereFoto - \$nomeFoto --> {$nomeFoto}");
    }
    $ext = strtolower(substr($nomeFoto, strrpos($nomeFoto, '.') + 1));
    $compagnia = min(getCompagniaArciere($nTessera));
    $newName = $compagnia . "_" . $nTessera . "." . $ext;
    $destinazione = AIRO_FS_FOLDER_FOTO_PODIO . $newName;
    $oldName = AIRO_FS_FOLDER_FOTO_DA_ASSOCIARE . $nomeFoto;
    if (!file_exists($oldName)) {
        return array("error" => 10, "messagge" => "Il file {$oldName} non esiste.");
    }
    if (file_exists($destinazione)) {
        return array("error" => 20, "messagge" => "Il file {$destinazione} esiste già.");
    }
    if (DEBUG) {
        error_log("Foto: {$nomeFoto}");
        error_log("Estensione: {$ext}");
        error_log("NewName: {$newName}");
        error_log("OldName: {$oldName}");
    }
    //		return "ciao";
    try {
        if (!setAbbinamentoArciereFoto($nTessera, $newName, $nomeFoto)) {
            if (DEBUG) {
                error_log("abbinaArciereFoto - Abbinamento FALLITO!! (DB) tessera: '{$nTessera}', nuovo nome: '{$newName}', nome originale: '{$nomeFoto}'.");
            }
            return array("error" => 30, "messagge" => "Impossible abbinare la tessera {$nTessera} alla foto {$nomeFoto}");
        } else {
            if (DEBUG) {
                error_log("abbinaArciereFoto - Abbinamento completato (DB) tessera: '{$nTessera}', nuovo nome: '{$newName}', nome originale: '{$nomeFoto}'.");
            }
        }
        // db insert
    } catch (Exception $c) {
        return $c;
    }
    try {
        rename($oldName, $destinazione);
        return array("error" => 0, "messagge" => "");
    } catch (Exception $c) {
        if (removeAbbinamentoArciereFoto($nTessera)) {
            // return "status: ko, messagge: impossible to rename $oldName in $nomeFoto";
            return array("error" => 40, "messagge" => "Impossible rinominare {$oldName} in {$destinazione}! Operazione annullata.");
        } else {
            return array("error" => 50, "messagge" => "Impossible rinominare {$oldName} in {$destinazione}! Operazione incompleta. Attenzione, su DB l'abbinamento è completo! ");
        }
    }
}