Exemplo n.º 1
0
<?php

if ($_POST["azione"] == "Chiudi") {
    $active_form = "clp.iter.php?comm_paesaggio=1&pratica={$idpratica}";
} elseif ($_POST["azione"] == "Elimina") {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database " . DB_NAME);
    }
    $sql = "SELECT stampe from ce.iter where id=" . $_POST["idriga"];
    $db->sql_query($sql);
    $id_stampa = $db->sql_fetchfield("stampe");
    $sql = "DELETE FROM stp.stampe WHERE id={$id_stampa};";
    $db->sql_query($sql);
    include_once "./db/db.savedata.php";
} else {
    include_once "./db/db.savedata.php";
    $sql = "UPDATE ce.iter SET nota=nota_edit WHERE id={$lastid};";
    $db->sql_query($sql);
}
Exemplo n.º 2
0
$sql = "SELECT id,nome,descrizione FROM stp.css order by ordine";
$db->sql_query($sql);
$css_nome = $db->sql_fetchlist('nome');
$css_desc = $db->sql_fetchlist('descrizione');
$css_id = $db->sql_fetchlist('id');
for ($i = 0; $i < count($css_desc); $i++) {
    $css_desc[$i] = addslashes(trim($css_desc[$i]));
}
/*GESTIONE DEL FILE*/
if ($_REQUEST["file"]) {
    $file = $_REQUEST["file"];
    $tipo = $_REQUEST["tipo"];
} elseif ($_REQUEST["id_doc"]) {
    $sql = "SELECT file_doc FROM stp.stampe WHERE id=" . $_REQUEST['id_doc'];
    $db->sql_query($sql);
    $file = $db->sql_fetchfield('file_doc');
    $tipo = "documenti";
    $id_doc = $_REQUEST["id_doc"];
    $id = $_REQUEST["id"];
} elseif ($_REQUEST["id_modelli"]) {
    $id_modelli = $_REQUEST["id_modelli"];
    $sql = "SELECT e_modelli.nome,form,testohtml,css_id,definizione,css.descrizione as css_desc FROM stp.e_modelli LEFT JOIN stp.css on (css_id=css.id) WHERE e_modelli.id={$id_modelli}";
    $db->sql_query($sql);
    $file = $db->sql_fetchfield('nome');
    $form = $db->sql_fetchfield('form');
    $testo = $db->sql_fetchfield('testohtml');
    $css_modello = $db->sql_fetchfield('css_id');
    $definizione = $db->sql_fetchfield('definizione');
    $mess_css = $db->sql_fetchfield('css_desc');
    $tipo = "modelli";
} elseif ($_REQUEST["mode"] == "new") {
Exemplo n.º 3
0
include_once "../login.php";
error_reporting(E_ERROR);
//if(!$dbconn->connection_id){
$dbconn = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$dbconn->db_connect_id) {
    die("Impossibile connettersi al database");
}
//}
if ($_REQUEST['id_doc']) {
    $idDoc = $_REQUEST['id_doc'];
    $testo = $_REQUEST['testo'];
    $testo = html_entity_decode($testo);
    $sql = "SELECT file_doc,definizione,css.nome,print_type,stampe.form,stampe.pratica,c.testo as footer,d.testo as header,d.margin as mtop,c.margin as mbottom FROM stp.stampe left join stp.e_modelli on(stampe.modello=e_modelli.id) left join stp.css on(css_id=css.id) left join stp.e_intestazioni c on(footer=c.id) left join stp.e_intestazioni d on(header=d.id) WHERE stampe.id={$idDoc};";
    $dbconn->sql_query($sql);
    $pratica = $dbconn->sql_fetchfield('pratica');
    $file = $dbconn->sql_fetchfield('file_doc');
    $definizione = $dbconn->sql_fetchfield('definizione');
    $css_name = $dbconn->sql_fetchfield('nome');
    $form = $dbconn->sql_fetchfield('form');
    $footer = $dbconn->sql_fetchfield("footer");
    $header = $dbconn->sql_fetchfield("header");
    $mbottom = $dbconn->sql_fetchfield("mbottom");
    $mtop = $dbconn->sql_fetchfield("mtop");
    $is_cdu = $form == 'cdu.vincoli' ? 1 : 0;
    $infoFile = pathinfo($file);
    $nome = $infoFile["filename"];
    $ext = $infoFile["extension"];
    //print mb_detect_encoding($testo,"UTF-8, ISO-8859-1,ISO-8859-15");
    $testo = utf8_encode($testo);
    $pr = new pratica($pratica, $is_cdu);
<?php

include "login.php";
include "./src/fckeditor/fckeditor.php";
/*GESTIONE DEL FILE*/
if ($_REQUEST["id_doc"]) {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    $sql = "SELECT file_doc,definizione,css.nome,print_type FROM stp.stampe left join stp.e_modelli on(stampe.modello=e_modelli.id) left join stp.css on(css_id=css.id) WHERE stampe.id=" . $_REQUEST['id_doc'];
    $db->sql_query($sql);
    $file = $db->sql_fetchfield('file_doc');
    $definizione = $db->sql_fetchfield('definizione');
    $css_name = $db->sql_fetchfield('nome');
    $modal = $db->sql_fetchfield('print_type');
    $tipo = "documenti";
    $id_doc = $_REQUEST["id_doc"];
    $id = $_REQUEST["id"];
}
if ($_REQUEST["form"]) {
    $form = $_REQUEST["form"];
}
$dir = STAMPE;
$action = "window.opener.focus();window.close();";
$f = LIB . 'HTML_ToPDF.conf';
$handle = fopen($f, "r");
$conf = fread($handle, filesize($f));
fclose($handle);
if ($_POST["azione"] and $_POST["azione"] !== "Annulla") {
    $testo = stripslashes(htmlentities($_POST["testo"]));
<?php

//if(!defined("comune")) return;
require_once "login.php";
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
$oggi = date("d-m-Y");
$dataoneri = date("d/m/Y");
$pratica = $_REQUEST['pratica'];
$sql = "SELECT numero,coalesce(data_prot,data_presentazione) as data from pe.avvioproc where pratica={$pratica}";
$db->sql_query($sql);
$numero = $db->sql_fetchfield('numero');
//$dataoneri=$db->sql_fetchfield('data');
$query = "SELECT * FROM oneri.parametri where '{$dataoneri}'::date BETWEEN datein AND coalesce(dateed,CURRENT_DATE);";
$result = $db->sql_query($query);
//if(!$result){echo "SQL Error - ".mysql_error()."<br>".$query;return;}
$row = $db->sql_fetchrow($result);
$costo_base = $row['costo_base'];
$qbase = $row['quota_base'];
$classe = $row['classe_comune'];
$quota = $row['corrispettivo'];
$delibera = $row['delibera'];
$sql = "SELECT case when (not coalesce(piva,'')='') then coalesce(ragsoc,'') else coalesce(cognome,'')||' '||coalesce(nome,'') end as nominativo FROM pe.soggetti WHERE richiedente=1 and pratica={$pratica};";
$db->sql_query($sql);
$ris = $db->sql_fetchlist('nominativo');
$nominativi = implode('; ', $ris);
$sql = "SELECT coalesce(via,'')||' '||coalesce(civico,'') as indirizzi FROM pe.indirizzi WHERE pratica={$pratica};";
$db->sql_query($sql);
$ris = $db->sql_fetchlist('indirizzi');
Exemplo n.º 6
0
            $sql = "insert into cdu.mappali (pratica,sezione,foglio,mappale) values ({$idpratica},{$sezione},{$foglio},{$mappale})";
            $result = $db->sql_query($sql);
        }
    }
}
if ($azione == "Elimina") {
    if ($_POST["active_form"] == "cdu.richiesta.php") {
        $id = $_POST["id"];
        $sql = "delete from cdu.mappali where id in(select q.id from cdu.mappali as p,cdu.mappali as q where p.foglio=q.foglio and p.mappale=q.mappale and p.id={$id});";
        $db->sql_query($sql);
    } else {
        if ($_POST["active_form"] == "cdu.vincoli.php") {
            $id = $_POST["idriga"];
            $sql_count = "SELECT coalesce(count(*),0) as quantita FROM cdu.mappali where pratica={$idpratica} and foglio='{$foglio}' and mappale='{$mappale}'";
            $db->sql_query($sql_count);
            $quantita = $db->sql_fetchfield('quantita');
            if ($quantita > 1) {
                $sql = "delete from cdu.mappali where id={$id}";
                print_debug($sql);
                $db->sql_query($sql);
            } else {
                if (NEW_VINCOLI == 1) {
                    $sql = "update cdu.mappali set sezione=NULL,vincolo=NULL,zona=NULL,tavola=NULL,perc_area='0' where id={$id}";
                } else {
                    $sql = "update cdu.mappali set sezione=NULL,vincolo=NULL,zona=NULL,perc_area='0' where id={$id}";
                }
                print_debug($sql);
                $db->sql_query($sql);
            }
        }
    }
Exemplo n.º 7
0
            $is_save_ok = 0;
            //echo $sql;
        }
        if ($debug) {
            echo "{$sql}<br>";
        }
    }
} elseif ($modo == "delete") {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    foreach ($_POST as $key => $val) {
        if ($val == "id" and $key != $_SESSION["USER_ID"]) {
            $sql = "SELECT permessi FROM admin.users WHERE userid={$key};";
            $db->sql_query($sql);
            $livello_utente = $db->sql_fetchfield("permessi");
            if ($livello_utente >= $_SESSION["PERMESSI"]) {
                $cond .= " userid={$key} OR";
            }
        }
    }
    if ($cond) {
        $cond = substr($cond, 0, strlen($cond) - 3);
        $sql = "DELETE FROM admin.users WHERE {$cond};";
        $db->sql_query($sql);
        if ($debug) {
            echo "{$sql}<br>";
        }
    }
}
$active_form = "ce.esiti_commissione.php";
$tabpath = "ce";
$file_config = "{$tabpath}/esiti_commissione";
$modo = isset($_REQUEST["mode"]) ? $_REQUEST["mode"] : 'view';
$idcomm = $_REQUEST["pratica"];
//print_r($_REQUEST);
$tornaacasa = "\n\t<script language=javascript>\n\t\tparent.location='index.php';\n\t</script>";
if ($modo == "edit" || $modo == "view") {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    $sql = "SELECT numero FROM pe.pareri left join pe.avvioproc on pareri.pratica=avvioproc.pratica WHERE pareri.id=" . $_REQUEST["id_parere"];
    $db->sql_query($sql);
    print_debug($sql);
    $num = $db->sql_fetchfield("numero");
}
?>


<html>
<head>
<title>Pareri della commissione - <?php 
echo $titolo;
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<SCRIPT language="javascript" src="js/LoadLibs.js" type="text/javascript"></SCRIPT>
<SCRIPT>
	function link(id,prat){
require_once "login.php";
//print_r($_POST);
include "./lib/tabella_h.class.php";
$tabpath = "stp";
$tipo = $_REQUEST["tipo"];
$mod = $tipo == 'html' ? 'nuovo' : '';
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
if ($_POST["azione"]) {
    $idrow = $_POST["idriga"];
    $sql = "SELECT * FROM stp.e_modelli WHERE id={$idrow}";
    $db->sql_query($sql);
    $nome = $db->sql_fetchfield("nome");
    $file = MODELLI_DIR . $nome;
    @unlink($file);
    $sql = "delete from stp.e_modelli where id={$idrow}";
    $db->sql_query($sql);
}
?>
<html>
<head>
<title>ELENCO MODELLI DI STAMPA</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<SCRIPT language="javascript" src="js/LoadLibs.js" type="text/javascript"></SCRIPT>
<script language="javascript">
<?php 
if ($tipo == "html") {
<?php

$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
if ($_POST["idpratica"]) {
    $pratiche = $_POST["idpratica"];
    $idcomm = $_POST["pratica"];
    //$numero=$_POST["numero"];
    $uid = $_SESSION['USER_ID'];
    $sql = "SELECT tipo_comm,data_convocazione FROM ce.commissione WHERE id={$idcomm};";
    $db->sql_query($sql);
    print_debug($sql);
    $tipo_comm = $db->sql_fetchfield("tipo_comm");
    $data = $db->sql_fetchfield("data_convocazione");
    for ($i = 0; $i < count($pratiche); $i++) {
        $tmsins = time();
        $sql = "INSERT INTO pe.pareri(pratica,ente,data_rich,data_ril,uidins,tmsins) VALUES(" . $pratiche[$i] . ",{$tipo_comm},'{$data}'::date,'{$data}'::date,{$uid},{$tmsins})";
        $db->sql_query($sql);
        print_debug($sql);
    }
}
$active_form = "ce.ordinegiorno_paesaggio.php?comm_paesaggio=1&pratica={$idpratica}";
Exemplo n.º 11
0
 function change_menu($idpratica, $oldtipo, $newtipo)
 {
     if (!$idpratica) {
         return;
     }
     $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
     if (!$db->db_connect_id) {
         die("Impossibile connettersi al dadabase");
     }
     $sql = "select menu_list from pe.menu where pratica={$idpratica};";
     $result = $db->sql_query($sql);
     $oldmenu = $db->sql_fetchfield("menu_list");
     $pos = strpos($oldmenu, "#");
     if ($pos) {
         //ho aggiunto dei menu al menu originale
         $oldmenu = substr($oldmenu, $pos);
     } else {
         $oldmenu = "";
     }
     $db->sql_query("update pe.menu set menu_list=e_tipopratica.menu_default || '{$oldmenu}' from pe.e_tipopratica where e_tipopratica.id={$newtipo} and pratica={$idpratica};");
     unset($_SESSION["MENU_" . $this->tipo . "_{$idpratica}"]);
     //$db->sql_close();
 }
Exemplo n.º 12
0
<?php

include_once "login.php";
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
$documento = $_REQUEST["documento"];
$tipo = $_REQUEST["tipo"];
if ($tipo == 'doc') {
    header("Content-Type: application/vnd.ms-word; Charset=UTF-8");
    header("Content-Disposition: inline; filename=file.doc");
}
$sql = "SELECT testohtml,file_doc,modello FROM stp.stampe WHERE id='{$documento}';";
if ($db->sql_query($sql)) {
    $nome = $db->sql_fetchfield('file_doc');
    $testo = $db->sql_fetchfield('testohtml');
    $modello = $db->sql_fetchfield('modello');
} else {
    echo "{$sql}";
}
$sql = "SELECT definizione,script FROM stp.e_modelli,stp.css WHERE e_modelli.id='{$modello}' and e_modelli.css_id=css.id;";
if ($db->sql_query($sql)) {
    $css_def = $db->sql_fetchfield('definizione');
    $css_script = $db->sql_fetchfield('script');
} else {
    echo "{$sql}";
}
?>

<html>
Exemplo n.º 13
0
    die("Impossibile connettersi al database");
}
/*Ricerca dei valori*/
$sql = "SELECT pratica,numero,data_presentazione FROM pe.avvioproc {$cond} order by data_presentazione,numero;";
//echo "<p>$sql</p>";
$db->sql_query($sql);
$risultato = $db->sql_fetchrowset();
//include "./lib/stati.class.php";
for ($i = 0; $i < count($risultato); $i++) {
    $pratica = $risultato[$i]["pratica"];
    //$st=new Stati($pratica);
    //$st->get_stato();
    //$stato=$st->stato["descrizione"];
    $sql_ins = "SELECT tmsins FROM pe.avvioproc WHERE pratica={$pratica};";
    $db->sql_query($sql_ins);
    $tms = $db->sql_fetchfield("tmsins");
    if ($tms) {
        $data_ins[] = date("d/m/y", $tms);
    } else {
        $data_ins[] = "non disponibile";
    }
    /*Ricerca Destinazione d'uso*/
    $sql_dest_uso = "SELECT destuso1,destuso2 FROM pe.progetto WHERE pratica={$pratica};";
    $db->sql_query($sql_dest_uso);
    $ris_destuso[] = $db->sql_fetchrowset();
    /*Ricerca info Richiedenti*/
    $sql_rich = "SELECT app||' '||nominativo as nome FROM stp.richiedenti WHERE pratica={$pratica};";
    //echo "$sql_rich<br>";
    $db->sql_query($sql_rich);
    $ris_rich[] = $db->sql_fetchrowset();
    //print_r($ris_rich);
Exemplo n.º 14
0
//ELENCO DEI TIPI DI TAG
$regexp_cicli = '|<span class="cicli">(.*)IN_CICLO(.*)</span>(.+)<span class="cicli">FI_CICLO</span>|Umi';
$regexp_if = '|<span class="se">INIZIO_SE</span>(.+)<span class="se">FINE_SE</span>|Umi';
$regexp_tag = '|<span class="valore">(.+)</span>|Umi';
$regexp_tag_obbl = '|<span class="obbligatori">(.+)</span>|Umi';
if ($_POST["azione"] == "Salva") {
    if (!$testo) {
        $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
        if (!$db->db_connect_id) {
            die("Impossibile connettersi al database");
        }
        $sql = "SELECT CASE WHEN coalesce(testohtml,'')='' THEN 0 ELSE 1 END as presente FROM stp.e_modelli WHERE nome='{$nomemodello}'";
        if (!$db->sql_query($sql)) {
            print_debug($sql, null, "modelli");
        }
        $presente = $db->sql_fetchfield('presente');
        if ($presente) {
            $testo = html_entity_decode($testo);
            //str_replace(chr(10),"",$testo);
            $testo = str_replace(chr(13), "", $testo);
            $testo = str_replace('/"', '"', $testo);
            $exist = 1;
            //$testo=$testo;
        } else {
            include "./lib/modelli.class.php";
            $model = new print_model($testo);
            $model->check();
            $model->save(0, $nomemodello, $form, $css_modello);
            //$testo='<head><LINK media="screen" href="./src/modelli.css" type="text/css" rel="stylesheet"></head>'.	$model->model."";
            $testo = $model->model;
        }
Exemplo n.º 15
0
    if ($modo == "new") {
        if (defined('GC_PROJECT')) {
            if ($_SESSION["PERMESSI"] > 1 && $role == 1) {
                $errors["role"] = "Non si dispone dei diritti per assegnare questo ruolo all'utente";
            } else {
                include "./db/db.gisclientuser.php";
                $sql = "INSERT INTO admin.users(userid,app,cognome,nominativo,username,pwd,enc_pwd,permessi,attivato,num_tel,info,gruppi,data_creazione,gisclient) VALUES({$newUserId},'{$app}','{$cognome}','{$nominativo}','{$username}','{$pwd}','{$enc_pwd}',{$livello_utente},{$attivato},'{$tel}','{$info}','{$gruppi}',now(),{$gc});";
                $db->sql_query($sql);
                $id = $newUserId;
            }
        } else {
            $sql = "INSERT INTO admin.users(app,cognome,nominativo,username,pwd,enc_pwd,permessi,attivato,num_tel,info,gruppi,data_creazione,gisclient) VALUES('{$app}','{$cognome}','{$nominativo}','{$username}','{$pwd}','{$enc_pwd}',{$livello_utente},{$attivato},'{$tel}','{$info}','{$gruppi}',now(),{$gc});";
            if (!$errors) {
                $db->sql_query($sql);
                $db->sql_query("SELECT max(userid) as lastvalue FROM admin.users");
                $id = $db->sql_fetchfield("lastvalue");
            }
        }
    } else {
        $sql = "UPDATE admin.users SET app='{$app}',nominativo='{$nominativo}',cognome='{$cognome}',username='******',pwd='{$pwd}',enc_pwd='{$enc_pwd}',gruppi='{$gruppi}',permessi='{$livello_utente}',attivato='{$attivato}',num_tel='{$tel}',info='{$info}',data_modifica=now(),gisclient={$gc} WHERE userid={$id}";
        if (!$errors) {
            $db->sql_query($sql);
        }
    }
    if (!$errors) {
        $modo = "view";
    }
} elseif ($azione == "Elimina") {
    if ($livello_utente < $_SESSION["PERMESSI"]) {
        $errors["permessi"] = "Non si dispone dei permessi necessari";
    }
Exemplo n.º 16
0
     $db->sql_close();
     $Errors = $array_dati["errors"];
     //print_array($Errors);
     include $active_form;
     exit;
 }
 $Dati = valida_campi($array_dati["data"]);
 //I dati sono stati validati costruisco le query di inserimento/aggiornamento
 if ($_POST["mode"] == "edit") {
     //controllo che un altro utente non abbia modificato il record
     //DA SOSTITUIRE CON UN TRIGGER???????
     if (!$tb->table_list) {
         $chkret = 0;
         $sql = "select coalesce(chk,0) as chk from {$tabelladb} where id={$idrow};";
         $db->sql_query($sql);
         $chkret = $db->sql_fetchfield("chk");
         if (!($chkret == $_POST["chk"])) {
             $Errors["Multiutenza"] = "Un altro utente ha salvato il record, oppure è gia stato salvato.....aggiornare  il form";
             echo "<p style=\"color:red\">Un altro utente ha salvato il record, oppure è gia stato salvato.....aggiornare  il form</p>";
             $db->sql_close();
             include $active_form;
             exit;
         }
         $Dati["chk"] = ++$chkret;
         $Dati["uidupd"] = $_SESSION["USER_ID"];
         $Dati["tmsupd"] = time();
     }
     foreach ($Dati as $campo => $valore) {
         if (strlen($valore) > 0) {
             $sqlupdate .= "{$campo}={$valore},";
         }
Exemplo n.º 17
0
<?php

if ($_POST["azione"] == "Chiudi" || $_POST["azione"] == "Annulla") {
    $active_form = "cdu.iter.php?cdu=1&pratica={$idpratica}";
} elseif ($_POST["azione"] == "Elimina") {
    $pr = new pratica($idpratica, 1);
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database " . DB_NAME);
    }
    $sql = "SELECT stampe from cdu.iter where id=" . $_POST["idriga"];
    $db->sql_query($sql);
    $id_stampa = $db->sql_fetchfield("stampe");
    $sql = "SELECT file_doc,file_pdf FROM stp.stampe WHERE id={$id_stampa};";
    $db->sql_query($sql);
    $nome_doc = $db->sql_fetchfield("file_doc");
    $nome_pdf = $db->sql_fetchfield("file_pdf");
    $sql = "DELETE FROM stp.stampe WHERE id={$id_stampa};";
    if ($id_stampa) {
        $sql = "SELECT file_doc,file_pdf FROM stp.stampe WHERE id={$id_stampa};";
        //echo "<p>$sql</p>";
        $db->sql_query($sql);
        $row = $db->sql_fetchrow();
        $file_doc = basename($row[0]) . ".doc";
        $file_pdf = $row[1];
        //extract($row);
        //echo "<p>Unlinking ".$pr->documenti.$file_doc."</p>";
        if ($file_doc) {
            @unlink($pr->documenti . $file_doc);
        }
        if ($file_pdf) {
Exemplo n.º 18
0
<?php

if ($_POST["numero"]) {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    $sql = "select id from pe.avvioproc where numero='" . $_POST["numero"] . "';";
    $db->sql_query($sql);
    $pratica = $db->sql_fetchfield("id");
    if ($pratica) {
        $sql = "\n\t\tDELETE FROM oneri.calcolati WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.fidi WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.monetizzazione WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.rate WHERE PRATICA={$pratica};\n\t\tDELETE FROM oneri.totali WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.abitabi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.allegati WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.asservimenti WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.asservimenti_map WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.avvioproc WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.cterreni WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.curbano WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.file_allegati WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.indirizzi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.infodia WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.integrazioni WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.iter WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.lavori WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.menu WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.parametri_prog WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.pareri WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.progetto WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.proroga WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.soggetti WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.sopralluoghi WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.titolo WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.vincoli WHERE PRATICA={$pratica};\n\t\tDELETE FROM pe.volture WHERE PRATICA={$pratica};\n\t\t";
        $result = $db->sql_query($sql);
        if ($result) {
            echo "pratica eliminata con successo";
        }
    }
}
Exemplo n.º 19
0
<?php

include "login.php";
require_once "html_pdf.class.php";
$id = $_REQUEST["id_doc"];
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
$sql = "SELECT testohtml FROM stp.stampe WHERE id={$id}";
$db->sql_query($sql);
$testo = $db->sql_fetchfield("testohtml");
$stp = new stampe_pdf($testo);
$stp->crea_pdf();
print_debug($stp, null, "pdf");
$stp->open_pdf();
Exemplo n.º 20
0
<?php

$sk = "geoweb";
$db1 = new sql_db(DB_HOST, DB_USER, DB_PWD, 'gisclient', false);
if (!$db1->db_connect_id) {
    die("Impossibile connettersi al database");
}
//ACQUISISCO ID DEL PROGETTO
$sql = "SELECT project_id FROM {$sk}.project WHERE project_name='" . GC_PROJECT . "';";
if (!$db1->sql_query($sql)) {
    print_array($db1->error_message);
}
$projectId = $db1->sql_fetchfield('project_id');
if ($role == 2) {
    //VERIFICO SE ESISTE L0 USERGROUP praticaweb
    $sql = "SELECT usergroup_id FROM {$sk}.usergroup WHERE project_id={$projectId} and usergroup='" . GC_ROLE . "'";
    if (!$db1->sql_query($sql)) {
        print_array($db1->error_message);
    }
    $usergroupId = $db1->sql_fetchfield('usergroup_id');
    if (!$usergroupId) {
        $sql = "select {$sk}.new_pkey('usergroup','usergroup_id') as newid;";
        if (!$db1->sql_query($sql)) {
            print_array($db1->error_message);
        }
        $newId = $db1->sql_fetchfield('newid');
        $sql = "INSERT INTO {$sk}.usergroup(usergroup_id,project_id,usergroup,description) VALUES({$newId},{$projectId},'praticaweb','Utenti delle Pratiche Edilizie')";
        if (!$db1->sql_query($sql)) {
            print_array($db1->error_message);
        }
        $usergroupId = $newId;
Exemplo n.º 21
0
<?php

//GESTIONE salvataggio form allegati
//print_r($_POST);
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
$vincolo = $_POST["vincolo"];
$zona = $_POST["zona"];
$tavola = $_POST["tavola"];
if (NEW_VINCOLI == 1) {
    $sql_zona = "select * from vincoli.zona where descrizione='{$zona}' and nome_vincolo='{$vincolo}' and nome_tavola='{$tavola}'";
    print_debug($sql_zona);
    $db->sql_query($sql_zona);
    $zona = $db->sql_fetchfield("nome_zona");
    if ($_POST["azione"] != "Chiudi") {
        $sql = "insert into pe.vincoli (pratica,vincolo,zona,tavola,uidins,tmsins) values ({$idpratica},'{$vincolo}','{$zona}','{$tavola}'," . $_SESSION["USER_ID"] . "," . time() . ");";
        $db->sql_query($sql);
    }
} else {
    /*	 print_array($_POST);	
    	foreach ($_POST as $key=>$value){
    		if ($value=="id"){
    			$sql="delete from pe.vincoli where id=$key;";
    		}
    		elseif($value=="mapkey"){
    			$insert=1;
    			if (!$_SESSION["ADD_NEW"]){//inserisco solo se non ho già inserito il dato
    				$dato=explode("@",$key);
    				$zona=trim($dato[0]);