default.php

Chris took this code of Joyce’s, and edited one line (#89) from “This is a real poll…” to “This is NOT a real poll…” since we (recently) learned that this poll was not sent to Google Analytics, and is just a propaganda vehicle…

This was done after uploading the original to the website, publishing it, reopening it …and it is the only change I made in it. We can go back in the history to the original version, and restore it on Divi.

<!–   default.php
    Created by:  Joyce Doorn
    Created on:  10/11/2018
    Purpose:     This php displays a table to enter poll data
inserts roster data into wp_poll/tbl_poll_a
and provides navigation–>
<?php
// require is all or nothing
// include will still try to run the page
require ‘dbconnect.php’;
//echo($dbstatus);
//Select Questions
$sql_question = “SELECT * FROM tbl_poll_q ORDER BY qQuestionNumber”;
//Execute the state/query
$result = $pdo->query($sql_question);
?>
<html>
<head>
<title>Poll</title>
<style>
/* body element – sets background to tan, text to black */
body {
background-color : #FFFFFF;
color : #666666;
font-family : Verdana, Arial, sans-serif;
font-size: 100%;
background-image: url(images/sand.jpg);
background-size: repeat;
color: rgb(64,48,40);
/* background-repeat: repeat; */
}
header, nav, main, footer
{
display: block;
}
th, td {
text-align: left;
padding: 8px;
font-weight: bold;
}
}
td {
text-align: left;
padding: 8px;
width: 250px;
}
// th {
// background-color: rgb(255, 99, 71);
// color: white;
// }
input {
width: 800px;
}
#submitbutton {
width: 200px;
margin-left: 400px;
padding: 12px;
font-weight: bold;
}
h1 {
background-color: #4CAF50;
color: white;
text-align: center;
padding: 12px;
}
/* nav element  */
nav {
font-weight: bold;
padding: 20px 5px 0px 20px;
text-decoration: none;
float: left;
}
</head>
</style>
<body>
<header>
<h1>Emerging Web Technology Final Project</h1>
<p>This poll is NOT a real poll, just a propaganda vehicle. There are four choices, and the last one links to one of our blog-categories. Please answer the entire poll first with the first three choices, then go back and choose (up to) five questions to blog about- the ones most important to you. In the last space, tell us what you think we can do to make the poll better.</p>
</header>
<form method=”POST” action=”Inputdata_DisplayData.php”>
<?php
                    while($row = $result->fetch())
                    {
echo(‘
<table border=”none”>
    <thead>
        <tr>
            <th colspan=”2″>
<option value=”‘.$row [‘qQuestionNumber’].”. “.$row [‘qQuestion’].'”>’.
$row [‘qQuestionNumber’].”. “.$row [‘qQuestion’].'</option>
</th>
        </tr>
    </thead>
        <tr>
<th>Select</th>
<td><select id=”Response” name=”Response”>
                <option value=”‘.$row [‘qResponse1′].'”>’.
                            $row [‘qResponse1’].'</option>
                <option value=”‘.$row [‘qResponse2′].'”>’.
                            $row [‘qResponse2’].'</option>
                <option value=”‘.$row [‘qResponse3′].'”>’.
                            $row [‘qResponse3’].'</option>
                <option value=”‘.$row [‘qResponse4′].'”>’.
                            $row [‘qResponse4’].'</option>
</tr>
<tr>
</td>
<th>Comment</th>
<td><input type=”text” width=”250″ name=”Comment”>
</td>
</tr>
</table>
‘);
}
?>
<br>
<tr>
      <td></td>
    <td><input id=”submitbutton” type=”submit” value=”Submit Survey” >
    </td>
</tr>
<br>
</form>
<?php
    include ‘menu.php’;
?>
</body>
</html>