Esempio n. 1
0
            break;
        case 'donna':
            return 'f';
            break;
        case 'bambino':
            return 'bo';
            break;
        default:
            return 'ba';
            break;
    }
}
$db = new DatabaseZalando();
$db->connetti();
try {
    $result = $db->exec('select nome, tipolv1, tipolv2, prezzo, sconto, disponibilita from Abito where sesso = "' . sessoToFlag() . '";');
    if ($result !== true) {
        while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
            echo '<tr><td>' . $row['nome'] . '</td><td>' . $row["tipolv1"] . ", " . $row["tipolv2"] . '</td><td>' . $row["prezzo"] . '</td><td>' . $row["sconto"] . '</td><td>' . $row["disponibilita"] . '</td></tr>';
        }
    }
    $result = null;
} catch (DatabaseException $e) {
    echo 'Impossibile connettersi al Database';
}
$db->disconnetti();
?>
                </tbody>
              </table>

              <div id="contextMenu" class="dropdown clearfix">
Esempio n. 2
0
              <thead>
                <tr>
                  <th>Email</th>
                  <th>Nome</th>
                  <th>Cognome</th>
                  <th>Data di iscrizione</th>
                  <th>Newsletter</th>
                </tr>
              </thead>
              <tbody>
                <?php 
require_once '../Utility/databaseZalando.php';
$db = new DatabaseZalando();
$db->connetti();
try {
    $result = $db->exec('select email, nome, cognome, data_iscrizione, newsletter from Utente where 1;');
    if ($result !== true) {
        while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
            echo '<tr><td>' . $row['email'] . '</td><td>' . $row["nome"] . '</td><td>' . $row["cognome"] . '</td><td>' . $row["data_iscrizione"] . '</td><td>' . $row["newsletter"] . '</td></tr>';
        }
    }
    $result = null;
} catch (DatabaseException $e) {
    echo 'Impossibile connettersi al Database';
}
$db->disconnetti();
?>
                </tbody>
              </table>

              <div id="contextMenu" class="dropdown clearfix">