示例#1
0
        p {
            clear: both;
        }
        h3 {
            margin-top: 30px;
            clear: both;
        }
    </style>
</head>
<body>

<?php 
echo '</br></br>';
require_once 'db/pdo.php';
require_once 'classes/voting.php';
$vote = new votes();
?>
    <div id="wrapper">
        <div id="header"></div>

        <div id="main">
            <div id="" class="">


<?php 
if (empty($_POST["startSubmit"])) {
    ?>

    <form name="start" action="<?php 
    echo htmlspecialchars($_SERVER["PHP_SELF"]);
    ?>
示例#2
0
            text-decoration: none;
            color: initial;
            width:200px;
        }
    </style>

</head>
<body>
<div>
    <a href="http://webgregor.co.uk/voting/data.csv" class="button">Download data</a>

<?php 
require_once 'db/pdo.php';
require_once 'classes/voting.php';
$vote = new votes();
$allVotes = $vote->getAllVotes();
//var_dump($allVotes);
$file = fopen("data.csv", "w");
foreach ($allVotes as $oneVote) {
    //var_dump($oneVote);
    $vote->saveDataToCsv($file, $oneVote);
    echo '</br></br>';
    echo 'id: ' . $oneVote->id . ' ';
    echo 'oneone: ' . $oneVote->oneone . ' ';
    echo 'onetwo: ' . $oneVote->onetwo . ' ';
    echo 'onethree: ' . $oneVote->onethree . ' ';
    echo 'onefour: ' . $oneVote->onefour . ' ';
    echo 'onefive: ' . $oneVote->onefive . ' ';
    echo 'onesix: ' . $oneVote->onesix . ' ';
    echo 'oneseven: ' . $oneVote->oneseven . ' ';