1<?
2 curFile.cache = false
3
4 // Evito di includere 'dbconf' piu' di una volta
5 if(curScript.IsDef("quantiDB"))
6 stop
7
8 /* Variabili generali */
9 path = ""
10 dbFolder = "/domini/souveniritalia/dbms/"
11
12 titleOK = "Souvenir Italia"
13 dominio = "souveniritalia.com"
14 emailTo = "staff@souveniritalia.com"
15 emailFrom = "store@souveniritalia.com"
16 smtp_email = "188.219.2.57"
17 url_negozio = "http://www.souveniritalia.com/"
18 nome_negozio = "Souvenir Italia"
19 cartella_edit = "edit_store"
20 pathBackoffice = path + "/" + cartella_edit + "/"
21
22 emailToBit = "giovanni2@bitlevel.com" // STAFF BITLEVEL
23
24 // mittente CRM
25 emailCRM = "giovanni@bitlevel.com" // non usato
26
27 global globMailAuth = "store@souveniritalia.com:sv17"
28
29/*
30 SCHEMA URL REWRITING
31
32 http://[nome_negozio]/[content_name]/[app_id]-[lang]/{extra1/extra1/}
33*/
34
35
36/*
37 Lista applicazioni possibili:
38
39 - la chiave (a due lettere) compare nell'url (app_id)
40
41 - il valore viene assegnato alla variabile 'go' e rappresenta l'applicazione da includere
42
43 /core/[go].bfr
44*/
45 gok = array("mc":"hit","hl":"hit","dt":"det","sc":"search","tt":"testi")
46
47 gok.Add("lc":"hit") // hitlist localita': la distinguo perche' nell'url c'e' "lc"
48/*
49 Lingue
50*/
51
52 languages = array("ita":"Italiano","eng":"English")
53 master_lang = languages.name[1]
54
55
56 // Definisco le sezioni utente (loggato o no) in cui non compare menu prodotti e cart ajax
57 sezioniUtente = array("login","crm","areautente","contatti","chi","order1","order2","order3","testi","situazione","agente")
58/*
59 DB
60*/
61 quantiDB = array("actions", "cart", "categorie", "corrieri", "destinazioni", "docs",
62 "items", "lingue", "liste", "listini", "master", "news",
63 "offerte", "ordini", "otp", "pagamenti", "prodotti", "ritorno",
64 "speciali", "spedizioni", "support", "testi","users", "volumi",
65 "crm","stock","stock_movs","fatture","clienti")
66
67
68 for(d=1; d<=quantiDB.dim; d++)
69 {
70 nomeDB = quantiDB[d] + ".db"
71 varDB = quantiDB[d] + "db"
72 textToEval = varDB + " = qb(dbFolder + '" + nomeDB + "')"
73 result = Eval(textToEval)
74 $result
75 }
76
77 oggi = time()
78 include("/functions.bfr")
79
80/* if(!noio())
81 exit
82*/
83 pathControl = request.filePath
84 if(!curScript.IsDef("paginaTemplate"))
85 paginaTemplate = "/included/template.bfr"
86
87 // Includo i cookies
88 include("/included/cookies.bfr")
89
90/* cuid = cookie.Get("cuid")
91 if(!cuid)
92 {
93 // Includo il controllo di provenienza geografica
94 include("/included/ip.check.bfr")
95 }
96 else
97 {
98 mostraPrezzo = int(cuid.ToArray("_")[3])
99 }
100*/
101
102 // dati da stampare in fattura o nei ddt
103 storeAnagrafica = "BitLevel srl<br />Via Innocenzo Isimbardi, 22<br />20141 Milano Italy<br />Tel +39-02-2953.6416<br />P.Iva 12261650159"
104
105 exportOrdini = "/edit_store/ftp/export_ordini/"
106 exportClienti = "/edit_store/ftp/export_clienti/"
107
108
109 datiFattura = "Remember.mi srl – P.IVA 07391350969<br>
110 Via dei Fontanili 17 – 20141 Milano<br>
111 Tel.+39 02 84895720 fax +39 02 36566179<br>
112 e-mail: segreteria@remembermi.it - sito: www.souveniritalia.com"
113
114/*
115
116 FEATURES
117
118*/
119
120 mostraPrezzo = true
121
122 // Tutti i pressi nel database sono da considerarsi IVA ESCLUSA
123 nettoIva = false
124
125 defaultIva = 22.0
126
127 storeEnabled = false
128
129 // NOTE DESTINAZIONE MODIFICABILI DA UTENTE
130 frontNoteDestinazione = true
131
132 // BACKOFFICE
133 // arrayOperatori = array("op1":"operatore 1","op2":"operatore 2","op3":"operatore 3","op4":"operatore 4")
134
135 // haveListino: usato in '/included/prezzo_listino.bfr' -> influenza 'hitlist', 'det', 'cart'
136 haveListino = true
137
138
139 // haveCRM: usato nella core/order3 e nel Backoffice
140 haveCRM = true
141
142 // haveFornitore: usato sulla conferma richiesta
143 haveFornitore = true // triangolazione
144
145 fornitoreMaster = "BitStore" // deve coincidere con uno 'username' reale record usersdb reale
146
147 // haveSpedizioniere: usato sulla conferma richiesta
148 haveSpedizioniere = true // spedizioniere (dhl, tnt)
149
150// spedizionieri = array("nessuno":"Nessuno","tnt":"TNT","dhlDay":"DHL Day","dhlTime":"DHL Time")
151 spedizionieri = array("nessuno":"Nessuno")
152 spedizioniereMaster = "nessuno"
153
154 // haveTesti: attiva il CMS nella 'not found' e il menu di gestione nel Backoffice
155 haveTesti = true
156
157 // crea il record in "fatturedb" su conferma del fornitore
158 haveFatture = true
159
160 // haveMonitor: tiene traccia degli ultimi n utenti passati per il sito: consultabile dal backoffice per lo staff
161 haveMonitor = false
162
163
164 haveMultilang = false
165
166 // haveWishlist: consente di avere una wishlist per utente, gestibile da backoffice -> influenza 'hitlist', 'det', 'cart'
167 haveWishlist = true
168
169 // haveDispo: disponibilita' prodotti
170 haveDispo = false
171
172
173 haveStock = false //true // usato in prodotti/edit
174 magazzini = array("A","B") // elenco magazzini
175 // scalaQuantita = "ordine_cliente" // conferma_richiesta
176
177 // login agenti: l'agente ha dei clienti associati, puo' loggarsi e fare ordini come cliente
178 haveAgente = true
179
180 haveRifCli = false // (???) usato in /richieste/cerca
181
182 haveTID = "" // usato in richieste/cerca
183
184
185// fakeMail = "giovanni@bitlevel.com" // usato nei test: le mail vengono inviate a staff indipendenetemente dal destinatario
186 // ==========================================
187 /*
188 Definisco la lingua
189 www.store.com/app/ --> www.store.com/[lang]/app/
190 */
191
192 urlArray = request.url.ToArray("/")
193 // Parte dell'URL che ci interessa per determinare quale applicazione lanciare
194 urlPart = 3
195 // Massimo numero di elementi dell'URL
196 urlMax = 4
197
198 if(!haveMultilang || urlArray[2].Begins("dbs") || urlArray[2].Begins("edit_"))
199 {
200
201 /*
202 NIENTE REDIRECT LINGUA NEI SEGUENTI CASI:
203 - multilingua disabilitato
204 - sono nel backoffice
205 - sono in 'dbs' o 'dbs_bis'
206 */
207 lang = master_lang
208 urlPart = 2
209 // Massimo numero di elementi dell'URL
210 urlMax = 3
211 langBaseUrl = "" // prefisso per tutti gli url
212 }
213 else if(request.url == "/")
214 {
215
216 // Se siamo nella home e non c'e' la lingua, la aggiungo
217 global pageOut.head.SetField("","HTTP/1.1 301 Moved permanently")
218 global pageOut.head.SetField("Location",url_negozio + master_lang + "/")
219 lang = master_lang
220 langBaseUrl = "/" + lang // prefisso per tutti gli url
221 }
222 else
223 {
224 if(!curScript.IsDef("lang"))
225 lang = master_lang
226 // Se non siamo nella home
227
228 // Se una lingua valida (languages) non segue il dominio
229 if(!languages.Find(urlArray[2]))
230 {
231 // Se la dimensione e' giusta (senza la lingua), reindirizzo aggiungendola
232 if(urlArray.dim == urlPart)
233 {
234 aaaredUrl = "http://" + request.GetField("Host") + "/" + master_lang + request.url
235 request.Redirect(aaaredUrl)
236 }
237 else // Altrimenti mando alla home
238 {
239 aaa = "LUNGHEZZA URL NON CORRETTA"
240 //debug
241 //request.Redirect("/" + master_lang + "/")
242 }
243 }
244 else // Altrimenti, definisco la lingua
245 lang = urlArray[2]
246
247 langBaseUrl = "/" + lang // prefisso per tutti gli url
248 }
249
250
251
252 // ==========================================
253 // PAGAMENTI ATTIVI: utilizzati in 'login' e 'order1'
254 payments= array("cp101":"Bonifico anticipato",
255 /* "cp102":"Vaglia postale - sconto 3%",
256 "cp103":"Contrassegno contanti (+ XXX €)",*/
257 "cp100":"Carta di credito" /*,
258 "cp_paypal":"PayPal",
259 "cp108":"Rate Consel 10 mesi tasso 0"*/
260 )
261 codContrassegno = "cp103"
262
263
264 // ==========================================
265 // MONITOR UTENTI
266 if(haveMonitor)
267 {
268 max_xsid = 10
269 if(!curScript.IsDef("persistent bsid"))
270 persistent bsid = ""
271
272 xsid = bsid.ToArray("|")
273 userKey = client.user + "(" + client.ipAddress + ")"
274 if(client.userAgent.Contains("safari"))
275 userKey += "safari"
276 else if(client.userAgent.Contains("firefox"))
277 userKey += "firefox"
278 userVal = oggi
279
280 founded = false
281 for(a=1;a<xsid.dim;a++)
282 {
283 if(xsid[a].Begins(userKey))
284 {
285 founded = true
286 // Se trovo aggiorno
287 xsid[a] = userKey + " - " + userVal
288 break
289 }
290 }
291 if(!founded)
292 {
293 xsid.Insert(1,userKey + " - " + userVal)
294 if(xsid.dim > max_xsid)
295 xsid.Delete(max_xsid)
296 }
297
298 bsid = xsid.ToString("|")
299 }
300
301
302
303
304
305?>