Skip to content

Commit ce85cdc

Browse files
committed
modifiche warning array orario
1 parent 93d2b78 commit ce85cdc

12 files changed

+42
-20
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,23 @@ Programmazione appuntamenti per studio medico
66

77
## Licenza
88

9-
Licenza MIT che trovate sotto il file licence
9+
Licenza MIT che trovate sotto il file licence
10+
11+
## Installazione XAMPP
12+
13+
In "C:\xampp\apache\conf\extra\httpd-vhosts.conf"
14+
```
15+
<VirtualHost *:80>
16+
ServerAdmin webmaster@localhost.com
17+
DocumentRoot "E:/siti/test/appuntamenti"
18+
DirectoryIndex index.php index.html
19+
ServerName appuntamenti.local
20+
<Directory "E:/siti/test/appuntamenti">
21+
Options Indexes FollowSymLinks
22+
AllowOverride None
23+
Require all granted
24+
</Directory>
25+
</VirtualHost>
26+
```
27+
28+
Modifica poi il file config.php con i propri dati di accesso alla base dati

aggiunto.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function pulisciStringa($stringa) {
4545
if (empty($errors)) {
4646
try {
4747

48-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
48+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
4949
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
5050
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
5151
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

appuntamentocancella.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if (empty($errors)) {
2222
try {
2323

24-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
24+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
2525
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
2626
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
2727
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

compitoaggiungi.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function pulisciStringa($stringa) {
2929
if (empty($errors)) {
3030
try {
3131

32-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
32+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
3333
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
3434
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
3535
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

compitocancella.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if (empty($errors)) {
2222
try {
2323

24-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
24+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
2525
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
2626
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
2727
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

config.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$dbhost = "localhost";
44
$dbname = "appuntamento";
55
$dbuser = "root";
6-
$dbpswd = "stronza77php";
6+
$dbpswd = "";
7+
$dbport = 3306;
78

89
?>

dafare.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<li><a href="opzioni.php">Opzioni</a></li>
4848
<li class="active"><a href="dafare.php">Da fare</a></li>
4949
</ul>
50-
<h3 class="text-muted corsivo">Dott.ssa Rollandin Christine</h3>
50+
<h3 class="text-muted corsivo">Appuntamenti</h3>
5151
</div>
5252

5353
<div class="jumbotron">
@@ -105,7 +105,9 @@ class Compito {
105105

106106
try {
107107

108-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
108+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
109+
110+
//$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
109111
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
110112
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
111113
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<li><a href="opzioni.php">Opzioni</a></li>
4848
<li><a href="dafare.php">Da fare</a></li>
4949
</ul>
50-
<h3 class="text-muted corsivo">Dott.ssa Rollandin Christine</h3>
50+
<h3 class="text-muted corsivo">Appuntamenti</h3>
5151
</div>
5252
5353
<div class="jumbotron">

lista.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<li><a href="opzioni.php">Opzioni</a></li>
4949
<li><a href="dafare.php">Da fare</a></li>
5050
</ul>
51-
<h3 class="text-muted corsivo">Dott.ssa Rollandin Christine</h3>
51+
<h3 class="text-muted corsivo">Appuntamenti</h3>
5252
</div>
5353

5454
<div class="jumbotron">
@@ -92,7 +92,7 @@ class Appuntamento {
9292
// segna tutti gli idorario occupati nel giorno
9393
try {
9494

95-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
95+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
9696
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
9797
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
9898
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

opzioni.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<li class="active"><a href="opzioni.php">Opzioni</a></li>
5555
<li><a href="dafare.php">Da fare</a></li>
5656
</ul>
57-
<h3 class="text-muted corsivo">Dott.ssa Rollandin Christine</h3>
57+
<h3 class="text-muted corsivo">Appuntamenti</h3>
5858
</div>
5959

6060
<div class="jumbotron">

orario.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function caricaDatiOrario() {
1818

1919
try {
2020

21-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
21+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
2222
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
2323
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
2424
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');

selezioneorario.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<li><a href="opzioni.php">Opzioni</a></li>
4848
<li><a href="dafare.php">Da fare</a></li>
4949
</ul>
50-
<h3 class="text-muted corsivo">Dott.ssa Rollandin Christine</h3>
50+
<h3 class="text-muted corsivo">Appuntamenti</h3>
5151
</div>
5252

5353
<div class="jumbotron">
@@ -65,8 +65,8 @@
6565
$dataselezionata = DateTime::createFromFormat('d-m-Y', $dataselezionatatesto);
6666
$dataDB = $dataselezionata->format('Y-m-d');
6767

68-
$nome = $_GET['nome'];
69-
$note = $_GET['note'];
68+
$nome = array_key_exists('nome', $_GET) ? $_GET['nome'] : "";
69+
$note = array_key_exists('note', $_GET) ? $_GET['note'] : "";
7070

7171
$formatterBreve = new IntlDateFormatter('it_IT', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
7272
$formatterBreve->setPattern('E');
@@ -91,7 +91,7 @@
9191
// segna tutti gli idorario occupati nel giorno
9292
try {
9393

94-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
94+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
9595
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
9696
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
9797
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');
@@ -114,7 +114,7 @@
114114
// Aggiungi le righe degli orari
115115
try {
116116

117-
$db = new PDO("mysql:host=" . $dbhost . ";dbname=" . $dbname, $dbuser, $dbpswd);
117+
$db = new PDO("mysql:host=$dbhost;port=$dbport;dbname=$dbname",$dbuser,$dbpswd);
118118
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
119119
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
120120
$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES UTF8');
@@ -131,8 +131,8 @@
131131
$row = get_object_vars($row);
132132

133133
// il primo elemento mettilo in autofocus e richesto
134-
$controllo = ($occupato[$row['idorario']] != '')?'disabled':'';
135-
$occupatonome = $occupato[$row['idorario']];
134+
$controllo = (array_key_exists($row['idorario'], $occupato) && $occupato[$row['idorario']] != '')?'disabled':'';
135+
$occupatonome = array_key_exists($row['idorario'], $occupato) ? $occupato[$row['idorario']] : "";
136136
//$attivo = $row['attivo'];
137137
/*
138138
if($primo == true) {

0 commit comments

Comments
 (0)