home [giuliac.altervista.org]giuliac.altervista.org/alterpages/files/relazionegiuliacarini.pdf ·...

111
1 http://giuliac.altervista.org/sito_mediaworld_2/home.html

Upload: phamxuyen

Post on 15-Feb-2019

213 views

Category:

Documents


0 download

TRANSCRIPT

1

http://giuliac.altervista.org/sito_mediaworld_2/home.html

2

INDICE

1. Traccia…………………………………………………………………………………………………………………………………….pag. 3 2. Analisi di massima ………………………………………………………………………………………………………………….pag. 3 3. Analisi completa:

Tabelle………………………………………………………………………………………………………………………..pag. 3 Attributi………………………………………………………………………………………………………………………pag. 4 Modello E/R………………………………………………………………………………………………………………..pag. 4 Modello

concettuale…………………………………………………………………………………………………………………………….pag. 5 Relazioni…………………………………………………………………………………………………………………….pag. 5 Tabelle delle variabili………………………………………………………………………………………………….pag. 6 Concetto di integrità referenziale……………………………………………………………………………..pag. 6 Comandi SQL..…………………………………………………………………………………………………………..pag. 7 Organigramma…………………………………………………………………………………………………………..pag. 8

4. Area applicativa Pagine HTML e PHP……………………………………………………………………………………………………pag. 9 Spiegazione del programma…………………………………………………………………………………….pag. 105

5. Manuale tecnico (come installare il database su Altervista e Xampp)……………………………………..pag. 106 6. Parte didattica tecnica…………………………………………………………………………………………………………..pag. 110

che cos'è un database (differenza di myisam e InnoDB) cos'è un server web differenza tra pagine statiche e dinamiche cos'è MySQL cos'è il PHP

3

Giulia Carini

5^I Mercurio A.S. 2012-2013 I.T.E. “A. Bassi”

Relazione sito E-COMMERCE

TRACCIA Un supermercato in una fase di fidelizzazione (carta punti) vuole tener traccia dei prodotti acquistati dai clienti. Di ogni cliente si vuole conoscere nome, cognome, indirizzo e data di

nascita. Di ogni tipo di prodotto è necessario sapere codice, marca, nome, tipo di confezione (bottiglia, lattina, scatola, …), quantità contenuta nella confezione (1 litro, 0.5 kg, …) e prezzo di

listino. Per ogni acquisto le casse emettono uno scontrino caratterizzato dal numero della cassa, dalla data ed orario di emissione, dall’elenco dei prodotti acquistati, dal prezzo di acquisto e dalla quantità di ogni prodotto.

Realizzare un sito web tipo e-commerce che consenta di gestire l’intera procedura informatica, che permetta al visitatore di visualizzare i prodotti presenti in magazzino e che consenta al responsabile di visualizzare i clienti.

ANALISI DI MASSIMA il programma richiede lo sviluppo di un sito e-commerce che permetta ai clienti di registrarsi per

poter acquistare i prodotti da loro desiderati; per quei clienti che non sono interessati alla registrazione per effettuare l’acquisto sarà possibile visualizzare i prodotti in un’area aperta a tutti i navigatori Web.

Gli amministratori, invece, potranno gestire tutti i clienti, i prodotti, gli acquisti, i fornitori, le carte fedeltà e gli operatori direttamente da un area a cui possono accedere attraverso un username e una password.

I dati verranno inseriti in un database MySql opportunamente configurato con server web Apache. L'applicativo consentirà agli operatori di gestire i dati attraverso dei programmi scritti in PHP.

MySql verrà utilizzato graficamente con il prodotto applicativo PhpMyAdmin.

TABELLE

-Prodotti -Clienti -Acquisti

-Fornitori -Operatori -Carta fedeltà

4

ENTITA’ (I campi sottolineati identificano le chiavi primarie, i campi in corsivo, le chiavi esterne.)

-CLIENTI (cl_codcli, cl_cognom, cl_indiri, cl_locali, cl_user, cl_passwo, cl_codfis, cl_datnas, cl_numtel, cl_email, cl_sesso) -ACQUISTI (ac_codacq, ac_codcli, ac_codpro, ac_quanti, ac_cosuni, ac_costot, ac_datacq,

ac_oraacq, ac_codcar, ac_punspe) -PRODOTTI (pr_codpro, pr_descri, pr_marca, pr_quanti, pr_ticonf, pr_prezzo, pr_codfor, pr_codope) -CARTA FEDELTA’ (cf_codcar, cf_totpun, cf_codcli) -FORNITORI (fo_codfor, fo_cognom, fo_codpro, fo_descri)

-OPERATORI (op_codope, op_cognom)

SCHEMA ER

Clienti Acquisti Prodotti

Operatori

Fornitori

Richiesti 1:N N:1

1:N

N

:1

N:1

N:1

1:N

Carta fedeltà

Registra Gestione

5

SCHEMA CONCETTUALE

acquisti

ac_codacq

ac_codfis

ac_codpro

ac_descri

ac_quaacq_new

ac_prezzo

ac_costot

ac_datacq

ac_oraacq

ac_codcar

ac_punspe

RELAZIONI

-Tra la tabella CLIENTI e la tabella ACQUISTI c’è una relazione 1:N perchè un

cliente può effettuare più acquisti. -Tra la tabella ACQUISTI e la tabella CARTA FEDELTA’ c’è una relazione N:1 perchè con una carta fedeltà possono essere effettuati più acquisti.

-Tra la tabella ACQUISTI e la tabella PRODOTTI c’è una relazione N:1 perchè più acquisti possono contenere un prodotto.

-Tra la tabella OPERATORI e la tabella PRODOTTI c’è una relazione 1:N perchè un operatore può gestire più prodotti.

-Tra la tabella FORNITORI e la tabella PRODOTTI c’è una relazione 1:N perchè più prodotti possono essere richiesti ad un fornitore.

prodotti

pr_codpro

pr_descri

pr_marca

pr_ticonf

pr_prezzo

pr_quanti

pr_codfor

pr_codope

clienti

cl_codfis

cl_nome

cl_cognome

cl_email

cl_comune

cl_locali

cl_user

cl_passwo

cl_numtel

cl_annas

cl_sesso

fornitori

fo_codfor

fo_nomfor

fo_codpro

fo_descri

carta fedeltà

cf_codcar

cf_codfis

cf_totpun

1

N

N

1

N

N

N

1

1

operatori

op_codope

op_nomope 1

6

TABELLA DEI METADATI

Tabelle Attributi Chiave Formato Lungh. Descrizione

Clienti cl_codfis cl_nome cl_cognome cl_email cl_indiri cl_comune cl_user cl_passwo cl_numtel cl_annas cl_sesso

Primaria Numerico Carattere Carattere Carattere Carattere Carattere Carattere Carattere Carattere Data/Ora Carattere

16 30 30 50 30 30 30 20 10 4 1

Codice fiscale Nome Cognome Email Indirizzo cliente Località cliente User cliente Password cliente Numero di telefono Anno di nascita cliente Sesso

Acquisti ac_codacq ac_codfis ac_codpro ac_descri ac_quanti ac_prezzo ac_costot ac_datacq ac_oraacq ac_codcar ac_punspe

Primaria Esterna Esterna Esterna

Carattere Numerico Numerico Carattere Numerico Numerico Numerico Data/Ora Data/Ora Numerico Numerico

6 16 6 50 3 5,2 10,2 6 10

Codice acquisto Codice fiscale cliente Codice prodotto Descrizione Quantità prodotto Prezzo Costo totale Data acquisto Ora acquisto Codice carta Punti spesa

Prodotti pr_codpro pr_descri pr_marca pr_ticonf pr_preuni pr_quanti pr_codfor pr_codope

Primaria Esterna Esterna

Numerico Carattere Carattere Carattere Numerico Numerico Numerico Numerico

6 50 30310 3 10,2 10 6 6

Codice del prodotto Nome del prodotto Marca del prodotto Tipo confezione Prezzo unitario Quantità Codice fornitore Codice operatore

Operatori op_codope op_cognom

Primaria Numerico Carattere

6 50

Codice dell’operatore Cognome e nome

Carta fedeltà ca_codcar ca_codfis ca_totpun

Primaria Esterna

Numerico Carattere Numerico

6 16 3

Codice carta fedeltà Codice fiscale cliente Punti totali

Fornitori fo_codfor fo_nomfor fo_codpro fo_descri

Primaria Esterna

Numerico Carattere Numerico Carattere

6 50 6 30

Codice del fornitore Nome del fornitore Codice prodotto Descrizione prodotto

CONCETTO DI INTEGRITA’ REFERENZIALE Per integrità referenziale si intende che la chiave esterna di una qualsiasi tabella di riferimento

deve essere sempre associata a una riga valida della suddetta tabella. L'integrità referenziale garantisce che le relazioni tra due tabelle rimangano sincronizzate durante le operazioni di aggiornamento e di eliminazione.

7

COMANDI SQL

Creazione: -clienti CREATE TABLE `clienti` (`cl_codfis` char(16) NOT NULL, `cl_nome` varchar(30) NOT NULL,

`cl_cognome` varchar(30) NOT NULL, `cl_indiri` varchar(50) NOT NULL, `cl_comune` varchar(30) NOT NULL, `cl_sesso` char(1) NOT NULL, `cl_email` varchar(30) NOT NULL, `cl_passwo` varchar(15) NOT NULL, `cl_user` varchar(30) NOT NULL, `cl_annas` year(4) NOT NULL, `cl_numtel` char(10) NOT NULL) PRIMARY KEY (`cl_codfis`);

-acquisti CREATE TABLE `acquisti` (`ac_codacq` int(6) NOT NULL, `ac_codfis` char(16) NOT NULL, `ac_codpro` int(6) NOT NULL, `ac_descri` varchar(50) NOT NULL, `ac_prezzo` decimal(5,2) NOT NULL, `ac_costot ` decimal(10,2) NOT NULL, `ac_datacq` date NOT NULL, `ac_oraacq` time NOT NULL, `ac_codcar` int(6) NOT NULL, `ac_punspe` int(10) NOT NULL, `ac_quaacq_new` int(3) NOT NULL) PRIMARY KEY (`ac_codacq`) FOREIGN KEY (`ac_codfis`) REFERENCES clienti (`cl_codfis`) FOREIGN KEY (`ac_codpro`) REFERENCES prodotto (`cl_codpro`) FOREIGN KEY (`ac_codcar`) REFERENCES carta_fedelta (`cf_codcar`);

-prodotti CREATE TABLE `prodotto` (`pr_codpro` int(6) NOT NULL, `pr_descri` varchar(50) NOT NULL, `pr_marca` varchar(30) NOT NULL, `pr_quanti` int (10) NOT NULL, `pr_ticonf` varchar(30) NOT NULL, `pr_prezzo ` decimal(10,2) NOT NULL, `pr_codfor` int(6) NOT NULL, `pr_codope` int(6) NOT NULL) PRIMARY KEY (`pr_codpro`)

FOREIGN KEY (`pr_codfor`) REFERENCES fornitori (`fo_codfor`) FOREIGN KEY (`pr_codope`) REFERENCES operatori (`op_codope`);

-operatori CREATE TABLE `operatori` (`op_codope` int (6) NOT NULL, `op_cognom` varchar(50) NOT NULL) PRIMARY KEY (`op_codope`);

-carta_fedelta

8

CREATE TABLE `carta_fedelta` (`cf_codcar` int (6) NOT NULL, `cf_totpun` int(15) NOT NULL, `cf_codfis ` char(16) NOT NULL) PRIMARY KEY (`cf_codcar`)

FOREIGN KEY (`cf_codfis`) REFERENCES clienti (`cl_codfis`);

-fornitori CREATE TABLE `fornitori` (`fo_codfor` int (6) NOT NULL, `fo_nomfor` varchar(30) NOT NULL, `fo_codpro ` int(6) NOT NULL, `fo_descri ` varchar(30) NOT NULL) PRIMARY KEY (`fo_codfor`) FOREIGN KEY (`fo_codpro`) REFERENCES prodotto (`fo_codpro`);

Queries: • Visualizzare tutti i clienti di sesso femminile:

SELECT *

FROM clienti WHERE cl_sesso=”F”;

• Visualizzare tutti gli acquisti effettuati dal possessore della carta fedeltà n. 000056:

SELECT *

FROM acquisti WHERE ac_codcar=”000056”;

• Visualizzare tutti i prodotti con il relativo codice della marca Danone:

SELECT pr_codpro, pr_descri, pr_marca

FROM prodotti

WHERE pr_marca=”Danone”;

• Cancellare una tabella a scelta:

DROP table carta fedeltà;

• Visualizzare in ordine discendente tutti i fornitori:

SELECT *

FROM fornitori

WHERE fo_codfor desc;

ORGANIGRAMMA GESTIONE CLIENTI: -inserimento cliente -modifica cliente -cancellazione cliente -visualizzazione cliente GESTIONE ACQUISTI: -modifica acquisto -cancellazione acquisto -visualizzazione acquisto GESTIONE PRODOTTI: -inserimento prodotto -modifica prodotto -cancellazione prodotto

9

-visualizzazione prodotto GESTIONE OPERATORI: -inserimento operatore -modifica operatore -cancellazione operatore -visualizzazione operatore GESTIONE FORNITORI: -inserimento fornitore -modifica fornitore -cancellazione fornitore -visualizzazione fornitore GESTIONE CARTA FEDELTA’: -modifica carta fedeltà -cancellazione carta fedeltà -visualizzazione carta fedeltà

LISTING PAGINE HTML E PHP

[home.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Mediaworld - Home</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { color: rgb(255, 255, 0);

} .auto-style2 { color: #00FF00;

} .auto-style3 { color: #FF0000;

} .auto-style4 { font-family: "Blue Highway D Type";

} .auto-style5 { color: rgb(255, 255, 0);

font-weight: normal; } .auto-style6 {

font-family: "Comic Sans MS"; } </style>

</head> <body>

<p>&nbsp;</p> <!--?php session_stat(); ?-->

<div id="header"><a href="home.html"> <img style="border-style: solid; border-color: inherit; border-width: 0px; float: left;" src="logo.gif" alt="" width="167" height="78" /></a> <ul id="navBar">

10

<li class="current"><a href="home.html">Home</a></li>

<li><a href="dovesiamo.html">Dove siamo </a></li> <li><a href="prodotti.html">I nostri prodotti</a></li> <li><a href="amm.html">Area amministratori</a></li>

<li><a href="contati.html">Contatti</a></li> </ul> </div>

<div> <h1 class="auto-style2">Benvenuti in Media World</h1> <div id="Benvenuti" align="float:left"><small> </small>

<h1><small><span class="auto-style3">ATTENZIONE</span><br /> </small></h1> <small> </small> <h2><small>Questo sito &egrave; una simulazione scolastica di Carini Giulia.</small></h2>

<h2><small>&nbsp;Classe 5^I Mercurio. A.S. 2012-2013<br /> Istituto Tecnico Economico A. Bassi di Lodi</small></h2>

</div> <p>&nbsp;</p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<div id="mainCol" class="clearfix"> <div id="services"> <h3 style="left: 289px; top: 6px;">SALDI</h3>

<ul> <li> <h4 style="text-align: center;"><a href="prodotto1.html">HTC One S</a></h4>

<div style="text-align: center;">&nbsp;</div> <p style="text-align: center;">. &nbsp; <big><span class="auto-style1"><big style="font-weight: bold;">Solo </big> </span><big class="auto-style1" style="font-weight: bold;">a 200

&euro;</big></big></p> </li>

<li> <h4 style="text-align: center;"><span style="font-weight: bold;"><a href="prodotto2.html">NIKON Fotocamera Reflex digitale D3100</a></span></h4>

<div style="text-align: center;">&nbsp;</div> <p class="auto-style1" style="font-weight: bold; text-align: center;"><big><big> <span class="auto-style1">Solo a 549&euro;</span></big></big></p>

</li> <li> <h4 style="text-decoration: underline; text-align: center;"><a href="prodotto3.html"><small><big>SHARP

TV LED 46&rdquo; LC-46LE636</big></small></a></h4> <p class="auto-style1" style="font-weight: bold; text-align: center;"><big> <span class="auto-style1">Solo a 699&euro; al posto di</span> <span class="auto-style1">1020&euro;</span></big></p>

<big><br /> </big></li> </ul> </div>

<br /> <div id="services"> <h3 style="left: 294px; top: 7px;">SALDI</h3>

<ul> <li>

<h4 style="text-decoration: underline; text-align: center;"><a href="prodotto4.html">HP ENVY 17-1188el</a></h4> <p style="font-weight: bold; text-align: center;"><big> <span class="auto-style1">Prezzo di

mercato</span> <span class="auto-style1">&euro; 299,00 Risparmi &euro; 500,00 pari al 38,49% di sconto.</span></big></p> </li>

11

<li style="text-align: center;"><a href="prodotto5.html"><big style="text-decoration:

underline;"><big>Sony Ericsson Xperia X10 Mini Black</big></big></a> <p class="auto-style1" style="text-align: center; font-weight: bold;"><big> <span class="auto-style1">Prezzo di mercato &euro;149,00</span> <span class="auto-style1">Risparmi &euro;49,10 pari al

32,95% di sconto</span>. </big></p> </li> <li style="text-align: center; color: #ff0000;"><br />

<h4><a href="prodotto6.html">HP Personal Computer Pavilion p6-2140el </a></h4> <p style="text-align: center; font-weight: bold;"><span class="auto-style5"> <strong>399 &euro;<br />39,90 &euro; AL MESE PER 10 RATE</strong></span></p>

</li> <li style="text-decoration: underline; text-align: center; color: #ff0000;"></li> <li><strong><br /> </strong></li>

</ul> <big><br />

</big></div> </div> <div id="secCol"><fieldset id="login">

<h4><big>Accesso Clienti</big></h4> <form action="checklogin.php" method="post" name="form_login"> <p class="clearfix"><label for="username"><big>Utente</big></label> <big><input id="username"

type="text" name="cl_user" value="" /></big></p> <p class="clearfix"><label for="password"><big>Password</big></label> <big><input id="password" type="password" name="cl_passwo" value="" /></big></p>

<big><input id="submit" type="submit" name="submit" value="" /></big></form></fieldset> <h3 id="news" class="auto-style4"><big>Registrati</big></h3> <form action="elabora_form.php" method="post">

<div align="center"> <table style="width: 300px;" border="0"> <tbody>

<tr> <td class="auto-style6">Nome:</td>

<td><input type="text" name="cl_nome" /></td> </tr> <tr>

<td class="auto-style6">Cognome:</td> <td><input type="text" name="cl_cognome" /></td> </tr>

<tr> <td class="auto-style6"> <p>Indirizzo:</p>

</td> <td> <p><input type="text" name="cl_indiri" /></p>

</td> </tr> <tr>

<td class="auto-style6"> <p>Comune:</p> </td>

<td> <p><input type="text" name="cl_comune" /></p>

</td> </tr> <tr>

<td class="auto-style6"> <p>Sesso:</p> </td>

12

<td>M:<input type="radio" name="cl_sesso" value="M">

F:<input type="radio" name="cl_sesso" value="F"></td> </tr> <tr>

<td class="auto-style6"> <p>Codice fiscale:</p> </td>

<td> <p><input type="text" name="cl_codfis" /></p> </td>

</tr> <tr> <td class="auto-style6">

<p>Anno di nascita:</p> </td>

<td><p><input type="text" name="cl_annas" /></p></td> </tr> <tr>

<td class="auto-style6">Username:</td> <td><input type="text" name="cl_user" /></td> </tr>

<tr> <td class="auto-style6">Password:</td> <td><input type="password" name="cl_passwo" /></td>

</tr> <tr> <td class="auto-style6">Mail:</td>

<td> <p><input type="text" name="cl_email" /></p> </td>

</tr> <tr>

<td class="auto-style6">Numero di telefono:</td> <td><p><input type="text" name="cl_numtel" /></p></td> </tr>

<tr> <td colspan="2" align="center"><input type="submit" name="action" value="Invia" /></td> </tr>

</tbody> </table> </div>

</form><big><br /> <br /> </big></div> </div>

</div> </div> <div id="footer">

<p><big>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</big></p> </div> </body>

</html>

13

[dovesiamo.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Dove siamo</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style2 { color: #FF0000;

} .auto-style3 { color: #00FF00;

} .auto-style4 { display: block;

text-align: center; }

.auto-style5 { text-align: center; }

.auto-style6 { font-size: large; font-family: "Comic Sans MS";

} </style> </head>

<body>

14

<div id="header"><a href="home.html"> <img style="border-style: solid; border-color: inherit; border-

width: 0px; float: left; height: 77px;" src="logo.gif" alt="" width="161" /></a> <ul id="navBar"> <li><a href="home.html">Home</a></li>

<li class="current"><a href="dovesiamo.html">Dove siamo </a></li> <li><a href="prodotti.html">I nostri prodotti </a></li> <li><a href="amm.html">Area amministratori</a></li>

<li><a href="contati.html">Contatti</a></li> </ul> </div>

<div> <h1 class="auto-style3">Benvenuti in Media World</h1> <div id="Benvenuti">

<h1><span class="auto-style2">ATTENZIONE</span></h1> <h2>Questo sito &egrave; una simulazione scolastica di Carini Giulia.</h2>

<h2>&nbsp;Classe 5^I Mercurio. A.S. 2012-2013<br /> Istituto Tecnico Economico A. Bassi di Lodi</h2> </div> <p>&nbsp;</p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <div id="mainCol" class="auto-style4"><br /> &nbsp;&nbsp;&nbsp; &nbsp;<iframe src="https://maps.google.it/maps?ie=UTF8&amp;cid=7874831400812113274&amp;q=Media+World+Muzza

+di+Cornegliano+Laudense&amp;gl=IT&amp;hl=it&amp;ll=45.289213,9.474064&amp;spn=0.006295,0.006295&amp;t=m&amp;iwloc=A&amp;output=embed" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="350"></iframe><br /><small><a style="color: #0000ff; text-align:

left;" href="https://maps.google.it/maps?ie=UTF8&amp;cid=7874831400812113274&amp;q=Media+World+Muzza+di+Cornegliano+Laudense&amp;gl=IT&amp;hl=it&amp;ll=45.289213,9.474064&amp;spn=0.006295,0.00

6295&amp;t=m&amp;iwloc=A&amp;source=embed">Visualizzazione ingrandita della mappa</a></small> <div id="layer1" class="auto-style5" style="position: absolute; width: 303px; height: 224px; z-index: 1; left:

614px; top: 385px;"><span class="auto-style6">Il punto vendita Media World Muzza di Cornegliano Laudense (dietro Viale de Gasperi) si trova a met&agrave; &nbsp;strada tra Milano e Piacenza e a 22 km circa da Crema. </span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</div>

<br /> <br /> &nbsp;</div> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

15

[prodotti.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Prodotti</title>

<link href="style.css" type="text/css" rel="stylesheet" /> <style type="text/css"> .auto-style1 {

font-family: "Comic Sans MS"; } </style>

</head> <body> <div id="header"><a href="#"><img id="logo" style="border: 0px solid; float: left; top: -4px; left: 104px;

width: 202px; height: 91px;" title="Affiliate Promo logo" src="logo.gif" alt="" /></a> <ul id="navBar"> <li><a href="home.html">Home</a></li>

<li><a href="dovesiamo.html">Dove siamo</a></li> <li class="current"><a href="prodotti.html">I nostri prodotti</a></li> <li><a href="amm.html">Area amministratori</a></li>

<li><a href="contati.html">Contatti</a></li> </ul>

</div> <div style="text-align: center;"> <div style="text-align: left;"><br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <img style="height: 196px; width: 259px;" src="media.gif" alt="" />&nbsp;&nbsp;

&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

16

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</div> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix">

<div id="mainCol" class="clearfix"><br /> <h3 id="why">I NOSTRI PRODOTTI-Cellulari</h3> <ul id="maincon">

<li class="clearfix"><img style="width: 123px; height: 123px;" src="cell.jpg" alt="image1" /> <h2>SAMSUNG GT-E1080 Black</h2> <p>Dual band - GSM - Memoria interna 200 numeri Display a 65.000 colori - Peso: 65 g.<br /> <span

style="color: #ff0000;">16,90 &euro;</span></p> </li> <li class="clearfix"><img style="width: 150px; height: 143px;" src="billy.jpg" alt="image1" />

<h2>NGM Billy Turquoise</h2> <p>Tri band - GPRS - Lettore MP3 Fotocamera VGA - Slot microSD Display a 65.000 colori - Peso: 98 g. Due SIM sempre attive e indipendenti<br /> <span style="color: #ff0000;">59,00 &euro;</span></p>

</li> <li class="clearfix"><img style="width: 152px; height: 146px;" src="C206.png" alt="image1" /> <h2>NOKIA C2-06 Touch and Type Graphite</h2>

<p>Dual band - GPRS - Bluetooth Fotocamera da 2 Megapixel - Lettore MP3 Memoria interna 10MB - Slot microSD Display 2,6" Touchscreen Due SIM sempre attive e indipendenti.<br /> <span style="color:

#ff0000;">105,00 &euro;</span></p> </li> <li class="clearfix last"><img style="width: 159px; height: 145px;" src="bla.jpg" alt="image1" />

<h2>BLACKBERRY Curve 8520 White</h2> <p>Quadriband - UMTS - HSDPA - Bluetooth - Wi-Fi Fotocamera da 5 Megapixel - Lettore MP3 Symbian OS S60 - GPS integrato Monitor LCD 3,2" Touchscreen - Slot microSD.<br /> <span style="color:

#ff0000;">149,00 &euro;</span></p> </li> <li class="clearfix"><img style="width: 150px; height: 143px;" src="iphone.jpg" alt="image1" />

<h2>APPLE iPhone 4 White 8GB</h2> <p>Quadriband - UMTS - HSDPA - HSUPA - Bluetooth - Wi-Fi Fotocamera da 5 Megapixel - Lettore MP3 Sistema Operativo Mac OS - GPS integrato Monitor LCD 3,5" Touchscreen - Memoria interna 8 GB <br />

<span style="color: #ff0000;">559,00 &euro;</span></p> </li> </ul>

</div> <table style="background-color: #3366ff; width: 193px; height: 199px; text-align: left; margin-left: auto; margin-right: 0px;" border="1" cellspacing="2" cellpadding="2">

<tbody> <tr>

<td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul> <li><a href="prodotti.html"><big>CELLULARI</big></a></li>

</ul> </td> </tr>

17

<tr>

<td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul> <li><a href="prodotti2.html"><big>COMPUTER</big></a></li>

</ul> </td> </tr>

<tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul>

<li><a href="prodotti3.html"><big>TELEVISIONE</big></a></li> </ul> </td>

</tr> </tbody>

</table> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[prodotti2.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

18

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Prodotti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { font-family: "Comic Sans MS"; }

</style> </head> <body>

<div id="header"><a href="#"><img id="logo" style="border: 0px solid; float: left; top: -4px; left: 104px; width: 202px; height: 91px;" title="Affiliate Promo logo" src="logo.gif" alt="" /></a> <ul id="navBar">

<li><a href="home.html">Home</a></li> <li><a href="dovesiamo.html">Dove siamo </a></li>

<li class="current"><a href="prodotti.html">I nostri prodotti</a></li> <li><a href="amm.html">Area amministratori</a></li> <li><a href="contati.html">Contatti</a></li>

<li><a href="ecomm_def.html">E-commerce</a></li> </ul> </div>

<div style="text-align: center;"> <div style="text-align: left;"><br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<img style="height: 196px; width: 259px;"

src="media.gif" alt="" /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</div> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<div id="mainCol" class="clearfix"><br /> <h3 id="why">I NOSTRI PRODOTTI-Computer</h3> <ul id="maincon">

<li class="clearfix"><img style="width: 161px; height: 144px;" src="dv6.jpg" alt="image1" /> <h2><span class="product_titleMark" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; color: #000000; line-height: 20px; font-style: normal; font-variant:

normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">HP</span><span style="color: #000000; font-

family: Verdana,sans-serif; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float:

none;">&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span><span class="product_titleModel" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #000000; line-height: 15px; font-style: normal; font-variant: normal; letter-

19

spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-

spacing: 0px; background-color: #ffffff;">Pavilion dv6-6159sl</span></h2> <p>Intel Core i5-2430M (2.40GHz, 3MB L3) HD 500GB - RAM 4GB - Display 15.6" wide Wi-Fi 802.11b/g/n - Windows 7 Home Premium Audio Beats - Bluetooth - Lettore impronte Scheda video AMD Radeon 6770M

2GB dedicata GDDR5 <br /> <span style="color: #ff0000;">579,00 &euro;</span></p> </li> <li class="clearfix"><img style="width: 173px; height: 149px;" src="vaio.jpg" alt="image1" />

<h2>&nbsp;&nbsp;&nbsp;&nbsp;<span class="product_titleMark" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; color: #000000; line-height: 20px; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none;

white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">SONY</span><span style="color: #000000; font-family: Verdana,sans-serif; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-

transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float: none;">&nbsp;&nbsp;<span class="Apple-converted-

space">&nbsp;</span></span><span class="product_titleModel" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #000000; line-height: 15px; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none;

white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff;">Vaio VPCEH3L1E/W</span></h2> <p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Intel Core i5-2450M (2.50GHz, 3MB L3) HD 750GB - RAM

4GB - &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Display 15.6" wide Wi-Fi 802.11b/g/n - Windows 7 Home Premium &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Webcam con microfono integrata - Bluetooth 3.0+HSScheda video

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NVIDIA GeForce 410M 1GB dedicata <br /> &nbsp;&nbsp;&nbsp; <span style="color: #ff0000;">&nbsp;&nbsp;&nbsp; 699,00 &euro; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:

#ff0000;">&nbsp;</span></p> </li> <li class="clearfix"><img style="width: 152px; height: 146px;" src="asus.jpg" alt="image1" />

<h2>ASUS N55SL-S1097V</h2> <p>Intel Core i7-2670QM (2.20GHz, 6MB L3) HD 1TB (2x500GB) - RAM 8GB - Display 15,6" FullHD Wi-Fi

802.11b/g/n - Windows 7 Home Premium Webcam 2MPixel integrata - Bluetooth 3.0+HS Audio Bang&amp;Olufsen con subwoofer - Masterizzatore Blu-ray Scheda video NVIDIA GeForce GT 635M 2GB dedicata <br /> <span style="color: #ff0000;">1249,00 &euro;</span></p>

</li> <li class="clearfix last"><img style="width: 159px; height: 145px;" src="2hp.jpg" alt="image1" /> <h2>HP Pavilion p6-2083it</h2>

<p>Intel Core i3-2120 (3.30GHz, 3MB L3) HD 2TB - RAM 4GB - Scheda audio 5.1 Microsoft Windows 7 Home Premium <br /> <span style="color: #ff0000;">449,00 &euro;</span></p> </li>

<li class="clearfix"><img style="width: 150px; height: 143px;" src="intel.jpg" alt="image1" /> <h2>ACER Aspire Predator G3610</h2> <p>Intel Core i5-2400 (3.10GHz, 6MB L3) HD 1TB - RAM 8GB - Scheda audio 5.1 WiFi 802.11 b/g/n -

Microsoft Windows 7 Home Premium Scheda video NVIDIA GeForce GT 545 1.5GB dedicata <br /> <span style="color: #ff0000;">799,00 &euro;</span></p> </li>

</ul> </div> <table style="background-color: #3366ff; width: 193px; height: 199px; text-align: left; margin-left: auto;

margin-right: 0px;" border="1" cellspacing="2" cellpadding="2"> <tbody>

<tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul>

<li><a href="prodotti.html"><big>CELLULARI</big></a></li> </ul> </td>

20

</tr>

<tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul>

<li><a href="prodotti2.html"><big>COMPUTER</big></a></li> </ul> </td>

</tr> <tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;">

<ul> <li><a href="prodotti3.html"><big>TELEVISIONE</big></a></li> </ul>

</td> </tr>

</tbody> </table> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[prodotti3.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

21

<head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Prodotti</title> <link href="style.css" type="text/css" rel="stylesheet" />

<style type="text/css"> .auto-style1 { font-family: "Comic Sans MS";

} </style> </head>

<body> <div id="header"><a href="#"><img id="logo" style="border: 0px solid; float: left; top: -4px; left: 104px; width: 202px; height: 91px;" title="Affiliate Promo logo" src="logo.gif" alt="" /></a>

<ul id="navBar"> <li><a href="home.html">Home</a></li>

<li><a href="dovesiamo.html">Dove siamo</a></li> <li class="current"><a href="prodotti.html">I nostri prodotti</a></li> <li><a href="amm.html">Area amministratori</a></li>

<li><a href="contati.html">Contatti</a></li> <li><a href="ecomm_def.html">E-commerce</a></li> </ul>

</div> <div style="text-align: center;"> <div style="text-align: left;"><br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<img style="height: 196px; width: 259px;" src="media.gif" alt="" />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</div>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <div id="mainCol" class="clearfix"><br /> <h3 id="why">I NOSTRI PRODOTTI-Televisore</h3>

<ul id="maincon"> <li class="clearfix"><img style="width: 123px; height: 123px;" src="led.jpg" alt="image1" /> <h2>MEDION LIFE P13149</h2>

<p>TV LCD con Retroilluminazione LED 18.5" - Formato 16:9 Risoluzione: 1366x768 - Contrasto 9000:1 Luminosit&agrave; 250 cd/mq - Tempo di risposta 5 ms Connessioni Scart - HDMI - USB - PC Composit -

Component - Slot CI HD Ready TUNER DIGITALE Terrestre INTEGRATO (per la ricezione di canali in chiaro) <br /> <span style="color: #ff0000;">139,00 &euro;</span></p> </li>

<li class="clearfix"><img style="width: 150px; height: 143px;" src="samsung.jpg" alt="image1" /> <h2>SAMSUNG T22A300</h2>

22

<p>TV color 21.5" LED - Formato 16:9 Risoluzione: 1920x1080 - Contrasto 5M:1 Luminosit&agrave; 250

cd/mq - Tempo di risposta 5 ms Connessioni Scart - HDMI - Component - Slot CI+ FULL HD TUNER DIGITALE Terrestre INTEGRATO Alta Definizione HD (per la ricezione di canali in chiaro) <br /> <span style="color: #ff0000;">189,00 &euro;</span></p>

</li> <li class="clearfix"><img style="width: 179px; height: 151px;" src="phi.jpg" alt="image1" /> <h2>&nbsp;&nbsp;&nbsp; PHILIPS 26PFL3405H</h2>

<p>&nbsp;&nbsp;&nbsp; TV LCD con Retroilluminazione LED 26" - Formato 16:9 Risoluzione: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1366x768 - Contrasto 150.000:1 Luminosit&agrave; 300 cd/mq - Tempo di &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; risposta 6 ms Connessioni Scart

- HDMI - USB - PC Component - Uscita &nbsp;&nbsp;&nbsp; Audio Digitale Coassiale - Slot CI HD Ready TUNER DIGITALE Terrestre &nbsp;&nbsp;&nbsp; INTEGRATO Alta Definizione HD (per la ricezione di canali in chiaro) <br /> <span style="color: #ff0000;">&nbsp;&nbsp;&nbsp; 105,00 &euro;</span></p>

</li> <li class="clearfix last"><img style="width: 159px; height: 145px;" src="smart.jpg" alt="image1" />

<h2>SAMSUNG UE22ES5410 White</h2> <p>TV LCD con Retroilluminazione LED 22" - Formato 16:9 Risoluzione: 1920x1080 - Contrasto 1.000.000:1 Connessioni Scart - HDMI - USB - PC - Slot CI+ Uscita Digitale Ottica - Component - Composit Internet TV -

DLNA - Wi-Fi FULL HD TUNER DIGITALE Terrestre INTEGRATO Alta Definizione HD (per la ricezione di canali in chiaro) Classe efficienza energetica: A <br /> <span style="color: #ff0000;">1497,00 &euro;</span></p>

</li> </ul> </div>

<table style="background-color: #3366ff; width: 193px; height: 199px; text-align: left; margin-left: auto; margin-right: 0px;" border="1" cellspacing="2" cellpadding="2"> <tbody>

<tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul>

<li><a href="prodotti.html"><big>CELLULARI</big></a></li> </ul>

</td> </tr> <tr>

<td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul> <li><a href="prodotti2.html"><big>COMPUTER</big></a></li>

</ul> </td> </tr>

<tr> <td class="auto-style1" style="text-align: center; background-color: #99ff99;"> <ul>

<li><a href="prodotti3.html"><big>TELEVISIONE</big></a></li> </ul> </td>

</tr> </tbody> </table>

</div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

23

[amm.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Area Amministratori</title> <link href="style.css" type="text/css" rel="stylesheet" />

<style type="text/css"> .auto-style1 { color: #209CFA;

} </style> </head>

<body> <div id="header"><img id="logo" src="images/mediaworld.jpg" alt="Logo" /> <ul id="navBar">

<li><a href="home.html">Home</a></li> <li><a href="dovesiamo.html">Dove siamo </a></li>

<li><a href="prodotti.html">I nostri prodotti</a></li> <li class="current"><a href="amm.html">Area amministratori</a></li> <li><a href="contati.html">Contatti</a></li>

</ul> </div> <div>&nbsp;</div>

<div>&nbsp;</div> <div><center><strong>ATTENZIONE</strong><br /> Questo sito &egrave; una simulazione scolastica di Carini Giulia.<br /> Classe 5^I&nbsp;Mercurio. Anno Scolastico 2012-2013<br /> Istituto Tecnico

Economico A. Bassi di Lodi</center></div> <div id="Benvenuti">

24

<h1 class="auto-style1">Area Amministratori</h1>

</div> <div id="wrapper"> <div id="secWrapper"><center><fieldset id="login">

<h4>Accesso Amministratori</h4> <form action="loghi_1.php" method="post"> <p class="clearfix">Username<input type="text" name="user" />&nbsp;</p>

<p class="clearfix"><label for="password">Password</label> <input type="password" name="pass" /></p> <br /><center>

<p class="clearfix check"><input id="submit" type="submit" name="submit" value="" /></p> </center>&nbsp;&nbsp; <p class="clearfix check">&nbsp;&nbsp;</p>

</form></fieldset></center> <div id="container" class="clearfix">

<div id="mainCol" class="clearfix">&nbsp;</div> <div id="secCol">&nbsp;</div> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[contatti.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

25

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contatti utili</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { display: block;

text-align: center; } .auto-style3 {

color: #FF0000; } .auto-style4 {

text-align: center; }

.auto-style5 { color: #0000FF; text-decoration: underline;

font-size: large; } .auto-style6 {

font-size: large; color: #FFFF00; }

.auto-style7 { text-decoration: underline; }

.auto-style10 { font-weight: normal; font-size: medium;

} </style>

</head> <body> <div id="header"><a href="home.html"> <img style="border-style: solid; border-color: inherit; border-

width: 0px; float: left; height: 77px;" src="logo.gif" alt="" width="165" /></a> <ul id="navBar"> <li><a href="home.html">Home</a></li>

<li><a href="dovesiamo.html">Dove siamo </a></li> <li><a href="prodotti.html">I nostri prodotti</a></li> <li><a href="amm.html">Area amministratori</a></li>

<li class="current"><a href="contati.html">Contatti</a></li> </ul> </div>

<div> <div id="Benvenuti"> <h1 class="auto-style3">ATTENZIONE</h1>

<p class="auto-style10">Questo sito &egrave; una simulazione scolastica di Carini Giulia.<br> Classe 5^I Mercurio A.S. 2012-2013<br /> Istituto Tecnico Economico "Agostino Bassi" di Lodi.</p> </div>

</div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <div class="auto-style4"><big><big><span class="auto-style5"><strong>Contatti

utili</strong></span><br class="auto-style6" /> Per contattare direttamente il nostro punto vendita, potete chiamare il numero:</big></big><span style="font-weight: bold;"> <big><big><big><br /> <span class="auto-style7">0371-123456</span></big></big></big></span><big><big><br /> oppure

26

mandate una mail all'indirizzo:</big></big><span style="font-weight: bold;"><br /> <span class="auto-

style7"> <big><big><big>[email protected]</big></big></big></span></span></div> <br /> <div id="mainCol" class="auto-style1">&nbsp;</div>

</div> </div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[checklogin.php] <?php $host="localhost"; // Host name

$username="root"; // Mysql username $password=""; // Mysql password

$db_name="my_giuliac"; // Database name $tbl_name="clienti"; // Table name // Connect to server and select databse.

mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form

$cl_user=$_POST['cl_user']; $cl_passwo=$_POST['cl_passwo']; // To protect MySQL injection (more detail about MySQL injection)

$cl_user = stripslashes($cl_user); $cl_passwo = stripslashes($cl_passwo);

27

$cl_user = mysql_real_escape_string($cl_user);

$cl_passwo = mysql_real_escape_string($cl_passwo); $sql="SELECT * FROM $tbl_name WHERE cl_user='$cl_user' and cl_passwo='$cl_passwo'";

$result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php"

session_register("cl_user"); session_register("cl_passwo"); header("location:paginacliente.php");

} else {

echo "Password e Username sbagliate <br><a href=home.html>torna indietro</a>"; } ?>

[elabora_form.php] <html> <head>

<title>Registrazione in corso..</title> </head> <body>

<center> <font face="arial" color="red"><h2>Registrazione in corso...</h2></font> <font face="arial">

<?php // Inizializzazione delle variabili

$cl_nome=$_POST['cl_nome']; $cl_cognome=$_POST['cl_cognome']; $cl_indiri=$_POST['cl_indiri'];

$cl_comune=$_POST['cl_comune']; $cl_sesso=$_POST['cl_sesso']; $cl_codfis=$_POST['cl_codfis'];

$cl_annas=$_POST['cl_annas']; $cl_user=$_POST['cl_user']; $cl_passwo=$_POST['cl_passwo'];

$cl_email=$_POST['cl_email']; $cl_numtel=$_POST['cl_numtel']; // Connessione al DB MYSQL

$db=mysql_connect("localhost","root"); // Creazione del comando SQL per l'inserimento dei dati $sqlinter = "insert clienti ";

$sqlinter .= "(cl_nome,cl_cognome,cl_indiri,cl_comune,cl_sesso,cl_codfis,cl_annas,cl_user,cl_passwo,cl_email,cl_numtel)

"; $sqlinter .= " values "; $sqlinter .=

"('$cl_nome','$cl_cognome','$cl_indiri','$cl_comune','$cl_sesso','$cl_codfis','$cl_annas','$cl_user','$cl_passwo','$cl_email','$cl_numtel')"; // Invio dei dati alla tabella attori del db sito

mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente $num=mysql_affected_rows();

28

// Controllo che il record sia stato inserito

if ($num>0) echo "<h4>Registrazione avvenuta correttamente!</h4><p>"; else echo "<h4>Nessuna registrazione!</h4><p>"; // Chiusura del database

mysql_close($db); ?> <a href="./home.html">HOME</a>

</font></center> </body> </html>

[indexamm.html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Area Amministratore - Home</title> <link rel="stylesheet" type="text/css" href="style.css" />

</head> <body> <div id="header"><img id="logo" src="images/mediaworld.jpg" alt="Logo" />

<ul id="navBar"> <li><a href="logout.php">Logout</a></li> </ul>

</div> <div id="Benvenuti"> <h1>ATTENZIONE</h1>

<h2>Questo sito &egrave; una simulazione scolastica di Carini Giulia.<br /> Classe 5^I Mercurio. A.S. 2012-2013 Istituto Tecnico Economico 'A. Bassi' di Lodi</h2>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <div id="mainCol" class="clearfix"><br /> <h3 id="why">Benvenuto Amministratore!</h3>

<center> <table style="width: 928px; height: 354px;" border="2" bgcolor="#c0c0c0"> <tbody>

<tr> <td><big> </big><center><strong>1.1 Gestione Operatori</strong></center><center><strong><br /></strong></center><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span

style="font-size: xx-small;"><big><big><a href="cartellaamministratore/operatori/operatori_1.php">1.1.1 inserimento</a></big></big></span><span style="font-size: xx-small;"><big><big><br /></big></big></span><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span

style="font-size: small;"><a href="cartellaamministratore/operatori/operatori_m1.php">1.1.2 modifica</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-

serif;"><span style="font-size: small;"><a href="cartellaamministratore/operatori/operatori_a1.php">1.1.3 cancellazione</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/operatori/operatori_q1.php">1.1.4

interrogazione </a></span></center></center></center> <p>&nbsp;</p> </center></td>

<td><big> </big><center><strong>1.2 Gestione Clienti</strong></center><center><strong><br /></strong></center><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: xx-small;"><big><big><a href="cartellaamministratore/clienti/clienti_1.php">1.2.1

29

inserimento</a></big></big></span><span style="font-size: xx-small;"><big><big><br

/></big></big></span><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/clienti/clienti_m1.php">1.2.2 modifica</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-

serif;"><span style="font-size: small;"><a href="cartellaamministratore/clienti/clienti_a1.php">1.2.3 cancellazione</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/clienti/clienti_q1.php">1.2.4

interrogazione </a></span></center></center></center> <p>&nbsp;</p> </center></td>

<td><center><strong>1.3 Gestione Acquisti</strong></center><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: x-small;"><big><br /> <a href="cartellaamministratore/acquisti/acquisti_m1.php">1.3.1 modifica</a><br /> <a

href="cartellaamministratore/acquisti/acquisti_a1.php">1.3.2 cancellazione</a><br /> <a href="cartellaamministratore/acquisti/acquisti_q1.php">1.3.3 interrogazione</a> </big></span>

<p>&nbsp;</p> </center><big style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"></big></td> <td><center><strong>1.4 Gestione Prodotti</strong></center><big style="font-weight: bold; font-

family: Helvetica,Arial,sans-serif;"><br /> </big><center><big style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><a href="cartellaamministratore/prodotti/prodotti_1.php">1.4.1 inserimento</a><br /> <a href="cartellaamministratore/prodotti/prodotti_m1.php">1.4.2 modifica</a><br

/> <a href="cartellaamministratore/prodotti/prodotti_a1.php">1.4.3 cancellazione</a><br /> <a href="cartellaamministratore/prodotti/prodotti_q1.php">1.4.4 interrogazione </a></big> <p>&nbsp;</p>

</center></td> <td><big> </big><center><strong>1.5 Gestione Carta Fedelt&agrave;</strong></center><center><strong><br /></strong></center><center style="font-

weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/cartafedelta/cartafedelta_m1.php">1.5.1 modifica</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a

href="cartellaamministratore/cartafedelta/cartafedelta_a1.php">1.5.2 cancellazione</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size:

small;"><a href="cartellaamministratore/cartafedelta/cartafedelta_q1.php">1.5.3 interrogazione </a></span></center></center></center> <p>&nbsp;</p>

</center></td> <td><big> </big><center><strong>1.6 Gestione Fornitori</strong></center><center><strong><br /></strong></center><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span

style="font-size: xx-small;"><big><big><a href="cartellaamministratore/fornitori/fornitori_1.php">1.6.1 inserimento</a></big></big></span><span style="font-size: xx-small;"><big><big><br /></big></big></span><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span

style="font-size: small;"><a href="cartellaamministratore/fornitori/fornitori_m1.php">1.6.2 modifica</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/fornitori/fornitori_a1.php">1.6.3

cancellazione</a></span><br /><center style="font-weight: bold; font-family: Helvetica,Arial,sans-serif;"><span style="font-size: small;"><a href="cartellaamministratore/fornitori/fornitori_q1.php">1.6.4 interrogazione </a></span></center></center></center>

<p>&nbsp;</p> </center></td> </tr>

</tbody> </table>

</center></div> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

30

</div>

</body> </html>

[paginacliente.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <? session_start();

if(!session_is_registered(cl_user)){ header("location:paginacliente.php"); }

?> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Home cliente</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 {

color: #209CFA; } .auto-style2 {

text-align: center; font-size: large; font-family: "Comic Sans MS";

} </style> </head>

<body> <div id="header"> <a href="home.html#">

31

<img src="logo.gif" alt="" style="border-style: solid; border-color: inherit; border-width: 0px; float: left;

height: 77px;" width="165" /></a> <ul id="navBar"> <li><a href="logout2.php">Logout</a></li>

</ul> </div> <div>

<h1 class="auto-style1">Benvenuti in Media World</h1> <div id="Benvenuti" class="auto-style2"> <em>In questa pagina potrete acquistare i nostri prodotti, <br />

specificati nella sezione &quot;I NOSTRI PRODOTTI&quot;<br /> nella parte esterna al login .</em></div> </div>

<div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix">&nbsp; <form action="paginacliente2.php" method="POST"> <?php

// Apertura del Database MySQL $db=mysql_connect("localhost","root"); // Costruzione della variabile da eseguire in SQL

$sqlinterr = "select * from prodotto"; /* Apertura del DB proiezioni05 inserito nel DataBase MySQL */

$db_selected = mysql_select_db('my_giuliac', $db); // Esecuzione del comando di interrogazione SQL $res=mysql_query($sqlinterr);

// N. di record estratti dal comando SQL $num=mysql_num_rows($res); //Intestazione della tabella

echo "<center><table border='0' align='center'> <tr>

<td><center><b>Selezione</center></b></td> <td><center><b>Codice prodotto</center></b></td> <td><center><b>Descrizione</center></b></td>

<td><center><b>Marca</center></b></td> <td><center><b>Quantit&agrave;</center></b></td> <td><center><b>Tipo confezione</center></b></td>

<td><center><b>Prezzo</center></b></td> <td><center><b>Codice fornitore</center></b></td> <td><center><b>Codice operatore</center></b></td>

</tr>"; //Visualizzazione dei record estratti for($i=0;$i<$num;$i++) {

$pr_codpro=mysql_result($res,$i,"pr_codpro"); $pr_descri=mysql_result($res,$i,"pr_descri"); $pr_marca=mysql_result($res,$i,"pr_marca");

$pr_quanti=mysql_result($res,$i,"pr_quanti"); $pr_ticonf=mysql_result($res,$i,"pr_ticonf"); $pr_prezzo=mysql_result($res,$i,"pr_prezzo");

$pr_codfor=mysql_result($res,$i,"pr_codfor"); $pr_codope=mysql_result($res,$i,"pr_codope");

// Visualizzazione della riga con radio echo "<tr> <td><center><input type='radio' name='selezi' value='$pr_codpro'></center></td>

<td><center>$pr_codpro</center></td> <td><center>$pr_descri</center></td> <td><center>$pr_marca</center></td>

32

<td><center>$pr_quanti</center></td>

<td><center>$pr_ticonf</center></td> <td><center>$pr_prezzo</center></td> <td><center>$pr_codfor</center></td>

<td><center>$pr_codope</center></td> </tr>"; }

//Chiusura della tabella echo "</table></center>"; echo "<p><center><input type='submit' value='Acquista'></center>";

// Chiusura del DataBase MySQL mysql_close($db); ?></form>

<br /> </div>

</div> </body> </html>

[paginacliente2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Mediaworld</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

33

.auto-style1 {

text-align: left; color: #FF0000; }

.auto-style2 { text-align: left; }

.auto-style3 { font-size: medium; }

</style> </head> <body style="margin-bottom: 0">

<div id="header"> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="72" style="left: 12px; top: 2px" width="150" /></a> <ul id="navBar">

<li><a href="paginacliente.php">Home</a></li> </ul> </div>

<div id="welcomeMessage"> <h1 class="auto-style1" style="width: 484px">Inserisci la quantit&agrave; che vuoi acquistare</h1> <div class="auto-style2" style="width: 505px">

<br /> <br /> <strong><span class="auto-style3">&nbsp;&nbsp;&nbsp; PS: Controlla la

disponibilit&agrave; in magazzino <br /> &nbsp;&nbsp;&nbsp; prima di acquistare un prodotto </span></strong></div> </div>

<br /> <br />

<br /> <br /> <br /><p>

<?php // Definizione delle variabili $selezi=$_POST['selezi'];

if ($selezi) { // Connessione al DB MySQL $db=mysql_connect("localhost","root");

/* Costruzione della variabile $sqlinterr per la visualizzazione dei record */ $sqlinterr = "select * from prodotto ";

$sqlinterr.= "where pr_codpro='$selezi'"; // Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr);

//$num=mysql_num_rows($res); // Lettura del contenuto del record trovato $pr_codpro_old=mysql_result($res,0,"pr_codpro");

$pr_descri_old=mysql_result($res,0,"pr_descri"); $pr_marca_old=mysql_result($res,0,"pr_marca");

$pr_quanti_old=mysql_result($res,0,"pr_quanti"); $pr_prezzo_old=mysql_result($res,0,"pr_prezzo"); // Creazione della mappa a video per la modifica

echo "<center><form action='paginacliente3.php' method='POST'>"; echo "<table border='1'> <tr>

34

<td><font color=white>Codice prodotto</font></td>

<td><font color=white>Descrizione</font></td> <td><font color=white>Marca</font></td> <td><font color=white>Prezzo</font></td>

<td><font color=white>Quantit&agrave; da acquistare</font></td> <td><font color=white>Quantit&agrave; residua</font></td> <td><font color=white>Codice fiscale</font></td>

</tr> <tr> <td><font color=white>$pr_codpro_old</font></td>

<td><font color=white>$pr_descri_old</font></td> <td><font color=white>$pr_marca_old</font></td> <td><font color=white>$pr_prezzo_old</font></td>

<td><br><center><input name='ac_quaacq_new' value='1' maxlenght='4'></center></td> <td><font color=white>$pr_quanti_old</font></td>

<td><br><center><input name='ac_codfis' value='' maxlenght='16'></center></td> </tr> </table>

<input type='hidden' name='ac_codacq' value='$selezi'> <input type='hidden' name='ac_quaacq' value='$pr_quanti_old'> <input type='hidden' name='pr_nom' value='$pr_descri_old'>

<input type='hidden' name='pr_pre' value='$pr_prezzo_old'> <input type='submit' value=' Acquista '> <input type='reset' value='Cancella'>

</font></center>"; // Chiusura del DB MySQL mysql_close($db);

} else echo "ERRORE!!! Selezionare un utente..."; ?> <br />

<p>&nbsp;</p> <p>&nbsp;</p>

</body> </html>

35

[paginacliente3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Mediaworld</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

font-family: "Cooper Black"; color: #800080;

text-align: center; } .auto-style2 {

font-family: "Cooper Black"; color: #800080; text-align: center;

text-decoration: underline; } </style>

</head> <body> <div id="header">

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="72" style="left: 12px; top: 2px" width="150" /></a>

</div> <div id="welcomeMessage"> <h1 class="auto-style1" style="width: 510px"><strong>Grazie per l&#39;acquisto</strong></h1>

<p class="auto-style2" style="width: 510px"><em>Saremo ancora a vostra disposizione se ne avrete bisogno </em></p>

<p class="auto-style2" style="width: 510px"><em>basta contattarci all'email:</em></p> <p class="auto-style2" style="width: 510px"><em>[email protected]</em></p> <br /><?php

// Inizializzazione delle variabili $ac_quaacq_new=$_POST['ac_quaacq_new']; $ac_quaacq=$_POST['ac_quaacq'];

$ac_codacq=$_POST['ac_codacq']; $pr_nom=$_POST['pr_nom']; $pr_pre=$_POST['pr_pre'];

$ac_prezzo=$_POST['ac_prezzo']; $ac_codfis=$_POST['ac_codfis']; // Connessione al DB MySQL

$db=mysql_connect("localhost","root",""); /* Costruzione della variabile $sqlinterr per la modifica del record selezionato */

$ris=$ac_quaacq-$ac_quaacq_new; $sqlinterr =" UPDATE prodotto set pr_quanti='$ris' ";

$sqlinterr.= "where pr_codpro='$ac_codacq'"; // Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac",$sqlinterr);

// N. di record soggetti alla modifica $num = mysql_affected_rows(); $today=date("y/m/d");

$ora=date("H:i:s"); // Se il record è stato trovato viene modificato.

36

if ($num>0) echo "<font face='comics sans MS' color=green size=3>Acquisto effettuato <a

href='paginacliente4.php'> clicca qui</a> per inviare l'email di conferma</font><br>"; else echo"acquisto non effettuato<br>"; //moltiplica

$ac_costot=$ac_quaacq_new*$pr_pre; $ac_punspe=$ac_costot/2; $sqlinterrr = "select co_totpun, co_codcar from carta_fedelta where co_codfis='$ac_codfis'";

// Esecuzione del comando $sqlinterrr $res=mysql_db_query("my_giuliac",$sqlinterrr); // N. di record soggetti alla modifica

$num = mysql_num_rows($res); $co_totpun_old=mysql_result($res,0,"co_totpun"); $co_codcar_old=mysql_result($res,0,"co_codcar");

$puntot=$co_totpun_old+$ac_punspe; // Creazione del comando SQL per l'inserimento dei dati

$sqlinter = "insert acquisti"; $sqlinter .= " (ac_codfis, ac_codpro, ac_descri, ac_prezzo, ac_costot, ac_datacq, ac_oraacq, ac_codcar, ac_punspe, ac_quaacq_new)";

$sqlinter .= " values "; $sqlinter .= "('$ac_codfis', '$ac_codacq', '$pr_nom', '$pr_pre', '$ac_costot', '$today', '$ora', '$co_codcar_old', ‘$ac_punspe', '$ac_quaacq_new')";

// Invio dei dati alla tabella del db sito mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente

$num=mysql_affected_rows(); // Controllo che il record sia stato inserito if ($num>0) echo "Registrazione dell'acquisto avvenuta correttamente.<p>";

else echo "ERRORE!!! Record non inserito<p>"; $sqlinterre =" UPDATE carta_fedelta set co_totpun='$puntot'"; $sqlinterre .= "where co_codcar='$co_codcar_old'";

// Invio dei dati alla tabella del db sito mysql_db_query("my_giuliac", $sqlinterre);

// Verifica che i dati siano stati inseriti correttamente $num=mysql_affected_rows(); echo "Con l'imminente acquisto hai ottenuto '$ac_punspe' punti; Il tuo saldo punti &egrave; di '$puntot'. ";

mysql_close($db); ?> <br />

</div> <br /> <br />

</body> </html>

37

[paginacliente4.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Mediaworld</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { font-family: "Cooper Black"; color: #800080;

text-align: center; }

.auto-style2 { font-family: "Cooper Black"; color: #800080;

text-align: center; text-decoration: underline; }

</style> </head> <body>

<div id="header"> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="72" style="left: 12px; top:

2px" width="150" /></a> </div> <p><br>

<div><center><font face="comic sans MS" size="9" color="red">Invia l'email di conferma acquisto </font></center></div>

38

<p><div><form action="paginacliente5.php" method=POST>

<center><table class="web-form" border="0"> <tbody> <tr>

<td><font color=black size=3>Email</font><br><input name="email" type="text" ></td> <td></td> <td rowspan=2><font color=black size=3>Messaggio</font><br><textarea name="testo" cols="30"

rows="5"></textarea></td> </tr> <tr>

<td><font color=black size=3>Nome e cognome</font><br><input name="mit"></td> <td></td> </tr>

<tr> <td colspan=3 ><center><input value="Invia" type="submit"></center></td>

</tr> </tbody></table></center></div> </form>

<br /> </div><o> <div><center><a href=informazioni1.html target="X"><img src=images/in.jpg height=40 width=40></a>

<font color=white size=3> <br>Esempio email</font></center></div> <P>&nbsp;</P> </BODY>

</HTML>

[paginacliente5.php] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Mediaworld</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { font-family: "Cooper Black";

color: #800080; text-align: center; }

.auto-style2 { font-family: "Cooper Black"; color: #800080;

text-align: center; text-decoration: underline; }

</style> </head> <body>

<div id="header"> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="72" style="left: 12px; top:

2px" width="150" /></a> <ul id="navBar"> <li><a href="paginacliente.php">Home</a></li>

</ul> </div>

<p><br>

39

<div></div>

<?PHP //inizializzazione delle variabili $mail=$_POST['mail'];

$testo=$_POST['testo']; $mit=$_POST['mit']; // Specifica la tua mail e quella del destinatario

$mail_mittente ="$mail"; $mail_destinatario = "[email protected]"; // Specifica l'oggetto ed il corpo della mail

$mail_oggetto = "Messaggio di conferma ordine"; $mail_corpo = "Buongiorno sono $mit; $testo"; // Invia la mail e lancia un messaggio di conferma

if (mail($mail_destinatario, $mail_oggetto, $mail_corpo, "From: $mail_mittente")) {

echo "<font face='comic sans MS' size='5'>Messaggio inviato con successo a $mail_destinatario</font>"; } // oppure un messaggio di errore in caso di fallimento

else { echo "Errore. Nessun messaggio inviato.";

} ?> </body>

</html>

[acquisti_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Annullamento acquisti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: center;

margin-left: 25.2em; } .auto-style3 {

margin-left: 139; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div>

40

<div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">CANCELLAZIONE DEGLI ACQUISTI</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <font face="comic sans MS" size="2"><center>

<h2><b>Selezionare il record da cancellare:</b></h2><p> <form action="acquisti_a2.php" method="POST"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from acquisti"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1' align='center'> <tr>

<td>Selezione</td> <td>Codice acquisti</td> <td>Codice fiscale</td>

<td>Codice prodotto</td> <td>Descrizione</td> <td>Prezzo</td>

<td>Costo totale</td> <td>Data acquisto</td>

<td>Ora acquisto</td> <td>Codice carta</td> <td>Punti spesa</td>

<td>Quantit&agrave;</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $ac_codacq=mysql_result($res,$i,"ac_codacq"); $ac_codfis=mysql_result($res,$i,"ac_codfis");

$ac_codpro=mysql_result($res,$i,"ac_codpro"); $ac_descri=mysql_result($res,$i,"ac_descri"); $ac_prezzo=mysql_result($res,$i,"ac_prezzo");

$ac_costot=mysql_result($res,$i,"ac_costot"); $ac_datacq=mysql_result($res,$i,"ac_datacq"); $ac_oraacq=mysql_result($res,$i,"ac_oraacq");

$ac_codcar=mysql_result($res,$i,"ac_codcar"); $ac_punspe=mysql_result($res,$i,"ac_punspe"); $ac_quaacq_new=mysql_result($res,$i,"ac_quaacq_new");

// Visualizzazione della riga con radio echo "<tr>

<td><input type='radio' name='selezi' value='$ac_codacq'></td>"; echo " <td>$ac_codacq</td> <td>$ac_codfis</td>

<td>$ac_codpro</td> <td>$ac_descri</td> <td>$ac_prezzo</td>

41

<td>$ac_costot</td>

<td>$ac_datacq</td> <td>$ac_oraacq</td> <td>$ac_codcar</td>

<td>$ac_punspe</td> <td>$ac_quaacq_new</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <input type="submit" value="Cancellare il record">

</form> </center> </font> </div>

</div> </body> </html>

[acquisti_a2.php]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Anullamento acquisti</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: center; margin-left: 25.2em; }

.auto-style3 { margin-left: 139; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> <li><a href="acquisti_a1.php">Pagina precedente</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CANCELLAZIONE DEGLI ACQUISTI</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

42

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <center>

<font face="arial" color="red"><h2>RISULTATO</h2></font> <font face="comic sans MS"> <?php

// Inizializzazione delle variabili $selezi=$_POST['selezi']; // Controllo che l'utente abbia selezionato il record da cancellare

if ($selezi) { // Connessione al database MySQL

$db=mysql_connect("localhost", "root"); // Creazione del comando sql di cancellazione $sqlinterr="delete from acquisti where";

$sqlinterr .=" ac_codacq='$selezi'"; // Invio del comando SQL $res=mysql_db_query("my_giuliac", $sqlinterr);

// Risultato della cancellazione $num=mysql_affected_rows(); if ($num>0)echo "Record cancellato<p>";

else echo "Record non cancellato<p>"; // Chiusura database mysql_close($db);

} else echo "Non &egrave; stato selezionato nessun record<p>"; ?>

</font></center> </div>

</div> </body> </html>

[acquisti_m1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica acquisti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: center; margin-left: 25.2em; }

.auto-style3 { margin-left: 139; }

43

</style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">MODIFICA DEGLI ACQUISTI</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <font face="comic sans MS" size="2"><center> <h2><b>Selezionare il record da modificare:</b></h2><p>

<form action="acquisti_m2.php" method="POST"> <?php // Connessione al database MySQL

$db=mysql_connect("localhost","root",""); // Creazione della variabile per l'interrogazione $sqlinterr ="select * from acquisti";

// Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione

$num=mysql_num_rows($res); // Intestazione della tabella

echo "<table border='1' align='center'> <tr> <td>Selezione</td>

<td>Codice acquisti</td> <td>Codice fiscale</td> <td>Codice prodotto</td>

<td>Descrizione</td> <td>Prezzo</td> <td>Costo totale</td>

<td>Data acquisto</td> <td>Ora acquisto</td> <td>Codice carta</td>

<td>Punti spesa</td> <td>Quantit&agrave;</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) { $ac_codacq=mysql_result($res,$i,"ac_codacq");

$ac_codfis=mysql_result($res,$i,"ac_codfis"); $ac_codpro=mysql_result($res,$i,"ac_codpro");

$ac_descri=mysql_result($res,$i,"ac_descri"); $ac_prezzo=mysql_result($res,$i,"ac_prezzo"); $ac_costot=mysql_result($res,$i,"ac_costot");

$ac_datacq=mysql_result($res,$i,"ac_datacq"); $ac_oraacq=mysql_result($res,$i,"ac_oraacq"); $ac_codcar=mysql_result($res,$i,"ac_codcar");

44

$ac_punspe=mysql_result($res,$i,"ac_punspe");

$ac_quaacq_new=mysql_result($res,$i,"ac_quaacq_new"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$ac_codacq'></td>"; echo " <td>$ac_codacq</td>

<td>$ac_codfis</td> <td>$ac_codpro</td> <td>$ac_descri</td>

<td>$ac_prezzo</td> <td>$ac_costot</td> <td>$ac_datacq</td>

<td>$ac_oraacq</td> <td>$ac_codcar</td>

<td>$ac_punspe</td> <td>$ac_quaacq_new</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <center><input type='submit' value='Record da modificare'></center> </form> </center>

</font> </div> </div>

</body> </html>

[acquisti_m2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica acquisti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 {

text-align: center; margin-left: 25.2em; }

.auto-style3 { margin-left: 139; }

</style> </head> <body>

45

<div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="acquisti_m1.php">Pagina precedente</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">MODIFICA DEGLI ACQUISTI</font></h1>

<CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER>

</div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <center>

<font face="arial" color="red"><h2>RISULTATO</h2></font> <font face="arial"> <?php

// Definizione delle variabili $selezi=$_POST['selezi']; if ($selezi) {

// Connessione al DB MySQL $db=mysql_connect("localhost","root"); /* Costruzione della variabile $sqlinterr per

la visualizzazione dei record */ $sqlinterr = "select * from acquisti"; $sqlinterr.= " where acquisti.ac_codacq='$selezi'";

// Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr);

//$num=mysql_num_rows($res); // Lettura del contenuto del record trovato $ac_codacq_old=mysql_result($res,0,"ac_codacq");

$ac_codfis_old=mysql_result($res,0,"ac_codfis"); $ac_codpro_old=mysql_result($res,0,"ac_codpro"); $ac_descri_old=mysql_result($res,0,"ac_descri");

$ac_prezzo_old=mysql_result($res,0,"ac_prezzo"); $ac_costot_old=mysql_result($res,0,"ac_costot"); $ac_datacq_old=mysql_result($res,0,"ac_datacq");

$ac_codcar_old=mysql_result($res,0,"ac_codcar"); $ac_punspe_old=mysql_result($res,0,"ac_punspe"); $ac_quaacq_new_old=mysql_result($res,0,"ac_quaacq_new");

// Creazione della mappa a video per la modifica echo "<h3><center>Gestione acquisti: modifica</center></h3><p>"; echo "<form action='acquisti_m3.php' method='POST'>";

echo " Codice acquisto<br><input name='ac_codacq_new' value='$ac_codacq_old'><p>"; echo " Codice fiscale cliente<br><input name='ac_codfis_new' value='$ac_codfis_old'><p>"; echo " Codice prodotto<br><input name='ac_codpro_new' value='$ac_codpro_old'><p>";

echo " Descrizione<br><input name='ac_descri_new' value='$ac_descri_old'><p>"; echo " Prezzo<br><input name='ac_prezzo_new' value='$ac_prezzo_old'><p>";

echo " Costo totale<br><input name='ac_costot_new' value='$ac_costot_old'><p>"; echo " Data acquisto<br><input name='ac_datacq_new' value='$ac_datacq_old'><p>"; echo " Ora acquisto<br><input name='ac_oraacq_new' value='$ac_oraacq_old'><p>";

echo " Codice carta<br><input name='ac_codcar_new' value='$ac_codcar_old'><p>"; echo " Punti spesa<br><input name='ac_punspe_new' value='$ac_punspe_old'><p>"; echo " Quantit&agrave;<br><input name='quaacq_new_new' value='$quaacq_new_old'><p>";

46

echo "<input type='hidden' name='ac_codacquisti' value='$selezi'>";

echo "<input type='submit' value='Modifica'> "; echo "<input type='reset' value='Cancella'>"; echo "</form>";

// Chiusura del DB MySQL mysql_close($db); } else echo "ERRORE!!! Nessuna selezione effettuata...<p>";

?> <font></center> </div> </div>

</body> </html>

[modifica_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica acquista</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: center;

margin-left: 25.2em; }

.auto-style3 { margin-left: 139; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="acquisti_m1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">MODIFICA DEGLI ACQUISTI</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<center> <font face="arial" color="red"><h2>RISULTATO</h2></font> <font face="arial">

47

<?php

// Inizializzazione delle variabili $ac_codacq_new=$_POST['ac_codacq_new']; $ac_codfis_new=$_POST['ac_codfis_new'];

$ac_codpro_new=$_POST['ac_codpro_new']; $ac_descri_new=$_POST['ac_descri_new']; $ac_prezzo_new=$_POST['ac_prezzo_new'];

$ac_costot_new=$_POST['ac_costot_new']; $ac_datacq_new=$_POST['ac_datacq_new']; $ac_oraacq_new=$_POST['ac_oraacq_new'];

$ac_codcar_new=$_POST['ac_codcar_new']; $ac_punspe_new=$_POST['ac_punspe_new']; $ac_quaacq_new_new=$_POST['ac_quaacq_new_new'];

$ac_codacquisti=$_POST['ac_codacquisti']; // Connessione al DB MySQL

$db=mysql_connect("localhost","root"); /* Costruzione della variabile $sqlinterr per la modifica del record selezionato */

$sqlinterr ="update acquisti set "; $sqlinterr.="ac_codacq='$ac_codacq_new', "; $sqlinterr.="ac_codfis='$ac_codfis_new', ";

$sqlinterr.="ac_codpro='$ac_codpro_new', "; $sqlinterr.="ac_descri='$ac_descri_new', "; $sqlinterr.="ac_prezzo='$ac_prezzo_new', ";

$sqlinterr.="ac_costot='$ac_costot_new', "; $sqlinterr.="ac_datacq='$ac_datacq_new', "; $sqlinterr.="ac_oraacq='$ac_oraacq_new', ";

$sqlinterr.="ac_codcar='$ac_codcar_new', "; $sqlinterr.="ac_punspe='$ac_punspe_new', "; $sqlinterr.="ac_quaacq_new='$ac_quaacq_new_new' ";

$sqlinterr.="where ac_codacq='$ac_codacquisti'"; // Esecuzione del comando $sqlinterr

mysql_db_query("my_giuliac", $sqlinterr); // N. di record soggetti alla modifica $num = mysql_affected_rows();

// Se il record è stato trovato viene modificato. if ($num>0) echo "Record modificato.<p>"; else echo "ERRORE!!! Record non modificato.<p>";

// Chiusura del DB MySQL mysql_close($db); ?>

</font></center> </div> </div> </body>

</html>

[acquisti_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Consultazione acquisti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

48

.auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: center; margin-left: 25.2em;

} .auto-style3 { margin-left: 139;

} </style> </head>

<body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CONSULTAZIONE DEGLI ACQUISTI</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<font face="comic sans MS" size="2"><center> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root",""); // Creazione della variabile per l'interrogazione

$sqlinterr ="select * from acquisti"; // Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr);

// Numero di record estratti dall'interrogazione $num=mysql_num_rows($res); // Intestazione della tabella

echo "<table border='1' align='center'> <tr> <td>Codice acquisti</td>

<td>Codice fiscale cliente</td> <td>Codice prodotto</td> <td>Descrizione</td>

<td>Prezzo</td> <td>Costo totale</td> <td>Data acquisto</td>

<td>Ora acquisto</td> <td>Codice carta</td>

<td>Punti spesa</td> <td>Quantit&agrave;</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) { $ac_codacq=mysql_result($res,$i,"ac_codacq");

49

$ac_codfis=mysql_result($res,$i,"ac_codfis");

$ac_codpro=mysql_result($res,$i,"ac_codpro"); $ac_descri=mysql_result($res,$i,"ac_descri"); $ac_prezzo=mysql_result($res,$i,"ac_prezzo");

$ac_costot=mysql_result($res,$i,"ac_costot"); $ac_datacq=mysql_result($res,$i,"ac_datacq"); $ac_oraacq=mysql_result($res,$i,"ac_oraacq");

$ac_codcar=mysql_result($res,$i,"ac_codcar"); $ac_punspe=mysql_result($res,$i,"ac_punspe"); $ac_quaacq_new=mysql_result($res,$i,"ac_quaacq_new");

// Visualizzazione della riga con radio echo " <tr><td>$ac_codacq</td> <td>$ac_codfis</td>

<td>$ac_codpro</td> <td>$ac_descri</td>

<td>$ac_prezzo</td> <td>$ac_costot</td> <td>$ac_datacq</td>

<td>$ac_oraacq</td> <td>$ac_codcar</td> <td>$ac_punspe</td>

<td>$ac_quaacq_new</td> </tr>"; }

// Chiusura della tabella echo "</table>"; // Chiusura del database

mysql_close($db); ?> <p>

</center> </font>

</div> </div> </body>

</html>

[cartafedelta_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Annullamento carta fedelt&agrave;</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: center; margin-left: 25.2em;

} .auto-style3 { margin-left: 139;

50

}

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CANCELLAZIONE DELLA CARTA

FEDELT&Agrave;</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<font face="comic sans MS" size="2"><center> <h2><b>Selezionare il record da cancellare:</b></h2><p> <form action="cartafedelta_a2.php" method="POST">

<?php // Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from carta_fedelta"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione

$num=mysql_num_rows($res); // Intestazione della tabella echo "<table border='1' align='center'>

<tr> <td>Selezione</td> <td>Codice carta</td>

<td>Totale punti</td> <td>Codice fiscale cliente</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) { $co_codcar=mysql_result($res,$i,"co_codcar");

$co_totpun=mysql_result($res,$i,"co_totpun"); $co_codfis=mysql_result($res,$i,"co_codfis"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$co_codcar'></td>"; echo " <td>$co_codcar</td>

<td>$co_totpun</td> <td>$co_codfis</td>

</tr>"; } // Chiusura della tabella

echo "</table>"; // Chiusura del database mysql_close($db);

51

?>

<p> <input type="submit" value="Cancellare il record"> </form> </center>

</font> </div> </div>

</body> </html>

[cartafedelta_a2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Anullamento carta fedelt&agrave;</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 {

text-align: center; margin-left: 25.2em; }

.auto-style3 { margin-left: 139; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="cartafedelta_a1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CANCELLAZIONE DELLA CARTA FEDELT&Agrave;</font></h1>

<CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167" /></p></CENTER>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <center> <font face="arial" color="red"><h2>RISULTATO</h2></font>

<font face="comic sans MS"> <?php // Inizializzazione delle variabili

52

$selezi=$_POST['selezi'];

// Controllo che l'utente abbia selezionato il record da cancellare if ($selezi) { // Connessione al database MySQL

$db=mysql_connect("localhost", "root"); // Creazione del comando sql di cancellazione $sqlinterr="delete from carta_fedelta where";

$sqlinterr .=" co_codcar='$selezi'"; // Invio del comando SQL $res=mysql_db_query("my_giuliac", $sqlinterr);

// Risultato della cancellazione $num=mysql_affected_rows(); if ($num>0)echo "Record cancellato<p>";

else echo "Record non cancellato<p>"; // Chiusura database

mysql_close($db); } else echo "Non &egrave; stato selezionato nessun record<p>";

?> </font></center> </div>

</div> </body> </html>

[cartafedelta_m1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica carta fedelt&agrave;</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: center; margin-left: 25.2em;

} .auto-style3 { margin-left: 139;

} </style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

53

<h1 class="auto-style1"><font color="Green">CANCELLAZIONE DELLA CARTA

FEDELT&Agrave;</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <font face="comic sans MS" size="2"><center>

<h2><b>Selezionare il record da modificare:</b></h2><p> <form action="cartafedelta_m2.php" method="POST"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from carta_fedelta"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1' align='center'> <tr>

<td>Selezione</td> <td>Codice carta</td> <td>Totale punti</td>

<td>Codice fiscale cliente</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $co_codcar=mysql_result($res,$i,"co_codcar");

$co_totpun=mysql_result($res,$i,"co_totpun"); $co_codfis=mysql_result($res,$i,"co_codfis"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$co_codcar'></td>"; echo " <td>$co_codcar</td>

<td>$co_totpun</td> <td>$co_codcli</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <input type="submit" value="Modifica il record"> </form> </center>

</font> </div>

</div> </body> </html>

54

[cartafedelta_m2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica carta fedelt&agrave;</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: center;

margin-left: 25.2em; } .auto-style3 {

margin-left: 139; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="cartafedelta_m1.php">Pagina precedente</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">MODIFICA DELLA CARTA FEDELT&Agrave;</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <center>

<font face="arial" color="red"><h2>RISULTATO</h2></font> <font face="arial"> <?php

// Definizione delle variabili $selezi=$_POST['selezi']; if ($selezi) {

// Connessione al DB MySQL $db=mysql_connect("localhost","root");

/* Costruzione della variabile $sqlinterr per la visualizzazione dei record */ $sqlinterr = "select * from carta_fedelta";

$sqlinterr.= " where carta_fedelta.co_codcar='$selezi'"; // Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr);

//$num=mysql_num_rows($res); // Lettura del contenuto del record trovato $co_codcar_old=mysql_result($res,0,"co_codcar");

55

$co_totpun_old=mysql_result($res,0,"co_totpun");

$co_codfis_old=mysql_result($res,0,"co_codfis"); // Creazione della mappa a video per la modifica echo "<h3><center>Gestione carta fedelt&agrave;: modifica</center></h3><p>";

echo "<form action='cartafedelta_m3.php' method='POST'>"; echo " Codice carta<br><input name='co_codcar_new' value='$co_codcar_old'><p>"; echo " Totale punti<br><input name='co_totpun_new' value='$co_totpun_old'><p>";

echo " Codice fiscale cliente<br><input name='co_codfis_new' value='$co_codfis_old'><p>"; echo "<input type='hidden' name='co_codcartafed' value='$selezi'>"; echo "<input type='submit' value='Modifica'> ";

echo "<input type='reset' value='Cancella'>"; echo "</form>"; // Chiusura del DB MySQL

mysql_close($db); } else echo "ERRORE!!! Nessuna selezione effettuata...<p>";

?> </font></center> </div> </div>

</body> </html>

[cartafedelta_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica carta fedelt&agrave;</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: center;

margin-left: 25.2em; } .auto-style3 {

margin-left: 139; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="cartafedelta_m1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">MODIFICA DELLA CARTA FEDEL&Agrave;</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px">

56

<img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <center>

<font face="arial" color="red"><h2>RISULTATO</h2></font> <font face="arial"> <?php

// Inizializzazione delle variabili $co_codcar_new=$_POST['co_codcar_new']; $co_totpun_new=$_POST['co_totpun_new'];

$co_codfis_new=$_POST['co_codfis_new']; $co_codcartafed=$_POST['co_codcartafed'];

// Connessione al DB MySQL $db=mysql_connect("localhost","root"); /* Costruzione della variabile $sqlinterr per

la modifica del record selezionato */ $sqlinterr ="update carta_fedelta set "; $sqlinterr.="co_codcar='$co_codcar_new', ";

$sqlinterr.="co_totpun='$co_totpun_new', "; $sqlinterr.="co_codfis='$co_codfis_new' "; $sqlinterr.="where co_codcar='$co_codcartafed'";

// Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac", $sqlinterr); // N. di record soggetti alla modifica

$num = mysql_affected_rows(); // Se il record è stato trovato viene modificato. if ($num>0) echo "Record modificato.<p>";

else echo "ERRORE!!! Record non modificato.<p>"; // Chiusura del DB MySQL

mysql_close($db); ?> </font></center> </div>

</div> </body> </html>

[cartafedelta_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Consultazione carta fedelt&agrave;</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: center; margin-left: 25.2em; }

57

.auto-style3 {

margin-left: 139; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CONSULTAZIONE DELLA CARTA

FEDELT&Agrave;</font></h1> <CENTER><p class="auto-style2" style="height: 127px; width: 170px"> <img class="auto-style3" height="125" src="images/soldi.jpg" style="float: left" width="167"

/></p></CENTER> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <font face="comic sans MS" size="2"><center>

<?php // Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from carta_fedelta"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione

$num=mysql_num_rows($res); // Intestazione della tabella echo "<table border='1' align='center'>

<tr> <td>Codice carta</td> <td>Totale punti</td>

<td>Codice fiscale cliente</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $co_codcar=mysql_result($res,$i,"co_codcar"); $co_totpun=mysql_result($res,$i,"co_totpun");

$co_codfis=mysql_result($res,$i,"co_codfis"); // Visualizzazione della riga con radio echo "<tr>";

echo " <td>$co_codcar</td> <td>$co_totpun</td> <td>$co_codfis</td>

</tr>"; }

// Chiusura della tabella echo "</table>"; // Chiusura del database

mysql_close($db); ?> <p>

58

</center>

</font> </div> </div>

</body> </html>

[clienti_1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Clienti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">INSERIMENTO DEI CLIENTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<?php echo"<font color='red' face='comic sans MS'>";

echo "<h2>Inserire i dati dell'utente e inviare il form</h2>"; echo "<form action='clienti_2.php' method='POST'>"; echo "Nome cliente<br> <input name='cl_nome' size='30' maxlength='30'><p>";

echo "Cognome cliente<br> <input name='cl_cognome' size='30' maxlength='30'><p>"; echo "Indirizzo<br><input name='cl_indiri' size='30' maxlength='200'><p>"; echo "Comune<br><input name='cl_comune' size='30' maxlength='30'><p>";

echo "Sesso<br><input name='cl_sesso' size='1' maxlength='1'><p>"; echo "Codice fiscale<br><input name='cl_codfis' size='16' maxlength='16'><p>"; echo "E-mail cliente<br> <input name='cl_email' size='30' maxlength='100'><p>";

59

echo "Username<br> <input name='cl_user' size='30' maxlength='12'><p>";

echo "Password<br> <input name='cl_passwo' size='30' maxlength='12'><p>"; echo "Anno di nascita<br><input name='cl_annas' size='4' maxlength='4'><p>"; echo "Numero di telefono<br><input name='cl_numtel' size='10' maxlength='10'><p>";

echo "<input type='submit' value='Invia'>"; echo "<input type='reset' value='Cancella'>"; echo"</font>";

echo "</form>"; ?> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[clienti_2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Clienti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="clienti_1.php">Pagina precedente</a></li>

</ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

60

<div id="container" class="clearfix">

<?php // Inizializzazione delle variabili $cl_nome=$_POST['cl_nome'];

$cl_cognome=$_POST['cl_cognome']; $cl_indiri=$_POST['cl_indiri']; $cl_comune=$_POST['cl_comune'];

$cl_sesso=$_POST['cl_sesso']; $cl_codfis=$_POST['cl_codfis']; $cl_email=$_POST['cl_email'];

$cl_user=$_POST['cl_user']; $cl_passwo=$_POST['cl_passwo']; $cl_annas=$_POST['cl_annas'];

$cl_numtel=$_POST['cl_numtel']; // Connessione al DB MYSQL

$db=mysql_connect("localhost","root",""); // Creazione del comando SQL per l'inserimento dei dati $sqlinter = "insert clienti ";

$sqlinter .= "(cl_nome, cl_cognome, cl_indiri, cl_comune, cl_sesso, cl_codfis, cl_email, cl_user, cl_passwo, cl_annas, cl_numtel)"; $sqlinter .= " values ";

$sqlinter .= "('$cl_nome', '$cl_cognome', '$cl_indiri', '$cl_comune', '$cl_sesso', '$cl_codfis', '$cl_email', '$cl_user', '$cl_passwo', '$cl_annas', '$cl_numtel')"; // Invio dei dati alla tabella attori del db sito

mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente $num=mysql_affected_rows();

// Controllo che il record sia stato inserito if ($num>0) echo "Nuovo record inserito correttamente.<p> Per tornare indietro cliccare su pagina precedente";

else echo "ERRORE!!! Record non inserito<p>"; // Chiusura del database

mysql_close($db); ?> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[clienti_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Clienti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

61

.auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { font-family: "Comic Sans MS"; font-size: medium;

color: #FF0000; } </style>

</head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CANCELLAZIONE CLIENTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<h2 class="auto-style4">Selezionare il record da cancellare</h2><p> <center><form action="clienti_a2.php" method="POST">

<?php // Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from clienti"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1'align='center'> <tr>

<td>Selezione</td> <td>Nome</td> <td>Cognome</td>

<td>Indirizzo</td> <td>Comune</td> <td>Sesso</td>

<td>Codice fiscale</td> <td>Email</td>

<td>Username</td> <td>Password</td> <td>Anno di nascita</td>

<td>Numero di telefono</td> </tr>"; // Visualizzazione dei record estratti

62

for ($i=0; $i<$num; $i++) {

$cl_nome=mysql_result($res,$i,"cl_nome"); $cl_cognome=mysql_result($res,$i,"cl_cognome"); $cl_indiri=mysql_result($res,$i,"cl_indiri");

$cl_comune=mysql_result($res,$i,"cl_comune"); $cl_sesso=mysql_result($res,$i,"cl_sesso"); $cl_codfis=mysql_result($res,$i,"cl_codfis");

$cl_email=mysql_result($res,$i,"cl_email"); $cl_user=mysql_result($res,$i,"cl_user"); $cl_passwo=mysql_result($res,$i,"cl_passwo");

$cl_annas=mysql_result($res,$i,"cl_annas"); $cl_numtel=mysql_result($res,$i,"cl_numtel"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$cl_codfis'></td>";

echo " <td>$cl_nome</td> <td>$cl_cognome</td> <td>$cl_indiri</td>

<td>$cl_comune</td> <td>$cl_sesso</td> <td>$cl_codfis</td>

<td>$cl_email</td> <td>$cl_user</td> <td>$cl_passwo</td>

<td>$cl_annas</td> <td>$cl_numtel</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db);

?> <p> <input type="submit" value="Cancellare il record"><p>

</form> </center> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[clienti_a2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Clienti</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

63

margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="clienti_a1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Inizializzazione delle variabili

$selezi=$_POST['selezi']; // Controllo che l'utente abbia selezionato il record da cancellare

if ($selezi) { // Connessione al database MySQL $db=mysql_connect("localhost", "root");

// Creazione del comando sql di cancellazione $sqlinterr="delete from clienti where"; $sqlinterr .=" cl_codfis='$selezi'";

// Invio del comando SQL $res=mysql_db_query("my_giuliac", $sqlinterr); // Risultato della cancellazione

$num=mysql_affected_rows(); if ($num>0)echo "Record cancellato<p>"; else echo "<font face='comic sans MS size='13' color=red><h2>Record non cancellato</font></h2><p>";

// Chiusura database mysql_close($db); }

else echo "Non &egrave; stato selezionato nessun record<p>"; ?> </div> </div>

</div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

64

[clienti_m1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica clienti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { color: #008000; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><span class="auto-style4">MODIFICA</span><font color="Green"> I CLIENTI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px">

<img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <?php

echo "<h2><center>Selezionare il record da modificare</center></h2>"; echo "<center><form action='clienti_m2.php' method='POST'>"; // Connessione al DB MySQL

$db=mysql_connect("localhost","root",""); /* Costruzione della variabile $sqlinterr per

la visualizzazione dei record */ $sqlinterr = "select * from clienti"; // Esecuzione del comando di interrogazione $sqlinterr

$res=mysql_db_query("my_giuliac",$sqlinterr); $num=mysql_num_rows($res); // Inizio della tabella

echo "<font face='comic sans MS' size=3 align='center'><table border='1'>"; // Titolo echo "<tr>

65

<b><center><td>Selezione</td>

<td>Nome</td> <td>Cognome</td> <td>Indirizzo</td>

<td>Comune</td> <td>Sesso</td> <td>Codice fiscale</td>

<td>Email</td> <td>Username</td> <td>Password</td>

<td>Anno di nascita</td> <td>Numero di telefono</td> </center></b>

</tr>"; // Estrapolazione dei valori degli attributi

for ($i=0;$i<$num;$i++) { $cl_nome=mysql_result($res,$i,"cl_nome"); $cl_cognome=mysql_result($res,$i,"cl_cognome");

$cl_indiri=mysql_result($res,$i,"cl_indiri"); $cl_comune=mysql_result($res,$i,"cl_comune"); $cl_sesso=mysql_result($res,$i,"cl_sesso");

$cl_codfis=mysql_result($res,$i,"cl_codfis"); $cl_email=mysql_result($res,$i,"cl_email"); $cl_user=mysql_result($res,$i,"cl_user");

$cl_passwo=mysql_result($res,$i,"cl_passwo"); $cl_annas=mysql_result($res,$i,"cl_annas"); $cl_numtel=mysql_result($res,$i,"cl_numtel");

// Visualizzazione degli attributi in tabella echo "<tr> <center><td><input type='radio' name='selezi' value='$cl_codfis'></td>

<td>$cl_codcli</td> <td>$cl_nome</td>

<td>$cl_cognome</td> <td>$cl_indiri</td> <td>$cl_comune</td>

<td>$cl_sesso</td> <td>$cl_codfis</td> <td>$cl_email</td>

<td>$cl_user</td> <td>$cl_passwo</td> <td>$cl_annas</td>

<td>$cl_numtel</td></center> </tr>"; }

echo "</table>"; // Chiusura del DB MySQL mysql_close($db);

// Bottone per l'invio dei dati a clienti_m2.php echo "<p><center><input type='submit' value='Record da modificare'></center>"; echo "</form></center>";

?> </div> </div>

</div> <div id="footer"> <p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

66

[clienti_m2.php]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica clienti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="clienti_m1.php">Pagina precedente</a></li>

</ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Definizione delle variabili

$selezi=$_POST['selezi']; if ($selezi) { // Connessione al DB MySQL

$db=mysql_connect("localhost","root",""); /* Costruzione della variabile $sqlinterr per

la visualizzazione dei record */ $sqlinterr = "select * from clienti "; $sqlinterr.= "where clienti.cl_codfis='$selezi'";

// Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr); //$num=mysql_num_rows($res);

// Lettura del contenuto del record trovato $cl_nome_old=mysql_result($res,0,"cl_nome"); $cl_cognome_old=mysql_result($res,0,"cl_cognome");

67

$cl_indiri_old=mysql_result($res,0,"cl_indiri");

$cl_comune_old=mysql_result($res,0,"cl_comune"); $cl_sesso_old=mysql_result($res,0,"cl_sesso"); $cl_codfis_old=mysql_result($res,0,"cl_codfis");

$cl_email_old=mysql_result($res,0,"cl_email"); $cl_user_old=mysql_result($res,0,"cl_user"); $cl_passwo_old=mysql_result($res,0,"cl_passwo");

$cl_annas_old=mysql_result($res,0,"cl_annas"); $cl_numtel_old=mysql_result($res,0,"cl_numtel"); // Creazione della mappa a video per la modifica

echo "<h3><center>Gestione clienti: modifica</center></h3><p>"; echo "<center><form action='clienti_m3.php' method='POST'>"; echo "<font color=red>";

echo " Nome<br><input name='cl_nome_new' value='$cl_nome_old'><p>"; echo " Cognome<br><input name='cl_cognome_new' value='$cl_cognome_old'><p>";

echo "Indirizzo<br><input name='cl_indiri_new' value='$cl_indiri_old'><p>"; echo "Comune<br><input name='cl_comune_new' value='$cl_comune_old'><p>"; echo "Sesso<br><input name='cl_sesso_new' value='$cl_sesso_old'><p>";

echo "Codice fiscale<br><input name='cl_codfis_new' value='$cl_codfis_old'><p>"; echo "Email<br><input name='cl_email_new' value='$cl_email_old'><p>"; echo "Username<br><input name='cl_user_new' value='$cl_user_old'><p>";

echo "Password<br><input name='cl_passwo_new' value='$cl_passwo_old'><p>"; echo "Anno di nascita<br><input name='cl_annas_new' value='$cl_annas_old'><p>"; echo "Numero di telefono<br><input name='cl_numtel_new' value='$cl_numtel_old'><p>";

echo "<input type='hidden' name='cl_codfis' value='$selezi'>"; echo "<input type='submit' value='Modifica'> "; echo "<input type='reset' value='Cancella'>";

echo "</font></form></center>"; // Chiusura del DB MySQL mysql_close($db);

} else echo "ERRORE!!! Selezionare un utente..."; ?> </div>

</div> </div> <div id="footer">

<p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[clienti_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Risultato</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right; margin-left: 25.2em;

68

}

.auto-style3 { margin-left: 237; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="clienti_m1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px">

<img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <?php

// Inizializzazione delle variabili $cl_codcli_new=$_POST['cl_codcli_new']; $cl_nome_new=$_POST['cl_nome_new'];

$cl_cognome_new=$_POST['cl_cognome_new']; $cl_indiri_new=$_POST['cl_indiri_new']; $cl_comune_new=$_POST['cl_comune_new'];

$cl_sesso_new=$_POST['cl_sesso_new']; $cl_codfis_new=$_POST['cl_codfis_new'];

$cl_email_new=$_POST['cl_email_new']; $cl_user_new=$_POST['cl_user_new']; $cl_passwo_new=$_POST['cl_passwo_new'];

$cl_annas_new=$_POST['cl_annas_new']; $cl_numtel_new=$_POST['cl_numtel_new']; $cl_codfis=$_POST['cl_codfis'];

// Connessione al DB MySQL $db=mysql_connect("localhost", "root"); /* Costruzione della variabile $sqlinterr per

la modifica del record selezionato */ $sqlinterr ="update clienti set "; $sqlinterr.="cl_nome='$cl_nome_new',";

$sqlinterr.="cl_cognome='$cl_cognome_new',"; $sqlinterr.="cl_indiri='$cl_indiri_new',"; $sqlinterr.="cl_comune='$cl_comune_new',";

$sqlinterr.="cl_sesso='$cl_sesso_new',"; $sqlinterr.="cl_codfis='$cl_codfis_new',"; $sqlinterr.="cl_email='$cl_email_new',";

$sqlinterr.="cl_user='$cl_user_new',"; $sqlinterr.="cl_passwo='$cl_passwo_new',";

$sqlinterr.="cl_annas='$cl_annas_new',"; $sqlinterr.="cl_numtel='$cl_numtel_new'"; $sqlinterr.=" where cl_codfis='$cl_codfis'";

// Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac",$sqlinterr); // N. di record soggetti alla modifica

69

$num = mysql_affected_rows();

// Se il record è stato trovato viene modificato. if ($num>0) echo "<font face='comics sans MS' color=green size=3>Record modificato.</font><p>"; else echo "<font face='comics sans MS' color=green size=7>ERRORE!!! Record non

modificato.</font><p>"; // Chiusura del DB MySQL mysql_close($db);

?> </div> </div> </div>

<div id="footer"> <p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[clienti_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Clienti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { font-family: "Comic Sans MS"; font-size: medium;

color: #FF0000; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">CONSULTAZIONE CLIENTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

70

<div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root",""); // Creazione della variabile per l'interrogazione

$sqlinterr ="select * from clienti"; // Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr);

// Numero di record estratti dall'interrogazione $num=mysql_num_rows($res); // Intestazione della tabella

echo "<table border='1'align='center'> <tr>

<td>Nome</td> <td>Cognome</td> <td>Indirizzo</td>

<td>Comune</td> <td>Sesso</td> <td>Codice fiscale</td>

<td>Email</td> <td>Username</td> <td>Password</td>

<td>Anno di nascita</td> <td>Numero di telefono</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) { $cl_nome=mysql_result($res,$i,"cl_nome");

$cl_cognome=mysql_result($res,$i,"cl_cognome"); $cl_indiri=mysql_result($res,$i,"cl_indiri");

$cl_comune=mysql_result($res,$i,"cl_comune"); $cl_sesso=mysql_result($res,$i,"cl_sesso"); $cl_codfis=mysql_result($res,$i,"cl_codfis");

$cl_email=mysql_result($res,$i,"cl_email"); $cl_user=mysql_result($res,$i,"cl_user"); $cl_passwo=mysql_result($res,$i,"cl_passwo");

$cl_annas=mysql_result($res,$i,"cl_annas"); $cl_numtel=mysql_result($res,$i,"cl_numtel"); // Visualizzazione della riga con radio

echo "<tr> echo " <td>$cl_nome</td> <td>$cl_cognome</td>

<td>$cl_indiri</td> <td>$cl_comune</td> <td>$cl_sesso</td>

<td>$cl_codfis</td> <td>$cl_email</td> <td>$cl_user</td>

<td>$cl_passwo</td> <td>$cl_annas</td>

<td>$cl_numtel</td> </tr>"; }

// Chiusura della tabella echo "</table>"; // Chiusura del database

71

mysql_close($db);

?> </center> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[fornitori_1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Fornitori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right; margin-left: 25.2em;

} .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">INSERIMENTO DEI FORNITORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px">

<img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<?php echo"<font color='red' face='comic sans MS'>"; echo "<h2>Inserire i dati dell'utente e inviare il form</h2>";

echo "<form action='fornitori_2.php' method='POST'>"; echo "Nome fornitore<br> <input name='fo_nomfor' size='30' maxlength='30'><p>"; echo "Codice prodotto<br> <input name='fo_codpro' size='6' maxlength='6'><p>";

72

echo "Descrizione<br><input name='fo_descri' size='30' maxlength='30'><p>";

echo "<input type='submit' value='Invia'>"; echo "<input type='reset' value='Cancella'>"; echo"</font>";

echo "</form>"; ?> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[fornitori_2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Fornitori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="fornitori_1.php">Pagina precedente</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Inizializzazione delle variabili

73

$fo_nomfor=$_POST['fo_nomfor'];

$fo_codpro=$_POST['fo_codpro']; $fo_descri=$_POST['fo_descri']; // Connessione al DB MYSQL

$db=mysql_connect("localhost","root",""); // Creazione del comando SQL per l'inserimento dei dati $sqlinter = "insert fornitori ";

$sqlinter .= "(fo_nomfor, fo_codpro, fo_descri)"; $sqlinter .= " values "; $sqlinter .= "('$fo_nomfor','$fo_codpro','$fo_descri')";

// Invio dei dati alla tabella attori del db sito mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente

$num=mysql_affected_rows(); // Controllo che il record sia stato inserito

if ($num>0) echo "Nuovo record inserito correttamente.<p> Per tornare indietro cliccare su pagina precedente"; else echo "ERRORE!!! Record non inserito<p>";

// Chiusura del database mysql_close($db); ?>

</div> </div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[fornitori_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Fornitori</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { font-family: "Comic Sans MS"; font-size: medium;

color: #FF0000; } </style>

74

</head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li class="current"><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">CANCELLAZIONE FORNITORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <h2 class="auto-style4">Selezionare il record da cancellare</h2><p>

<center><form action="fornitori_a2.php" method="POST"> <?php // Connessione al database MySQL

$db=mysql_connect("localhost","root",""); // Creazione della variabile per l'interrogazione $sqlinterr ="select * from fornitori";

// Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione

$num=mysql_num_rows($res); // Intestazione della tabella echo "<table border='1'align='center'>

<tr> <td>Selezione</td>

<td>Codice fornitore</td> <td>Nome fornitore</td> <td>Codice prodotto</td>

<td>Descrizione</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $fo_codfor=mysql_result($res,$i,"fo_codfor"); $fo_nomfor=mysql_result($res,$i,"fo_nomfor");

$fo_codpro=mysql_result($res,$i,"fo_codpro"); $fo_descri=mysql_result($res,$i,"fo_descri"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$fo_codfor'></td>"; echo " <td>$fo_codfor</td>

<td>$fo_nomfor</td> <td>$fo_codpro</td> <td>$fo_descri</td>

</tr>"; }

// Chiusura della tabella echo "</table>"; // Chiusura del database

mysql_close($db); ?> <p>

75

<input type="submit" value="Cancellare il record"><p>

</form> </center> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[fornitori_a2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Fornitori</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237;

} </style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> <li><a href="fornitori_a1.php">Pagina precedente</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px">

<img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<?php // Inizializzazione delle variabili $selezi=$_POST['selezi'];

// Controllo che l'utente abbia selezionato il record da cancellare if ($selezi) { // Connessione al database MySQL

76

$db=mysql_connect("localhost", "root");

// Creazione del comando sql di cancellazione $sqlinterr="delete from fornitori where"; $sqlinterr .=" fo_codfor='$selezi'";

// Invio del comando SQL $res=mysql_db_query("my_giuliac", $sqlinterr); // Risultato della cancellazione

$num=mysql_affected_rows(); if ($num>0)echo "Record cancellato<p>"; else echo "<font face='comic sans MS size='13' color=red><h2>Record non cancellato</font></h2><p>";

// Chiusura database mysql_close($db); }

else echo "Non &egrave; stato selezionato nessun record<p>"; ?> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[fornitori_m1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Fornitori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right; margin-left: 25.2em;

} .auto-style3 { margin-left: 237;

} .auto-style4 { font-family: "Comic Sans MS";

font-size: medium; color: #FF0000;

} </style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li class="current"><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

77

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">MODIFICA DEI FORNITORI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<h2 class="auto-style4">Selezionare il record da modificare</h2><p> <center><form action="fornitori_m2.php" method="POST"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from fornitori"; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1' align='center'> <tr>

<td>Selezione</td> <td>Codice fornitore</td> <td>Nome fornitore</td>

<td>Codice prodotto</td> <td>Descrizione</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) {

$fo_codfor=mysql_result($res,$i,"fo_codfor"); $fo_nomfor=mysql_result($res,$i,"fo_nomfor"); $fo_codpro=mysql_result($res,$i,"fo_codpro");

$fo_descri=mysql_result($res,$i,"fo_descri"); // Visualizzazione della riga con radio echo "<tr>

<td><input type='radio' name='selezi' value='$fo_codfor'></td>"; echo " <td>$fo_codfor</td> <td>$fo_nomfor</td>

<td>$fo_codpro</td> <td>$fo_descri</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <input type="submit" value="Modificare il record"><p>

</form> </center> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

78

</div>

</body> </html>

[fornitori_m2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica fornitori</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="fornitori_m1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Definizione delle variabili

$selezi=$_POST['selezi']; if ($selezi) {

// Connessione al DB MySQL $db=mysql_connect("localhost","root",""); /* Costruzione della variabile $sqlinterr per

la visualizzazione dei record */ $sqlinterr = "select * from fornitori "; $sqlinterr.= "where fo_codfor='$selezi'";

// Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr); //$num=mysql_num_rows($res);

79

// Lettura del contenuto del record trovato

$fo_nomfor_old=mysql_result($res,0,"fo_nomfor"); $fo_codpro_old=mysql_result($res,0,"fo_codpro"); $fo_descri_old=mysql_result($res,0,"fo_descri");

// Creazione della mappa a video per la modifica echo "<h3><center>Gestione fornitori: modifica</center></h3><p>"; echo "<center><form action='fornitori_m3.php' method='POST'>";

echo "<font color=red>"; echo " Nome fornitore<br><input name='fo_nomfor_new' value='$fo_nomfor_old'><p>"; echo "Codice prodotto<br><input name='fo_codpro_new' value='$fo_codpro_old'><p>";

echo "Descrizione<br><input name='fo_descri_new' value='$fo_descri_old'><p>"; echo "<input type='hidden' name='fo_codfor' value='$selezi'>"; echo "<input type='submit' value='Modifica'> ";

echo "<input type='reset' value='Cancella'>"; echo "</font></form></center>";

// Chiusura del DB MySQL mysql_close($db); } else echo "ERRORE!!! Selezionare un utente...";

?> </div> </div> </div>

<div id="footer"> <p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[fornitori_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Risultato</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="fornitori_m1.php">Pagina precedente</a></li> </ul> <a href="#">

80

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1">Risultato</h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<?php // Inizializzazione delle variabili $fo_nomfor_new=$_POST['fo_nomfor_new'];

$fo_codpro_new=$_POST['fo_codpro_new']; $fo_descri_new=$_POST['fo_descri_new'];

$fo_codfor=$_POST['fo_codfor']; // Connessione al DB MySQL $db=mysql_connect("localhost", "root");

/* Costruzione della variabile $sqlinterr per la modifica del record selezionato */ $sqlinterr ="update fornitori set ";

$sqlinterr.="fo_nomfor='$fo_nomfor_new',"; $sqlinterr.="fo_codpro='$fo_codpro_new',"; $sqlinterr.="fo_descri='$fo_descri_new'";

$sqlinterr.=" where fo_codfor='$fo_codfor'"; // Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac",$sqlinterr);

// N. di record soggetti alla modifica $num = mysql_affected_rows(); // Se il record è stato trovato viene modificato.

if ($num>0) echo "<font face='comics sans MS' color=green size=3>Record modificato.</font><p>"; else echo "<font face='comics sans MS' color=green size=7>ERRORE!!! Record non

modificato.</font><p>"; // Chiusura del DB MySQL mysql_close($db);

?> </div> </div> </div>

<div id="footer"> <p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[fornitori_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Fornitori</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

81

}

.auto-style2 { text-align: right; margin-left: 25.2em;

} .auto-style3 { margin-left: 237;

} .auto-style4 { font-family: "Comic Sans MS";

font-size: medium; color: #FF0000; }

</style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li class="current"><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">VISUALIZZAZIONE DEI FORNITORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root",""); // Creazione della variabile per l'interrogazione

$sqlinterr ="select * from fornitori"; // Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr);

// Numero di record estratti dall'interrogazione $num=mysql_num_rows($res); // Intestazione della tabella

echo"<center>"; echo "<table border='1' align='center'> <tr>

<td>Codice fornitore</td> <td>Nome fornitore</td> <td>Codice prodotto</td>

<td>Descrizione</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $fo_codfor=mysql_result($res,$i,"fo_codfor");

$fo_nomfor=mysql_result($res,$i,"fo_nomfor"); $fo_codpro=mysql_result($res,$i,"fo_codpro"); $fo_descri=mysql_result($res,$i,"fo_descri");

// Visualizzazione della riga con radio echo "<tr>"; echo " <td>$fo_codfor</td>

82

<td>$fo_nomfor</td>

<td>$fo_codpro</td> <td>$fo_descri</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> </center> </div>

</div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[operatori_1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Operatori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">INSERIMENTO DEGLI OPERATORI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p> </div>

83

<div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <?php

echo"<font color='red' face='comic sans MS'>"; echo "<h2>Inserire i dati dell'operatore</h2>"; echo "<form action='operatori_2.php' method='POST'>";

echo "Cognome e Nome<br> <input name='op_cognom' size='50' maxlength='50'><p>"; echo "<input type='submit' value='Invia'>"; echo "<input type='reset' value='Cancella'>";

echo"</font>"; echo "</form>"; ?>

</div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[operatori_2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Operatori</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> <li><a href="operatori_1.php">Pagina precedente</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px">

84

<img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Inizializzazione delle variabili

$op_cognom=$_POST['op_cognom']; // Connessione al DB MYSQL $db=mysql_connect("localhost","root","");

// Creazione del comando SQL per l'inserimento dei dati $sqlinter = "insert operatori "; $sqlinter .= "(op_cognom)";

$sqlinter .= " values "; $sqlinter .= "('$op_cognom')";

// Invio dei dati alla tabella attori del db sito mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente

$num=mysql_affected_rows(); // Controllo che il record sia stato inserito if ($num>0) echo "Nuovo record inserito correttamente.<p> Per tornare indietro cliccare su pagina

precedente"; else echo "ERRORE!!! Record non inserito<p>"; // Chiusura del database

mysql_close($db); ?> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[operatori_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Operatori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } .auto-style4 {

85

font-family: "Comic Sans MS";

font-size: medium; color: #FF0000; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">CANCELLAZIONE OPERATORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <h2 class="auto-style4">Selezionare il record da cancellare</h2><p> <center><form action="operatori_a2.php" method="POST">

<?php // Connessione al database MySQL $db=mysql_connect("localhost","root","");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from operatori "; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione

$num=mysql_num_rows($res); // Intestazione della tabella echo "<table border='1'align='center'>

<tr> <td>Selezione</td> <td>Codice operatore</td>

<td>Cognome e nome</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $op_codope=mysql_result($res,$i,"op_codope"); $op_cognom=mysql_result($res,$i,"op_cognom");

// Visualizzazione della riga con radio echo "<tr> <td><input type='radio' name='selezi' value='$op_codope'></td>";

echo " <td>$op_codope</td> <td>$op_cognom</td> </tr>";

} // Chiusura della tabella

echo "</table>"; // Chiusura del database mysql_close($db);

?> <p> <input type="submit" value="Cancellare il record"><p>

86

</form> </center>

</div> </div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[operatori_a2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Operatori</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="operatori_a1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix"> <?php

// Inizializzazione delle variabili $selezi=$_POST['selezi']; // Controllo che l'utente abbia selezionato il record da cancellare

if ($selezi) { // Connessione al database MySQL $db=mysql_connect("localhost", "root");

87

// Creazione del comando sql di cancellazione

$sqlinterr="delete from operatori where"; $sqlinterr .=" op_codope='$selezi'"; // Invio del comando SQL

$res=mysql_db_query("my_giuliac", $sqlinterr); // Risultato della cancellazione $num=mysql_affected_rows();

if ($num>0)echo "Record cancellato<p>"; else echo "<font face='comic sans MS size='13' color=red><h2>Record non cancellato</font></h2><p>"; // Chiusura database

mysql_close($db); } else echo "Non &egrave; stato selezionato nessun record<p>";

?> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[operatori_m1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica operatori</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { color: #008000; }

</style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

88

<h1 class="auto-style1"><span class="auto-style4">MODIFICA</span><font color="Green">

GLI OPERATORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php echo "<h2><center>Selezionare il record da modificare</center></h2>";

echo "<center><form action='operatori_m2.php' method='POST'>"; // Connessione al DB MySQL $db=mysql_connect("localhost","root","");

/* Costruzione della variabile $sqlinterr per la visualizzazione dei record */

$sqlinterr = "select * from operatori"; // Esecuzione del comando di interrogazione $sqlinterr $res=mysql_db_query("my_giuliac",$sqlinterr);

$num=mysql_num_rows($res); // Inizio della tabella echo "<font face='comic sans MS' size=3 align='center'><center><table border='1' align='center'>";

// Titolo echo "<tr> <b><center><td>Selezione</td>

<td>Codice operatore</td> <td>Cognome e nome</td> </center></b>

</tr>"; // Estrapolazione dei valori degli attributi for ($i=0;$i<$num;$i++) {

$op_codope=mysql_result($res,$i,"op_codope"); $op_cognom=mysql_result($res,$i,"op_cognom");

// Visualizzazione degli attributi in tabella echo "<tr> <center><td><center><input type='radio' name='selezi' value='$op_codope'></center></td>

<td><center>$op_codope</center></td> <td><center>$op_cognom</center></td></center> </tr>";

} echo "</table></center>"; // Chiusura del DB MySQL

mysql_close($db); // Bottone per l'invio dei dati a operatori_m2.php echo "<p><center><input type='submit' value='Record da modificare'></center>";

echo "</form></center>"; ?> </div> </div>

</div> <div id="footer"> <p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p>

</div> </body>

</html>

89

[operatori_m2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica operatori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="operatori_m1.php">Pagina precedente</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php // Definizione delle variabili

$selezi=$_POST['selezi']; if ($selezi) { // Connessione al DB MySQL

$db=mysql_connect("localhost","root",""); /* Costruzione della variabile $sqlinterr per la visualizzazione dei record */

$sqlinterr = "select * from operatori "; $sqlinterr.= "where operatori.op_codope='$selezi'";

// Esecuzione del comando select $res=mysql_db_query("my_giuliac",$sqlinterr); //$num=mysql_num_rows($res);

// Lettura del contenuto del record trovato $op_codope_old=mysql_result($res,0,"op_codope"); $op_cognom_old=mysql_result($res,0,"op_cognom");

// Creazione della mappa a video per la modifica echo "<h3><center>Gestione operatori: modifica</center></h3><p>"; echo "<center><form action='operatori_m3.php' method='POST'>";

90

echo "<font color=red>";

echo " Cognome e nome<br><input name='op_cognom_new' value='$op_cognom_old'><p>"; echo "<input type='hidden' name='op_codope' value='$selezi'>"; echo "<input type='submit' value='Modifica'> ";

echo "<input type='reset' value='Cancella'>"; echo "</font></form></center>"; // Chiusura del DB MySQL

mysql_close($db); } else echo "ERRORE!!! Selezionare un utente..."; ?> </div>

</div> </div> <div id="footer">

<p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[operatori_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Risultato</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="operatori_m1.php">Pagina precedente</a></li>

</ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1">Risultato</h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

91

<div id="container" class="clearfix">

<?php // Inizializzazione delle variabili $op_codope_new=$_POST['op_codope_new'];

$op_cognom_new=$_POST['op_cognom_new']; $op_codope=$_POST['op_codope']; // Connessione al DB MySQL

$db=mysql_connect("localhost", "root"); /* Costruzione della variabile $sqlinterr per la modifica del record selezionato */

$sqlinterr ="update operatori set "; $sqlinterr.="op_cognom='$op_cognom_new' "; $sqlinterr.=" where op_codope='$op_codope'";

// Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac",$sqlinterr);

// N. di record soggetti alla modifica $num = mysql_affected_rows(); // Se il record è stato trovato viene modificato.

if ($num>0) echo "<font face='comics sans MS' color=green size=3>Record modificato.</font><p>"; else echo "<font face='comics sans MS' color=green size=7>ERRORE!!! Record non modificato.</font><p>";

// Chiusura del DB MySQL mysql_close($db); ?> </div>

</div> </div> <div id="footer">

<p>Copyrights © 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[operatori_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Operatori</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

92

&nbsp;<ul id="navBar">

<li class="current"><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><font color="Green">CONSULTAZIONE OPERATORI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/msn.png" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <?php

// Apertura del Database MySQL) $db=mysql_connect("localhost","root",""); // Costruzione della variabile da eseguire in SQL

$sqlinterr = "select * from operatori "; /* Apertura del DB sito inserito nel DataBase MySQL */

// $db_selected = mysql_select_db('my_giuliac', $db); // Esecuzione del comando di interrogazione SQL $res=mysql_db_query("my_giuliac",$sqlinterr);

$res=mysql_query($sqlinterr); // N. di record estratti dal comando SQL $num=mysql_num_rows($res);

// Costruzione dell'intestazione della tabella echo "<h2><center>Consultazione operatori</center></h2>"; echo "<center><font size='3' align='center'><center><table border='1' align='center' >

<tr> <td>Codice operatore </td>

<td>Cognome e nome</td> </tr>"; // Visualizzazione del contenuto dei record trovati

for ($i=0;$i<$num;$i++) { $op_codope=mysql_result($res,$i,"op_codope"); $op_cognom=mysql_result($res,$i,"op_cognom");

// Visualizzazione dei dati letti echo "<tr> <td>$op_codope</td>

<td>$op_cognom</td> </tr>"; }

// Chiusura della tabella echo "</table></font></center>"; // Chiusura del DataBase MySQL

mysql_close($db); ?> </div> </div>

</div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

93

[prodotti_1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Inserimento prodotti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">INSERIMENTO DEI PRODOTTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<center> <font face="comic sans MS" color="red" size="1"> <?php

echo "<h2>Inserire i dati dei prodotti e inviare il form</h2>"; echo "<form action='prodotti_2.php' method='POST'>"; echo "Codice prodotto<br> <input name='pr_codpro' size='6' maxlength='6'><p>";

echo "Descrizione<br> <input name='pr_descri' size='50' maxlength='50'><p>"; echo "Marca <br> <input name='pr_marca' size='30' maxlength='30'><p>"; echo "Tipo confezione <br><input name='pr_ticonf' size='30' maxlength='30'><p>";

echo "Quantit&agrave; <br><input name='pr_quanti' size='10' maxlength='10'><p>"; echo "Prezzo <br><input name='pr_prezzo size='10,2' maxlength='10,2'><p>";

echo "Codice fornitore <br><input name='pr_codfor' size='6' maxlength='6'><p>"; echo "Codice operatore <br><input name='pr_codope' size='6' maxlength='6'><p>"; echo "<input type='submit' value='Invia'>";

echo "<input type='reset' value='Cancella'>"; echo "</form>"; ?>

</font></center> </div> </div> </div>

94

<div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[prodotti_2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Inserimento prodotti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right; margin-left: 25.2em;

} .auto-style3 { margin-left: 237;

} </style> </head>

<body> <div id="header">

&nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li> <li><a href="prodotti_1.php">Pagina precdente</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><font color="Green">RISULTATO</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<center> <font face="comic sans MS" color="red" size="2">

<?php // Inizializzazione delle variabili $pr_codpro=$_POST['pr_codpro'];

$pr_descri=$_POST['pr_descri']; $pr_marca=$_POST['pr_marca']; $pr_quanti=$_POST['pr_quanti'];

$pr_ticonf=$_POST['pr_ticonf']; $pr_prezzo=$_POST['pr_prezzo']; $pr_codfor=$_POST['pr_codfor'];

95

$pr_codope=$_POST['pr_codope'];

// Connessione al DB MYSQL $db=mysql_connect("localhost","root"); // Creazione del comando SQL per l'inserimento dei dati

$sqlinter = "insert prodotto"; $sqlinter .= "(pr_codpro, pr_descri, pr_marca, pr_quanti, pr_ticonf, pr_prezzo, pr_codfor, pr_codope)"; $sqlinter .= " values ";

$sqlinter .= "('$pr_codpro','$pr_descri','$pr_marca','$pr_quanti','$pr_ticonf','$pr_prezzo','$pr_codfor','$pr_codope')"; // Invio dei dati alla tabella attori del db sito

mysql_db_query("my_giuliac", $sqlinter); // Verifica che i dati siano stati inseriti correttamente $num=mysql_affected_rows();

// Controllo che il record sia stato inserito if ($num>0) echo "Nuovo record inserito correttamente.<p>";

else echo "ERRORE!!! Record non inserito<p>"; // Chiusura del database mysql_close($db);

?> </font></center> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[prodotti_a1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Annullamento prodotti</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237;

} .auto-style4 { color: #008000;

} </style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

96

<li class="current"><a href="../../indexamm.html">Index</a></li>

</ul> <a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><span class="auto-style4">CANCELLAZIONE</span><font color="Green"> DEI

PRODOTTI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <center>

<font face="comic sans MS"> <h2>Selezionare il record da cancellare</h2><p> <form action="prodotti_a2.php" method="POST">

<?php // Connessione al database MySQL $db=mysql_connect("localhost","root");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from prodotto "; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1' align='center'> <tr>

<td>Selezione</td> <td>Codice prodotto</td>

<td>Descrizione</td> <td>Marca</td> <td>Quantit&agrave;</td>

<td>Tipo confezione</td> <td>Prezzo</td> <td>Codice fornitore</td>

<td>Codice operatore</td> </tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $pr_codpro=mysql_result($res,$i,"pr_codpro"); $pr_descri=mysql_result($res,$i,"pr_descri");

$pr_marca=mysql_result($res,$i,"pr_marca"); $pr_quanti=mysql_result($res,$i,"pr_quanti"); $pr_ticonf=mysql_result($res,$i,"pr_ticonf");

$pr_prezzo=mysql_result($res,$i,"pr_prezzo"); $pr_codfor=mysql_result($res,$i,"pr_codfor"); $pr_codope=mysql_result($res,$i,"pr_codope");

// Visualizzazione della riga con radio echo "<tr>

<td><input type='radio' name='selezi' value='$pr_codpro'></td>"; echo " <td>$pr_codpro</td> <td>$pr_descri</td>

<td>$pr_marca</td> <td>$pr_quanti</td> <td>$pr_ticonf</td>

97

<td>$pr_prezzo</td>

<td>$pr_codfor</td> <td>$pr_codope</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <input type="submit" value="Cancellare il record"><p> </form> </div>

</div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[prodotti_a2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Annullamento prodotti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } .auto-style4 {

color: #008000; } </style>

</head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="prodotti_a1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

98

<h1 class="auto-style1"><span class="auto-style4">RISULTATO</span></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

<center> <font face="comic sans MS"> <?php

// Inizializzazione delle variabili $selezi=$_POST['selezi']; // Controllo che l'utente abbia selezionato il record da cancellare

if ($selezi) { // Connessione al database MySQL

$db=mysql_connect("localhost", "root"); // Creazione del comando sql di cancellazione $sqlinterr="delete from prodotto where";

$sqlinterr .=" pr_codpro='$selezi'"; // Invio del comando SQL $res=mysql_db_query("my_giuliac", $sqlinterr);

// Risultato della cancellazione $num=mysql_affected_rows(); if ($num>0)echo "Record cancellato<p>";

else echo "Record non cancellato<p>"; // Chiusura database mysql_close($db);

} else echo "Non &egrave; stato selezionato nessun record<p>"; ?>

</font></center> </div> </div>

</div> <div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p>

</div> </body> </html>

[prodotti_m1.php]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica prodotti</title> <link rel="stylesheet" type="text/css" href="style.css" />

<style type="text/css"> .auto-style1 { text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

99

.auto-style3 {

margin-left: 237; } .auto-style4 {

color: #008000; } </style>

</head> <body> <div id="header">

&nbsp;<ul id="navBar"> <li class="current"><a href="../../indexamm.html">Index</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -

8px" /></a></div> <div id="welcomeMessage"> <h1 class="auto-style1"><span class="auto-style4">MODIFICA</span><font color="Green"> DEI

PRODOTTI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <center> <font face="comic sans MS">

<h2>Selezionare il record da modificare</h2><p> <form action="prodotti_m2.php" method="POST"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root");

// Creazione della variabile per l'interrogazione $sqlinterr ="select * from prodotto "; // Esecuzione dell'interrogazione

$res=mysql_db_query("my_giuliac",$sqlinterr); // Numero di record estratti dall'interrogazione $num=mysql_num_rows($res);

// Intestazione della tabella echo "<table border='1' align='center'> <tr>

<td>Selezione</td> <td>Codice prodotto</td> <td>Descrizione</td>

<td>Marca</td> <td>Quantit&agrave;</td> <td>Tipo confezione</td>

<td>Prezzo</td> <td>Codice fornitore</td> <td>Codice operatore</td>

</tr>"; // Visualizzazione dei record estratti

for ($i=0; $i<$num; $i++) { $pr_codpro=mysql_result($res,$i,"pr_codpro"); $pr_descri=mysql_result($res,$i,"pr_descri");

$pr_marca=mysql_result($res,$i,"pr_marca"); $pr_quanti=mysql_result($res,$i,"pr_quanti"); $pr_ticonf=mysql_result($res,$i,"pr_ticonf");

100

$pr_prezzo=mysql_result($res,$i,"pr_prezzo");

$pr_codfor=mysql_result($res,$i,"pr_codfor"); $pr_codope=mysql_result($res,$i,"pr_codope"); // Visualizzazione della riga con radio

echo "<tr> <td><input type='radio' name='selezi' value='$pr_codpro'></td>"; echo " <td>$pr_codpro</td>

<td>$pr_descri</td> <td>$pr_marca</td> <td>$pr_quanti</td>

<td>$pr_ticonf</td> <td>$pr_prezzo</td> <td>$pr_codfor</td>

<td>$pr_codope</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

<p> <input type="submit" value="Modifica il record"><p> </form> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[prodotti_m2.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modifica prodotti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

text-align: center; margin-left: 0.2em; }

.auto-style2 { text-align: right;

margin-left: 25.2em; } .auto-style3 {

margin-left: 237; } .auto-style4 {

color: #008000; } </style>

101

</head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li><a href="../../indexamm.html">Index</a></li> <li><a href="prodotti_m1.php">Pagina precedente</a></li> </ul>

<a href="#"> <img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><span class="auto-style4">MODIFICA</span><font color="Green"> DEI PRODOTTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p>

</div> <div id="wrapper"> <div id="secWrapper">

<div id="container" class="clearfix"> <center> <font face="arial">

<?php // Definizione delle variabili $selezi=$_POST['selezi'];

if ($selezi) { // Connessione al DB MySQL $db=mysql_connect("localhost","root");

/* Costruzione della variabile $sqlinterr per la visualizzazione dei record */ $sqlinterr = "select * from prodotto ";

$sqlinterr.= "where prodotto.pr_codpro='$selezi'"; // Esecuzione del comando select

$res=mysql_db_query("my_giuliac",$sqlinterr); //$num=mysql_num_rows($res); // Lettura del contenuto del record trovato

$pr_codpro_old=mysql_result($res,0,"pr_codpro"); $pr_descri_old=mysql_result($res,0,"pr_descri"); $pr_marca_old=mysql_result($res,0,"pr_marca");

$pr_quanti_old=mysql_result($res,0,"pr_quanti"); $pr_ticonf_old=mysql_result($res,0,"pr_ticonf"); $pr_prezzo_old=mysql_result($res,0,"pr_prezzo");

$pr_codfor_old=mysql_result($res,0,"pr_codfor"); $pr_codope_old=mysql_result($res,0,"pr_codope"); // Creazione della mappa a video per la modifica

echo "<h3><center>Gestione prodotti: modifica</center></h3><p>"; echo "<form action='prodotti_m3.php' method='POST'>"; echo "Codice prodotto<br><input name='pr_codpro_new' value='$pr_codpro_old'><p>";

echo "Descrizione<br><input name='pr_descri_new' value='$pr_descri_old'><p>"; echo "Marca<br><input name='pr_marca_new' value='$pr_marca_old'><p>"; echo "Quantit&agrave;<br><input name='pr_quanti_new' value='$pr_quanti_old'><p>";

echo "Tipo confezione<br><input name='pr_ticonf_new' value='$pr_ticonf_old'><p>"; echo "Prezzo<br><input name='pr_prezzo_new' value='$pr_prezzo_old'><p>";

echo "Codice fornitore<br><input name='pr_codfor_new' value='$pr_codfor_old'><p>"; echo "Codice operatore<br><input name='pr_codope_new' value='$pr_codope_old'><p>"; echo "<input type='hidden' name='pr_codprodotto' value='$selezi'>";

echo "<input type='submit' value='Modifica'> "; echo "<input type='reset' value='Cancella'>"; echo "</form>";

102

// Chiusura del DB MySQL

mysql_close($db); } else echo "ERRORE!!! Selezionare un utente...<p>"; ?>

</font></center> </div> </div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

[prodotti_m3.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Modifica prodotti</title> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css">

.auto-style1 { text-align: center; margin-left: 0.2em;

} .auto-style2 { text-align: right;

margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { color: #008000; }

</style> </head> <body>

<div id="header"> &nbsp;<ul id="navBar"> <li><a href="../../indexamm.html">Index</a></li>

<li><a href="prodotti_m1.php">Pagina precedente</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div>

<div id="welcomeMessage"> <h1 class="auto-style1"><span class="auto-style4">MODIFICA</span><font color="Green"> DEI PRODOTTI</font></h1>

<p class="auto-style2" style="height: 127px; width: 155px"> <img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p> </div>

<div id="wrapper"> <div id="secWrapper"> <div id="container" class="clearfix">

103

<center>

<font face="comic sans MS"> <?php // Inizializzazione delle variabili

$pr_codpro_new=$_POST['pr_codpro_new']; $pr_descri_new=$_POST['pr_descri_new']; $pr_marca_new=$_POST['pr_marca_new'];

$pr_quanti_new=$_POST['pr_quanti_new']; $pr_ticonf_new=$_POST['pr_ticonf_new']; $pr_prezzo_new=$_POST['pr_prezzo_new'];

$pr_codfor_new=$_POST['pr_codfor_new']; $pr_codope_new=$_POST['pr_codope_new']; $pr_codprodotto=$_POST['pr_codprodotto'];

// Connessione al DB MySQL $db=mysql_connect("localhost", "root");

/* Costruzione della variabile $sqlinterr per la modifica del record selezionato */ $sqlinterr = "update prodotto set ";

$sqlinterr.="pr_codpro='$pr_codpro_new',"; $sqlinterr.="pr_descri='$pr_descri_new',"; $sqlinterr.="pr_marca='$pr_marca_new',";

$sqlinterr.="pr_quanti='$pr_quanti_new',"; $sqlinterr.="pr_ticonf='$pr_ticonf_new',"; $sqlinterr.="pr_prezzo='$pr_prezzo_new',";

$sqlinterr.="pr_codfor='$pr_codfor_new', "; $sqlinterr.="pr_codope='$pr_codope_new' "; $sqlinterr.= "where pr_codpro='$pr_codprodotto'";

// Esecuzione del comando $sqlinterr mysql_db_query("my_giuliac", $sqlinterr); // N. di record soggetti alla modifica

$num = mysql_affected_rows(); // Se il record è stato trovato viene modificato.

if ($num>0) echo "Record modificato.<p>"; else echo "ERRORE!!! Record non modificato.<p>"; // Chiusura del DB MySQL

mysql_close($db); ?> </font></center> </div>

</div> </div> <div id="footer">

<p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div> </body>

</html>

[prodotti_q1.php] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Consultazione prodotti</title>

<link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> .auto-style1 {

104

text-align: center;

margin-left: 0.2em; } .auto-style2 {

text-align: right; margin-left: 25.2em; }

.auto-style3 { margin-left: 237; }

.auto-style4 { color: #008000; }

</style> </head>

<body> <div id="header"> &nbsp;<ul id="navBar">

<li class="current"><a href="../../indexamm.html">Index</a></li> </ul> <a href="#">

<img src="logo.gif" title="Affiliate Promo logo" id="logo" alt="Logo" height="90" style="left: 113px; top: -8px" /></a></div> <div id="welcomeMessage">

<h1 class="auto-style1"><span class="auto-style4">CONSULTAZIONE</span><font color="Green"> DEI PRODOTTI</font></h1> <p class="auto-style2" style="height: 127px; width: 155px">

<img class="auto-style3" height="125" src="images/care.jpg" style="float: right" width="119" /></p> </div> <div id="wrapper">

<div id="secWrapper"> <div id="container" class="clearfix">

<center> <font face="comic sans MS"> <?php

// Connessione al database MySQL $db=mysql_connect("localhost","root"); // Creazione della variabile per l'interrogazione

$sqlinterr ="select * from prodotto "; // Esecuzione dell'interrogazione $res=mysql_db_query("my_giuliac",$sqlinterr);

// Numero di record estratti dall'interrogazione $num=mysql_num_rows($res); // Intestazione della tabella

echo "<table border='1' align='center'> <tr> <td>Codice prodotto</td>

<td>Descrizione</td> <td>Marca</td> <td>Quantit&agrave;</td>

<td>Tipo confezione</td> <td>Prezzo</td>

<td>Codice fornitore</td> <td>Codice operatore</td> </tr>";

// Visualizzazione dei record estratti for ($i=0; $i<$num; $i++) { $pr_codpro=mysql_result($res,$i,"pr_codpro");

105

$pr_descri=mysql_result($res,$i,"pr_descri");

$pr_marca=mysql_result($res,$i,"pr_marca"); $pr_quanti=mysql_result($res,$i,"pr_quanti"); $pr_ticonf=mysql_result($res,$i,"pr_ticonf");

$pr_prezzo=mysql_result($res,$i,"pr_prezzo"); $pr_codfor=mysql_result($res,$i,"pr_codfor"); $pr_codope=mysql_result($res,$i,"pr_codope");

// Visualizzazione della riga con radio echo "<tr>"; echo " <td>$pr_codpro</td>

<td>$pr_descri</td> <td>$pr_marca</td> <td>$pr_quanti</td>

<td>$pr_ticonf</td> <td>$pr_prezzo</td>

<td>$pr_codfor</td> <td>$pr_codope</td> </tr>";

} // Chiusura della tabella echo "</table>";

// Chiusura del database mysql_close($db); ?>

</div> </div> </div>

<div id="footer"> <p>Copyrights &copy; 2012 PPCB, Tutti i diritti riservati</p> </div>

</body> </html>

SPIEGAZIONE PROGRAMMA -lato cliente: il cliente ha la possibilità di visualizzare tutti i prodotti, di registrarsi al sito inserendo i propri dati e, una volta effettuata la login utente, di acquistare i prodotti desiderati.

-lato amministratore: l’amministratore gestisce tutte le tabelle attraverso un area protetta in cui egli può accedere attraverso un username e una password. Egli può inserire, modificare, cancellare e visualizzare tutti i dati contenuti all’interno del database.

-programma di login: il programma di login consente all’utente di accedere alla parte del sito che può essere visualizzata soltanto da chi è già registrato, attraverso l’username e la password

scelti al momento della registrazione. Questo programma controlla se il nome utente e la password sono corretti. Se sono corretti visualizza la pagina successiva del sito, altrimenti segnala che sono stati inseriti in modo errato.

-carta fedeltà: la carta fedeltà permette ai clienti che la possiedono di ottenere un certo numero di punti a ogni acquisto effettuato e di accumularli allinterno di essa.

106

MANUALE TECNICO

Italiano: Nella scelta dello spazio dove sviluppare il sito io ho scelto “Altervista”. All’interno di questo spazio c’è la possibilità di creare e gestire delle tabelle all’interno di un database grazie all’utilizzo

dell’applicativo PhpMyadmin. Per accedere o registrarsi a questo sito basta cliccare sul seguente link: http://it.altervista.org/

Avrei potuto utilizzare un altro tipo di applicativo dove sviluppare il mio lavoro: Xampp. Per scaricare Xampp cliccate su questo link: http://www.apachefriends.org/it/xampp.html

Dal link sopra scaricate e installate il software. Per far funzionare il sito in modo coretto è necessaria la versione 1.7.3, altrimenti appena avvierete il programma vi risulteranno delle

avvertenze. Il programma non andrà installato come gli altri programmi nella cartella programmi sul disco locale C ma direttamente sul disco locale C.

Alla fine dell’installazione apparirà la seguente finestra:

Da questa finestra voi dovrete cliccare sul tasto start del modulo apache per attivarlo da qual punto in poi potrete creare tutti i database che volete.

Per facilitare la creazione del database e della tabella per l’inserimento dei comandi sql utilizzerete l’interfaccia grafica (tool grafico) di xampp per creare il database.

Per prima cosa aprite un browser e inserite il link: http://127.0.0.1/phpmyadmin/ .

107

Da qui, bisognerà eseguire il file "Xampp Control Panel" situato nel menu windows e cliccare sullo

start relativo ad Apache e su quello relativo a MySQL. Per visualizzare se XAMPP è stato installato correttamente basta andare a scrivere http://localhost/ e se tutto è apposto dovrebbe apparire la seguente schermata:

Successivamente digitando: http://127.0.0.1/phpmyadmin/, dovreste avere un output come questo:

Grazie a questa interfaccia riuscirete a gestire in maniera più semplice il vostro database.

Dopo avere creato tutto il programma, per utilizzarlo bisogna entrare con un browser sul server dove si è inserito il programma digitando il suo indirizzo IP e dovrete visualizzare la HOME

(pagina principale). Da li potrete iniziare ha usare il vostro sito di e-commerce.

108

Inglese: In the choice of the space in which to develop the site I chose "Altervista." Within this space there is the possibility to create and manage tables in a database by using the application phpmyadmin. To login or register to this site just click on the following link: http://it.altervista.org/ I could have used another type of application in which to develop my job: Xampp. To download Xampp click on this link: http://www.apachefriends.org/it/xampp.html From the above links to download and install the software. To operate the site correctly if you need version 1.7.3, otherwise just start the program there will be warnings. The program will be installed as the other programs in the Programs folder on the local disk C but directly to your local disk C. At the end of the installation the following window appears:

From this window you need to click on the start button to activate the apache module from which point onwards, you can create all the databases you want. To facilitate the creation of the database and table to insert sql command will use the graphical user interface (GUI tool) to xampp to create the database. First, open a browser and enter the link: http://127.0.0.1/phpmyadmin/. From here, you should execute the file "XAMPP Control Panel" located in the windows menu and click on start relating to that relating to Apache and MySQL. To see if XAMPP is installed correctly just go to write http://localhost/ and if everything is fine you should see the following screen:

109

Then typing: http://127.0.0.1/phpmyadmin/, you should get output like this:

With this interface you will be able to more easily manage your databases. After you have created throughout the program, to use it you must enter with a browser on the server where you entered the program by typing its IP address and you will have to display the HOME (main page). From there you can start using your e-commerce website.

110

PARTE DIDATTICA-TECNICA

-COS’è UN DATABASE? In informatica, il termine database, banca dati o base di dati, indica un archivio dati, o un insieme di archivi, in cui le informazioni in esso contenute sono strutturate e collegate tra loro secondo un

particolare modello logico (relazionale, gerarchico, reticolare o a oggetti) e in modo tale da consentire la gestione/organizzazione efficiente dei dati stessi grazie a particolari applicazioni

software dedicate (DBMS), basate su un'architettura di tipo client-server, e ai cosiddetti query language per l'interfacciamento con le richieste dell'utente (query di ricerca o interrogazione, inserimento, cancellazione ed aggiornamento).

Il popolare Database Server MySQL dispone di vari tipi di tabelle. Le più usate sono senza dubbio le MyISAM e le InnoDB.

MyISAM sono le tabelle "storiche" di MySQL. Hanno fatto il loro successo grazie alle ottime performace e al ridotto carico sul server che necessitano. Purtroppò però mancano di alcune caratteristiche molto importanti nelle basi di dati; primo fra tutte il mancato supporto alle foreign

key (chiavi esterne), grazie alle quali è possibile creare relazioni tra tabelle e applicare il concetto di integrità referenziale. Mancano inoltre del supporto alle transazioni. Mancando il supporto alle transazioni e alle foreign keys solitamente non sono adatte per realizzare sistemi di commercio

elettronico o altre applicazioni enterprise. Le tabelle di tipo MyISAM si compongono di 3 file con estensioni .frm, .MYD e .MIY. Il primo file

contiene la struttura della tabella, il secondo i dati e il terzo gli indici. Per trasferire una tabella da una macchina ad un'altra è sufficiente spostare questi 3 file. Il tipo di tabella MyISAM è solitamente quello predefinito nel DBMS.

InnoDB sono tabelle molto più complete rispetto alle MyISAM ma si sono fatte la nomina di essere più lente a causa delle funzionalità aggiuntive di cui dispongono. Vorrei fermarmi un attimo proprio

su questa questione delle performance: ritengo che al giorno d'oggi la differenza reale di prestazioni tra MyISAM e InnoDB sia divenuta veramente minima. Tra le caratteristiche a loro vantaggio, invece, vi sono le foreign key e la transazionalità, con le

quali è possibile creare una base di dati relazionale e transazionale. Per trasferire questo tipo di tabelle da un server ad un altro non è sufficiente spostarne i file e questo rende più complicate le procedure di backup. Questo tipo di tabelle, inoltre, non sono

sempre disponibili negli hosting economici.

-COS’è UN SERVER WEB?

Un server web è un servizio o tipologia di server, e per estensione il computer su cui è in esecuzione, che si occupa di fornire, tramite software dedicato e su richiesta dell'utente (client),

file di qualsiasi tipo, tra cui pagine web (successivamente visualizzabili dal web browser sul PC dell'utente). Le informazioni inviate dal server web all'utente viaggiano in rete trasportate dal protocollo HTTP. L'insieme di server web dà vita al World Wide Web, uno dei servizi più utilizzati

della Rete Internet.

-DIFFERENZA TRA PAGINE STATICHE E DINAMICHE

Le pagine statiche (quelle che in genere riconoscete dall’estensione .html o .htm) sono dei file in codice HTML che descrivono minuziosamente testi da impaginare, grafica e immagini. Quando l’utente di un sito visita una pagina, ciò che avviene è che il server su cui risiede il sito

invia al browser (il programma che utilizzato per navigare, ad esempio Microsoft Explorer) il file HTML; il browser sa decodificare il file, e quindi mostra i contenuti della pagina sullo schermo

dell’utente. Le pagine dinamiche, invece che contenere il codice HTML (o meglio invece di contenere solo quello) contengono programmi per il server; questo li esegue e quindi scrive il codice HTML da

111

inviare al browser (che quindi non è preesistente come nella pagina statica).

In altre parole, il contenuto della pagina non è deciso a priori ma può variare in base a condizioni di vario genere. Un esempio: quando su un motore di ricerca effettuate una interrogazione, la pagina dei risultati che vi viene presentata non è già esistente prima della vostra richiesta. Solo

dopo che il server ha eseguito la sua ricerca sulla parola chiave da voi indicata viene creato il codice per presentarvi i risultati.

I linguaggi utilizzati per scrivere queste pagine sono diversi; ASP, PHP o CFM e tanti altri. Possono dialogare con Data Base cioè archivi puri di informazioni.

-COS’è MySql? MySQL, definito Oracle MySQL, è un Relational database management system (RDBMS), composto da un client con interfaccia a riga di comando e un server, entrambi disponibili sia per sistemi Unix

o Unix-like come GNU/Linux che per Windows, anche se prevale un suo utilizzo in ambito Unix.

-COS’è IL PHP?

PHP (acronimo ricorsivo di "PHP: Hypertext Preprocessor", preprocessore di ipertesti; originariamente acronimo di "Personal Home Page"[2]) è un linguaggio di programmazione interpretato, originariamente concepito per la programmazione Web ovvero la realizzazione di

pagine web dinamiche. L'interprete ha una licenza open source e libera (ma incompatibile con la GPL). Attualmente è utilizzato principalmente per sviluppare applicazioni web lato server ma può essere

usato anche per scrivere script a riga di comando o applicazioni stand-alone con interfaccia grafica.