foreach ($form AS $input) {
$name = "criterio-form-input[". $input["codice"] . "]";
$value = "";
if (!empty($data)) {
if (is_numeric($data)) {
$content = $this->db->go($dataSql,[":input"=>$input["codice"],":offerta"=>$data])->fetch(PDO::FETCH_ASSOC);
if (!empty($content)) {
if (!empty($content["content"]) || $content["content"] == "0") {
$value = $content["content"];
if($input["tipo"] == "file" || $input["tipo"] == "image") {
$value = json_decode($value,true);
$value["codice"] = $content["codice"];
$value = json_encode($value);
}
}
}
} else if (is_array($data)) {
$value = $data[$input["codice"]] ?? "";
}
}
?>
filesManager::printList($input["codice"],$attachID,"A",0,false);
if ($bozza) { $input["obbligatorio"] = "N"; }
if (!$edit) {
?>
switch ($input["tipo"]) {
case "image":
case "file":
if (!empty($value)) {
$file = json_decode($value,true);
$link = (!empty($file["codice"])) ? "{$viewFormAttachPath}?codice={$file["codice"]}" : "";
if (!empty($this->commissario) && !empty($link)) {
$link .= "&valutatore=1";
}
if (!empty($file)) {
?>
if ($input["tipo"] == "file") {
addBypassCheckURL($link);
if (!empty($link)) { ?>
} ?>
= $file["filename"] ?>
if (!empty($link)) { ?> } ?>
SHA256: = $file["sha256"] ?>
} else {
$file["content"] = simple_decrypt($file["content"],$config["simple_encrypt"]["offer"]); ?>

;base64,= base64_encode($file["content"]) ?>">
} ?>
$input["obbligatorio"] = "N";
}
}
break;
case "select_json":
$sources = json_decode($input["opzioni"]);
$options = array();
foreach($sources AS $source) {
$source = sanitize_string($source);
if (file_exists($this->root."/form/json/".$source)) {
$tmp = json_decode(file_get_contents($this->root."/form/json/".$source),true);
foreach ($tmp AS $op_value => $op_label) {
$options[$op_value] = (!empty($op_label)) ? $op_label : $op_label;
}
}
}
if (!empty($options[$value])) { echo $options[$value]; }
break;
case "valuta":
if (is_numeric($value)) {
echo number_format($value,$criterio["decimali"] ?? 2,",",".");
}
break;
default:
echo $value;
break;
}
?>
} else { ?>
}
?>