Example #1
0
 function &getServiceInstance($name, $servicedir = NULL)
 {
     global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype;
     static $instances = array();
     static $db;
     if (!isset($db)) {
         require_once dirname(__FILE__) . '/../includes/db/' . $dbtype . '.php';
         $db = new sql_db();
         $db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist);
         if (!$db->db_connect_id) {
             message_die(CRITICAL_ERROR, "Could not connect to the database", $db);
         }
     }
     if (!isset($instances[$name])) {
         if (isset($serviceoverrules[$name])) {
             $name = $serviceoverrules[$name];
         }
         if (!class_exists($name)) {
             if (!isset($servicedir)) {
                 $servicedir = dirname(__FILE__) . '/';
             }
             require_once $servicedir . strtolower($name) . '.php';
         }
         $instances[$name] = call_user_func(array($name, 'getInstance'), $db);
     }
     return $instances[$name];
 }
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = './../';
include $phpbb_root_path . 'config.' . $phpEx;
require $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx;
require $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
include $phpbb_root_path . 'includes/functions.' . $phpEx;
define('ACL_NEVER', 0);
define('ACL_YES', 1);
define('ACL_NO', -1);
define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups');
define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options');
define('ACL_USERS_TABLE', $table_prefix . 'acl_users');
define('GROUPS_TABLE', $table_prefix . 'groups');
define('USERS_TABLE', $table_prefix . 'users');
$cache = new acm();
$db = new sql_db();
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
// auth => is_local, is_global
$f_permissions = array('f_' => array(1, 0), 'f_list' => array(1, 0), 'f_read' => array(1, 0), 'f_post' => array(1, 0), 'f_reply' => array(1, 0), 'f_edit' => array(1, 0), 'f_user_lock' => array(1, 0), 'f_delete' => array(1, 0), 'f_bump' => array(1, 0), 'f_poll' => array(1, 0), 'f_vote' => array(1, 0), 'f_votechg' => array(1, 0), 'f_announce' => array(1, 0), 'f_sticky' => array(1, 0), 'f_attach' => array(1, 0), 'f_download' => array(1, 0), 'f_icons' => array(1, 0), 'f_bbcode' => array(1, 0), 'f_smilies' => array(1, 0), 'f_img' => array(1, 0), 'f_flash' => array(1, 0), 'f_sigs' => array(1, 0), 'f_search' => array(1, 0), 'f_email' => array(1, 0), 'f_print' => array(1, 0), 'f_ignoreflood' => array(1, 0), 'f_postcount' => array(1, 0), 'f_noapprove' => array(1, 0), 'f_report' => array(1, 0), 'f_subscribe' => array(1, 0));
$m_permissions = array('m_' => array(1, 1), 'm_edit' => array(1, 1), 'm_delete' => array(1, 1), 'm_move' => array(1, 1), 'm_lock' => array(1, 1), 'm_split' => array(1, 1), 'm_merge' => array(1, 1), 'm_approve' => array(1, 1), 'm_unrate' => array(1, 1), 'm_auth' => array(1, 1), 'm_ip' => array(1, 1), 'm_info' => array(1, 1));
$a_permissions = array('a_' => array(0, 1), 'a_server' => array(0, 1), 'a_board' => array(0, 1), 'a_clearlogs' => array(0, 1), 'a_words' => array(0, 1), 'a_icons' => array(0, 1), 'a_bbcode' => array(0, 1), 'a_attach' => array(0, 1), 'a_email' => array(0, 1), 'a_styles' => array(0, 1), 'a_user' => array(0, 1), 'a_useradd' => array(0, 1), 'a_userdel' => array(0, 1), 'a_ranks' => array(0, 1), 'a_ban' => array(0, 1), 'a_names' => array(0, 1), 'a_group' => array(0, 1), 'a_groupadd' => array(0, 1), 'a_groupdel' => array(0, 1), 'a_forum' => array(0, 1), 'a_forumadd' => array(0, 1), 'a_forumdel' => array(0, 1), 'a_prune' => array(0, 1), 'a_auth' => array(0, 1), 'a_authmods' => array(0, 1), 'a_authadmins' => array(0, 1), 'a_authusers' => array(0, 1), 'a_authgroups' => array(0, 1), 'a_authdeps' => array(0, 1), 'a_backup' => array(0, 1), 'a_restore' => array(0, 1), 'a_search' => array(0, 1), 'a_events' => array(0, 1), 'a_cron' => array(0, 1));
$u_permissions = array('u_' => array(0, 1), 'u_sendemail' => array(0, 1), 'u_readpm' => array(0, 1), 'u_sendpm' => array(0, 1), 'u_sendim' => array(0, 1), 'u_hideonline' => array(0, 1), 'u_viewonline' => array(0, 1), 'u_viewprofile' => array(0, 1), 'u_chgavatar' => array(0, 1), 'u_chggrp' => array(0, 1), 'u_chgemail' => array(0, 1), 'u_chgname' => array(0, 1), 'u_chgpasswd' => array(0, 1), 'u_chgcensors' => array(0, 1), 'u_search' => array(0, 1), 'u_savedrafts' => array(0, 1), 'u_download' => array(0, 1), 'u_attach' => array(0, 1), 'u_sig' => array(0, 1), 'u_pm_attach' => array(0, 1), 'u_pm_bbcode' => array(0, 1), 'u_pm_smilies' => array(0, 1), 'u_pm_download' => array(0, 1), 'u_pm_edit' => array(0, 1), 'u_pm_printpm' => array(0, 1), 'u_pm_emailpm' => array(0, 1), 'u_pm_forward' => array(0, 1), 'u_pm_delete' => array(0, 1), 'u_pm_img' => array(0, 1), 'u_pm_flash' => array(0, 1));
echo "<p><b>Determining existing permissions</b></p>\n";
$sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE;
$result = $db->sql_query($sql);
$remove_auth_options = array();
while ($row = $db->sql_fetchrow($result)) {
    if (!in_array($row['auth_option'], array_keys(${substr($row['auth_option'], 0, 2) . 'permissions'}))) {
        $remove_auth_options[$row['auth_option']] = $row['auth_option_id'];
    }
Example #3
0
if (defined('NV_IS_FLOOD_BLOCKER') and NV_IS_FLOOD_BLOCKER == 1 and !$nv_Request->isset_request('admin', 'session') and (!$nv_Request->isset_request('second', 'get') or $nv_Request->isset_request('second', 'get') and $client_info['is_myreferer'] != 1)) {
    require_once NV_ROOTDIR . '/includes/core/flood_blocker.php';
}
//Xac dinh borwser cua client
$client_info['browser'] = $client_info['is_bot'] ? array('key' => "Unknown", 'name' => 'Unknown') : array_combine(array('key', 'name'), explode("|", nv_getBrowser(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/br.ini')));
//Xac dinh OS cua client
$client_info['client_os'] = $client_info['is_bot'] ? array('key' => "Robot", 'name' => $client_info['bot_info']['name']) : array_combine(array('key', 'name'), explode("|", nv_getOs(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/os.ini')));
//Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
    include_once NV_ROOTDIR . "/includes/core/captcha.php";
}
//Bat dau phien lam viec cua MySQL
require_once NV_ROOTDIR . '/includes/class/mysql.class.php';
$db_config['new_link'] = NV_MYSQL_NEW_LINK;
$db_config['persistency'] = NV_MYSQL_PERSISTENCY;
$db = new sql_db($db_config);
if (!empty($db->error)) {
    $die = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
    $die .= !empty($db->error['code']) ? ' (Code: ' . $db->error['code'] . ')' : '';
    trigger_error($die, 256);
}
unset($db_config['dbpass']);
//Ten cac table cua CSDL dung chung cho he thong
define('NV_AUTHORS_GLOBALTABLE', $db_config['prefix'] . '_authors');
define('NV_GROUPS_GLOBALTABLE', $db_config['prefix'] . '_groups');
define('NV_USERS_GLOBALTABLE', $db_config['prefix'] . '_users');
define('NV_SESSIONS_GLOBALTABLE', $db_config['prefix'] . '_sessions');
define('NV_LANGUAGE_GLOBALTABLE', $db_config['prefix'] . '_language');
define('NV_BANNERS_CLIENTS_GLOBALTABLE', $db_config['prefix'] . '_banners_clients');
define('NV_BANNERS_PLANS_GLOBALTABLE', $db_config['prefix'] . '_banners_plans');
define('NV_BANNERS_ROWS_GLOBALTABLE', $db_config['prefix'] . '_banners_rows');
Example #4
0
             $check_exts = 'mysql';
             $check_other = 'mysql';
             break;
         case 'postgres':
             $check_exts = 'pgsql';
             $check_other = 'pgsql';
             break;
     }
     if (!extension_loaded($check_exts) && !extension_loaded($check_other)) {
         page_header($lang['Install'], '');
         page_error($lang['Installer_Error'], $lang['Install_No_Ext']);
         page_footer();
         exit;
     }
     include $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
     $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
     if (!$db->db_connect_id) {
         message_die(CRITICAL_ERROR, "Could not connect to the database");
     }
 }
 $dbms_schema = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
 $dbms_basic = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql';
 $remove_remarks = $available_dbms[$dbms]['COMMENTS'];
 $delimiter = $available_dbms[$dbms]['DELIM'];
 $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC'];
 if ($install_step == 1) {
     if ($upgrade != 1) {
         if ($dbms != 'msaccess') {
             // Load in the sql parser
             include $phpbb_root_path . 'includes/sql_parse.' . $phpEx;
             // Ok we have the db info go ahead and read in the relevant schema
<?php

include_once "login.php";
//print_r($_REQUEST);
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
$object = $_POST["obj"];
$id = $_POST["id"];
$azione = $_POST["action"];
$sql = "select distinct zona.nome_tavola as id from vincoli.zona left join vincoli.tavola on(zona.nome_tavola=tavola.nome_tavola) where zona.nome_vincolo= '{$id}' and tavola.cdu=1;";
$db->sql_query($sql);
print_debug($sql);
$ris = $db->sql_fetchrowset();
for ($i = 0; $i < count($ris); $i++) {
    $out[] = "{id:'" . $ris[$i]["id"] . "',name:'" . $ris[$i]["id"] . "'}";
}
header("Content-Type: text/plain; Charset=UTF-8");
$debug = "{id:'{$object}',values:[" . implode(',', $out) . "]}";
print_debug($debug);
echo $debug;
Example #6
0
{
	define('IP_ROOT_PATH', dirname(dirname($argv[0])) . '/');
}

define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

@set_time_limit(0);
@ini_set('memory_limit', '32M');

require(IP_ROOT_PATH . 'config.' . PHP_EXT);
define('SQL_LAYER', 'mysql4');
require(IP_ROOT_PATH . 'includes/db/mysql.' . PHP_EXT);

$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if(!$db->db_connect_id)
{
	trigger_error('Database connection failed', E_USER_ERROR);
}

// HTML HEADER - BEGIN
echo("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
echo("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
echo("<head>\n");
echo("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n");
echo("<meta name=\"author\" content=\"Icy Phoenix Team\" />\n");
echo("<title>Icy Phoenix :: UTF-8 Conversion</title>\n");
echo("</head>\n");
echo("<body>\n");
echo("<div style=\"font-family: 'Lucida Grande', 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; font-size: 10px;\">\n");
<?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');
<?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";
        }
    }
}
<?php

//Gestione della rateizzazione calcolo delle rate
//DA RIVEDERE LE GESTIONE DEI DATI STATICI es titolo
//DA PERSONALIZZARE SULLE ESIGENZE DEL COMUNE
//echo "calcolo della rateizzazione";
//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");
}
$campo_cc = $_POST["scade_cc"];
$campo_oneri = $_POST["scade_oneri"];
$tipo = trim($_POST["tipo"]);
$data_rata1 = $_POST["data_rata1"];
if ($campo_cc and $campo_oneri) {
    $sql = "select titolo." . $campo_cc . " as scade_cc, titolo." . $campo_oneri . " as scade_oneri,monet,cc,(b1-scb1) as b1,(b2-scb2) as b2 from oneri.totali,pe.titolo where oneri.totali.pratica=pe.titolo.pratica and pe.titolo.pratica={$idpratica}";
    if (!$db->sql_query($sql)) {
        print_debug($sql);
    }
    //$db->sql_query($sql);
    //echo "<p>$sql</p>";
    //$db->sql_fetchrow();
}
$oneri = 1;
if ($oneri) {
    $sql = "select * from oneri.e_rata_calcolo where tipo='{$tipo}' order by rata";
    print_debug($sql);
    if (!$db->sql_query($sql)) {
        print_debug($sql);
    }
Example #10
0
    $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") {
    $tipo = "modelli";
}
if ($_REQUEST["form"]) {
    $form = $_REQUEST["form"];
}
if ($tipo == "modelli") {
    /*SELEZIONE DELLE VISTE DAL DATABASE*/
    $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 'Seleziona -->' as nome,'' as tipo,'Seleziona -->' as alias_nome,'' as descrizione,1 as ord) UNION (SELECT DISTINCT nome_vista as nome,tipo,alias_nome_vista,descrizione_vista,2 as ord FROM stp.colonne) order by ord,nome;";
    $db->sql_query($sql);
    $tables = $db->sql_fetchlist('nome');
    $types = $db->sql_fetchlist('tipo');
    $alias = $db->sql_fetchlist('alias_nome');
    for ($i = 0; $i < count($tables); $i++) {
        $value = $types[$i] . "." . $tables[$i];
        $tmp = explode("_", $tables[$i]);
        $str_name = ucwords($alias[$i]);
        $print_options .= "\t\t\t\t\t\t\t\t\t<option value=\"{$value}\">{$str_name}</option>\n";
    }
    $sql = "SELECT CASE (tipo) WHEN 'FUNCTION' THEN 'FN_'||nome_vista ELSE nome_vista end as nome,nome as \t\tcolonna,alias_nome as alias_colonna,descrizione,visibile,tipo FROM stp.colonne WHERE visibile=1 order by nome_vista,nome;";
<?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);
}
Example #12
0
?>
<html>
<head>
<title>Pratiche recenti</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>
</head>
<body link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php 
include "./inc/inc.page_header.php";
?>
<H2 class=blueBanner>Ultime pratiche aperte</H2>
<?php 
$userid = $_SESSION["USER_ID"];
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al dadabase");
}
$db->sql_query("select pratica from pe.recenti where utente={$userid} order by data desc");
$elenco_pratiche = $db->sql_fetchlist("pratica");
$prat_max = count($elenco_pratiche);
if (!$elenco_pratiche) {
    print "<p>Nessuna pratica aperta di recente dall'utente<p></body></html>";
    exit;
}
$offset = 0;
include "pe.elenco_pratiche.php";
?>
				<input  name=""  id="" class="hexfield1"  type="button" value="  Chiudi  " onClick="javascript:window.open('index.php','indexPraticaweb');window.close()"></td>
</BODY>
            if ($ricerca["tipo_pratica"] == 1) {
                $arr_cond[] = "report._tipo_pratica BETWEEN 11000 AND 11999";
            } elseif ($ricerca["tipo_pratica"] == 2) {
                $arr_cond[] = "report._tipo_pratica BETWEEN 10000 AND 10999";
            } elseif ($ricerca["tipo_pratica"] > 2) {
                $arr_cond[] = "report._tipo_pratica = " . $ricerca["tipo_pratica"] . "";
            }
        }
        if (is_array($arr_cond)) {
            $cond = "(" . implode(") AND (", $arr_cond) . ")";
        }
        $tabella = new Tabella_h("admin/report", 'view');
        $nrows = $tabella->set_dati("{$cond} order by substr(report.numero,4,1),substr(report.numero,5,3),substr(report.numero,1,3)");
    }
}
$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 0 as id, 'Seleziona ===>' as opzione) UNION (SELECT 1 as id, 'Tutti i Permessi di Costruire' as opzione) UNION (SELECT 2 as id, 'Tutte le D.I.A.' as opzione) UNION (SELECT distinct id,nome as opzione FROM pe.e_tipopratica order by opzione);";
$db->sql_query($sql);
print_debug($sql);
$tipo_pratica = $db->sql_fetchrowset();
$sel_tipo_pratica = "";
foreach ($tipo_pratica as $val) {
    $s = $_POST["tipo_pratica"] && $_POST["tipo_pratica"] == $val["id"] ? "selected" : "";
    $sel_tipo_pratica .= "<option value=\"" . $val["id"] . "\" {$s}>" . $val["opzione"] . "</option>";
}
?>
<html>
<head>
Example #14
0
<?php

include_once "login.php";
$tabpath = "pe";
$notfound = 0;
//Attenzione funzione relazione tra il file elenco e
$pratichexpagina = 5;
$offset = 0;
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
if (isset($_POST["pag"])) {
    //pagina con i risultati al primo giro faccio tutta la query poi mi porto dietro l'array delle pratiche trovate
    $pagenum = $_POST["pag"];
    $pratichexpagina = $_POST["xpag"];
    $elenco = $_POST["elenco"];
    $criterio = $_POST["criterio"];
    if (!isset($elenco)) {
        //se non ho ancora fatto la query la costruisco
        include_once "./db/db.pe.queryricerca.php";
        //echo $sqlRicerca;
        $db->sql_query($sqlRicerca);
        //trovo l'elenco degli id delle pratiche che mi interessano
        $elenco_pratiche = $db->sql_fetchlist("pratica");
        if ($elenco_pratiche) {
            $elenco = implode(",", $elenco_pratiche);
        }
        $_SESSION["RICERCA"] = $_POST;
    } else {
        //sono al secondo giro ho l'elenco delle pratiche per la query
}
require_once $currentconfig;
// Do we have template specific settings?
if (isset($_SESSION['template'])) {
    $template = $_SESSION['template'];
}
$templateconfig = "templates/" . $template . "/config.php";
if (file_exists($templateconfig)) {
    include $templateconfig;
}
if (!isset($main_width)) {
    $main_width = 800;
}
global $coddb;
if ($coddb == null) {
    $coddb = new sql_db($db_host, $db_user, $db_pass, $db_db, false);
    if (!$coddb->db_connect_id) {
        die("Could not connect to the database");
    }
}
function time2ymd($time, $char = '-')
{
    return date(implode($char, array('Y', 'm', 'd')), $time);
}
if (isset($_GET['id'])) {
    $plid = $_GET['id'];
    $query = "SELECT {$t['b3_clients']}.name, ctime.id, ctime.gone, ctime.came\n              FROM {$t['b3_clients']}, ctime, {$t['players']} \n              WHERE {$t['players']}.id = \"{$plid}\"\n              AND {$t['players']}.client_id = {$t['b3_clients']}.id\n              AND {$t['b3_clients']}.guid = ctime.guid\n              ORDER BY ctime.id DESC";
} else {
    if (isset($_GET['dbid'])) {
        $plid = $_GET['dbid'];
        $query = "SELECT {$t['b3_clients']}.name, ctime.id, ctime.gone, ctime.came\n              FROM {$t['b3_clients']}, ctime\n              WHERE {$t['b3_clients']}.id = \"{$plid}\"\n              AND {$t['b3_clients']}.guid = ctime.guid\n              ORDER BY ctime.id DESC";
<?php

include_once "config/config.php";
$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);
}
//print_r($_POST);
//print_r($_FILES);
$descr = $_POST['descrizione'];
$propr = $_POST['propr'];
$uploaddir = getcwd() . "/modelli/";
$err_msg = "errore nel caricamento del file!";
if (move_uploaded_file($_FILES['myfile']['tmp_name'], $uploaddir . $_FILES['myfile']['name'])) {
    list($nome, $ext) = explode(".", $_FILES['myfile']['name']);
    $sql = "SELECT * FROM stp.e_modelli WHERE nome='" . $_FILES['myfile']['name'] . "' AND form='{$form}' and proprietario='{$propr}'";
    if ($db->sql_query($sql)) {
        $elenco_modelli = $db->sql_fetchrowset();
        $nrighe = $db->sql_numrows();
        if ($nrighe === 0) {
            $nome .= "." . $ext;
            $sql = "INSERT INTO stp.e_modelli(nome,form,descrizione,proprietario) VALUES('{$nome}','{$form}','{$descr}','{$propr}')";
            if (!$db->sql_query($sql)) {
                //echo "caricamento non riuscito di :".$_FILES['myfile']['name']."<br>$sql<br>";
                $err_msg = "caricamento del modello " . $_FILES['myfile']['name'] . " non riuscito!";
            } else {
                unset($err_msg);
            }
        } else {
            $err_msg = "Il modello " . $_FILES['myfile']['name'] . " è già presente!";
        }
Example #17
0
<?php

/*
                                                          |
+---------------------------------------------------------------------------+
*/
//error_reporting (0);
ini_set('display_errors', 'On');
// Support Database
require_once 'classes/db.class.php';
$db = new sql_db();
$db->getConnect();
// Core
require_once 'classes/core.class.php';
$core = new Core();
// Global
$url = $core->url;
$conf = $core->conf;
$form = $core->form;
$mess = $core->mess;
$error_mess = $core->error_mess;
$user = $core->user;
// Controller
require_once 'pages/controller.php';
$db->connectClose();
$testo = stripslashes(htmlentities($_POST["testo"]));
$testo = preg_replace('|<head>(.+)</head>|Umi', "", $testo);
$id = $_POST["id"];
$id_doc = $_POST["id_doc"];
$id_modelli = $_REQUEST["id_modelli"];
$nomemodello = $_POST["file"];
$css_modello = $_POST["css"];
//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;
					primary: "ui-icon-circle-triangle-w"
					},
				label:"Annulla"	
			}).click(function(){
				document.location='praticaweb.php?comm=1&pratica=<?php 
        echo $idcomm;
        ?>
&active_form=ce.ordinegiorno.php';
			});
		</script>
	</form>
		
		<?php 
        // Eseguo cancellazione della pratica dalla commissione
        if ($idpratica) {
            $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
            if (!$db->db_connect_id) {
                die("Impossibile connettersi al database");
            }
            $sql = "DELETE FROM pe.pareri WHERE ente=(SELECT tipo_comm FROM ce.commissione WHERE id={$idcomm}) and data_rich=(SELECT data_convocazione FROM ce.commissione WHERE id={$idcomm}) and pratica={$idpratica}";
            if (!$db->sql_query($sql)) {
                echo "ERRORE NELLA CANCELLAZIONE DELLA PRATICA <br>{$sql}<br>";
            }
            print_debug($sql);
        }
        $tabella_h = new Tabella_h($file_config, $modo);
        $tabella_h->set_titolo("Elenco pratiche da discutere");
        $tabella_h->get_titolo();
        $tabella_h->set_dati("pratica > 0");
        ?>
	<form name="cancella" method="post" action="ce.ordinegiorno.php">
Example #20
0
 if (!isset($_POST['location'])) {
     $errors[] = 'location';
 }
 if (!isset($_POST['currency'])) {
     $errors[] = 'currency';
 }
 if (count($errors) > 0) {
     if ($is_ajax) {
         echo json_encode($errors);
         die;
     } else {
         include "form.php";
         exit;
     }
 }
 $db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 $created = time();
 $db->query("INSERT INTO members_changes SET\n\t\t\t\t            m_created = " . $created . ",\n\t\t\t\t            m_type = 'add',\n\t\t\t\t            m_state = 'awaiting',\n\t\t\t\t            m_nick = '" . $db->check($_POST["nick"]) . "',\n\t\t\t\t            m_name = '" . $db->check($_POST["name"] . " " . $_POST["surname"]) . "',\n\t\t\t\t            m_mail = '" . $db->check($_POST["email"]) . "',\n\t\t\t\t            m_address = '" . $db->check($_POST["address"] . ", " . $_POST["zip"] . " " . $_POST["city"] . ", " . $_POST["country"]) . "',\n\t\t\t\t            m_year = '" . $db->check($_POST["birth"]) . "',\n\t\t\t\t            m_jabber = '',\n\t\t\t\t            m_how = '" . $db->check($_POST["how"]) . "',\n\t\t\t\t            m_note = '" . $db->check($_POST["note"]) . "',\n\t\t\t\t            m_distribution = '" . $db->check($_POST["distribution"]) . "',\n\t\t\t\t            m_location = '" . $db->check($_POST["location"]) . "',\n\t\t\t\t            m_currency = '" . $db->check($_POST["currency"]) . "',\n\t\t\t\t            m_reason = '',\n\t\t\t\t            m_addr = '" . $db->check($_SERVER["REMOTE_ADDR"]) . "',\n\t\t\t\t            m_addr_reverse = '" . $db->check(gethostbyaddr($_SERVER["REMOTE_ADDR"])) . "',\n\t\t\t\t            m_last_mail_id = 1\n\t\t\t\t            ");
 $request_id = $db->insert_id();
 // Mail admins
 $admins = explode(",", cfg_get("mailer_requests_sendto"));
 $subject = cfg_get("mailer_requests_admin_sub");
 $text = cfg_get("mailer_requests_admin_text");
 $subject = str_replace("%request_id%", $request_id, $subject);
 $subject = str_replace("%type%", "add", $subject);
 $subject = str_replace("%state%", "awaiting", $subject);
 $subject = str_replace("%member_id%", "-", $subject);
 $subject = str_replace("%member%", "-", $subject);
 $subject = str_replace("%name%", $_POST["name"] . " " . $_POST["surname"], $subject);
 $text = str_replace("%created%", strftime("%Y-%m-%d %H:%M", $created), $text);
 $text = str_replace("%changed_at%", "-", $text);
    if ($modo == "new") {
        $id = $_SESSION["ADD_NEW"];
    }
    $active_form .= "?pratica={$idpratica}&id={$id}&ruolo={$ruolo}";
} elseif ($_POST["azione"] == "Annulla") {
    //se annullo da nuovo soggetto torno ad elenco
    if ($modo == "edit") {
        $active_form .= "?pratica={$idpratica}&id={$id}&ruolo={$ruolo}";
    } else {
        $active_form = "pe.elenco_soggetti.php?pratica={$idpratica}&id={$id}";
    }
} elseif (ereg("Sposta", $_POST["azione"])) {
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    $sql = "update pe.soggetti set {$ruolo}=-1 where id={$id};";
    if (DEBUG) {
        echo $sql;
    }
    $db->sql_query($sql);
    $active_form = "pe.elenco_soggetti.php?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");
    }
    $sql = "update pe.soggetti set {$ruolo}=0 where id={$id};\n\t\t\t\t  delete from pe.soggetti where proprietario=0 and richiedente=0 and concessionario=0 \n\t\t\t\t  and progettista=0 and direttore=0 and esecutore=0 and id={$id};";
    $db->sql_query($sql);
    $active_form = "pe.elenco_soggetti.php?pratica={$idpratica}";
}
function valida_dati($array_config, $campi_obbligatori)
{
    //dall'array tratto dal file di configurazione crea l'array campi=>valori validati per il db
    $OK_Save = 1;
    $db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
    if (!$db->db_connect_id) {
        die("Impossibile connettersi al database");
    }
    //Controllo dei campi obbligatori
    if (isset($campi_obbligatori)) {
        foreach ($campi_obbligatori as $c) {
            if (strlen(trim($_POST[trim($c)])) == 0) {
                $errors[trim($c)] = "Campo Obbligatorio";
                $OK_Save = 0;
            }
        }
    }
    //for ($i=1;$i<count($array_config);$i++){
    //	$row_config=explode('|',$array_config[$i]);
    //	foreach($row_config as  $r)
    //		$array_def[]=explode(';',$r);
    //}
    for ($i = 0; $i < count($array_config); $i++) {
        $row_config = $array_config[$i];
        foreach ($row_config as $r) {
            $array_def[] = explode(';', $r);
        }
    }
    foreach ($array_def as $def) {
        $campo = $def[1];
        $tipo = trim($def[3]);
        $val = trim($_POST[$campo]);
        //echo "Sto Validando $campo : $tipo con valore ".$val."<br>";
        switch ($tipo) {
            case "idriga":
                $val = '';
                //inutile metterlo nella query
                break;
            case "pratica":
                if (strlen(trim($val)) > 0) {
                    $sql = "SELECT pratica FROM pe.avvioproc WHERE numero='{$val}'";
                    if ($db->sql_query($sql)) {
                        $r = $db->sql_fetchrowset();
                        if (count($r) == 0) {
                            $OK_Save = 0;
                            $errors[$campo] = "La pratica {$val} non esiste";
                        } else {
                            $val = "'{$val}'";
                        }
                    }
                } else {
                    $val = "NULL";
                }
                break;
            case "text":
            case "textarea":
            case "richtext":
            case "autosuggest":
                if (strlen($val) > 0) {
                    if (get_magic_quotes_runtime() or get_magic_quotes_gpc()) {
                        //$val="'".htmlentities($val)."'";
                        $val = "'" . $val . "'";
                        //$val="'".$val."'";
                    } else {
                        //$val="'".htmlentities(addslashes($val),ENT_QUOTES)."'";
                        $val = "'" . addslashes($val) . "'";
                    }
                } elseif (strlen($val) === 0) {
                    $val = "NULL";
                }
                break;
            case "data":
                $l = strlen($val);
                //primo controllo se i caratteri inseriti sono del tipo corretto
                if (strlen($val) > 0 and !ereg("([0123456789/.-]{" . $l . "})", $val)) {
                    $OK_Save = 0;
                    $errors[$campo] = "Formato della data non valido {$val}";
                } else {
                    list($giorno, $mese, $anno) = split('[/.-]', $val);
                    //Da Verificare..... il 30 Febbraio 2005 lo prende se scritto come anno-mese-giorno con anno a 2 cifre!!!!! Errore
                    if (strlen($val) > 0 and checkdate((int) $mese, (int) $giorno, (int) $anno)) {
                        $val = "'" . $giorno . "/" . $mese . "/" . $anno . "'";
                    } elseif (strlen($val) > 0 and strlen($giorno) > 3 and checkdate((int) $mese, (int) $anno, (int) $giorno)) {
                        $val = "'" . $anno . "/" . $mese . "/" . $giorno . "'";
                    } elseif (strlen($val) > 0 and strlen($giorno) <= 2 and checkdate((int) $mese, (int) $anno, (int) $giorno)) {
                        $OK_Save = 0;
                        $errors[$campo] = "Data ambigua {$val}";
                    } elseif (strlen($val) > 0) {
                        $OK_Save = 0;
                        $errors[$campo] = "Data non valida {$val}";
                    } elseif (strlen($val) === 0) {
                        $val = "NULL";
                    }
                }
                break;
            case "select":
                if ($val) {
                    $val = "'" . addslashes($val) . "'";
                }
                break;
            case "multiselectdb":
                if (is_array($val) && count($val)) {
                    $val = implode(',', $val);
                } else {
                    $val = '';
                }
                break;
            case "selectdb":
            case "selectRPC":
                if ($val == -1) {
                    $OK_Save = 0;
                    $errors[$campo] = $campo == "tipo_allegati" ? "Impossibile modificare il tipo per allegati. Prima di modicarlo rimuovere tutti gli allegati presenti" : "Errore generico";
                } elseif (strlen(trim($val)) == 0) {
                    $val = 'null';
                } elseif (!is_numeric($val)) {
                    $val = "'" . addslashes($val) . "'";
                }
            case "elenco":
                break;
            case "valuta":
                //$val=str_replace("€","",$val);
                //$val=str_replace(".","",$val);
                $val = str_replace(",", ".", $val);
                if (strlen($val) and !is_numeric($val)) {
                    $OK_Save = 0;
                    $errors[$campo] = "Dato non numerico";
                } else {
                    if (strlen($val) == 0) {
                        $val = "0";
                    }
                }
                break;
            case "ora":
                $val = str_replace(",", ".", $val);
                $val = str_replace(":", ".", $val);
                if (strlen($val) and !is_numeric($val)) {
                    $OK_Save = 0;
                    $errors[$campo] = "Dato orario non valido";
                }
                break;
            case "superficie":
                $val = str_replace("mq", "", $val);
                $val = (double) str_replace(",", ".", $val);
                if (strlen($val) and !is_float($val)) {
                    $OK_Save = 0;
                    $errors[$campo] = "Dato non numerico";
                }
                break;
            case "volume":
            case "numero":
                $val = str_replace(",", ".", $val);
                if (strlen($val) and !is_numeric($val)) {
                    $OK_Save = 0;
                    $errors[$campo] = "Dato non numerico";
                }
                //else if (strlen($val)==0) $val=0.00;
                break;
            case "intero":
                if (is_numeric($val)) {
                    $val = (int) $val;
                }
                $val = str_replace(",", " ", $val);
                if (strlen($val) and !is_numeric($val) and !ereg("/^[0-9]{1,12}\$/")) {
                    $OK_Save = 0;
                    $errors[$campo] = "Dato non numerico";
                }
                //else if (strlen($val)==0) $val=0.00;
                break;
            case "bool":
                ($val = "SI") ? $val = "'t'" : ($val = "'f'");
                break;
            case "yesno":
                if ($val == 'SI') {
                    $val = 1;
                } else {
                    if ($val == 'NO') {
                        $val = 0;
                    }
                }
                break;
            case "checkbox":
            case "semaforo":
                if ($val == 'on') {
                    $val = 1;
                } else {
                    $val = 0;
                }
                break;
            case "radio":
                $arvalue = $_POST[$campo];
                break;
        }
        if ($tipo != "button" and $tipo != "submit") {
            $array_data[$campo] = $val;
        }
    }
    return array("data" => $array_data, "errors" => $errors);
}
Example #23
0
<?php

define('VPSFREE', true);
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
require "config.php";
require "lib/db.lib.php";
$db = new sql_db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">    
    <title>vpsFree.cz - Virtuální Privátní Servery svobodně</title>
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="keywords" content="VPS, hosting, virtualni server, linux, server, privatni server, virtual, virtualny">    
    <meta name="description" content="vpsFree.cz je občanské sdružení, které provozuje virtuální servery pro své členy. Členům poskytujeme virtuální server za 300 Kč měsíčně.">

	<!-- Meta tagy pre socialne siete-->
	<meta property="og:site_name" content="vpsFree.cz">
	<meta property="og:url" content="https://www.vpsfree.cz">	
	<meta property="og:title" content="vpsFree.cz - Virtuální Privátní Servery svobodně">
	<meta property="og:description" content="vpsFree.cz je občanské sdružení, které provozuje virtuální servery pro své členy. Členům poskytujeme virtuální server za 300 Kč měsíčně.">
	<meta name="author" content="vpsFree.cz"/>
	<meta property="og:type" content="article">
	<!--<meta property="og:image" content="/assets/linka-na-konkretny-obrazok-predvoleny-pre-facebook.jpg">-->
	<meta property="og:image:type" content="image/jpeg" />
<?php

include_once "login.php";
$tabpath = "pe";
$notfound = 0;
//Attenzione funzione relazione tra il file elenco e
$pratichexpagina = 20;
$offset = 0;
$db = new sql_db(DB_HOST, DB_USER, DB_PWD, DB_NAME, false);
if (!$db->db_connect_id) {
    die("Impossibile connettersi al database");
}
//pagina con i risultati al primo giro faccio tutta la query poi mi porto dietro l'array delle pratiche trovate
$pagenum = $_POST["pag"] ? $_POST["pag"] : 1;
$elenco = $_POST["elenco"];
if (!isset($elenco)) {
    //se non ho ancora fatto la query la costruisco
    $sqlRicerca = "SELECT pratica,max(tmsins) FROM pe.wf_transizioni WHERE utente_fi={$_SESSION['USER_ID']} group by 1 order by 2 DESC LIMIT 100;";
    //echo $sqlRicerca;
    $db->sql_query($sqlRicerca);
    //trovo l'elenco degli id delle pratiche che mi interessano
    $elenco_pratiche = $db->sql_fetchlist("pratica");
    if ($elenco_pratiche) {
        $elenco = implode(",", $elenco_pratiche);
    }
    $_SESSION["RICERCA"] = $_POST;
} else {
    //sono al secondo giro ho l'elenco delle pratiche per la query
    $elenco_pratiche = explode(",", $elenco);
}
//così faccio una query in più la prima volta ma evito di fare una query pesante ad ogni pagina
Example #25
0
        {
            return mysql_real_escape_string($expression);
        }
        /*
         * Sets the client character set (requires MySQL 5.0.7+).
         *
         * @param string $encoding the charset encoding to set
         */
        function set_charset($encoding)
        {
            if (function_exists('mysql_set_charset')) {
                //>=PHP 5.2.3
                mysql_set_charset($encoding, $this->id);
            } else {
                //Old PHP version
                $this->sql_query("SET NAMES '{$encoding}'");
            }
        }
    }
    /**
     * The main sql_db instance
     * 
     * @global sql_db $db
     */
    $db = new sql_db($Config['sql']['host'], $Config['sql']['username'], $Config['sql']['password'], $Config['sql']['database']);
    $db->set_charset('utf8');
    //By security, we unset the SQL parameters, so you can safely output Zed
    //config parts (there's still the problem of the secret key, but it's less
    //a security problem than database password)
    unset($Config['sql']);
}
<?php

include_once "login.php";
include "./lib/tabella_h.class.php";
include_once "./lib/tabella_v.class.php";
$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>
<?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;
Example #28
0
// Getting the ID
$id = (int) $_GET['flid'];
if (!$id) {
    die('oups');
}
// Loading Site Core
error_reporting(0);
define('IN_ALTERCMS_CORE_ONE', true);
define('PATH', dirname(__FILE__) . '/');
include PATH . 'core/cache.php';
include PATH . 'core/config.php';
include PATH . 'core/db.php';
include PATH . 'core/settings.php';
include PATH . 'lib/wmsale.php';
// Create working objects
$db = new sql_db(SQL_HOST, SQL_USER, SQL_PASS, SQL_BASE, SQL_CHARSET, SQL_COLLATE);
if (defined('MC_HOST')) {
    $cache = new CacheControl(PATH . 'cache/%s.txt');
} else {
    $cache = new CacheControl(PATH . 'cache/%s.txt', array('host' => MC_HOST, 'port' => MC_PORT, 'pref' => MC_PREF, 'exp' => 7200));
}
// Make new WMsale instance
$core = new stdClass();
$core->db = $db;
$core->cache = $cache;
$wmsale = new WMsale($core);
// Get the flow data
$flow = $wmsale->get('flow', $id);
if (!$flow['flow_id']) {
    die('oups');
}
Example #29
0
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
// We enter the detail in the database
if (isset($_POST['id']) == true) {
    define('IN_APP', true);
    include_once 'mysql.php';
    $db = new sql_db();
    $db->sql_open('localhost', 'db_user', 'db_password', 'db_name', true, '');
    // Escape everything
    foreach ($_POST as $key => $value) {
        if (is_array($_POST[$key]) == false) {
            $_POST[$key] = mysql_real_escape_string($value);
        }
    }
    $data = 0;
    // Enter the details in database
    for ($i = 0; $i < count($_POST['time']); $i++) {
        $db->sql_insert('markers', 'user_id, phone_id, locked, time, lat, lon, acc, spd', "'1', '{$_POST['id']}', '{$_POST['lock']}', '{$_POST['time'][$i]}', '{$_POST['lat'][$i]}', '{$_POST['lon'][$i]}', '{$_POST['acc'][$i]}', '{$_POST['spd'][$i]}'");
        $data++;
    }
    echo 'Data received (' . $data . ') ' . time();
} else {
        $template = "holidaypack";
    } elseif (date("d.m") == "31.10") {
        $csspath = $xlrpath . "templates/holidaypack/halloween.css";
        $template_dyn_css = "";
        $template = "holidaypack";
    }
}
$templateconfig = "templates/" . $template . "/config.php";
// Default width of a template:
$main_width = 800;
if (file_exists($templateconfig)) {
    include $templateconfig;
}
global $coddb;
if ($coddb == null) {
    $coddb = new sql_db($db_host, $db_user, $db_pass, $db_db, false);
    if (!$coddb->db_connect_id) {
        die("Could not connect to the database");
    }
}
function time2ymd($time, $char = '-')
{
    return date(implode($char, array('Y', 'm', 'd')), $time);
}
if (isset($_GET['id'])) {
    $plid = $_GET['id'];
    $query = "SELECT {$t['b3_clients']}.name, {$t['history_weekly']}.*\n              FROM {$t['b3_clients']}, {$t['history_weekly']}, {$t['players']} \n              WHERE {$t['players']}.id = \"{$plid}\"\n              AND {$t['players']}.client_id = {$t['b3_clients']}.id\n              AND {$t['b3_clients']}.id = {$t['history_weekly']}.client_id\n              ORDER BY {$t['history_weekly']}.year DESC, {$t['history_weekly']}.week DESC\n              ";
} else {
    if (isset($_GET['dbid'])) {
        $plid = $_GET['dbid'];
        $query = "SELECT {$t['b3_clients']}.name, {$t['history_weekly']}.*\n              FROM {$t['b3_clients']}, {$t['history_weekly']}\n              WHERE {$t['b3_clients']}.id = \"{$plid}\"\n              AND {$t['b3_clients']}.id = {$t['history_weekly']}.client_id\n              ORDER BY {$t['history_weekly']}.year DESC, {$t['history_weekly']}.week DESC\n              ";