159 lines
5.6 KiB
PHP
159 lines
5.6 KiB
PHP
<?php
|
|
/*
|
|
if(!isset($_SESSION["username"]) && isset($_SESSION["user"])){
|
|
$_SESSION["username"] = $_SESSION["user"];
|
|
unset($_SESSION["user"]);
|
|
}
|
|
*/
|
|
|
|
define("_agenti", 5);
|
|
define("_ispettori", 6);
|
|
define("_clienti", 3);
|
|
define("_fornitori", 4);
|
|
define("_utente_az", 2);
|
|
define("_amministratore_az", 9);
|
|
define("_amministratore_sis", 1);
|
|
|
|
define("tb_"._agenti, "vtb_agen.cod_vage");
|
|
define("tb_"._clienti, "gtb_anag.cod_anag");
|
|
define("tb_"._fornitori, "gtb_anag.cod_anag");
|
|
define("tb_"._ispettori, "vtb_ispe.cod_visp");
|
|
|
|
define("app_name", "Order Web+");
|
|
|
|
define("export_pre_folder", "ORDER_");
|
|
define("json_cache_folder", "cache/json");
|
|
define("repo_images_root", "../REPO-IMAGES/");
|
|
|
|
include "func.php";
|
|
include "obj-json-b64-codecs.php";
|
|
include "include/GestSetup.class.php";
|
|
|
|
|
|
$_SESSION["azienda"] = getConfigAzienda();
|
|
if($_SESSION["azienda"]){
|
|
include "config_aziende/{$_SESSION["azienda"]}.class.php";
|
|
} else{
|
|
unset($_SESSION["azienda"]);
|
|
echo "Errore su acquisizione azienda";
|
|
exit;
|
|
}
|
|
/*
|
|
$cust_conf = new cust_conf();
|
|
$sql_class = $cust_conf->getSqlClass();
|
|
include "include/{$sql_class}.php";*/
|
|
|
|
require_once('include/Cms.php');
|
|
|
|
$conf["webapp_title"] .= app_name;
|
|
|
|
$sett = new common();
|
|
$debugMode = (($sett->getAzienda()!="cliente"));
|
|
unset($sett);
|
|
|
|
$weekDays = array( 1 => "Domenica",
|
|
2 => "Lunedì",
|
|
3 => "Martedì",
|
|
4 => "Mercoledì",
|
|
5 => "Giovedì",
|
|
6 => "Venerdì",
|
|
7 => "Sabato");
|
|
|
|
define("separatore_improbabile", "|;$|");
|
|
define("selected", "selected='selected'");
|
|
define("checked", "checked='checked'");
|
|
define("disabled", "disabled='disabled'");
|
|
define("readonly", "readonly='readonly'");
|
|
define("note_ord_default", "Indica qui le annotazioni per quest'ordine");
|
|
define("password_min_char", 6);
|
|
define("pw_edit_report", "integrywin");
|
|
|
|
$array_color_group = array ("E2E6F0", "9BDD9B", "FDF3CB", "FF9966", "F0C8C8", "9BFFDE", "FFB3E7");
|
|
|
|
define("border_konstant", 4536868);
|
|
|
|
define("cache_folder", "cache/");
|
|
define("time_in_cache", 24*3600); // in secondi
|
|
|
|
$absolute_path = str_replace("\\", "/", realpath("."));
|
|
$config_image_structure = "images/structure/";
|
|
$config_image = "images/";
|
|
|
|
$conf["popup"] = array("width" => 800, "height" => 620);
|
|
|
|
$conf["page_menu"][_agenti] = array("ordini_aperti", "nuovo_ordine", "ordini_validati");
|
|
$conf["page_menu"][_clienti] = array("ordini_aperti", "nuovo_ordine", "ordini_validati");
|
|
|
|
$conf["page_menu"][_ispettori] =
|
|
$conf["page_menu"][_utente_az] = array("ordini_aperti", "nuovo_ordine", "area_report", "ordini_validati", "file_manager", "file_upload");
|
|
|
|
$conf["page_menu"][_amministratore_sis] =
|
|
$conf["page_menu"][_amministratore_az] = array("ordini_validati", "area_report", "file_manager", "file_upload");
|
|
|
|
$conf["superuser"] = array(_ispettori, _utente_az, _amministratore_sis, _amministratore_az);
|
|
|
|
$conf["file_manager_groups"] = "1, 2, 6, 9"; // tipologie utenti web per la gestione file uploadati
|
|
$conf["tipi_utenze_solo_interne"] = array(1, 9); // tipologie utenti web con accesso solo interno (amministratori sistema e aziend)
|
|
|
|
if(isset($_SESSION["gruppo"]) && isset($conf["page_menu"][$_SESSION["gruppo"]]) ){
|
|
$conf["homepage_user"] = $conf["page_menu"][$_SESSION["gruppo"]][0].".php";
|
|
}
|
|
if(!isset($conf["lis_dec"])){
|
|
$conf["lis_dec"] = 2;
|
|
}
|
|
|
|
//$conf["wsdl"] = "WS_orderWebPlus";
|
|
$conf["report"]["keyfield"] = array(); // contiene i campi chiave nei campi sql area report che sono nascosti
|
|
|
|
$string_searchClie = "Ricerca per codice, ragione sociale, destinatario o città";
|
|
$arr_newClieObbl = array("rag_soc", "indirizzo", "citta","cap", "prov", "nazione", "part_iva", "cod_fisc", "cod_vage", "rag_soc_dest", "indirizzo_dest","citta_dest","cap_dest","prov_dest","nazione_dest");
|
|
|
|
$array_festivi = array("01/01", "06/01", "25/04", "01/05", "02/06", "15/08", "01/11", "08/12", "25/12", "26/12");
|
|
|
|
$xmlaParams = array( "QUERY_LANG",
|
|
"XMLA_DATA_URL" ,
|
|
"XMLA_DATA_DATASOURCE",
|
|
"XMLA_DATA_CATALOG",
|
|
"XMLA_USERNAME",
|
|
"XMLA_PASSWORD");
|
|
|
|
$arrType = array( "text" => "Testo",
|
|
"date_static" => "Data fissa",
|
|
"date_dynamic" => "Data variabile",
|
|
"select_sql" => "Select SQL",
|
|
"monoselect_sql" => "Mono-Select SQL",
|
|
"sinoselect_sql" => "Campo in Select Condizionale",
|
|
"where_static" => "Condizione WHERE statica");
|
|
|
|
$selGiro = (isset($conf["sel_clienti_giro"]) && $conf["sel_clienti_giro"] && isset($_SESSION["gruppo"]) && $_SESSION["gruppo"]==_agenti);
|
|
$superuser = (isset($_SESSION["gruppo"]) && in_array($_SESSION["gruppo"], $conf["superuser"]));
|
|
|
|
function getConfigAzienda(){
|
|
global $arrAziende, $_SESSION, $_GET;
|
|
if(isset($_GET["azienda"])){
|
|
return $_GET["azienda"];
|
|
} else{
|
|
if(!isset($_SESSION["azienda"])){
|
|
$azienda = getAzienda();
|
|
if($azienda=="studioml"){
|
|
return "dulciar"; // azienda di default a caso solo se in esecuzione da noi
|
|
} else{
|
|
if(in_array($azienda, $arrAziende)){
|
|
return $azienda;
|
|
} else{
|
|
print_r("Azienda '$azienda' non corretta");
|
|
return false;
|
|
}
|
|
}
|
|
} else{
|
|
return $_SESSION["azienda"];
|
|
}
|
|
}
|
|
}
|
|
|
|
require_once "big_query.php";
|
|
$lang = "it";
|
|
require_once("language/lang_{$lang}/_{$lang}_.php");
|
|
require_once('include/Cms.php');
|
|
|
|
$db = new Cms; |