fwrite($fileaperto, "<?php\n\$unit['s_n'] = \$trad_var['bed'];\n\$unit['p_n'] = \$trad_var['beds'];\n\$unit['gender'] = \$trad_var['bed_gender'];\n\$unit['special'] = 0;\n\$car_spec = explode(\",\",\$trad_var['special_characters']);\nfor (\$num1 = 0 ; \$num1 < count(\$car_spec) ; \$num1++) if (substr(\$unit['p_n'],0,strlen(\$car_spec[\$num1])) == \$car_spec[\$num1]) \$unit['special'] = 1;\n?>"); fclose($fileaperto); $fileaperto = fopen(C_DATA_PATH . "/tema.php", "w+"); fwrite($fileaperto, "<?php\n\$parole_sost = 0;\n\$tema[1] = \"sim\";\n?>"); fclose($fileaperto); $fileaperto = fopen(C_DATA_PATH . "/versione.php", "w+"); fwrite($fileaperto, "<?php\ndefine(C_VERSIONE_ATTUALE," . C_PHP_VERSION_NUM . ");\ndefine(C_DIFF_ORE,0);\n?>"); fclose($fileaperto); include "./includes/funzioni_relutenti.php"; aggiorna_relutenti("", "SI", "", "", $id_utente, $id_utente, "", "", "", "", "", "", "", "nazione", "nazioni", $tablenazioni, $tablerelutenti); aggiorna_relutenti("", "SI", "", "", $id_utente, $id_utente, "", "", "", "", "", "", "", "regione", "regioni", $tableregioni, $tablerelutenti, "nazione", "nazioni", $tablenazioni); if (C_CREADB_CITTA_DEFAULT == "SI") { aggiorna_relutenti("", "SI", "", "", $id_utente, $id_utente, "", "", "", "", "", "", "", "citta", "citta", $tablecitta, $tablerelutenti, "regione", "regioni", $tableregioni); } aggiorna_relutenti("", "SI", "", "", $id_utente, $id_utente, "", "", "", "", "", "", "", "documentoid", "documentiid", $tabledocumentiid, $tablerelutenti); aggiorna_relutenti("", "SI", "", "", $id_utente, $id_utente, "", "", "", "", "", "", "", "parentela", "parentele", $tableparentele, $tablerelutenti); if (C_NASCONDI_MARCA == "SI" and @is_file(C_CARTELLA_CREA_MODELLI . "/index.html")) { @unlink(C_CARTELLA_CREA_MODELLI . "/index.html"); } if (C_UTILIZZA_SEMPRE_DEFAULTS != "AUTO") { # seconda form di inserimento (appartamenti). echo "<br>" . mex2("Inserisci ora i data sugli appartamenti", 'unit.php', $lingua) . " (<b>" . mex2("almeno il numero, diverso per ogni appartamento", 'unit.php', $lingua) . "</b>).<br>\n<form accept-charset=\"utf-8\" method=\"post\" action=\"createdb.php\"><div>\n<input type=\"hidden\" name=\"numappartamenti\" value=\"{$numappartamenti}\">\n<input type=\"hidden\" name=\"numletti\" value=\"{$numletti}\">\n<hr style=\"width: 95%\">"; $zeri = (string) "0000000000000000000000000000"; $lettere = (string) "abcdefghijklmnopqrstuvwxyz"; $pos_lettera = 0; $num_dorm = $numappartamenti; if (!$numletti) { $num_app_max = $numappartamenti; } else { $num_app_max = $numappartamenti + ceil((double) $numletti / 26); }
function aggiorna_pers_relutenti ($rel_sing,$rel_plur,$tablerel,$frase_canc,$rel_sup_sing="",$rel_sup_plur="",$tablerel_sup="",$rel_inf_sing="",$rel_inf_plur="",$tablerel_inf="") { $aggiungi_rel = "aggiungi_".$rel_sing; $rel_predefinite = $rel_plur."_predefinite"; $elimina_tutte_rel = "elimina_tutte_".$rel_plur; $importa_rel = "importa_".$rel_plur; $elimina_rel = "elimina_".$rel_sing; $nuova_rel = "nuova_".$rel_sing; $sup_n_rel = "sup_n_".$rel_sing; $cod_n_rel = "cod_n_".$rel_sing; $cod2_n_rel = "cod2_n_".$rel_sing; $cod3_n_rel = "cod3_n_".$rel_sing; $utente_importa_rel = "utente_importa_".$rel_plur; $rel_da_eliminare = $rel_sing."_da_eliminare"; global $$aggiungi_rel,$$rel_predefinite,$$elimina_tutte_rel,$$importa_rel,$$elimina_rel,$$nuova_rel,$$sup_n_rel,$$cod_n_rel,$$cod2_n_rel,$$cod3_n_rel,$$utente_importa_rel,$$rel_da_eliminare,$id_utente,$id_utente_mod,$pag,$anchor,$tablerelutenti; if ($$aggiungi_rel or $$rel_predefinite or $$elimina_tutte_rel or $$importa_rel or $$elimina_rel) { $anchor = "pers_rel"; aggiorna_relutenti($$aggiungi_rel,$$rel_predefinite,$$elimina_tutte_rel,$$importa_rel,$id_utente,$id_utente_mod,$$nuova_rel,$$sup_n_rel,$$cod_n_rel,$$cod2_n_rel,$$cod3_n_rel,$$utente_importa_rel,$pag,$rel_sing,$rel_plur,$tablerel,$tablerelutenti,$rel_sup_sing,$rel_sup_plur,$tablerel_sup,$rel_inf_sing,$rel_inf_plur,$tablerel_inf); if ($$elimina_rel) { if (get_magic_quotes_gpc()) $$rel_da_eliminare = stripslashes($$rel_da_eliminare); $$rel_da_eliminare = aggslashdb(htmlspecialchars($$rel_da_eliminare)); if (str_replace(" ","",$$rel_da_eliminare)) { if ($tablerel_inf) $tabelle_lock = array($tablerel,$tablerel_inf,$tablerelutenti); else $tabelle_lock = array($tablerel,$tablerelutenti); $tabelle_lock = lock_tabelle($tabelle_lock); $num_rel = esegui_query("select * from $tablerel where nome_$rel_sing = '".$$rel_da_eliminare."' "); if (numlin_query($num_rel)) { $num_rel = risul_query($num_rel,0,"id$rel_plur"); cancella_relutente($num_rel,$id_utente_mod,$rel_sing,$rel_plur,$tablerel,$tablerelutenti,$rel_inf_sing,$rel_inf_plur,$tablerel_inf); echo mex($frase_canc,$pag).".<br>"; } # fine if (numlin_query($num_rel)) unlock_tabelle($tabelle_lock); } # fine if (str_replace(" ","",$$rel_da_eliminare)) } # fine if ($$elimina_rel) } # fine if ($$aggiungi_rel or $$rel_predefinite or... } # fine function aggiorna_pers_relutenti